imports-walk-ts
v1.0.0
Published
Find 'import' and 're-export' statements in typescript using babel parser.
Downloads
1
Maintainers
Readme
imports-walk-ts
Find
import
andre-export
statements in typescript using babel parser.
Install
npm i imports-walk-ts
Usage
source.ts
import moduleA from './module-a';
import moduleB from './module-b';
import moduleC = require('./module-c');
export * from './module-d';
program.ts
import importsWalkTs from 'imports-walk-ts';
import fs from 'fs';
const source = fs.readFileSync('source.ts', 'utf8');
importsWalkTs(source); // <= ['./module-a', './module-b', './module-c', './module-d']
API
importsWalkTs(src, options?)
Looks for import
and re-export
statements.
src
Type: String
Source, where import
and re-export
statements will be looked for.
options
Type: Object
Options are the same as babel parser options.
Related
- imports-walk - Find
import
andre-export
statements of an ES6 module. - requires-walk - Find
require()
calls.
License
MIT 💖