{"id":19123416,"url":"https://github.com/dependents/detective-typescript","last_synced_at":"2026-04-19T07:03:12.996Z","repository":{"id":20977039,"uuid":"79769800","full_name":"dependents/detective-typescript","owner":"dependents","description":"Get the dependencies of a TypeScript module","archived":false,"fork":false,"pushed_at":"2025-02-05T15:27:04.000Z","size":583,"stargazers_count":58,"open_issues_count":3,"forks_count":28,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-07T03:15:59.089Z","etag":null,"topics":["detective","typescript"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dependents.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-01-23T04:24:38.000Z","updated_at":"2025-03-27T03:41:07.000Z","dependencies_parsed_at":"2025-03-09T23:30:33.123Z","dependency_job_id":"67f60f9e-c268-4ffc-af20-72090881f2b2","html_url":"https://github.com/dependents/detective-typescript","commit_stats":{"total_commits":101,"total_committers":15,"mean_commits":6.733333333333333,"dds":0.6831683168316831,"last_synced_commit":"39a16fc95b2ea90510941094a648447993770a5d"},"previous_names":["pahen/detective-typescript"],"tags_count":38,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dependents%2Fdetective-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dependents%2Fdetective-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dependents%2Fdetective-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dependents%2Fdetective-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dependents","download_url":"https://codeload.github.com/dependents/detective-typescript/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248889912,"owners_count":21178322,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["detective","typescript"],"created_at":"2024-11-09T05:25:34.909Z","updated_at":"2026-04-19T07:03:07.949Z","avatar_url":"https://github.com/dependents.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# detective-typescript\n\n[![CI](https://img.shields.io/github/actions/workflow/status/dependents/detective-typescript/ci.yml?branch=main\u0026label=CI\u0026logo=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\u0026logoColor=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\u003e 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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdependents%2Fdetective-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdependents%2Fdetective-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdependents%2Fdetective-typescript/lists"}