requires

like node-detective but trades AST correctness for speed

MIT 4 个版本
安装
npm install requires
yarn add requires
pnpm add requires
bun add requires
README

requires

Super simple require parser, trades correctness for speed. If you do weird things like concat strings for require()s this will fail.

Installation

$ npm install requires

Example

js:

var a = require('./a.js');
var b = require('./something/here/whoop');
var c = require("something");

parser output:

[
  {
    "string": "require('./a.js')",
    "path": "./a.js",
    "index": 9
  },
  {
    "string": "require('./something/here/whoop')",
    "path": "./something/here/whoop",
    "index": 36
  },
  {
    "string": "require(\"something\")",
    "path": "something",
    "index": 79
  }
]

License

MIT

版本列表
1.0.2 2014-10-07
1.0.1 2014-04-10
1.0.0 2013-11-14
0.0.1 2013-11-14