re-require

0.0.1 • Public • Published

re-require Build Status

find some require statements and maybe change them if you feel like it

var rerequire = require('re-require');
var fs = require('fs');
var strOldCode = fs.readFileSync('./your-killer-module.js', 'utf-8');
 
var strNewCode = rerequire(strOldCode, function(arg){
  // if there is a single string argument to the require call 
  // then it be passed to the callback as the only parameter.
  console.dir(arg);
 
  // this.value is the esprima node for a require call.
  // you can change it by overwriting or modifying this.value
  console.dir(this.value);
});

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.1
    67
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.1
    67
  • 0.0.0
    0

Package Sidebar

Install

npm i re-require

Weekly Downloads

67

Version

0.0.1

License

mit

Last publish

Collaborators

  • chevett