summaryrefslogtreecommitdiff
path: root/deps/npm/man/man7/npm-scripts.7
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/man/man7/npm-scripts.7')
-rw-r--r--deps/npm/man/man7/npm-scripts.735
1 files changed, 32 insertions, 3 deletions
diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7
index 60acb3195e..efcf992f95 100644
--- a/deps/npm/man/man7/npm-scripts.7
+++ b/deps/npm/man/man7/npm-scripts.7
@@ -1,4 +1,4 @@
-.TH "NPM\-SCRIPTS" "7" "November 2016" "" ""
+.TH "NPM\-SCRIPTS" "7" "December 2016" "" ""
.SH "NAME"
\fBnpm-scripts\fR \- How npm handles the "scripts" field
.SH DESCRIPTION
@@ -9,7 +9,15 @@ following scripts:
.IP \(bu 2
prepublish:
Run BEFORE the package is published\. (Also run on local \fBnpm
-install\fP without any arguments\.)
+install\fP without any arguments\. See below\.)
+.IP \(bu 2
+prepare:
+Run both BEFORE the package is published, and on local \fBnpm
+install\fP without any arguments\. (See below\.) This is run
+AFTER \fBprepublish\fP, but BEFORE \fBprepublishOnly\fP\|\.
+.IP \(bu 2
+prepublishOnly:
+Run BEFORE the package is published\. (See below\.)
.IP \(bu 2
publish, postpublish:
Run AFTER the package is published\.
@@ -59,7 +67,28 @@ names will be run for those as well (e\.g\. \fBpremyscript\fP, \fBmyscript\fP,
\fBpostmyscript\fP)\. Scripts from dependencies can be run with `npm explore
.P
<pkg> \-\- npm run <stage>`\.
-.SH COMMON USES
+.SH PREPUBLISH AND PREPARE
+.SS DEPRECATION NOTE
+.P
+Since \fBnpm@1\.1\.71\fP, the npm CLI has run the \fBprepublish\fP script for both \fBnpm
+publish\fP and \fBnpm install\fP, because it's a convenient way to prepare a package
+for use (some common use cases are described in the section below)\. It has
+also turned out to be, in practice, very
+confusing \fIhttps://github\.com/npm/npm/issues/10074\fR\|\. As of \fBnpm@4\.0\.0\fP, a new
+event has been introduced, \fBprepare\fP, that preserves this existing behavior\. A
+\fInew\fR event, \fBprepublishOnly\fP has been added as a transitional strategy to
+allow users to avoid the confusing behavior of existing npm versions and only
+run on \fBnpm publish\fP (for instance, running the tests one last time to ensure
+they're in good shape)\.
+.P
+\fBIMPORTANT:\fR As of \fBnpm@5\fP, \fBprepublish\fP will \fIonly\fR be run for \fBnpm
+publish\fP\|\. This will make its behavior identical to \fBprepublishOnly\fP, so
+\fBnpm@6\fP or later may drop support for the use of \fBprepublishOnly\fP, and then
+maybe we can all forget this embarrassing thing ever happened\.
+.P
+See https://github\.com/npm/npm/issues/10074 for a much lengthier
+justification, with further reading, for this change\.
+.SS USE CASES
.P
If you need to perform operations on your package before it is used, in a way
that is not dependent on the operating system or architecture of the