★ wanayoo — archive 1999 https://github.com/nodejs/node/commit/8cae4dde91Nouvelle recherche | Portail wanayoo
Skip to content
Permalink
Browse files
deps: upgrade npm to 6.14.1
PR-URL: #31977
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Shelley Vohr <codebytere@gmail.com>
Reviewed-By: Beth Griggs <Bethany.Griggs@uk.ibm.com>
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
  • Loading branch information
isaacs authored and BethGriggs committed Mar 23, 2020
1 parent a2b0e9e commit 8cae4dde9101edc5d313d1e515a77105ec95749a
Showing with 2,611 additions and 945 deletions.
  1. +6 −0 deps/npm/AUTHORS
  2. +38 −0 deps/npm/CHANGELOG.md
  3. +10 −2 deps/npm/docs/content/cli-commands/npm-fund.md
  4. +6 −6 deps/npm/docs/content/cli-commands/npm-publish.md
  5. +19 −2 deps/npm/docs/content/configuring-npm/package-json.md
  6. +1 −1 deps/npm/docs/content/using-npm/disputes.md
  7. +88 −81 deps/npm/docs/content/using-npm/scripts.md
  8. +2 −2 deps/npm/docs/public/cli-commands/npm-access/index.html
  9. +2 −2 deps/npm/docs/public/cli-commands/npm-adduser/index.html
  10. +2 −2 deps/npm/docs/public/cli-commands/npm-audit/index.html
  11. +2 −2 deps/npm/docs/public/cli-commands/npm-bin/index.html
  12. +2 −2 deps/npm/docs/public/cli-commands/npm-bugs/index.html
  13. +2 −2 deps/npm/docs/public/cli-commands/npm-build/index.html
  14. +2 −2 deps/npm/docs/public/cli-commands/npm-bundle/index.html
  15. +2 −2 deps/npm/docs/public/cli-commands/npm-cache/index.html
  16. +2 −2 deps/npm/docs/public/cli-commands/npm-ci/index.html
  17. +2 −2 deps/npm/docs/public/cli-commands/npm-completion/index.html
  18. +2 −2 deps/npm/docs/public/cli-commands/npm-config/index.html
  19. +2 −2 deps/npm/docs/public/cli-commands/npm-dedupe/index.html
  20. +2 −2 deps/npm/docs/public/cli-commands/npm-deprecate/index.html
  21. +2 −2 deps/npm/docs/public/cli-commands/npm-dist-tag/index.html
  22. +2 −2 deps/npm/docs/public/cli-commands/npm-docs/index.html
  23. +2 −2 deps/npm/docs/public/cli-commands/npm-doctor/index.html
  24. +2 −2 deps/npm/docs/public/cli-commands/npm-edit/index.html
  25. +2 −2 deps/npm/docs/public/cli-commands/npm-explore/index.html
  26. +11 −4 deps/npm/docs/public/cli-commands/npm-fund/index.html
  27. +2 −2 deps/npm/docs/public/cli-commands/npm-help-search/index.html
  28. +2 −2 deps/npm/docs/public/cli-commands/npm-help/index.html
  29. +2 −2 deps/npm/docs/public/cli-commands/npm-hook/index.html
  30. +2 −2 deps/npm/docs/public/cli-commands/npm-init/index.html
  31. +2 −2 deps/npm/docs/public/cli-commands/npm-install-ci-test/index.html
  32. +2 −2 deps/npm/docs/public/cli-commands/npm-install-test/index.html
  33. +2 −2 deps/npm/docs/public/cli-commands/npm-install/index.html
  34. +2 −2 deps/npm/docs/public/cli-commands/npm-link/index.html
  35. +2 −2 deps/npm/docs/public/cli-commands/npm-logout/index.html
  36. +3 −3 deps/npm/docs/public/cli-commands/npm-ls/index.html
  37. +2 −2 deps/npm/docs/public/cli-commands/npm-org/index.html
  38. +2 −2 deps/npm/docs/public/cli-commands/npm-outdated/index.html
  39. +2 −2 deps/npm/docs/public/cli-commands/npm-owner/index.html
  40. +2 −2 deps/npm/docs/public/cli-commands/npm-pack/index.html
  41. +2 −2 deps/npm/docs/public/cli-commands/npm-ping/index.html
  42. +2 −2 deps/npm/docs/public/cli-commands/npm-prefix/index.html
  43. +2 −2 deps/npm/docs/public/cli-commands/npm-profile/index.html
  44. +2 −2 deps/npm/docs/public/cli-commands/npm-prune/index.html
  45. +8 −8 deps/npm/docs/public/cli-commands/npm-publish/index.html
  46. +2 −2 deps/npm/docs/public/cli-commands/npm-rebuild/index.html
  47. +2 −2 deps/npm/docs/public/cli-commands/npm-repo/index.html
  48. +2 −2 deps/npm/docs/public/cli-commands/npm-restart/index.html
  49. +2 −2 deps/npm/docs/public/cli-commands/npm-root/index.html
  50. +2 −2 deps/npm/docs/public/cli-commands/npm-run-script/index.html
  51. +2 −2 deps/npm/docs/public/cli-commands/npm-search/index.html
  52. +2 −2 deps/npm/docs/public/cli-commands/npm-shrinkwrap/index.html
  53. +2 −2 deps/npm/docs/public/cli-commands/npm-star/index.html
  54. +2 −2 deps/npm/docs/public/cli-commands/npm-stars/index.html
  55. +2 −2 deps/npm/docs/public/cli-commands/npm-start/index.html
  56. +2 −2 deps/npm/docs/public/cli-commands/npm-stop/index.html
  57. +2 −2 deps/npm/docs/public/cli-commands/npm-team/index.html
  58. +2 −2 deps/npm/docs/public/cli-commands/npm-test/index.html
  59. +2 −2 deps/npm/docs/public/cli-commands/npm-token/index.html
  60. +2 −2 deps/npm/docs/public/cli-commands/npm-uninstall/index.html
  61. +2 −2 deps/npm/docs/public/cli-commands/npm-unpublish/index.html
  62. +2 −2 deps/npm/docs/public/cli-commands/npm-update/index.html
  63. +2 −2 deps/npm/docs/public/cli-commands/npm-version/index.html
  64. +2 −2 deps/npm/docs/public/cli-commands/npm-view/index.html
  65. +2 −2 deps/npm/docs/public/cli-commands/npm-whoami/index.html
  66. +3 −3 deps/npm/docs/public/cli-commands/npm/index.html
  67. +2 −2 deps/npm/docs/public/configuring-npm/folders/index.html
  68. +2 −2 deps/npm/docs/public/configuring-npm/install/index.html
  69. +2 −2 deps/npm/docs/public/configuring-npm/npmrc/index.html
  70. +21 −5 deps/npm/docs/public/configuring-npm/package-json/index.html
  71. +2 −2 deps/npm/docs/public/configuring-npm/package-lock-json/index.html
  72. +2 −2 deps/npm/docs/public/configuring-npm/package-locks/index.html
  73. +2 −2 deps/npm/docs/public/configuring-npm/shrinkwrap-json/index.html
  74. +1 −1 deps/npm/docs/public/index.html
  75. +1 −1 deps/npm/docs/public/static/d/2215187023.json
  76. +2 −2 deps/npm/docs/public/using-npm/config/index.html
  77. +2 −2 deps/npm/docs/public/using-npm/developers/index.html
  78. +3 −3 deps/npm/docs/public/using-npm/disputes/index.html
  79. +2 −2 deps/npm/docs/public/using-npm/orgs/index.html
  80. +2 −2 deps/npm/docs/public/using-npm/registry/index.html
  81. +2 −2 deps/npm/docs/public/using-npm/removal/index.html
  82. +2 −2 deps/npm/docs/public/using-npm/scope/index.html
  83. +80 −74 deps/npm/docs/public/using-npm/scripts/index.html
  84. +2 −2 deps/npm/docs/public/using-npm/semver/index.html
  85. +1 −1 deps/npm/lib/access.js
  86. +47 −81 deps/npm/lib/fund.js
  87. +4 −4 deps/npm/lib/utils/error-handler.js
  88. +2 −2 deps/npm/lib/utils/error-message.js
  89. +62 −32 deps/npm/lib/utils/funding.js
  90. +5 −26 deps/npm/lib/utils/unsupported.js
  91. +1 −1 deps/npm/man/man1/npm-README.1
  92. +1 −1 deps/npm/man/man1/npm-access.1
  93. +1 −1 deps/npm/man/man1/npm-adduser.1
  94. +1 −1 deps/npm/man/man1/npm-audit.1
  95. +1 −1 deps/npm/man/man1/npm-bin.1
  96. +1 −1 deps/npm/man/man1/npm-bugs.1
  97. +1 −1 deps/npm/man/man1/npm-build.1
  98. +1 −1 deps/npm/man/man1/npm-bundle.1
  99. +1 −1 deps/npm/man/man1/npm-cache.1
  100. +1 −1 deps/npm/man/man1/npm-ci.1
  101. +1 −1 deps/npm/man/man1/npm-completion.1
  102. +1 −1 deps/npm/man/man1/npm-config.1
  103. +1 −1 deps/npm/man/man1/npm-dedupe.1
  104. +1 −1 deps/npm/man/man1/npm-deprecate.1
  105. +1 −1 deps/npm/man/man1/npm-dist-tag.1
  106. +1 −1 deps/npm/man/man1/npm-docs.1
  107. +1 −1 deps/npm/man/man1/npm-doctor.1
  108. +1 −1 deps/npm/man/man1/npm-edit.1
  109. +1 −1 deps/npm/man/man1/npm-explore.1
  110. +15 −4 deps/npm/man/man1/npm-fund.1
  111. +1 −1 deps/npm/man/man1/npm-help-search.1
  112. +1 −1 deps/npm/man/man1/npm-help.1
  113. +1 −1 deps/npm/man/man1/npm-hook.1
  114. +1 −1 deps/npm/man/man1/npm-init.1
  115. +1 −1 deps/npm/man/man1/npm-install-ci-test.1
  116. +1 −1 deps/npm/man/man1/npm-install-test.1
  117. +1 −1 deps/npm/man/man1/npm-install.1
  118. +1 −1 deps/npm/man/man1/npm-link.1
  119. +1 −1 deps/npm/man/man1/npm-logout.1
  120. +2 −2 deps/npm/man/man1/npm-ls.1
  121. +1 −1 deps/npm/man/man1/npm-org.1
  122. +1 −1 deps/npm/man/man1/npm-outdated.1
  123. +1 −1 deps/npm/man/man1/npm-owner.1
  124. +1 −1 deps/npm/man/man1/npm-pack.1
  125. +1 −1 deps/npm/man/man1/npm-ping.1
  126. +1 −1 deps/npm/man/man1/npm-prefix.1
  127. +1 −1 deps/npm/man/man1/npm-profile.1
  128. +1 −1 deps/npm/man/man1/npm-prune.1
  129. +1 −1 deps/npm/man/man1/npm-publish.1
  130. +1 −1 deps/npm/man/man1/npm-rebuild.1
  131. +1 −1 deps/npm/man/man1/npm-repo.1
  132. +1 −1 deps/npm/man/man1/npm-restart.1
  133. +1 −1 deps/npm/man/man1/npm-root.1
  134. +1 −1 deps/npm/man/man1/npm-run-script.1
  135. +1 −1 deps/npm/man/man1/npm-search.1
  136. +1 −1 deps/npm/man/man1/npm-shrinkwrap.1
  137. +1 −1 deps/npm/man/man1/npm-star.1
  138. +1 −1 deps/npm/man/man1/npm-stars.1
  139. +1 −1 deps/npm/man/man1/npm-start.1
  140. +1 −1 deps/npm/man/man1/npm-stop.1
  141. +1 −1 deps/npm/man/man1/npm-team.1
  142. +1 −1 deps/npm/man/man1/npm-test.1
  143. +1 −1 deps/npm/man/man1/npm-token.1
  144. +1 −1 deps/npm/man/man1/npm-uninstall.1
  145. +1 −1 deps/npm/man/man1/npm-unpublish.1
  146. +1 −1 deps/npm/man/man1/npm-update.1
  147. +1 −1 deps/npm/man/man1/npm-version.1
  148. +1 −1 deps/npm/man/man1/npm-view.1
  149. +1 −1 deps/npm/man/man1/npm-whoami.1
  150. +2 −2 deps/npm/man/man1/npm.1
  151. +1 −1 deps/npm/man/man5/folders.5
  152. +1 −1 deps/npm/man/man5/install.5
  153. +1 −1 deps/npm/man/man5/npmrc.5
  154. +19 −3 deps/npm/man/man5/package-json.5
  155. +1 −1 deps/npm/man/man5/package-lock-json.5
  156. +1 −1 deps/npm/man/man5/package-locks.5
  157. +1 −1 deps/npm/man/man5/shrinkwrap-json.5
  158. +1 −1 deps/npm/man/man7/config.7
  159. +1 −1 deps/npm/man/man7/developers.7
  160. +2 −2 deps/npm/man/man7/disputes.7
  161. +1 −1 deps/npm/man/man7/orgs.7
  162. +1 −1 deps/npm/man/man7/registry.7
  163. +1 −1 deps/npm/man/man7/removal.7
  164. +1 −1 deps/npm/man/man7/scope.7
  165. +122 −83 deps/npm/man/man7/scripts.7
  166. +1 −1 deps/npm/man/man7/semver.7
  167. +58 −16 deps/npm/node_modules/chownr/chownr.js
  168. +18 −15 deps/npm/node_modules/chownr/package.json
  169. +16 −0 deps/npm/node_modules/hosted-git-info/CHANGELOG.md
  170. +25 −2 deps/npm/node_modules/hosted-git-info/index.js
  171. +11 −11 deps/npm/node_modules/hosted-git-info/package.json
  172. +13 −12 deps/npm/node_modules/npm-packlist/package.json
  173. +11 −0 deps/npm/node_modules/npm-registry-fetch/CHANGELOG.md
  174. +29 −2 deps/npm/node_modules/npm-registry-fetch/README.md
  175. +3 −1 deps/npm/node_modules/npm-registry-fetch/config.js
  176. +22 −10 deps/npm/node_modules/npm-registry-fetch/index.js
  177. +14 −11 deps/npm/node_modules/npm-registry-fetch/package.json
  178. +3 −8 deps/npm/node_modules/readable-stream/README.md
  179. +54 −17 deps/npm/node_modules/readable-stream/lib/_stream_readable.js
  180. +21 −7 deps/npm/node_modules/readable-stream/lib/_stream_writable.js
  181. +167 −146 deps/npm/node_modules/readable-stream/lib/internal/streams/buffer_list.js
  182. +26 −6 deps/npm/node_modules/readable-stream/lib/internal/streams/destroy.js
  183. +3 −0 deps/npm/node_modules/readable-stream/lib/internal/streams/from-browser.js
  184. +64 −0 deps/npm/node_modules/readable-stream/lib/internal/streams/from.js
  185. +13 −11 deps/npm/node_modules/readable-stream/package.json
  186. +21 −0 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/LICENSE
  187. +586 −0 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/README.md
  188. +187 −0 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.d.ts
  189. +64 −0 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/index.js
  190. +62 −0 deps/npm/node_modules/string_decoder/node_modules/safe-buffer/package.json
  191. +7 −7 deps/npm/node_modules/string_decoder/package.json
  192. +10 −7 deps/npm/package.json
  193. +123 −0 deps/npm/scripts/update-dist-tags.js
  194. +24 −11 deps/npm/tap-snapshots/test-tap-fund.js-TAP.test.js
  195. +1 −1 deps/npm/test/fixtures/config/userconfig-with-gc
  196. +27 −0 deps/npm/test/tap/access.js
  197. +95 −1 deps/npm/test/tap/fund.js
  198. +2 −1 deps/npm/test/tap/unsupported.js
  199. +43 −0 deps/npm/test/tap/utils.funding.js
