JSPM

  • Created
  • Published
  • Downloads 2948216
  • Score
    100M100P100Q196628F
  • License MIT

Get the dependencies of a TypeScript module

Package Exports

  • detective-typescript
  • detective-typescript/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (detective-typescript) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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.ts', '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
  • skipAsyncImports: (default: false) Whether or not to omit async imports (import('foo'))
  • jsx: (default: false) Enable parsing of JSX

License

MIT