Socket
Socket
Sign inDemoInstall

browserify-derequire

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify-derequire - npm Package Compare versions

Comparing version 0.9.3 to 0.9.4

23

index.js

@@ -25,3 +25,2 @@ /*

var fs = require("fs");
var through = require("through2");

@@ -32,6 +31,6 @@ var derequire = require("derequire");

module.exports = function (browserify, opts) {
/* hook into the bundle generation pipeline of Browserify */
browserify.on("bundle", function (pipeline) {
/* create a transform stream */
var createStream = function () {
var code = "";
pipeline.get("wrap").push(through.obj(function (buf, enc, next) {
var stream = through.obj(function (buf, enc, next) {
/* accumulate the code chunks */

@@ -43,9 +42,17 @@ code += buf.toString();

if (opts.derequire === undefined)
opts.derequire = [ { from: "require", to: "_dereq_" } ]
code = derequire(code, opts.derequire)
this.push(new Buffer(code))
opts.derequire = [ { from: "require", to: "_dereq_" } ];
code = derequire(code, opts.derequire);
this.push(new Buffer(code));
next();
}));
});
stream.label = "derequire";
return stream;
};
/* hook into the bundle generation pipeline of Browserify */
browserify.pipeline.get("wrap").push(createStream());
browserify.on("reset", function () {
browserify.pipeline.get("wrap").push(createStream());
});
};
{
"name": "browserify-derequire",
"version": "0.9.3",
"version": "0.9.4",
"description": "Browserify Plugin for Renaming require() Calls",

@@ -5,0 +5,0 @@ "keywords": [ "browserify-plugin", "browserify", "plugin", "derequire" ],

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