@tromgy/npm-tree

1.1.1 • Public • Published

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.

Package Sidebar

Install

npm i @tromgy/npm-tree

Weekly Downloads

0

Version

1.1.1

License

ISC

Unpacked Size

57 kB

Total Files

23

Last publish

Collaborators

  • tromgy