/detective-typescript

Get the dependencies of a TypeScript module

Primary LanguageJavaScript

detective-typescript Build Status npm npm

Get the dependencies of TypeScript module

npm install detective-typescript

Usage

var detective = require('detective-typescript');

var mySourceCode = fs.readFileSync('myfile.js', 'utf8');

// Pass in a file's content or an AST
var dependencies = detective(mySourceCode);

Options

  • skipTypeImports (default: false) - Skips imports that only imports types
  • mixedImports: (default: false) - Include CJS imports in dependency list

License

MIT