/es-deps

ECMAScript 2015+/CommonJS module dependencies array

Primary LanguageJavaScript

es-deps

NPM version Build Status Coveralls Status Dependency Status

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 requires.

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