1.0.1 • Published 6 years ago
that-depends-js v1.0.1
that-depends-js
Reads in JS, returns the imported/required file paths.
Usage
// foo.js
import x from 'z'
import a from 'a'
import otherA from './a'
import thatDependsJS from 'that-depends-js'
const fooSource = fs.readFileSync('foo.js', 'utf8')
const dependenciesOfFoo = thatDependsJS(fooSource)
// returns ['./a', 'a', 'z']