All Projects → tj → Node Requires

tj / Node Requires

find / replace require()s

Programming Languages

javascript
184084 projects - #8 most used programming language

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

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].