@@ -682,3 +682,9 @@ Zhenya Vinogradov <zhenyavinogradov@gmail.com>
Rafael Hengles <rhengles@gmail.com>
Jan-Philip Gehrcke <jp@opstrace.com>
Caleb Sacks <16855387+clabe45@users.noreply.github.com>
Kyle Getz <kgetz@arista.com>
Sean Healy <s@xib.ca>
Netanel Gilad <netanelg@wix.com>
Dave Nicolson <david.nicolson@gmail.com>
Ajay Narain Mathur <ajaynarainmathur@gmail.com>
Vitaliy Markitanov <9357021+vit100@users.noreply.github.com>
@@ -1,3 +1,41 @@
## 6.14.1 (2020-02-26)

* [`303e5c11e`](https://github.com/npm/cli/commit/303e5c11e7db34cf014107aecd2e81c821bfde8d)
`hosted-git-info@2.8.7`
Fixes a regression where scp-style git urls are passed to the WhatWG URL
parser, which does not handle them properly.
([@isaacs](https://github.com/isaacs))

## 6.14.0 (2020-02-25)

### FEATURES
* [`30f170877`](https://github.com/npm/cli/commit/30f170877954acd036cb234a581e4eb155049b82) [#731](https://github.com/npm/cli/pull/731) add support for multiple funding sources ([@ljharb](https://github.com/ljharb) & [@ruyadorno](hhttps://github.com/ruyadorno/))

### BUG FIXES
* [`55916b130`](https://github.com/npm/cli/commit/55916b130ef52984584678f2cc17c15c1f031cb5) [#508](https://github.com/npm/cli/pull/508) fix: check `npm.config` before accessing its members ([@kaiyoma](https://github.com/kaiyoma))
* [`7d0cd65b2`](https://github.com/npm/cli/commit/7d0cd65b23c0986b631b9b54d87bbe74902cc023) [#733](https://github.com/npm/cli/pull/733) fix: access grant with unscoped packages ([@netanelgilad](https://github.com/netanelgilad))
* [`28c3d40d6`](https://github.com/npm/cli/commit/28c3d40d65eef63f9d6ccb60b99ac57f5057a46e), [`0769c5b20`](https://github.com/npm/cli/commit/30f170877954acd036cb234a581e4eb155049b82) [#945](https://github.com/npm/cli/pull/945), [#697](https://github.com/npm/cli/pull/697) fix: allow new major versions of node to be automatically considered "supported" ([@isaacs](https://github.com/isaacs), [@ljharb](https://github.com/ljharb))

### DEPENDENCIES
* [`6f39e93`](https://github.com/npm/hosted-git-info/commit/6f39e93bae9162663af6f15a9d10bce675dd5de3) `hosted-git-info@2.8.6` ([@darcyclarke](https://github.com/darcyclarke))
* fix: passwords & usernames are escaped properly in git deps ([@stevenhilder](https://github.com/stevenhilder))
* [`f14b594ee`](https://github.com/npm/cli/commit/f14b594ee9dbfc98ed0b65c65d904782db4f31ad) `chownr@1.1.4` ([@isaacs](https://github.com/isaacs))
* [`77044150b`](https://github.com/npm/cli/commit/77044150b763d67d997f9ff108219132ea922678) `npm-packlist@1.4.8` ([@isaacs](https://github.com/isaacs))
* [`1d112461a`](https://github.com/npm/cli/commit/1d112461ad8dc99e5ff7fabb5177e8c2f89a9755) `npm-registry-fetch@4.0.3` ([@isaacs](https://github.com/isaacs))
* [`ba8b4fe`](https://github.com/npm/npm-registry-fetch/commit/ba8b4fe60eb6cdf9b39012560aec596eda8ce924) fix: always bypass cache when ?write=true
* [`a47fed760`](https://github.com/npm/cli/commit/a47fed7603a6ed31dcc314c0c573805f05a96830) `readable-stream@3.6.0`
* [`3bbf2d6`](https://github.com/nodejs/readable-stream/commit/3bbf2d6feb45b03f4e46a2ae8251601ad2262121) fix: babel's "loose mode" class transform enbrittles BufferList ([@ljharb](https://github.com/ljharb))

### DOCUMENTATION
* [`284c1c055`](https://github.com/npm/cli/commit/284c1c055a28c4b334496101799acefe3c54ceb3), [`fbb5f0e50`](https://github.com/npm/cli/commit/fbb5f0e50e54425119fa3f03c5de93e4cb6bfda7) [#729](https://github.com/npm/cli/pull/729) update lifecycle hooks docs
([@seanhealy](https://github.com/seanhealy), [@mikemimik](https://github.com/mikemimik))
* [`1c272832d`](https://github.com/npm/cli/commit/1c272832d048300e409882313305c416dc6f21a2) [#787](https://github.com/npm/cli/pull/787) fix: trademarks typo ([@dnicolson](https://github.com/dnicolson))
* [`f6ff41776`](https://github.com/npm/cli/commit/f6ff417767d52418cc8c9e7b9731ede2c3916d2e) [#936](https://github.com/npm/cli/pull/936) fix: postinstall example ([@ajaymathur](https://github.com/ajaymathur))
* [`373224b16`](https://github.com/npm/cli/commit/373224b16e019b7b63d8f0b4c5d4adb7e5cb80dd) [#939](https://github.com/npm/cli/pull/939) fix: bad links in publish docs ([@vit100](https://github.com/vit100))

### MISCELLANEOUS
* [`85c79636d`](https://github.com/npm/cli/commit/85c79636df31bac586c0e380c4852ee155a7723c) [#736](https://github.com/npm/cli/pull/736) add script to update dist-tags ([@mikemimik](https://github.com/mikemimik))

## 6.13.7 (2020-01-28)

### BUG FIXES
@@ -21,7 +21,8 @@ a given project. If no package name is provided, it will list all
dependencies that are looking for funding in a tree-structure in which
are listed the type of funding and the url to visit. If a package name
is provided then it tries to open its funding url using the `--browser`
config param.
config param; if there are multiple funding sources for the package, the
user will be instructed to pass the `--which` command to disambiguate.

The list will avoid duplicated entries and will stack all packages
that share the same type/url as a single entry. Given this nature the
@@ -38,8 +39,8 @@ The browser that is called by the `npm fund` command to open websites.

#### json

* Default: false
* Type: Boolean
* Default: false

Show information in JSON format.

@@ -51,6 +52,13 @@ Show information in JSON format.
Whether to represent the tree structure using unicode characters.
Set it to `false` in order to use all-ansi output.

#### which

* Type: Number
* Default: undefined

If there are multiple funding sources, which 1-indexed source URL to open.

## See Also

* [npm docs](/cli-commands/npm-docs)
@@ -73,9 +73,9 @@ included and packs them into a tarball to be uploaded to the registry.
* [npm registry](/using-npm/registry)
* [npm scope](/using-npm/scope)
* [npm adduser](/cli-commands/npm-adduser)
* [npm owner](/cli-commands/npm-owner)
* [npm deprecate](/cli-commands/npm-deprecate)
* [npm dist-tag](/cli-commands/npm-dist-tag)
* [npm pack](/cli-commands/npm-pack)
* [npm profile](/cli-commands/npm-profile)
* [npm adduser](/cli-commands/adduser)
* [npm owner](/cli-commands/owner)
* [npm deprecate](/cli-commands/deprecate)
* [npm dist-tag](/cli-commands/dist-tag)
* [npm pack](/cli-commands/pack)
* [npm profile](/cli-commands/profile)
@@ -197,7 +197,8 @@ npm also sets a top-level "maintainers" field with your npm user info.
### funding

You can specify an object containing an URL that provides up-to-date
information about ways to help fund development of your package:
information about ways to help fund development of your package, or
a string URL, or an array of these:

"funding": {
"type" : "individual",
@@ -209,10 +210,26 @@ information about ways to help fund development of your package:
"url" : "https://www.patreon.com/my-account"
}

"funding": "http://example.com/donate"

"funding": [
{
"type" : "individual",
"url" : "http://example.com/donate"
},
"http://example.com/donateAlso",
{
"type" : "patreon",
"url" : "https://www.patreon.com/my-account"
}
]


Users can use the `npm fund` subcommand to list the `funding` URLs of all
dependencies of their project, direct and indirect. A shortcut to visit each
funding url is also available when providing the project name such as:
`npm fund <projectname>`.
`npm fund <projectname>` (when there are multiple URLs, the first one will be
visited)

### files

@@ -105,7 +105,7 @@ If you see bad behavior like this, please report it to <abuse@npmjs.com> right
away. **You are never expected to resolve abusive behavior on your own. We are
here to help.**

### Trademarkss
### Trademarks

If you think another npm publisher is infringing your trademark, such as by
using a confusingly similar package name, email <abuse@npmjs.com> with a link to
@@ -10,90 +10,64 @@ description: How npm handles the "scripts" field

### Description

npm supports the "scripts" property of the package.json file, for the
following scripts:

* **prepublish** (_as of npm@5, `prepublish` is deprecated. Use `prepare` for build steps and `prepublishOnly` for upload-only._):
Run BEFORE the package is packed and published, as well as on local `npm
install` without any arguments. (See below)
* **prepare**:
Run both BEFORE the package is packed and published, on local `npm
install` without any arguments, and when installing git dependencies (See
below). This is run AFTER `prepublish`, but BEFORE `prepublishOnly`.
* **prepublishOnly**:
Run BEFORE the package is prepared and packed, ONLY on `npm publish`. (See
below.)
* **prepack**:
run BEFORE a tarball is packed (on `npm pack`, `npm publish`, and when
installing git dependencies)
* **postpack**:
Run AFTER the tarball has been generated and moved to its final destination.
* **publish**, **postpublish**:
Run AFTER the package is published.
* **preinstall**:
Run BEFORE the package is installed
* **install**, **postinstall**:
Run AFTER the package is installed.
* **preuninstall**, **uninstall**:
Run BEFORE the package is uninstalled.
* **postuninstall**:
Run AFTER the package is uninstalled.
* **preversion**:
Run BEFORE bumping the package version.
* **version**:
Run AFTER bumping the package version, but BEFORE commit.
* **postversion**:
Run AFTER bumping the package version, and AFTER commit.
* **pretest**, **test**, **posttest**:
Run by the `npm test` command.
* **prestop**, **stop**, **poststop**:
Run by the `npm stop` command.
* **prestart**, **start**, **poststart**:
Run by the `npm start` command.
* **prerestart**, **restart**, **postrestart**:
Run by the `npm restart` command. Note: `npm restart` will run the
stop and start scripts if no `restart` script is provided.
* **preshrinkwrap**, **shrinkwrap**, **postshrinkwrap**:
Run by the `npm shrinkwrap` command.

Additionally, arbitrary scripts can be executed by running `npm
run-script <stage>`. *Pre* and *post* commands with matching
names will be run for those as well (e.g. `premyscript`, `myscript`,
`postmyscript`). Scripts from dependencies can be run with
`npm explore <pkg> -- npm run <stage>`.

#### Prepublish and Prepare

#### Deprecation Note

Since `npm@1.1.71`, the npm CLI has run the `prepublish` script for both `npm
publish` and `npm install`, 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](https://github.com/npm/npm/issues/10074). As of `npm@4.0.0`, a new
event has been introduced, `prepare`, that preserves this existing behavior. A
_new_ event, `prepublishOnly` has been added as a transitional strategy to
allow users to avoid the confusing behavior of existing npm versions and only
run on `npm publish` (for instance, running the tests one last time to ensure
they're in good shape).

See <https://github.com/npm/npm/issues/10074> for a much lengthier
justification, with further reading, for this change.

#### Use Cases

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
target system, use a `prepublish` script. This includes
tasks such as:
The `"scripts"` property of of your `package.json` file supports a number of built-in scripts and their preset life cycle events as well as arbitrary scripts. These all can be executed by running `npm run-script <stage>` or `npm run <stage>` for short. *Pre* and *post* commands with matching names will be run for those as well (e.g. `premyscript`, `myscript`, `postmyscript`). Scripts from dependencies can be run with `npm explore <pkg> -- npm run <stage>`.

### Pre & Post Scripts

To create "pre" or "post" scripts for any scripts defined in the `"scripts"` section of the `package.json`, simply create another script *with a matching name* and add "pre" or "post" to the beginning of them.

```json
{
"scripts": {
"precompress": "{{ executes BEFORE the `compress` script }}",
"compress": "{{ run command to compress files }}",
"postcompress": "{{ executes AFTER `compress` script }}"
}
}
```

### Life Cycle Scripts

There are some special life cycle scripts that happen only in certain situations. These scripts happen in addtion to the "pre" and "post" script.
* `prepare`, `prepublish`, `prepublishOnly`, `prepack`, `postpack`

**prepare** (since `npm@4.0.0`)
* Runs BEFORE the package is packed
* Runs BEFORE the package is published
* Runs on local `npm install` without any arguments
* Run AFTER `prepublish`, but BEFORE `prepublishOnly`
* NOTE: If a package being installed through git contains a `prepare` script, its `dependencies` and `devDependencies` will be installed, and the prepare script will be run, before the package is packaged and installed.

**prepublish** (DEPRECATED)
* Same as `prepare`

**prepublishOnly**
* Runs BEFORE the package is prepared and packed, ONLY on `npm publish`.

**prepack**
* Runs BEFORE a tarball is packed (on "`npm pack`", "`npm publish`", and when installing a git dependencies).
* NOTE: "`npm run pack`" is NOT the same as "`npm pack`". "`npm run pack`" is an arbitrary user defined script name, where as, "`npm pack`" is a CLI defined command.

**postpack**
* Runs AFTER the tarball has been generated and moved to its final destination.

#### Prepare and Prepublish

**Deprecation Note: prepublish**

Since `npm@1.1.71`, the npm CLI has run the `prepublish` script for both `npm publish` and `npm install`, 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](https://github.com/npm/npm/issues/10074). As of `npm@4.0.0`, a new event has been introduced, `prepare`, that preserves this existing behavior. A _new_ event, `prepublishOnly` has been added as a transitional strategy to allow users to avoid the confusing behavior of existing npm versions and only run on `npm publish` (for instance, running the tests one last time to ensure they're in good shape).

See <https://github.com/npm/npm/issues/10074> for a much lengthier justification, with further reading, for this change.

**Use Cases**

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 target system, use a `prepublish` script. This includes tasks such as:

* Compiling CoffeeScript source code into JavaScript.
* Creating minified versions of JavaScript source code.
* Fetching remote resources that your package will use.

The advantage of doing these things at `prepublish` time is that they can be done once, in a
single place, thus reducing complexity and variability.
Additionally, this means that:
The advantage of doing these things at `prepublish` time is that they can be done once, in a single place, thus reducing complexity and variability. Additionally, this means that:

* You can depend on `coffee-script` as a `devDependency`, and thus
your users don't need to have it installed.
@@ -102,8 +76,41 @@ Additionally, this means that:
* You don't need to rely on your users having `curl` or `wget` or
other system tools on the target machines.

### Default Values
### Life Cycle Operation Order

#### [`npm publish`](/cli-commands/npm-publish)

* `prepublishOnly`
* `prepare`
* `prepublish`
* `publish`
* `postpublish`

#### [`npm pack`](/cli-commands/npm-pack)

* `prepack`
* `postpack`

#### [`npm install`](/cli-commands/npm-install)

* `preinstall`
* `install`
* `postinstall`

Also triggers

* `prepublish` (when on local)
* `prepare` (when on local)

#### [`npm start`](/cli-commands/npm-start)

`npm run start` has an `npm start` shorthand.

* `prestart`
* `start`
* `poststart`

### Default Values
npm will default some script values based on package contents.

* `"start": "node server.js"`:
@@ -208,7 +215,7 @@ For example, if your package.json contains this:
```json
{ "scripts" :
{ "install" : "scripts/install.js"
, "postinstall" : "scripts/install.js"
, "postinstall" : "scripts/postinstall.js"
, "uninstall" : "scripts/uninstall.js"
}
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 8cae4dd

Please sign in to comment.