Skip to content

ECMAScript 2015+/CommonJS module dependencies resolved in depth

Notifications You must be signed in to change notification settings

iamstarkov/es-deps-deep

Repository files navigation

es-deps-deep

NPM version Unix Build Status Windows Build Status Coveralls Status Dependency Status

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

About

ECMAScript 2015+/CommonJS module dependencies resolved in depth

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 3

  •  
  •  
  •