{"name":"detective-typescript","version":"14.1.0","keywords":["detective","typescript","dependencies","module","ast","import"],"author":{"name":"Patrik Henningsson","email":"patrik.henningsson@gmail.com"},"license":"MIT","_id":"detective-typescript@14.1.0","maintainers":[{"name":"pahen","email":"patrik.henningsson@gmail.com"},{"name":"mrjoelkemp","email":"mrjoelkemp@gmail.com"},{"name":"xhmikosr","email":"xhmikosr@gmail.com"},{"name":"davidfirst","email":"davidnet@gmail.com"}],"homepage":"https://github.com/dependents/detective-typescript","bugs":{"url":"https://github.com/dependents/detective-typescript/issues"},"xo":{"rules":{"curly":["error","multi-line"],"comma-dangle":["error","never"],"prefer-template":"error","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":["index.d.ts","test/fixtures/*"]},"dist":{"shasum":"78355f614c1a3ff0cf97ca571d9ce5f47a34a482","tarball":"http://registry-npm.ywwl.com/detective-typescript/download/detective-typescript-14.1.0.tgz","fileCount":3,"integrity":"sha512-9zrrmk+VzpN1UGEdCJgX7At3GuIkaLqFcsFeZbYH/meKwURcZm65wNiU5G7cZqP9lug2SGjcFvjW/oAsBv7LSw==","signatures":[{"sig":"MEQCIBE5I58zR/ZL1bi6FhRA7Zl1WB78hV48VxLxVWyFaOw1AiBzhPq1GmzsTgV7eC6IzKhPZZLKgRfJojfcw7EFWEEwCw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7957,"size":2748,"noattachment":false,"key":"/detective-typescript/-/detective-typescript-14.1.0.tgz"},"main":"index.js","engines":{"node":">=18"},"gitHead":"88d9ed6fefca145592bab9a418a78f7ba4fede02","scripts":{"fix":"xo --fix","lint":"xo","test":"npm run lint && uvu test","test:ci":"c8 uvu test"},"_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":"^6.0.1","node-source-walk":"^7.0.1","@typescript-eslint/typescript-estree":"^8.58.2"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","xo":"^0.60.0","uvu":"^0.5.6","typescript":"^6.0.3"},"peerDependencies":{"typescript":"^5.4.4 || ^6.0.2"},"_npmOperationalInternal":{"tmp":"tmp/detective-typescript_14.1.0_1776531507000_0.7592079071713391","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":1776531507149,"_cnpm_publish_time":1776531507149,"dist-tags":{"latest":"15.0.1"}}