13.0.0 • Published 12 days ago
detective-typescript v13.0.0
detective-typescript
Get the dependencies of TypeScript module
npm install detective-typescript typescript
Usage
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
(aWalker
instance fromnode-source-walk
configured for TypeScript to which you can pass theast
orsrc
).onAfterFile
: Similar toonFile
, but the callback is also passed an object propertydependencies
, a string array with the extracted dependencies.
License
MIT
13.0.0
12 days ago
12.0.0
17 days ago
11.2.0
17 days ago
10.0.0
1 year ago
11.0.2
12 months ago
11.0.0
12 months ago
11.1.0
12 months ago
11.0.1
12 months ago
9.1.1
1 year ago
9.1.0
1 year ago
9.0.0
2 years ago
7.0.2
2 years ago
7.0.1
2 years ago
8.0.1
2 years ago
8.0.0
2 years ago
7.0.0
3 years ago
6.0.0
3 years ago
5.8.0
4 years ago
5.7.0
4 years ago
5.6.1
5 years ago
5.6.0
5 years ago
5.5.0
5 years ago
5.4.0
5 years ago
5.3.0
5 years ago
5.2.0
5 years ago
5.1.1
5 years ago
5.1.0
5 years ago
5.0.0
5 years ago
4.1.2
5 years ago
4.1.1
6 years ago
4.1.0
6 years ago
4.0.0
6 years ago
3.0.0
6 years ago
2.0.0
6 years ago
1.0.1
7 years ago
1.0.0
7 years ago