1 ---
2 title: npm-docs
3 section: 1
4 description: Open documentation for a package in a web browser
5 github_repo: npm/cli
6 github_branch: latest
7 github_path: docs/lib/content/commands/npm-docs.md
8 redirect_from:
9 - /cli-commands/docs
10 - /cli-commands/npm-docs
11 - /cli-documentation/cli-commands/docs
12 - /cli-documentation/cli-commands/npm-docs
13 - /cli-documentation/commands/docs
14 - /cli-documentation/commands/npm-docs
15 - /cli-documentation/docs
16 - /cli-documentation/npm-docs
17 - /cli-documentation/v11/cli-commands/docs
18 - /cli-documentation/v11/cli-commands/npm-docs
19 - /cli-documentation/v11/commands/docs
20 - /cli-documentation/v11/commands/npm-docs
21 - /cli-documentation/v11/docs
22 - /cli-documentation/v11/npm-docs
23 - /cli/cli-commands/docs
24 - /cli/cli-commands/npm-docs
25 - /cli/commands/docs
26 - /cli/commands/npm-docs
27 - /cli/docs
28 - /cli/npm-docs
29 - /cli/v11/cli-commands/docs
30 - /cli/v11/cli-commands/npm-docs
31 - /cli/v11/commands/docs
32 - /cli/v11/docs
33 - /cli/v11/npm-docs
34 - /commands/docs
35 - /commands/npm-docs
36 ---
37
38 ### Synopsis
39
40 ```bash
41 npm docs [<pkgname> [<pkgname> ...]]
42
43 alias: home
44 ```
45
46 ### Description
47
48 This command tries to guess at the likely location of a package's documentation URL, and then tries to open it using the [`--browser` config](/cli/v11/using-npm/config#browser) param. You can pass multiple package names at once. If no package name is provided, it will search for a `package.json` in the current folder and use the `name` property.
49
50 ### Configuration
51
52 #### `browser`
53
54 - Default: macOS: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
55 - Type: null, Boolean, or String
56
57 The browser that is called by npm commands to open websites.
58
59 Set to `false` to suppress browser behavior and instead print urls to terminal.
60
61 Set to `true` to use default system URL opener.
62
63 #### `registry`
64
65 - Default: "https://registry.npmjs.org/"
66 - Type: URL
67
68 The base URL of the npm registry.
69
70 #### `workspace`
71
72 - Default:
73 - Type: String (can be set multiple times)
74
75 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.
76
77 Valid values for the `workspace` config are either:
78
79 - Workspace names
80 - Path to a workspace directory
81 - Path to a parent workspace directory (will result in selecting all workspaces within that folder)
82
83 When set for the `npm init` 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.
84
85 This value is not exported to the environment for child processes.
86
87 #### `workspaces`
88
89 - Default: null
90 - Type: null or Boolean
91
92 Set to true to run the command in the context of **all** configured workspaces.
93
94 Explicitly setting this to false will cause commands like `install` to ignore workspaces altogether. When not set explicitly:
95
96 - 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.
97
98 This value is not exported to the environment for child processes.
99
100 #### `include-workspace-root`
101
102 - Default: false
103 - Type: Boolean
104
105 Include the workspace root when workspaces are enabled for a command.
106
107 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.
108
109 This value is not exported to the environment for child processes.
110
111 ### See Also
112
113 - [npm view](/cli/v11/commands/npm-view)
114 - [npm publish](/cli/v11/commands/npm-publish)
115 - [npm registry](/cli/v11/using-npm/registry)
116 - [npm config](/cli/v11/commands/npm-config)
117 - [npmrc](/cli/v11/configuring-npm/npmrc)
118 - [package.json](/cli/v11/configuring-npm/package-json)