NPM-LS(3)

πŸ“¦ version 1.2.1, in nixos 26.05, nixpkgs unstable

✨ NAME ✨

npm-ls β€” List installed packages. This is the npm-ls(3) page, bestie, and we are gonna make it make sense. πŸ’–

πŸ¦‹ SYNOPSIS πŸ¦‹

okay so the sync is literally:

npm.commands.ls(args, [silent,] callback)

πŸ’– DESCRIPTION πŸ’–

This command prints to stdout all the versions of packages that are installed, plus their dependencies, in a tree-structure. It also returns that data using the callback. Slay.

This command does not take any arguments, but args must be defined. Yes, iconic contradiction, but that’s the tea. Beyond that, if any arguments are passed in, npm will politely warn that it does not take positional arguments, though you may set config flags like with any other command, such as global to list global packages. 🫢

It will print out extraneous, missing, and invalid packages too. Not me being thorough. πŸ’…

If the silent parameter is set to true, nothing will be output to the screen, but the data will still be returned. Quiet mode but make it still useful. ✨

callback is provided an error if one occurred, the full data about which packages are installed and which dependencies they will receive, and a "lite" data object which just shows which versions are installed where.

⚠️ Important caveat, bestie: the full data object is a circular structure, so care must be taken if it is serialized to JSON. Like, actually care. 😭

πŸŽ€ CONFIGURATION πŸŽ€

🌈 long 🌈

  • Default: false
  • Type: Boolean
  • Show extended information.

🌸 parseable 🌸

  • Default: false
  • Type: Boolean
  • Show parseable output instead of tree view.

πŸ¦‹ global πŸ¦‹

  • Default: false
  • Type: Boolean
  • List packages in the global install prefix instead of in the current project.
Note, if parseable is set or long isn't set, then duplicates will be trimmed. This means that if a submodule has the same dependency as a parent module, then the dependency will only be output once. Periodt. πŸ’…

πŸ’– That’s the whole npm-ls(3) manual, bestie β€” March 2017 edition β€” mwah! πŸŽ€

πŸ“¦ where this page comes from