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:
authorMichael Garvin <gar+gh@danger.computer>2021-01-09 02:15:27 +0300
committerMichael Garvin <gar+gh@danger.computer>2021-01-15 00:17:21 +0300
commit1135539bac9f98bb1a5d5ed05227a8ecd19493d3 (patch)
tree78baeb636459c7eab0850d602f8ccc41334b9198 /docs
parent4b43656fc608783a29ccf8495dc305459abc5cc7 (diff)
fix(docs): clean up `npm uninstall` docs
Lots of flags removed, clarification on what `--no-save` does, consolidated examples into a separate section
Diffstat (limited to 'docs')
-rw-r--r--docs/content/commands/npm-uninstall.md43
1 files changed, 21 insertions, 22 deletions
diff --git a/docs/content/commands/npm-uninstall.md b/docs/content/commands/npm-uninstall.md
index fe3c87113..155193e4f 100644
--- a/docs/content/commands/npm-uninstall.md
+++ b/docs/content/commands/npm-uninstall.md
@@ -7,7 +7,7 @@ description: Remove a package
### Synopsis
```bash
-npm uninstall [<@scope>/]<pkg>[@<version>]... [-S|--save|-D|--save-dev|-O|--save-optional|--no-save]
+npm uninstall [<@scope>/]<pkg>[@<version>]... [--no-save]
aliases: remove, rm, r, un, unlink
```
@@ -17,40 +17,39 @@ aliases: remove, rm, r, un, unlink
This uninstalls a package, completely removing everything npm installed
on its behalf.
-Example:
+It also removes the package from the `dependencies`, `devDependencies`,
+`optionalDependencies`, and `peerDependencies` objects in your
+`package.json`.
-```bash
-npm uninstall sax
-```
+Futher, if you have an `npm-shrinkwrap.json` or `package-lock.json`, npm
+will update those files as well.
+
+`npm uninstall` takes one optional flag, `--no-save` which will tell npm
+not to remove the package from your `package.json`,
+`npm-shrinkwrap.json`, or `package-lock.json` files
In global mode (ie, with `-g` or `--global` appended to the command),
it uninstalls the current package context as a global package.
+`--no-save` is ignored in this case.
-`npm uninstall` takes 3 exclusive, optional flags which save or update
-the package version in your main package.json:
-
-* `-S, --save`: Package will be removed from your `dependencies`.
-
-* `-D, --save-dev`: Package will be removed from your `devDependencies`.
-
-* `-O, --save-optional`: Package will be removed from your `optionalDependencies`.
+Scope is optional and follows the usual rules for [`scope`](/using-npm/scope).
-* `--no-save`: Package will not be removed from your `package.json` file.
+### Examples
-Further, if you have an `npm-shrinkwrap.json` then it will be updated as
-well.
+```bash
+npm uninstall sax
+```
-Scope is optional and follows the usual rules for [`scope`](/using-npm/scope).
+sax will no longer be in your `package.json`, `npm-shrinkwrap.json`, or
+`package-lock.json` files.
-Examples:
```bash
-npm uninstall sax --save
-npm uninstall @myorg/privatepackage --save
-npm uninstall node-tap --save-dev
-npm uninstall dtrace-provider --save-optional
npm uninstall lodash --no-save
```
+lodash will not be removed fromy your `package.json`,
+`npm-shrinkwrap.json`, or `package-lock.json` files.
+
### See Also
* [npm prune](/commands/npm-prune)