Necessarily Precedes Mischief

    detective-typescript

    9.0.0 • Public • Published

    detective-typescript CI npm npm

    Get the dependencies of TypeScript module

    npm install detective-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 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

    Install

    npm i detective-typescript

    DownloadsWeekly Downloads

    675,620

    Version

    9.0.0

    License

    MIT

    Unpacked Size

    5.46 kB

    Total Files

    3

    Last publish

    Collaborators

    • pahen
    • xhmikosr
    • mrjoelkemp
    • davidfirst