ncm-analyze-tree
Advanced tools
Comparing version 3.0.0 to 3.0.1
31
index.js
@@ -45,33 +45,6 @@ 'use strict' | ||
const id = node => `${node.data.name}@${node.data.version}` | ||
const readUniversalTree = async dir => { | ||
const tree = await universalModuleTree(dir) | ||
const pkgs = new Map() | ||
const walk = (node, path) => { | ||
let pkgObj | ||
if (pkgs.has(id(node))) { | ||
pkgObj = pkgs.get(id(node)) | ||
pkgObj.paths.push(path) | ||
} else { | ||
pkgObj = { | ||
name: node.data.name, | ||
version: node.data.version, | ||
paths: [path] | ||
} | ||
pkgs.set(id(node), pkgObj) | ||
for (const child of node.children) { | ||
walk(child, [...path, node]) | ||
} | ||
} | ||
} | ||
for (const child of tree.children) { | ||
walk(child, []) | ||
} | ||
const set = new Set() | ||
for (const [, pkg] of pkgs) set.add(pkg) | ||
return set | ||
const list = universalModuleTree.flatten(tree) | ||
return new Set(list) | ||
} | ||
@@ -78,0 +51,0 @@ |
{ | ||
"name": "ncm-analyze-tree", | ||
"version": "3.0.0", | ||
"version": "3.0.1", | ||
"license": "MIT", | ||
@@ -18,4 +18,4 @@ "repository": "nodesource/ncm-analyze-tree", | ||
"semver": "^5.5.1", | ||
"universal-module-tree": "^2.0.0" | ||
"universal-module-tree": "^2.2.0" | ||
} | ||
} |
# ncm-analyze-tree | ||
[![Build Status](https://travis-ci.org/nodesource/ncm-analyze-tree.svg?branch=master)](https://travis-ci.org/nodesource/ncm-analyze-tree) | ||
Get certification data for a module's dependency tree, as it is on disk. | ||
@@ -97,2 +99,4 @@ | ||
- `dir`: The node project's directory | ||
- `token`: accounts token | ||
- `onPkgs`: Called with a `Set` of package objects `{ name, version }`, once the | ||
@@ -99,0 +103,0 @@ tree has been read |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7
112
8192
149
1
Updateduniversal-module-tree@^2.2.0