Skip to content

ForbesLindesay/remove-require

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

Build Status Dependency Status NPM version

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

About

Remove requires and replace them with something else of the same length.

Resources

License

Stars

Watchers

Forks

Packages

No packages published