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: release/v7
7 github_path: docs/content/commands/npm-docs.md
8 redirect_from:
9 - /cli-documentation/v7/cli-commands/docs
10 - /cli-documentation/v7/cli-commands/npm-docs
11 - /cli-documentation/v7/commands/docs
12 - /cli-documentation/v7/commands/npm-docs
13 - /cli-documentation/v7/docs
14 - /cli-documentation/v7/npm-docs
15 - /cli/v7/cli-commands/docs
16 - /cli/v7/cli-commands/npm-docs
17 - /cli/v7/commands/docs
18 - /cli/v7/docs
19 - /cli/v7/npm-docs
20 ---
21
22 ### Synopsis
23
24 ```bash
25 npm docs [<pkgname> [<pkgname> ...]]
26
27 aliases: home
28 ```
29
30 ### Description
31
32 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 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.
33
34 ### Configuration
35
36 #### `browser`
37
38 - Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"`
39 - Type: null, Boolean, or String
40
41 The browser that is called by npm commands to open websites.
42
43 Set to `false` to suppress browser behavior and instead print urls to terminal.
44
45 Set to `true` to use default system URL opener.
46
47 #### `registry`
48
49 - Default: "https://registry.npmjs.org/"
50 - Type: URL
51
52 The base URL of the npm registry.
53
54 #### `workspace`
55
56 - Default:
57 - Type: String (can be set multiple times)
58
59 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.
60
61 Valid values for the `workspace` config are either:
62
63 - Workspace names
64 - Path to a workspace directory
65 - Path to a parent workspace directory (will result to selecting all of the nested workspaces)
66
67 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.
68
69 This value is not exported to the environment for child processes.
70
71 #### `workspaces`
72
73 - Default: false
74 - Type: Boolean
75
76 Enable running a command in the context of **all** the configured workspaces.
77
78 This value is not exported to the environment for child processes.
79
80 ### See Also
81
82 - [npm view](/cli/v7/commands/npm-view)
83 - [npm publish](/cli/v7/commands/npm-publish)
84 - [npm registry](/cli/v7/using-npm/registry)
85 - [npm config](/cli/v7/commands/npm-config)
86 - [npmrc](/cli/v7/configuring-npm/npmrc)
87 - [package.json](/cli/v7/configuring-npm/package-json)