reggi/overrides
@reggi/path-to-regexp
dependabot/npm_and_yarn/main/copy-to-clipboard-4.0.2
dependabot/npm_and_yarn/main/eslint-10.4.0
dependabot/npm_and_yarn/main/npmcli/eslint-config-7.0.0
dependabot/npm_and_yarn/main/proc-log-7.0.0
dependabot/npm_and_yarn/npm_and_yarn-826852524d
dependabot/npm_and_yarn/npm_and_yarn-ab9a7f4bc2
deprecate-totp-2fa
dhei/classic-tokens
gat-bypass-2fa-docs
jpg619/fix-accessibility-content-flow
jpg619/version-bump-tar-2
kartykp/gat-bypass-2fa-docs
kartykp/upgrade-path-to-regex
main
maitxn/version-bump-tar
patch-1
reggi/cache-based-on-version
reggi/dev-engines
reggi/fix-transform-prettier
reggi/overrides
update-search-sensitivity
| 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/v8 |
| 7 | github_path: docs/lib/content/commands/npm-docs.md |
| 8 | redirect_from: |
| 9 | - /cli-documentation/v8/cli-commands/docs |
| 10 | - /cli-documentation/v8/cli-commands/npm-docs |
| 11 | - /cli-documentation/v8/commands/docs |
| 12 | - /cli-documentation/v8/commands/npm-docs |
| 13 | - /cli-documentation/v8/docs |
| 14 | - /cli-documentation/v8/npm-docs |
| 15 | - /cli/v8/cli-commands/docs |
| 16 | - /cli/v8/cli-commands/npm-docs |
| 17 | - /cli/v8/commands/docs |
| 18 | - /cli/v8/docs |
| 19 | - /cli/v8/npm-docs |
| 20 | --- |
| 21 | |
| 22 | ### Synopsis |
| 23 | |
| 24 | ```bash |
| 25 | npm docs [<pkgname> [<pkgname> ...]] |
| 26 | |
| 27 | alias: 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 in selecting all workspaces within that folder) |
| 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: null |
| 74 | - Type: null or Boolean |
| 75 | |
| 76 | Set to true to run the command in the context of **all** configured workspaces. |
| 77 | |
| 78 | Explicitly setting this to false will cause commands like `install` to ignore workspaces altogether. When not set explicitly: |
| 79 | |
| 80 | - 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. |
| 81 | |
| 82 | This value is not exported to the environment for child processes. |
| 83 | |
| 84 | #### `include-workspace-root` |
| 85 | |
| 86 | - Default: false |
| 87 | - Type: Boolean |
| 88 | |
| 89 | Include the workspace root when workspaces are enabled for a command. |
| 90 | |
| 91 | 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. |
| 92 | |
| 93 | This value is not exported to the environment for child processes. |
| 94 | |
| 95 | ### See Also |
| 96 | |
| 97 | - [npm view](/cli/v8/commands/npm-view) |
| 98 | - [npm publish](/cli/v8/commands/npm-publish) |
| 99 | - [npm registry](/cli/v8/using-npm/registry) |
| 100 | - [npm config](/cli/v8/commands/npm-config) |
| 101 | - [npmrc](/cli/v8/configuring-npm/npmrc) |
| 102 | - [package.json](/cli/v8/configuring-npm/package-json) |