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 - npm Package Compare versions

Comparing version 1.2.0 to 1.2.1

3

index.js

@@ -56,3 +56,4 @@ 'use strict';

});
var ctx = new esrefactor.Context(inCode);
var ctx = new esrefactor.Context(ast);
ctx._code = inCode;

@@ -59,0 +60,0 @@ estraverse.traverse(ast,{

{
"name": "derequire",
"version": "1.2.0",
"version": "1.2.1",
"description": "remove requires",

@@ -24,5 +24,5 @@ "main": "index.js",

"concat-stream": "^1.4.6",
"esprima-fb": "^3001.1.0-dev-harmony-fb",
"esprima-fb": "^10001.1.0-dev-harmony-fb",
"esrefactor": "~0.1.0",
"estraverse": "~1.5.0",
"estraverse": "~1.9.1",
"yargs": "^1.3.1"

@@ -29,0 +29,0 @@ },

@@ -13,5 +13,5 @@ derequire [![Build Status](https://travis-ci.org/calvinmetcalf/derequire.svg)](https://travis-ci.org/calvinmetcalf/derequire)

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 or variable declerations and subsequent uses of said argument, then returnes the code.
`derequire` takes a string of code and replaces all instances of the `tokenFrom` identifier (defaults to 'require') and replaces them with the `tokenTo` identifier (defaults to '\_dereq\_') but only if they are functional arguments or variable declarations and subsequent uses of said argument, then returnes the code.
For multiple renames at the same times accepts the syntax
For multiple renames at the same time, the following syntax is accepted:

@@ -31,2 +31,2 @@ ```js

__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.
__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.
!function (define) {
define(function (require) {
define(function (requir_) {
var jQuery;
if (!jQuery && typeof require === 'function') {
jQuery = require('jquery');
if (!jQuery && typeof requir_ === 'function') {
jQuery = requir_('jquery');
}
});
}();

@@ -87,3 +87,3 @@ var should = require('chai').should();

{
from: 'require',
from: 'requir_',
to: '_derec_'

@@ -90,0 +90,0 @@ },

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