14.0.0 • Published 9 months ago
detective-typescript v14.0.0
detective-typescript
Get the dependencies of TypeScript module
npm install detective-typescript typescriptUsage
const fs = require('fs');
const detective = require('detective-typescript');
const mySourceCode = fs.readFileSync('myfile.ts', 'utf8');
// Pass in a file's content or an AST
const dependencies = detective(mySourceCode);Options
skipTypeImports(default:false) Skips imports that only imports typesmixedImports: (default:false) Include CJS imports in dependency listskipAsyncImports: (default:false) Whether or not to omit async imports (import('foo'))jsx: (default:false) Enable parsing of JSXonFile: A callback that will be called before the file is processed. Intended for use withdependency-tree. Passed an object argument with propertiesoptions(echoing any options passed in, e.g., byprecinct),src(source code for file as string),ast(parsed AST object for the file source), andwalker(aWalkerinstance fromnode-source-walkconfigured for TypeScript to which you can pass theastorsrc).onAfterFile: Similar toonFile, but the callback is also passed an object propertydependencies, a string array with the extracted dependencies.
License
MIT
14.0.0
9 months ago
13.0.1
9 months ago
13.0.0
2 years ago
12.0.0
2 years ago
11.2.0
2 years ago
10.0.0
3 years ago
11.0.2
3 years ago
11.0.0
3 years ago
11.1.0
3 years ago
11.0.1
3 years ago
9.1.1
3 years ago
9.1.0
3 years ago
9.0.0
4 years ago
7.0.2
4 years ago
7.0.1
4 years ago
8.0.1
4 years ago
8.0.0
4 years ago
7.0.0
5 years ago
6.0.0
5 years ago
5.8.0
6 years ago
5.7.0
6 years ago
5.6.1
6 years ago
5.6.0
6 years ago
5.5.0
6 years ago
5.4.0
6 years ago
5.3.0
6 years ago
5.2.0
7 years ago
5.1.1
7 years ago
5.1.0
7 years ago
5.0.0
7 years ago
4.1.2
7 years ago
4.1.1
7 years ago
4.1.0
7 years ago
4.0.0
7 years ago
3.0.0
7 years ago
2.0.0
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago