NPM-LS(3)
β¨ 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, ifparseableis set orlongisn'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
- nixos 26.05: hueadm 1.2.1
- nixpkgs unstable: hueadm 1.2.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms