Socket
Socket
Sign inDemoInstall

browserify

Package Overview
Dependencies
Maintainers
0
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 1.2.3 to 1.2.4

test/coffee/entry.coffee

20

lib/wrap.js

@@ -8,2 +8,3 @@ var detective = require('detective');

var wrappers = require('./wrappers');
var commondir = require('commondir');
var nub = require('nub');

@@ -103,4 +104,6 @@

Wrap.prototype.addEntry = function (file) {
var body = this.readFile(file);
Wrap.prototype.addEntry = function (file, opts) {
var self = this;
var body = self.readFile(file);
if (!opts) opts = {};

@@ -117,9 +120,10 @@ var required = detective.find(body);

var dir = path.dirname(path.resolve(process.cwd(), file));
if (!opts.root) {
opts.root = commondir(dir, required.strings.concat(file));
}
this.require(required.strings.map(function (r) {
if (r.match(/^(\.\.?)?\//)) {
return path.resolve(dir, r);
}
else return r;
}));
required.strings.forEach(function (r) {
var x = r.match(/^(\.\.?)?\//) ? path.resolve(opts.root, r) : r;
self.require(x, { root : opts.root });
});

@@ -126,0 +130,0 @@ this.entries[file] = this.appends.length;

3

package.json
{
"name" : "browserify",
"version" : "1.2.3",
"version" : "1.2.4",
"description" : "Browser-side require() for js directories and npm modules",

@@ -27,2 +27,3 @@ "main" : "./index.js",

"nub" : "0.0.x",
"commondir" : "0.0.x",
"coffee-script" : ">=1.1.1 <1.2"

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

@@ -23,1 +23,19 @@ var assert = require('assert');

};
exports.coffeeEntry = function () {
var b = browserify({ entry : __dirname + '/coffee/entry.coffee' });
var src = b.bundle();
var to = setTimeout(function () {
assert.fail('never called done');
}, 5000);
var c = {
setTimeout : setTimeout,
done : function (fn) {
clearTimeout(to);
assert.equal(fn(10), 100);
}
};
vm.runInNewContext(src, c);
};
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