umd-deps

0.1.2 • Public • Published

umd-deps

Get cmd or amd dependences

Installation

npm install umd-deps

Api

  • parseDependencies(code:String, replace:Function = null, flag:Boolean = false):String
  • parseDependencies(code:String, flag:Boolean = false):Array
    • flag means if use "require.async" like, the result should have a property "flag" of "async"

Example

js:

require('a');
//require('b');
/require('c')/;
'require("d")';
if(true)/require('e')/;
do /require('f')/.test(s); while(false);
require.async('g');
require.async(['h']);

parser output:

[
  {  
    "flag": null,
    "path": "a"
  },
  {  
    "flag": 'async',
    "path": "g"
  },
  {  
    "flag": 'async',
    "path": "h"
  }
]

License

MIT

Notice

umd-deps has renamed to cmd-deps

Package Sidebar

Install

npm i umd-deps

Weekly Downloads

1

Version

0.1.2

License

MIT

Last publish

Collaborators

  • nuintun