{"name":"detective-typescript","version":"15.0.0","keywords":["detective","typescript","dependencies","module","ast","import"],"author":{"name":"Patrik Henningsson","email":"patrik.henningsson@gmail.com"},"license":"MIT","_id":"detective-typescript@15.0.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/detective-typescript","bugs":{"url":"https://github.com/dependents/detective-typescript/issues"},"dist":{"shasum":"535cdb919b07d5fdeafea2f4a5c0571c804d61df","tarball":"http://registry-npm.ywwl.com/detective-typescript/download/detective-typescript-15.0.0.tgz","fileCount":3,"integrity":"sha512-4V618NRA+WHrnynSKHaPjNszpkWRNm+SLUtzm3SIeSi+9O5veg+oSBkK1AA+dWhRJnS+5V2nt5iFQuEkB3nvBg==","signatures":[{"sig":"MEUCICCDZSR707o7LrF4KIHAn5l1a/Sj/XY3jhhdAWlxNbKMAiEA8vWWIgJ+U+7/ga8Id0SjdM9SbcCURwfS7CYuvSppt7c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":6895,"size":2475,"noattachment":false,"key":"/detective-typescript/-/detective-typescript-15.0.0.tgz"},"type":"module","engines":{"node":">=20.19.0 || >=22.12.0"},"exports":{".":"./index.js"},"gitHead":"e4d10c7b38104200f57158c52959c98acb7fce6a","scripts":{"fix":"xo --fix","uvu":"uvu test","lint":"xo","test":"npm run lint && npm run uvu","test:ci":"c8 npm run uvu"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/dependents/detective-typescript.git","type":"git"},"_npmVersion":"11.12.1","description":"Get the dependencies of a TypeScript module","directories":{},"_nodeVersion":"24.15.0","dependencies":{"ast-module-types":"^7.0.0","node-source-walk":"^8.0.0","@typescript-eslint/typescript-estree":"^8.59.3"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^11.0.0","xo":"^2.0.2","uvu":"^0.5.6","typescript":"^6.0.3"},"peerDependencies":{"typescript":"^5.4.4 || ^6.0.2"},"_npmOperationalInternal":{"tmp":"tmp/detective-typescript_15.0.0_1779200241784_0.4834154292918995","host":"s3://npm-registry-packages-npm-production"},"readme":"# detective-typescript\n\n[![CI](https://img.shields.io/github/actions/workflow/status/dependents/detective-typescript/ci.yml?branch=main&label=CI&logo=github)](https://github.com/dependents/detective-typescript/actions/workflows/ci.yml?query=branch%3Amain)\n[![npm version](https://img.shields.io/npm/v/detective-typescript?logo=npm&logoColor=fff)](https://www.npmjs.com/package/detective-typescript)\n[![npm downloads](https://img.shields.io/npm/dm/detective-typescript)](https://www.npmjs.com/package/detective-typescript)\n\n> Get the dependencies of TypeScript module\n\n```sh\nnpm install detective-typescript typescript\n```\n\n## Usage\n\n### ESM\n\n```js\nimport fs from 'node:fs';\nimport detective from 'detective-typescript';\n\nconst mySourceCode = fs.readFileSync('myfile.ts', 'utf8');\n\n// Pass in a file's content or an AST\nconst dependencies = detective(mySourceCode);\n\n// For TSX/JSX files\nconst tsxDependencies = detective.tsx(mySourceCode);\n```\n\n### CommonJS\n\n```js\nconst { default: detective } = require('detective-typescript');\n```\n\n## Options\n\n| Option | Type | Default | Description |\n| --- | --- | --- | --- |\n| `skipTypeImports` | `boolean` | `false` | Skip imports that only import types |\n| `mixedImports` | `boolean` | `false` | Include CJS `require()` calls in the dependency list |\n| `skipAsyncImports` | `boolean` | `false` | Omit dynamic `import('foo')` expressions |\n| `jsx` | `boolean` | `false` | Enable parsing of JSX/TSX syntax |\n| `onFile` | `Function` | - | Callback invoked before a file is processed. Receives `{ options, src, ast, walker }`. Intended for use with [`dependency-tree`](https://github.com/dependents/node-dependency-tree) and [`precinct`](https://github.com/dependents/node-precinct). |\n| `onAfterFile` | `Function` | - | Like `onFile`, but also receives `dependencies` (string array of extracted dependencies). |\n\n## License\n\n[MIT](LICENSE)\n","publish_time":1779200241924,"_cnpm_publish_time":1779200241924,"dist-tags":{"latest":"15.0.1"}}