{"name":"detective-cjs","version":"7.0.0","description":"Get the dependencies of a CommonJS module by traversing its AST","type":"module","exports":{".":"./index.js"},"scripts":{"lint":"xo","fix":"xo --fix","uvu":"uvu test","test":"npm run lint && npm run uvu","test:ci":"c8 npm run uvu"},"repository":{"type":"git","url":"git+https://github.com/dependents/node-detective-cjs.git"},"keywords":["detective","commonjs","dependencies","ast","static analysis","cjs","jsx"],"author":{"name":"Joel Kemp","email":"joel@mrjoelkemp.com"},"license":"MIT","bugs":{"url":"https://github.com/dependents/node-detective-cjs/issues"},"homepage":"https://github.com/dependents/node-detective-cjs","engines":{"node":">=20.19.0 || >=22.12.0"},"dependencies":{"ast-module-types":"^7.0.0","node-source-walk":"^8.0.0"},"devDependencies":{"c8":"^11.0.0","uvu":"^0.5.6","xo":"^2.0.2"},"gitHead":"8e522580119929deefdfb010a696f47ded773020","_id":"detective-cjs@7.0.0","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-rp+2gWa939K35U6UVZc7af6RkJlUTsoDLsJS/1wPTCKUSt/E2rEnLHbE01DPJGsXzDso0hLfzdePwK0935EwPg==","shasum":"4730b920d3e856e1b0cef8068e774c19a3f6f423","tarball":"http://registry-npm.ywwl.com/detective-cjs/download/detective-cjs-7.0.0.tgz","fileCount":4,"unpackedSize":5013,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIB82gZNRnUHmOWTXHfXEK2gaNIWSp1MVd0LUX0puwz+MAiBrZ25vkFudZbol9rUbAB3xPf3vNfhaxk6EyYxMh5LY6g=="}],"size":2409,"noattachment":false,"key":"/detective-cjs/-/detective-cjs-7.0.0.tgz"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"directories":{},"maintainers":[{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"mrjoelkemp","email":"mrjoelkemp@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/detective-cjs_7.0.0_1779202061302_0.9256368875010275"},"_hasShrinkwrap":false,"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":1779202061449,"_cnpm_publish_time":1779202061449,"dist-tags":{"latest":"7.0.0"}}