1.0.1 • Published 6 years ago

that-depends-js v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
6 years ago

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