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

app-root

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-root - npm Package Compare versions

Comparing version 1.1.1 to 1.1.2

13

index.js

@@ -31,3 +31,3 @@ var detective = require('detective'),

// For each file, mark its non-core dependencies as used
return q.all(jsFiles.map(getDependencies))
return q.all(jsFiles.map(getNonCoreDependencies))
.then(function (results) {

@@ -57,4 +57,4 @@ var filesUsed = {};

// Resolve with a list of dependencies for the given file
function getDependencies(jsFile) {
// Resolve with a list of non-core dependencies for the given file
function getNonCoreDependencies(jsFile) {
return getModuleType(jsFile)

@@ -74,4 +74,9 @@ // Configure required options

if (err) console.log(jsFile, err);
deps = deps || [];
deferred.resolve(deps || []);
var nonCoreDeps = deps.filter(function (dep) {
return ! dep.core;
});
deferred.resolve(nonCoreDeps);
});

@@ -78,0 +83,0 @@

{
"name": "app-root",
"version": "1.1.1",
"version": "1.1.2",
"description": "Find the entry-point/root file of any CommonJS or AMD JavaScript application",

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

@@ -17,2 +17,8 @@ var getAppRoot = require('../');

console.log(root[0].indexOf('a2.js') !== -1);
});
});
getAppRoot(__dirname, options, function (root) {
console.log('Entire directory Candidate roots: ', root);
console.log(root.length === 2);
console.log(root[0].indexOf('a2.js') !== -1 && root[1].indexOf('a2.js') !== -1);
});
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