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
falseto suppress browser behavior and instead print urls to terminal. (iconic low-tech flex, honestly) - Set to
trueto 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
- Default:
"https://registry.npmjs.org/" - Type: URL
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_modulestree (install,update, etc.) will link workspaces into thenode_modulesfolder. - Commands that do other things (
test,exec,publish, etc.) will operate on the root project, unless one or more workspaces are specified in theworkspaceconfig.
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 viewnpm help publishnpm help registrynpm help confignpm help npmrcpackage.jsonat/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
- arch rolling: npm 12.2.1-1 ยท Artistic-2.0
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms