{"name":"detective-typescript","version":"13.0.1","keywords":["detective","typescript","dependencies","module","ast","import"],"author":{"name":"Patrik Henningsson","email":"patrik.henningsson@gmail.com"},"license":"MIT","_id":"detective-typescript@13.0.1","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":"37fab40671e2a372c7a7cb498f6b378c3785f431","tarball":"http://registry-npm.ywwl.com/detective-typescript/download/detective-typescript-13.0.1.tgz","fileCount":3,"integrity":"sha512-k+1EbJESP/PVA3G+Squsd7EjCoitCn3ZWdpl4ReWR8TyEfdF7AP7yMhlpbYXOw7i5VBFY2tOeOmKZD2XtsCpVQ==","signatures":[{"sig":"MEUCIQD3+lFsY8drFvTzgd/aahnwHQ3rKVvt/VNQRT98wAL1LQIgT4jQwvn3Gsy8KPrsjJ4cKXPj7Zx/RF2NVCU96nXykYs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7991,"size":2755,"noattachment":false,"key":"/detective-typescript/-/detective-typescript-13.0.1.tgz"},"main":"index.js","engines":{"node":"^14.14.0 || >=16.0.0"},"gitHead":"833625491feeda4fadef3ffe0d537f4465fa95e4","scripts":{"fix":"xo --fix","lint":"xo","test":"npm run lint && npm run mocha","mocha":"mocha","watch":"npm run mocha -- -w","test:ci":"c8 npm run mocha"},"_npmUser":{"name":"xhmikosr","email":"xhmikosr@gmail.com"},"repository":{"url":"git+https://github.com/dependents/detective-typescript.git","type":"git"},"_npmVersion":"10.8.2","description":"Get the dependencies of a TypeScript module","directories":{},"_nodeVersion":"20.18.2","dependencies":{"ast-module-types":"^6.0.1","node-source-walk":"^7.0.1","@typescript-eslint/typescript-estree":"^7.18.0"},"_hasShrinkwrap":false,"devDependencies":{"c8":"^10.1.3","xo":"^0.60.0","mocha":"^11.1.0","typescript":"^5.7.3"},"peerDependencies":{"typescript":"^5.4.4"},"_npmOperationalInternal":{"tmp":"tmp/detective-typescript_13.0.1_1738416457898_0.10984956943449209","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```js\nconst fs = require('fs');\nconst detective = require('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\n## Options\n\n- `skipTypeImports` (default: `false`) Skips imports that only imports types\n- `mixedImports`: (default: `false`) Include CJS imports in dependency list\n- `skipAsyncImports`: (default: `false`) Whether or not to omit async imports (import('foo'))\n- `jsx`: (default: `false`) Enable parsing of JSX\n- `onFile`: A callback that will be called before the file is processed. Intended for use with [`dependency-tree`](https://github.com/dependents/node-dependency-tree). Passed an object argument with properties `options` (echoing any options passed in, e.g., by [`precinct`](https://github.com/dependents/node-precinct)), `src` (source code for file as string), `ast` (parsed AST object for the file source), and `walker` (a `Walker` instance from [`node-source-walk`](https://github.com/dependents/node-source-walk) configured for TypeScript to which you can pass the `ast` or `src`).\n- `onAfterFile`: Similar to `onFile`, but the callback is also passed an object property `dependencies`, a string array with the extracted dependencies.\n\n## License\n\nMIT\n","publish_time":1738416458078,"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"}],"_cnpm_publish_time":1738416458078,"dist-tags":{"latest":"15.0.1"}}