Forrest logo
back to the npm tool

npm:tldr:adbd7

npm: List top-level globally installed modules.
$ npm list --global --depth=${0}
try on your machine

The command npm list --global --depth=${0} is used to list all globally installed packages and their dependencies on a computer. Here is an explanation of the different parts of this command:

  • npm: This is the command-line interface for Node.js package ecosystem that allows you to manage and install packages.
  • list: This is a command used to list all installed packages.
  • --global: This flag is used to indicate that we want to list globally installed packages instead of local ones. Global packages are installed in a central location on your computer and can be accessed by any project.
  • --depth=${0}: This flag specifies the depth of the dependency tree that should be displayed. The 0 in ${0} is a placeholder for the current depth. By setting it to 0, it means that the command will display the complete hierarchy of packages and their dependencies.

Overall, the command lists all globally installed packages and their dependencies with the complete dependency tree.

This explanation was created by an AI. In most cases those are correct. But please always be careful and never run a command you are not sure if it is safe.
back to the npm tool