Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2021-05-27 00:16:36 +0300
committerGar <gar+gh@danger.computer>2021-05-27 01:41:50 +0300
commit399ff8cbccd5198f637518ccafa86c43bab47a4a (patch)
treeb84315af1d2fa50342d0888a333a6b1bd2b68efa /docs
parent96367f93f46c24494d084c8b8d34e4de9cd375da (diff)
feat(link): add workspace support
PR-URL: https://github.com/npm/cli/pull/3312 Credit: @isaacs Close: #3312 Reviewed-by: @wraithgar
Diffstat (limited to 'docs')
-rw-r--r--docs/content/commands/npm-link.md42
1 files changed, 42 insertions, 0 deletions
diff --git a/docs/content/commands/npm-link.md b/docs/content/commands/npm-link.md
index e48be396a..b1c606676 100644
--- a/docs/content/commands/npm-link.md
+++ b/docs/content/commands/npm-link.md
@@ -99,6 +99,16 @@ relevant metadata by running `npm install <dep> --package-lock-only`.
If you _want_ to save the `file:` reference in your `package.json` and
`package-lock.json` files, you can use `npm link <dep> --save` to do so.
+### Workspace Usage
+
+`npm link <pkg> --workspace <name>` will link the relevant package as a
+dependency of the specified workspace(s). Note that It may actually be
+linked into the parent project's `node_modules` folder, if there are no
+conflicting dependencies.
+
+`npm link --workspace <name>` will create a global link to the specified
+workspace(s).
+
### Configuration
<!-- AUTOGENERATED CONFIG DESCRIPTIONS START -->
@@ -261,6 +271,38 @@ commands that modify your local installation, eg, `install`, `update`,
Note: This is NOT honored by other network related commands, eg `dist-tags`,
`owner`, etc.
+#### `workspace`
+
+* Default:
+* Type: String (can be set multiple times)
+
+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.
+
+Valid values for the `workspace` config are either:
+
+* Workspace names
+* Path to a workspace directory
+* Path to a parent workspace directory (will result to selecting all of the
+ nested workspaces)
+
+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.
+
+This value is not exported to the environment for child processes.
+
+#### `workspaces`
+
+* Default: false
+* Type: Boolean
+
+Enable running a command in the context of **all** the configured
+workspaces.
+
+This value is not exported to the environment for child processes.
+
<!-- AUTOGENERATED CONFIG DESCRIPTIONS END -->
### See Also