Socket
Socket
Sign inDemoInstall

browserify

Package Overview
Dependencies
Maintainers
40
Versions
485
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

browserify - npm Package Compare versions

Comparing version 16.0.0 to 16.1.0

16

bin/args.js

@@ -67,15 +67,3 @@ var browserify = require('../');

});
if (argv.node) {
argv.bare = true;
argv.browserField = false;
}
if (argv.bare) {
argv.builtins = false;
argv.commondir = false;
if (argv.igv === undefined) {
argv.igv = '__filename,__dirname';
}
}
if (argv.igv) {

@@ -93,2 +81,4 @@ var insertGlobalVars = {};

var b = browserify(xtend({
node: argv.node,
bare: argv.bare,
noParse: Array.isArray(argv.noParse) ? argv.noParse : [argv.noParse],

@@ -95,0 +85,0 @@ extensions: [].concat(argv.extension).filter(Boolean).map(function (extension) {

17

index.js

@@ -47,2 +47,19 @@ var path = require('path');

else opts = xtend(files, opts);
if (opts.node) {
opts.bare = true;
opts.browserField = false;
}
if (opts.bare) {
opts.builtins = false;
opts.commondir = false;
if (opts.insertGlobalVars === undefined) {
opts.insertGlobalVars = {}
Object.keys(insertGlobals.vars).forEach(function (name) {
if (name !== '__dirname' && name !== '__filename') {
opts.insertGlobalVars[name] = undefined;
}
})
}
}

@@ -49,0 +66,0 @@ self._options = opts;

{
"name": "browserify",
"version": "16.0.0",
"version": "16.1.0",
"description": "browser-side require() the node way",

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

var test = require('tap').test;
var spawn = require('child_process').spawn;
var browserify = require('../');
var path = require('path');

@@ -7,2 +8,3 @@ var concat = require('concat-stream');

var fs = require('fs');
var through = require('through2');
var temp = require('temp');

@@ -46,2 +48,27 @@ temp.track();

test('bare api', function (t) {
t.plan(3);
var input = through();
var b = browserify(input, { bare: true });
b.bundle().pipe(concat(function (body) {
vm.runInNewContext(body, {
Buffer: function (s) { return s.toLowerCase() },
console: {
log: function (msg) { t.equal(msg, 'abc') }
}
});
vm.runInNewContext(body, {
Buffer: Buffer,
console: {
log: function (msg) {
t.ok(Buffer.isBuffer(msg));
t.equal(msg.toString('utf8'), 'ABC')
}
}
});
}));
input.end('console.log(Buffer("ABC"))');
});
test('bare inserts __filename,__dirname but not process,global,Buffer', function (t) {

@@ -48,0 +75,0 @@ t.plan(2);

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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