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
bin/pls — pls -p express
1 $ pls -p express
express
accepts
mime-types
2 mime-db
negotiator
3 body-parser
debug
ms
qs
send
4 mime-types
fresh
5 Done in 2 seconds.

What the numbers point at

  1. 1

    No subcommands to learn — a single -p flag prints the whole tree to stdout.

  2. 2

    Every dependency is indented two spaces per depth level, drawn by Reporter#out's recursive del + 2 calls.

  3. 3

    accepts, body-parser, and send are express's direct dependencies — Pls#build_dep spawns one thread per key, so all three resolve concurrently.

  4. 4

    mime-types shows up under both accepts and send, but Pls#build only calls the npm registry for it once — the second line comes straight from the in-memory cache.

  5. 5

    The only line Reporter#do adds after the tree — total wall-clock time for the run.

License

pls is copyright David Rabkin and available under a Zero-Clause BSD license.