Socket
Socket
Sign inDemoInstall

ncm-analyze-tree

Package Overview
Dependencies
111
Maintainers
2
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.0.0 to 3.0.1

.travis.yml

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc