npm.io
1.0.1 • Published 8 years ago

that-depends-js

Licence
MIT
Version
1.0.1
Deps
0
Size
3 kB
Vulns
0
Weekly
0

that-depends-js

Build Status

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']