2025-04-10 14:36:22 -07:00
.TH "NPM-DOCS" "1" "April 2025" "NPM@11.3.0" ""
2011-11-26 09:21:03 -08:00
.SH "NAME"
2022-12-06 22:18:33 -05:00
\fB npm-docs\fR - Open documentation for a package in a web browser
.SS "Synopsis"
2014-09-24 14:41:07 -07:00
.P
.RS 2
2014-11-04 15:08:12 -08:00
.nf
2022-12-06 22:18:33 -05:00
npm docs \[ lB]<pkgname> \[ lB]<pkgname> ...\[ rB]\[ rB]
2020-10-02 17:52:19 -04:00
2022-02-24 21:41:49 +00:00
alias: home
2014-11-04 15:08:12 -08:00
.fi
2014-09-24 14:41:07 -07:00
.RE
2022-12-06 22:18:33 -05:00
.SS "Description"
.P
This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the \fB \fB --browser\fR config\fR \fI \(la /using-npm/config#browser\(ra \fR param. You can pass multiple package names at once. If no package name is provided, it will search for a \fB package.json\fR in the current folder and use the \fB name\fR property.
.SS "Configuration"
.SS "\fBbrowser\fR"
2014-09-24 14:41:07 -07:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: OS X: \fB "open"\fR , Windows: \fB "start"\fR , Others: \fB "xdg-open"\fR
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: null, Boolean, or String
2022-12-06 22:18:33 -05:00
.RE 0
2014-09-24 14:41:07 -07:00
2011-11-26 09:21:03 -08:00
.P
2022-12-06 22:18:33 -05:00
The browser that is called by npm commands to open websites.
2020-10-02 17:52:19 -04:00
.P
2022-12-06 22:18:33 -05:00
Set to \fB false\fR to suppress browser behavior and instead print urls to terminal.
2020-10-02 17:52:19 -04:00
.P
2022-12-06 22:18:33 -05:00
Set to \fB true\fR to use default system URL opener.
.SS "\fBregistry\fR"
2014-09-24 14:41:07 -07:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Default: "https://registry.npmjs.org/"
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: URL
2022-12-06 22:18:33 -05:00
.RE 0
2014-09-24 14:41:07 -07:00
2011-11-26 09:21:03 -08:00
.P
2022-12-06 22:18:33 -05:00
The base URL of the npm registry.
.SS "\fBworkspace\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Default:
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Type: String (can be set multiple times)
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
2021-04-01 17:27:18 -04:00
.P
2022-12-06 22:18:33 -05:00
Enable running a command in the context of the configured workspaces of the current project while filtering by running only the workspaces defined by this configuration option.
2021-04-01 17:27:18 -04:00
.P
2022-12-06 22:18:33 -05:00
Valid values for the \fB workspace\fR config are either:
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Workspace names
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-05-20 15:54:50 -04:00
Path to a workspace directory
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Path to a parent workspace directory (will result in selecting all workspaces within that folder)
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
When set for the \fB npm init\fR command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a brand new workspace within the project.
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
This value is not exported to the environment for child processes.
.SS "\fBworkspaces\fR"
2021-05-20 15:54:50 -04:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-10-14 22:17:47 +00:00
Default: null
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-10-14 22:17:47 +00:00
Type: null or Boolean
2022-12-06 22:18:33 -05:00
.RE 0
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Set to true to run the command in the context of \fB all\fR configured workspaces.
2021-05-20 15:54:50 -04:00
.P
2022-12-06 22:18:33 -05:00
Explicitly setting this to false will cause commands like \fB install\fR to ignore workspaces altogether. When not set explicitly:
2021-10-14 22:17:47 +00:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
Commands that operate on the \fB node_modules\fR tree (install, update, etc.) will link workspaces into the \fB node_modules\fR folder. - Commands that do other things (test, exec, publish, etc.) will operate on the root project, \fI unless\fR one or more workspaces are specified in the \fB workspace\fR config.
.RE 0
2021-10-14 22:17:47 +00:00
.P
2022-12-06 22:18:33 -05:00
This value is not exported to the environment for child processes.
.SS "\fBinclude-workspace-root\fR"
2021-10-14 22:17:47 +00:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-10-14 22:17:47 +00:00
Default: false
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2021-10-14 22:17:47 +00:00
Type: Boolean
2022-12-06 22:18:33 -05:00
.RE 0
2021-10-14 22:17:47 +00:00
.P
2022-12-06 22:18:33 -05:00
Include the workspace root when workspaces are enabled for a command.
2021-10-14 22:17:47 +00:00
.P
2022-12-06 22:18:33 -05:00
When false, specifying individual workspaces via the \fB workspace\fR config, or all workspaces via the \fB workspaces\fR flag, will cause npm to operate only on the specified workspaces, and not on the root project.
2022-04-14 21:57:02 +00:00
.P
2022-12-06 22:18:33 -05:00
This value is not exported to the environment for child processes.
.SS "See Also"
2014-09-24 14:41:07 -07:00
.RS 0
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help view
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help publish
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-05 14:55:08 -05:00
npm help registry
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-18 21:01:39 +02:00
npm help config
2022-12-06 22:18:33 -05:00
.IP \(bu 4
2019-11-05 14:55:08 -05:00
npm help npmrc
2022-12-06 22:18:33 -05:00
.IP \(bu 4
\fB package.json\fR \fI \(la /configuring-npm/package-json\(ra \fR
.RE 0