es-deps
v1.0.6
Published
ECMAScript 2015+/CommonJS module dependencies array
Downloads
5
Maintainers
Readme
es-deps
ECMAScript 2015+/CommonJS module dependencies array
This package handles es2015+ modules, and 'cause CommonJS won't go away anytime soon, it also
takes care of non-dynamic require
s.
Install
npm install --save es-deps
Usage
import esDeps from 'es-deps';
esDeps('./fixture.js')
.then(result => console.log(result)); /* [
'out', './local',
'q', 'fs', './local-cjs', 'globalImport',
] */
API
esDeps(file)
// esDeps :: String -> Promise Array[String]
Return a promise that resolves to dependencies array of String.
file
Required
Type: String
Path to JavaScript file.
Related
- es-deps-from-string — ECMAScript 2015+/CommonJS module dependencies array from string
- es-deps-resolved — ECMAScript 2015+/CommonJS module dependencies resolved array
- es-dep-unit — Constructor for ECMAScript 2015+/CommonJS dependency unit
Object { requested, from, resolved }
- es-deps-deep — ECMAScript 2015+/CommonJS module dependencies resolved in depth
- es-dep-kit — ECMAScript 2015+/CommonJS module dependencies helpers kit
License
MIT © Vladimir Starkov