{"name":"detective-cjs","version":"6.1.0","keywords":["detective","commonjs","dependencies","ast","static analysis","cjs","jsx"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"license":"MIT","_id":"detective-cjs@6.1.0","maintainers":[{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"mrjoelkemp","email":"mrjoelkemp@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"homepage":"https://github.com/dependents/node-detective-cjs","bugs":{"url":"https://github.com/dependents/node-detective-cjs/issues"},"xo":{"rules":{"curly":["error","multi-line"],"comma-dangle":["error","never"],"arrow-body-style":"off","operator-linebreak":["error","after"],"capitalized-comments":"off","object-curly-spacing":["error","always"],"unicorn/prefer-module":"off","space-before-function-paren":["error","never"],"unicorn/prefer-node-protocol":"off","unicorn/prevent-abbreviations":"off","unicorn/prefer-top-level-await":"off","unicorn/no-anonymous-default-export":"off"},"space":true,"ignores":["test/fixtures/*"]},"dist":{"shasum":"bdc42637765686800be491e46fc8cedb565804ff","tarball":"http://registry-npm.ywwl.com/detective-cjs/download/detective-cjs-6.1.0.tgz","fileCount":4,"integrity":"sha512-Qt3S4IddVNDb+71lm+jmt5NznIsgcKlibTnrw9Zr91rT9vRwKp+73+ImqLTNrQj4YuOxnzrC7GwIAVwF7136XQ==","signatures":[{"sig":"MEYCIQCi7EXPgEL/1NVaByVs/LOdZcwyd7XgBE7clEY5rwXxhAIhALV+hBjcOldfO1Y5zcPZ+kCfi3CjuskzYxMhiSShfrAV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":5554,"size":2530,"noattachment":false,"key":"/detective-cjs/-/detective-cjs-6.1.0.tgz"},"main":"index.js","engines":{"node":">=18"},"gitHead":"2a5ea6ca903172293306fa4b8df495256fefbda8","scripts":{"fix":"xo --fix","lint":"xo","test":"npm run lint && npm run mocha","mocha":"mocha","test:ci":"c8 npm run mocha"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/dependents/node-detective-cjs.git","type":"git"},"_npmVersion":"11.9.0","description":"Get the dependencies of a CommonJS module by traversing its AST","directories":{},"_nodeVersion":"24.14.0","dependencies":{"ast-module-types":"^6.0.1","node-source-walk":"^7.0.1"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","xo":"^0.60.0","mocha":"^11.7.5"},"_npmOperationalInternal":{"tmp":"tmp/detective-cjs_6.1.0_1772566250368_0.0176833414740023","host":"s3://npm-registry-packages-npm-production"},"readme":"# detective-cjs\n\n[![CI](https://img.shields.io/github/actions/workflow/status/dependents/node-detective-cjs/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/node-detective-cjs/actions/workflows/ci.yml?query=branch%3Amain)\n[![npm version](https://img.shields.io/npm/v/detective-cjs?logo=npm&logoColor=fff)](https://www.npmjs.com/package/detective-cjs)\n[![npm downloads](https://img.shields.io/npm/dm/detective-cjs)](https://www.npmjs.com/package/detective-cjs)\n\n> Get the dependencies of a CommonJS module by traversing its AST\n\n```sh\nnpm install detective-cjs\n```\n\nBut dude, substack already built this: node-detective. Yes, but I needed the capability to reuse an AST\nand this was unlikely to be merged timely. I can also support jsx and other syntactic constructs faster.\n\n## Usage\n\n```js\nconst fs = require('fs');\nconst detective = require('detective-cjs');\n\nconst mySourceCode = fs.readFileSync('myfile.js', 'utf8');\n\n// Pass in a file's content or an AST\nconst dependencies = detective(mySourceCode);\n\n// Use skipLazyLoaded to only include top-level requires,\n// treating inline (lazy-loaded) requires as intentional and legal\nconst topLevelOnly = detective(mySourceCode, { skipLazyLoaded: true });\n```\n\n* Supports JSX, ES7, and any other features that [node-source-walk](https://github.com/dependents/node-source-walk) supports.\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1772566250514,"_cnpm_publish_time":1772566250514,"dist-tags":{"latest":"7.0.0"}}