lego-require
Get require() like node-detective by lexical analysis
Last updated 6 years ago by herbertliu .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install lego-require 
SYNC missed versions from official npm registry.

Get require() like node-requires by lexical analysis

changed name from "searequire"

Installation

npm install lego-require

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
}

Current Tags

  • 0.0.1                                ...           latest (6 years ago)

1 Versions

  • 0.0.1                                ...           6 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 15
Last Day 0
Last Week 0
Last Month 27
Dependencies (0)
None
Dev Dependencies (9)

Copyright 2014 - 2017 © taobao.org |