es-deps-deep
v2.0.0
Published
ECMAScript 2015+/CommonJS module dependencies resolved in depth
Downloads
4
Maintainers
Readme
es-deps-deep
ECMAScript 2015+/CommonJS module dependencies resolved in depth
Install
npm install --save es-deps-deep
Usage
import esDepsDeep from 'es-deps-deep';
esDepsDeep(['./fixtures/extended'])
.then(result => console.log(result)); /* [
{ requested: null,
from: null,
resolved: '/Users/iamstarkov/projects/es-deps-deep/fixtures/extended/index.js' },
{ requested: './first/index.js',
from: '/Users/iamstarkov/projects/es-deps-deep/fixtures/extended/index.js',
resolved: '/Users/iamstarkov/projects/es-deps-deep/fixtures/extended/first/index.js' },
{ requested: './second/index.js',
from: '/Users/iamstarkov/projects/es-deps-deep/fixtures/extended/first/index.js',
resolved: '/Users/iamstarkov/projects/es-deps-deep/fixtures/extended/first/second/index.js' },
{ requested: '../third/index.js',
from: '/Users/iamstarkov/projects/es-deps-deep/fixtures/extended/first/index.js',
resolved: '/Users/iamstarkov/projects/es-deps-deep/fixtures/extended/third/index.js' },
{ requested: '../first/fourth/index.js',
from: '/Users/iamstarkov/projects/es-deps-deep/fixtures/extended/third/index.js',
resolved: '/Users/iamstarkov/projects/es-deps-deep/fixtures/extended/first/fourth/index.js' } ] */
Another examples with rollup and mkdirp can be found in the showcase gist.
API
esDepsDeep(files, options)
Return a promise that resolves to Array[Object]
, where object is es-dep-unit
.
files
Required
Type: Array
of String
Entry points for your app.
options
excludeFn
Type: Function
Default: () => false;
excludeFn
decides items to exclude from es-deps-resolved
each time when it's going deeper.
Related
- es-deps — ECMAScript 2015+/CommonJS module dependencies array
- 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-dep-kit — ECMAScript 2015+/CommonJS module dependencies helpers kit
License
MIT © Vladimir Starkov