The NPM list command helps list all the dependencies you install in the root level project.
Npm list command print the Package list based on the package.json and package.lock.json file.
npm ls npm ls <option> or <flags>
npm ls command is a similar command to the Linux ls command. But the difference in npm and ls command. Linux ls command prints directory or folders, and the npm ls command prints the installed packages in your project.
Npm ls command print package information with a beautiful design format in your terminal.
We discuss only daily base options or flags in npm. npm ls command provides many more flags, which many more flags work for the developer, and some commands are not under everyday use.
We make sure with the npm ls command to speed up your workflow.
Option or Flags
npm ls –all print all the dependencies are depending upon the current project.
npm ls -all
npm ls –json command print the data in json formate in the terminal.
npm ls json
npm ls –long print the extended information.
npm ls --long
npm ls global command prints all global installed package lists in the terminal.
npm ls --global
npm ls depth command prints in-depth dependencies into the terminal.
npm ls –link command only print the linked packages list in the terminal.
npm ls --link
npm ls package-lock-only command print dependences tree based on the package-lock.json file.
The npm ls command flags are not discussed in this article.