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

deptrace

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

deptrace - npm Package Compare versions

Comparing version 0.2.3 to 0.2.4

27

index.js

@@ -10,2 +10,5 @@ const promise = require('bluebird');

}
if (opts.setup) {
this.setup = opts.setup;
}
if (opts.resolve) {

@@ -38,13 +41,23 @@ this.resolve = opts.resolve;

Deptrace.prototype.graph = function (input, parents) {
var ready = promise.resolve();
var initialCall = (arguments.length === 1);
if (!parents) {
parents = [];
if (typeof this.setup === 'function') {
ready = promise.resolve(this.setup());
}
}
parents = parents.slice();
parents.push(input);
var recurse = this._recurse(input, parents);
if (arguments.length === 1) {
recurse = recurse.then(this.format.bind(this, input));
}
return recurse;
return ready.then(function () {
parents = parents.slice();
parents.push(input);
var recurse = this._recurse(input, parents);
if (initialCall) {
recurse = recurse.then(this.format.bind(this, input));
}
return recurse;
}.bind(this));
};

@@ -51,0 +64,0 @@

{
"name": "deptrace",
"description": "Trace and format recursive dependency trees asynchronously.",
"version": "0.2.3",
"version": "0.2.4",
"homepage": "https://github.com/gitfuse/deptrace",

@@ -24,3 +24,3 @@ "authors": [

"engines": {
"node": ">= 0.8.0"
"node": ">= 0.10.0"
},

@@ -38,3 +38,3 @@ "scripts": {

"dependencies": {
"bluebird": "^2.2.1"
"bluebird": "~2.2.1"
},

@@ -41,0 +41,0 @@ "keywords": [

@@ -14,2 +14,5 @@ # deptrace [![Build Status](https://secure.travis-ci.org/gitfuse/deptrace.png)](http://travis-ci.org/gitfuse/deptrace)

const tracer = new Deptrace({
setup: function () {
// optional method to call before running graph
},
depsFor: function (input) {

@@ -28,2 +31,9 @@ // extract an array of dependencies from some input

### opts.setup
Use this to perform any setup necessary before running a graph. May return a promise.
Type: `Function`
Default: null
#### opts.depsFor(input)

@@ -30,0 +40,0 @@

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