umd-deps
v0.1.2
Published
Get cmd or amd dependences
Downloads
4
Maintainers
Readme
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
Notice
umd-deps
has renamed to cmd-deps