$ gnpm install replace-requires
Replace require statements
$ npm install --save replace-requires
var replaceRequires = require('replace-requires');
replaceRequires('require("foo")', {foo: 'bar'});
//=> bar
replaceRequires(code, replacements)
-> string
Required
Type: string
The code to parse and replace.
Required
Type: object
The replacements, where keys are module ids and the corresponding values are the replacements for their require statements.
MIT © Ben Drucker
Copyright 2013 - present © cnpmjs.org | Home |