{"name":"detective-typescript","version":"15.0.1","author":{"name":"Patrik Henningsson","email":"patrik.henningsson@gmail.com"},"description":"Get the dependencies of a TypeScript module","type":"module","exports":{".":"./index.js"},"scripts":{"lint":"xo","fix":"xo --fix","vitest":"vitest","test":"npm run lint && vitest run","test:ci":"vitest run --coverage"},"repository":{"type":"git","url":"git+https://github.com/dependents/detective-typescript.git"},"keywords":["detective","typescript","dependencies","module","ast","import"],"engines":{"node":">=20.19.0 || >=22.12.0"},"license":"MIT","homepage":"https://github.com/dependents/detective-typescript","peerDependencies":{"typescript":"^5.4.4 || ^6.0.2"},"dependencies":{"@typescript-eslint/typescript-estree":"^8.62.1","ast-module-types":"^7.0.0","node-source-walk":"^8.0.0"},"devDependencies":{"@vitest/coverage-v8":"^4.1.9","typescript":"^6.0.3","vitest":"^4.1.9","xo":"^2.0.2"},"gitHead":"22c1533cb88fc6ed82fdbaa1d1eb218396c91f60","_id":"detective-typescript@15.0.1","bugs":{"url":"https://github.com/dependents/detective-typescript/issues"},"_nodeVersion":"24.18.0","_npmVersion":"11.16.0","dist":{"integrity":"sha512-7+5ZwOkvIrIxKDMxcoiW2NtbBr6IM6BzORVrpx3nKmNin4Q445ev9J7dqEfYB4RMVsAcbVLlwI2QD17YIUlP3A==","shasum":"95b1a1738664a5fcffb41833c376e9634af9a21b","tarball":"http://registry-npm.ywwl.com/detective-typescript/download/detective-typescript-15.0.1.tgz","fileCount":3,"unpackedSize":6891,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIF+U15V5/sxFpWyKeKK4YLIxw0mP+fECkZ83UVy2TOR8AiAchlk45RSlc23FDOiKxD0Vs/sUKDzGTge4AQpWBIWzCg=="}],"size":2464,"noattachment":false,"key":"/detective-typescript/-/detective-typescript-15.0.1.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-typescript_15.0.1_1783004015069_0.2324757114680236"},"_hasShrinkwrap":false,"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":1783004015278,"_cnpm_publish_time":1783004015278,"dist-tags":{"latest":"15.0.1"}}