Socket
Socket
Sign inDemoInstall

@tromgy/npm-tree

Package Overview
Dependencies
207
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @tromgy/npm-tree

A convenience tool on top of 'npm list'. Presents the the dependent packages in a collapsible tree with search and dependency path capabilities.


Version published
Weekly downloads
6
Maintainers
1
Created
Weekly downloads
 

Readme

Source

npm-tree

Netlify Status

A tool to aid in analyzing npm (or yarn) package dependencies.

Usage

It can be used either as a command-line utility, or as a pure online solution, available at https://npm-tree.netlify.app.

Pre-requisites

Requires version of Node 12 or newer and npm 6 or newer. Tested with Node versions 12.18.0 and 14.15.5, npm versions 6.14.4 and 7.6.1

Command line

To run it as a command-line tool you can install it globally:

    npm install @tromgy/npm-tree -g

and run it in your project directory (the one that contains package.json):

    npm-tree

or run it via npx (also in your project directory):

    npx @tromgy/npm-tree

When you run it, it will create an HTML file containing the same dependency information as the output from npm list, but in a collapsible, searchable tree and display this HTML file in your default browser:

npm-tree in a browser

This file is removed automatically once it's loaded in the browser.

If you want to keep the file and open it later, use the --save option:

    npm-tree --save
A caveat for Windows systems

If you use drive mapping via the subst command on Windows and try to run npm-tree from such mapped drive, it will not be able to open your default browser unless you also add the correspoding mapping to the following registry key:

[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices]

Online

To use it online, you can just drop the text file containing the output from npm list or yarn list:

npm-tree on Netlify

It will be processed right in the browser and the same searchable tree will be shown.

Keywords

FAQs

Last updated on 19 Apr 2021

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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