ECMAScript 2015+/CommonJS module dependencies resolved in depth
npm install --save es-deps-deep
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.
Return a promise that resolves to Array[Object]
, where object is es-dep-unit
.
Required
Type: Array
of String
Entry points for your app.
Type: Function
Default: () => false;
excludeFn
decides items to exclude from es-deps-resolved
each time when it's going deeper.
- 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
MIT © Vladimir Starkov