NPM-DOCS(1)

๐Ÿ’… NPM-DOCS(1)

okay so real quick โ€” this is the npm-docs page from the npm manual, bestie. yes, that npm. the one you already have installed and are definitely not using to its full potential. let's get into it ๐Ÿซถ


โœจ NAME โœจ

npm-docs โ€” open the documentation for a package in a web browser. that's it. that's the whole job. it's giving personal assistant who only does one thing but does it flawlessly ๐Ÿ’…


๐ŸŒธ SYNOPSIS ๐ŸŒธ

npm docs [<pkgname> [<pkgname> ...]]

alias: home

so yeah, you can hit it with zero, one, or a whole little squad of package names. and the alias is home, so npm home <pkg> is the exact same energy โ€” pick whichever one your fingers reach for first ๐Ÿ’–


๐Ÿฆ‹ DESCRIPTION ๐Ÿฆ‹

okay so here's the vibe: this command tries to guess at the likely location of a package's documentation URL, and then it tries to open it using the --browser config param (that's the browser config โ€” more on that below, and you can peep the config docs at /using-npm/config#browser if you're nosy ๐Ÿ‘€).

the "tries" is doing a LOT of work in that sentence ngl โ€” it's a guesser, not a psychic ๐Ÿ”ฎ

you can pass multiple package names at once, so yes, you may absolutely open six docs tabs at 2am and regret it tomorrow. no judgment here, that's main character behavior โœจ

and if you don't provide any package name, it'll do the cute little trick of searching for a package.json in the current folder and using the name property โ€” so if you're standing inside a project, it just knows. iykyk ๐ŸŽ€


๐Ÿ‘‘ CONFIGURATION ๐Ÿ‘‘

๐ŸŒˆ browser

  • Default: macOS: "open", Windows: "start", Others: "xdg-open"
  • Type: null, Boolean, or String

this is the browser that gets called by npm commands to open websites. it's the little hand that reaches out and opens a tab for you ๐Ÿซถ

here's the part you actually need to remember:

  • Set to false to suppress browser behavior and instead print urls to terminal. (iconic low-tech flex, honestly)
  • Set to true to use the default system URL opener.

so if your setup is headless or you just hate surprise tabs, false is your girlie. no cap ๐Ÿ’€


โญ registry

the base URL of the npm registry. that's the address npm is talking to when it's out here looking things up. simple, clean, no drama โœจ


๐Ÿงš workspace

  • Default: (empty โ€” nothing set)
  • Type: String (can be set multiple times)

enable running a command in the context of the configured workspaces of the current project, while filtering by only running the workspaces defined by this config option. so you're like "only these ones, please" ๐Ÿ’…

Valid values for the workspace config are either:

  • Workspace names
  • Path to a workspace directory
  • Path to a parent workspace directory (this will result in selecting all workspaces within that folder โ€” yes, all of them, it cascades ๐Ÿฆ‹)

and one special case, listen up: when set for the npm init command, this may be set to the folder of a workspace which does not yet exist, so npm can create the folder and set it up as a brand new workspace within the project. baby workspace. fresh out the box. precious ๐ŸŽ€

this value is not exported to the environment for child processes. important detail, don't forget it ๐Ÿ’œ

๐ŸŒธ workspaces

  • Default: null
  • Type: null or Boolean

set to true to run the command in the context of all configured workspaces. all of them. the whole group chat ๐Ÿซถ

explicitly setting this to false will cause commands like install to ignore workspaces altogether. like, fully ghost them ๐Ÿ™ˆ

when not set explicitly:

  • Commands that operate on the node_modules tree (install, update, etc.) will link workspaces into the node_modules folder.
  • Commands that do other things (test, exec, publish, etc.) will operate on the root project, unless one or more workspaces are specified in the workspace config.

so the behavior is context-dependent, which, yeah, but that's literally what it says and i'm not about to make stuff up โœจ

also not exported to the environment for child processes. same rule as above ๐Ÿ’œ

๐Ÿ’€ include-workspace-root

  • Default: false
  • Type: Boolean

include the workspace root when workspaces are enabled for a command. like, do we invite the parent to the party or not ๐ŸŽ‰

when false, specifying individual workspaces via the workspace config, or all workspaces via the workspaces flag, will cause npm to operate only on the specified workspaces, and not on the root project. root stays home. sorry root ๐Ÿซถ

yep โ€” this value is not exported to the environment for child processes either. ๐Ÿ’œ

๐Ÿ”ฅ SEE ALSO ๐Ÿ”ฅ

  • npm help view
  • npm help publish
  • npm help registry
  • npm help config
  • npm help npmrc
  • package.json at /configuring-npm/package-json

like, go read the related pages too, bestie. that's how you actually level up ๐Ÿ“šโœจ


okay that's the whole page!! signed, sealed, delivered by npm@12.2.1, dated October 2026 โ€” this page ate and left no crumbs, mwah ๐Ÿ’‹๐ŸŽ€๐Ÿฆ‹

๐Ÿ“ฆ where this page comes from