searequire

1.5.3 • Public • Published

Get require() like node-requires by lexical analysis

NPM version Build Status

Installation

npm install searequire

Api

  • parseDependencies(code:String, callback:Function = null, flag:Boolean = false):String
  • parseDependencies(code:String, flag:Boolean = false):String
    • 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);

parser output:

{
  "string": "require('a')",
  "path": "a",
  "index": 0,
  "flag": null
}

Readme

Keywords

Package Sidebar

Install

npm i searequire

Homepage

seajs.org/

Weekly Downloads

195

Version

1.5.3

License

none

Last publish

Collaborators

  • army8735
  • lifesinger