npm stats
  • Search
  • About
  • Repo
  • Sponsor
  • more
    • Search
    • About
    • Repo
    • Sponsor

Made by Antonio Ramirez

remove-require

1.0.0

@forbeslindesay

npmHomeRepoSnykSocket
Downloads:6
$ npm install remove-require
DailyWeeklyMonthlyYearly

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