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

dependency-tree

Package Overview
Dependencies
Maintainers
1
Versions
78
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dependency-tree - npm Package Compare versions

Comparing version 5.4.1 to 5.5.0

22

index.js

@@ -100,14 +100,22 @@ var precinct = require('precinct');

* @param {String} filename
* @return {String[]}
* @return {Object}
*/
module.exports._getDependencies = function(filename) {
var data = {
dependencies: [],
ast: null,
};
try {
return precinct.paperwork(filename, {
data.dependencies = precinct.paperwork(filename, {
includeCore: false
});
data.ast = precinct.ast;
return data;
} catch (e) {
debug('error getting dependencies: ' + e.message);
debug(e.stack);
return [];
return data;
}

@@ -130,3 +138,4 @@ };

var dependencies = module.exports._getDependencies(config.filename);
var data = module.exports._getDependencies(config.filename);
var dependencies = data.dependencies;

@@ -140,2 +149,3 @@ debug('extracted ' + dependencies.length + ' dependencies: ', dependencies);

directory: config.directory,
ast: data.ast,
config: config.requireConfig,

@@ -159,2 +169,3 @@ webpackConfig: config.webpackConfig

debug('cabinet-resolved all dependencies: ', dependencies);
// Prevents cycles by eagerly marking the current file as read

@@ -165,3 +176,6 @@ // so that any dependent dependencies exit

if (config.filter) {
debug('using filter function to filter out dependencies');
debug('unfiltered number of dependencies: ' + dependencies.length);
dependencies = dependencies.filter(config.filter);
debug('filtered number of dependencies: ' + dependencies.length);
}

@@ -168,0 +182,0 @@

8

package.json
{
"name": "dependency-tree",
"version": "5.4.1",
"version": "5.5.0",
"description": "Get the dependency tree of a module (as a list)",

@@ -35,4 +35,4 @@ "main": "index.js",

"debug": "~2.2.0",
"filing-cabinet": "~1.2.11",
"precinct": "^3.0.0"
"filing-cabinet": "~1.4.0",
"precinct": "^3.1.1"
},

@@ -44,3 +44,3 @@ "devDependencies": {

"mocha": "~2.0.1",
"mock-fs": "~3.9.0",
"mock-fs": "~3.11.0",
"rewire": "~2.5.2",

@@ -47,0 +47,0 @@ "sinon": "~1.12.2"

@@ -473,3 +473,4 @@ import assert from 'assert';

directory: this._root,
webpackConfig: this._webpackConfig
webpackConfig: this._webpackConfig,
filter: filename => filename.indexOf('filing-cabinet') !== -1
});

@@ -482,2 +483,3 @@

it('resolves aliased modules', function() {
this.timeout(5000);
this._testResolution('aliased');

@@ -487,2 +489,3 @@ });

it('resolves unaliased modules', function() {
this.timeout(5000);
this._testResolution('unaliased');

@@ -489,0 +492,0 @@ });

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