About
Package Lister prints the full dependency tree of a given NodeJS package. NodeJS packages are modules published to npm, each with its own version, documentation, and dependencies on other packages. Given a package name, the tool fetches its complete set of dependencies from npm.
Install
The tool runs on macOS, GNU/Linux, other Unix-like systems, and Windows. It is packaged as a Ruby gem and requires Ruby 3.2 or later. If your platform lacks a suitable Ruby, see Installing Ruby.
Install the gem with:
gem install pls
Or install it with Homebrew from the rdavid tap:
brew install rdavid/tap/pls
Usage
pls [options]
-p, --pac package Sets the package name.
-v, --version Shows the version.
Example
pls -p express
What the numbers point at
-
1
No subcommands to learn — a single
-pflag prints the whole tree to stdout. -
2
Every dependency is indented two spaces per depth level, drawn by
Reporter#out's recursivedel + 2calls. -
3
accepts,body-parser, andsendare express's direct dependencies —Pls#build_depspawns one thread per key, so all three resolve concurrently. -
4
mime-typesshows up under bothacceptsandsend, butPls#buildonly calls the npm registry for it once — the second line comes straight from the in-memory cache. -
5
The only line
Reporter#doadds after the tree — total wall-clock time for the run.
License
pls is copyright David Rabkin and available under a
Zero-Clause BSD license.