1.0.0 • Published 9 years ago
remove-require v1.0.0
remove-require
Remove requires and replace them with something else of the same length.
It is clever enough to detect if _dereq_
is already taken, and always choose a token that is unused. It also changes any parameter names, variable declarations etc. to match. It will change the variable even if it appears to be global, this saves it from having to do scope analysis.
Installation
npm install remove-require
Usage
var removeRequire = require('remove-require');
var result = removeRequire('var x = require("foo");');
// => {src: 'var x = _dereq_("foo");', name: '_dereq_'}
License
MIT
1.0.0
9 years ago