11cb0ef41Sopenharmony_ci--- 21cb0ef41Sopenharmony_cititle: npm-docs 31cb0ef41Sopenharmony_cisection: 1 41cb0ef41Sopenharmony_cidescription: Open documentation for a package in a web browser 51cb0ef41Sopenharmony_ci--- 61cb0ef41Sopenharmony_ci 71cb0ef41Sopenharmony_ci### Synopsis 81cb0ef41Sopenharmony_ci 91cb0ef41Sopenharmony_ci```bash 101cb0ef41Sopenharmony_cinpm docs [<pkgname> [<pkgname> ...]] 111cb0ef41Sopenharmony_ci 121cb0ef41Sopenharmony_cialias: home 131cb0ef41Sopenharmony_ci``` 141cb0ef41Sopenharmony_ci 151cb0ef41Sopenharmony_ci### Description 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ciThis command tries to guess at the likely location of a package's 181cb0ef41Sopenharmony_cidocumentation URL, and then tries to open it using the 191cb0ef41Sopenharmony_ci[`--browser` config](/using-npm/config#browser) param. You can pass multiple 201cb0ef41Sopenharmony_cipackage names at once. If no package name is provided, it will search for a 211cb0ef41Sopenharmony_ci`package.json` in the current folder and use the `name` property. 221cb0ef41Sopenharmony_ci 231cb0ef41Sopenharmony_ci### Configuration 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ci#### `browser` 261cb0ef41Sopenharmony_ci 271cb0ef41Sopenharmony_ci* Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` 281cb0ef41Sopenharmony_ci* Type: null, Boolean, or String 291cb0ef41Sopenharmony_ci 301cb0ef41Sopenharmony_ciThe browser that is called by npm commands to open websites. 311cb0ef41Sopenharmony_ci 321cb0ef41Sopenharmony_ciSet to `false` to suppress browser behavior and instead print urls to 331cb0ef41Sopenharmony_citerminal. 341cb0ef41Sopenharmony_ci 351cb0ef41Sopenharmony_ciSet to `true` to use default system URL opener. 361cb0ef41Sopenharmony_ci 371cb0ef41Sopenharmony_ci 381cb0ef41Sopenharmony_ci 391cb0ef41Sopenharmony_ci#### `registry` 401cb0ef41Sopenharmony_ci 411cb0ef41Sopenharmony_ci* Default: "https://registry.npmjs.org/" 421cb0ef41Sopenharmony_ci* Type: URL 431cb0ef41Sopenharmony_ci 441cb0ef41Sopenharmony_ciThe base URL of the npm registry. 451cb0ef41Sopenharmony_ci 461cb0ef41Sopenharmony_ci 471cb0ef41Sopenharmony_ci 481cb0ef41Sopenharmony_ci#### `workspace` 491cb0ef41Sopenharmony_ci 501cb0ef41Sopenharmony_ci* Default: 511cb0ef41Sopenharmony_ci* Type: String (can be set multiple times) 521cb0ef41Sopenharmony_ci 531cb0ef41Sopenharmony_ciEnable running a command in the context of the configured workspaces of the 541cb0ef41Sopenharmony_cicurrent project while filtering by running only the workspaces defined by 551cb0ef41Sopenharmony_cithis configuration option. 561cb0ef41Sopenharmony_ci 571cb0ef41Sopenharmony_ciValid values for the `workspace` config are either: 581cb0ef41Sopenharmony_ci 591cb0ef41Sopenharmony_ci* Workspace names 601cb0ef41Sopenharmony_ci* Path to a workspace directory 611cb0ef41Sopenharmony_ci* Path to a parent workspace directory (will result in selecting all 621cb0ef41Sopenharmony_ci workspaces within that folder) 631cb0ef41Sopenharmony_ci 641cb0ef41Sopenharmony_ciWhen set for the `npm init` command, this may be set to the folder of a 651cb0ef41Sopenharmony_ciworkspace which does not yet exist, to create the folder and set it up as a 661cb0ef41Sopenharmony_cibrand new workspace within the project. 671cb0ef41Sopenharmony_ci 681cb0ef41Sopenharmony_ciThis value is not exported to the environment for child processes. 691cb0ef41Sopenharmony_ci 701cb0ef41Sopenharmony_ci#### `workspaces` 711cb0ef41Sopenharmony_ci 721cb0ef41Sopenharmony_ci* Default: null 731cb0ef41Sopenharmony_ci* Type: null or Boolean 741cb0ef41Sopenharmony_ci 751cb0ef41Sopenharmony_ciSet to true to run the command in the context of **all** configured 761cb0ef41Sopenharmony_ciworkspaces. 771cb0ef41Sopenharmony_ci 781cb0ef41Sopenharmony_ciExplicitly setting this to false will cause commands like `install` to 791cb0ef41Sopenharmony_ciignore workspaces altogether. When not set explicitly: 801cb0ef41Sopenharmony_ci 811cb0ef41Sopenharmony_ci- Commands that operate on the `node_modules` tree (install, update, etc.) 821cb0ef41Sopenharmony_ciwill link workspaces into the `node_modules` folder. - Commands that do 831cb0ef41Sopenharmony_ciother things (test, exec, publish, etc.) will operate on the root project, 841cb0ef41Sopenharmony_ci_unless_ one or more workspaces are specified in the `workspace` config. 851cb0ef41Sopenharmony_ci 861cb0ef41Sopenharmony_ciThis value is not exported to the environment for child processes. 871cb0ef41Sopenharmony_ci 881cb0ef41Sopenharmony_ci#### `include-workspace-root` 891cb0ef41Sopenharmony_ci 901cb0ef41Sopenharmony_ci* Default: false 911cb0ef41Sopenharmony_ci* Type: Boolean 921cb0ef41Sopenharmony_ci 931cb0ef41Sopenharmony_ciInclude the workspace root when workspaces are enabled for a command. 941cb0ef41Sopenharmony_ci 951cb0ef41Sopenharmony_ciWhen false, specifying individual workspaces via the `workspace` config, or 961cb0ef41Sopenharmony_ciall workspaces via the `workspaces` flag, will cause npm to operate only on 971cb0ef41Sopenharmony_cithe specified workspaces, and not on the root project. 981cb0ef41Sopenharmony_ci 991cb0ef41Sopenharmony_ciThis value is not exported to the environment for child processes. 1001cb0ef41Sopenharmony_ci 1011cb0ef41Sopenharmony_ci### See Also 1021cb0ef41Sopenharmony_ci 1031cb0ef41Sopenharmony_ci* [npm view](/commands/npm-view) 1041cb0ef41Sopenharmony_ci* [npm publish](/commands/npm-publish) 1051cb0ef41Sopenharmony_ci* [npm registry](/using-npm/registry) 1061cb0ef41Sopenharmony_ci* [npm config](/commands/npm-config) 1071cb0ef41Sopenharmony_ci* [npmrc](/configuring-npm/npmrc) 1081cb0ef41Sopenharmony_ci* [package.json](/configuring-npm/package-json) 109