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

install

Package Overview
Dependencies
Maintainers
1
Versions
64
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

install - npm Package Compare versions

Comparing version 0.1.2 to 0.1.3

24

main.js

@@ -16,1 +16,25 @@ var fs = require("fs");

};
// Not perfect, but we need to match the behavior of install.js.
var requireExp = /\brequire\(['"]([^'"]+)['"]\)/g;
// This function should match the behavior of `ready` and `absolutize` in
// install.js, but the implementations are not worth unifying because we have
// access to the "path" module here.
exports.getRequiredIDs = function(id, source) {
var match, seen = {}, ids = [];
requireExp.lastIndex = 0;
while ((match = requireExp.exec(source))) {
var rid = match[1];
if (rid.charAt(0) === ".")
rid = path.normalize(path.join(id, "..", match[1]));
if (!seen.hasOwnProperty(rid)) {
seen[rid] = true;
ids.push(rid);
}
}
return ids;
};

2

package.json

@@ -18,3 +18,3 @@ {

],
"version": "0.1.2",
"version": "0.1.3",
"homepage": "http://github.com/benjamn/install",

@@ -21,0 +21,0 @@ "repository": {

@@ -208,3 +208,3 @@ var main = require("../main");

install("path/to/n", function(require, exports) {
function n(require, exports) {
assert.strictEqual(require("./o").value, value);

@@ -221,5 +221,11 @@ assert.strictEqual(require("../to/o").value, value);

assert.deepEqual(
main.getRequiredIDs("path/to/n", n.toString()),
["path/to/o"]);
finish(t);
});
}
install("path/to/n", n);
install("path/to/o", function(require, exports) {

@@ -226,0 +232,0 @@ exports.value = value;

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