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/doc
diff options
context:
space:
mode:
authorKat Marchán <kzm@sykosomatic.org>2017-05-20 03:50:15 +0300
committerRebecca Turner <me@re-becca.org>2017-05-26 04:55:26 +0300
commit187045185cfffbd83d38b05f1376c348f2043c28 (patch)
treeb9c395a00a4da04b1b36d0a7b1c8bb139081fc45 /doc
parent38a1c38498e7833eaf836e355c4ecf25b8811f21 (diff)
feat(save): fix update and improve experience of moving deps between dep types
Diffstat (limited to 'doc')
-rw-r--r--doc/cli/npm-install.md5
-rw-r--r--doc/misc/npm-config.md12
2 files changed, 16 insertions, 1 deletions
diff --git a/doc/cli/npm-install.md b/doc/cli/npm-install.md
index a642b6470..44cb68792 100644
--- a/doc/cli/npm-install.md
+++ b/doc/cli/npm-install.md
@@ -15,7 +15,7 @@ npm-install(1) -- Install a package
npm install <folder>
alias: npm i
- common options: [-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
+ common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run]
## DESCRIPTION
@@ -98,6 +98,9 @@ after packing it up into a tarball (b).
Additionally, you can control where and how they get saved with some
additional flags:
+ * `-P, --save-prod`: Package will appear in your `dependencies`. This is the
+ default unless `-D` or `-O` are present.
+
* `-D, --save-dev`: Package will appear in your `devDependencies`.
* `-O, --save-optional`: Package will appear in your `optionalDependencies`.
diff --git a/doc/misc/npm-config.md b/doc/misc/npm-config.md
index 0b7db2e0e..2ad711d0c 100644
--- a/doc/misc/npm-config.md
+++ b/doc/misc/npm-config.md
@@ -63,6 +63,7 @@ The following shorthands are parsed on the command-line:
* `-f`: `--force`
* `-desc`: `--description`
* `-S`: `--save`
+* `-P`: `--save-prod`
* `-D`: `--save-dev`
* `-O`: `--save-optional`
* `-B`: `--save-bundle`
@@ -803,6 +804,17 @@ If a package would be saved at install time by the use of `--save`,
When used with the `npm rm` command, it removes it from the
bundledDependencies list.
+### save-prod
+
+* Default: false
+* Type: Boolean
+
+Makes sure that a package will be saved into `dependencies` specifically. This
+is useful if a package already exists in `devDependencies` or
+`optionalDependencies`, but you want to move it to be a production dep. This is
+also the default behavior if `--save` is true, and neither `--save-dev` or
+`--save-optional` are true.
+
### save-dev
* Default: false