Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

derequire

Package Overview
Dependencies
Maintainers
1
Versions
26
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

derequire

remove requires

  • 0.8.0
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

derequire

npm install derequire
var derequire = require('derequire');
var transformedCode = derequire(code, /*tokenTo=*/'_dereq_', /*tokenFrom=*/'require');

takes a string of code and replaces all instances of the identifier tokenFrom (default 'require') and replaces them with tokenTo (default '_dereq_') but only if they are functional arguments and subsequent uses of said argument, then returnes the code.

Note: in order to avoid quite a few headaches the token you're changing from and the token you're changing to need to be the same length.

FAQs

Package last updated on 19 Mar 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc