scripts.html 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471
  1. <html><head>
  2. <title>scripts</title>
  3. <style>
  4. body {
  5. background-color: #ffffff;
  6. color: #24292e;
  7. margin: 0;
  8. line-height: 1.5;
  9. font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji";
  10. }
  11. #rainbar {
  12. height: 10px;
  13. background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff);
  14. }
  15. a {
  16. text-decoration: none;
  17. color: #0366d6;
  18. }
  19. a:hover {
  20. text-decoration: underline;
  21. }
  22. pre {
  23. margin: 1em 0px;
  24. padding: 1em;
  25. border: solid 1px #e1e4e8;
  26. border-radius: 6px;
  27. display: block;
  28. overflow: auto;
  29. white-space: pre;
  30. background-color: #f6f8fa;
  31. color: #393a34;
  32. }
  33. code {
  34. font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace;
  35. font-size: 85%;
  36. padding: 0.2em 0.4em;
  37. background-color: #f6f8fa;
  38. color: #393a34;
  39. }
  40. pre > code {
  41. padding: 0;
  42. background-color: inherit;
  43. color: inherit;
  44. }
  45. h1, h2, h3 {
  46. font-weight: 600;
  47. }
  48. #logobar {
  49. background-color: #333333;
  50. margin: 0 auto;
  51. padding: 1em 4em;
  52. }
  53. #logobar .logo {
  54. float: left;
  55. }
  56. #logobar .title {
  57. font-weight: 600;
  58. color: #dddddd;
  59. float: left;
  60. margin: 5px 0 0 1em;
  61. }
  62. #logobar:after {
  63. content: "";
  64. display: block;
  65. clear: both;
  66. }
  67. #content {
  68. margin: 0 auto;
  69. padding: 0 4em;
  70. }
  71. #table_of_contents > h2 {
  72. font-size: 1.17em;
  73. }
  74. #table_of_contents ul:first-child {
  75. border: solid 1px #e1e4e8;
  76. border-radius: 6px;
  77. padding: 1em;
  78. background-color: #f6f8fa;
  79. color: #393a34;
  80. }
  81. #table_of_contents ul {
  82. list-style-type: none;
  83. padding-left: 1.5em;
  84. }
  85. #table_of_contents li {
  86. font-size: 0.9em;
  87. }
  88. #table_of_contents li a {
  89. color: #000000;
  90. }
  91. header.title {
  92. border-bottom: solid 1px #e1e4e8;
  93. }
  94. header.title > h1 {
  95. margin-bottom: 0.25em;
  96. }
  97. header.title > .description {
  98. display: block;
  99. margin-bottom: 0.5em;
  100. line-height: 1;
  101. }
  102. footer#edit {
  103. border-top: solid 1px #e1e4e8;
  104. margin: 3em 0 4em 0;
  105. padding-top: 2em;
  106. }
  107. </style>
  108. </head>
  109. <body>
  110. <div id="banner">
  111. <div id="rainbar"></div>
  112. <div id="logobar">
  113. <svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700">
  114. <polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon>
  115. <polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon>
  116. </svg>
  117. <div class="title">
  118. npm command-line interface
  119. </div>
  120. </div>
  121. </div>
  122. <section id="content">
  123. <header class="title">
  124. <h1 id="scripts">scripts</h1>
  125. <span class="description">How npm handles the "scripts" field</span>
  126. </header>
  127. <section id="table_of_contents">
  128. <h2 id="table-of-contents">Table of contents</h2>
  129. <div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#pre--post-scripts">Pre &amp; Post Scripts</a></li><li><a href="#life-cycle-scripts">Life Cycle Scripts</a></li><ul><li><a href="#prepare-and-prepublish">Prepare and Prepublish</a></li></ul><li><a href="#life-cycle-operation-order">Life Cycle Operation Order</a></li><ul><li><a href="#npm-cache-add"><a href="../commands/npm-cache.html"><code>npm cache add</code></a></a></li><li><a href="#npm-ci"><a href="../commands/npm-ci.html"><code>npm ci</code></a></a></li><li><a href="#npm-diff"><a href="../commands/npm-diff.html"><code>npm diff</code></a></a></li><li><a href="#npm-install"><a href="../commands/npm-install.html"><code>npm install</code></a></a></li><li><a href="#npm-pack"><a href="../commands/npm-pack.html"><code>npm pack</code></a></a></li><li><a href="#npm-publish"><a href="../commands/npm-publish.html"><code>npm publish</code></a></a></li><li><a href="#npm-rebuild"><a href="../commands/npm-rebuild.html"><code>npm rebuild</code></a></a></li><li><a href="#npm-restart"><a href="../commands/npm-restart.html"><code>npm restart</code></a></a></li><li><a href="#npm-run-user-defined"><a href="../commands/npm-run-script.html"><code>npm run &lt;user defined&gt;</code></a></a></li><li><a href="#npm-start"><a href="../commands/npm-start.html"><code>npm start</code></a></a></li><li><a href="#npm-stop"><a href="../commands/npm-stop.html"><code>npm stop</code></a></a></li><li><a href="#npm-test"><a href="../commands/npm-test.html"><code>npm test</code></a></a></li><li><a href="#a-note-on-a-lack-of-npm-uninstall-scripts">A Note on a lack of <a href="../commands/npm-uninstall.html"><code>npm uninstall</code></a> scripts</a></li></ul><li><a href="#user">User</a></li><li><a href="#environment">Environment</a></li><ul><li><a href="#path">path</a></li><li><a href="#packagejson-vars">package.json vars</a></li><li><a href="#current-lifecycle-event">current lifecycle event</a></li></ul><li><a href="#examples">Examples</a></li><li><a href="#exiting">Exiting</a></li><li><a href="#best-practices">Best Practices</a></li><li><a href="#see-also">See Also</a></li></ul></div>
  130. </section>
  131. <div id="_content"><h3 id="description">Description</h3>
  132. <p>The <code>"scripts"</code> property of your <code>package.json</code> file supports a number
  133. of built-in scripts and their preset life cycle events as well as
  134. arbitrary scripts. These all can be executed by running
  135. <code>npm run-script &lt;stage&gt;</code> or <code>npm run &lt;stage&gt;</code> for short. <em>Pre</em> and <em>post</em>
  136. commands with matching names will be run for those as well (e.g. <code>premyscript</code>,
  137. <code>myscript</code>, <code>postmyscript</code>). Scripts from dependencies can be run with
  138. <code>npm explore &lt;pkg&gt; -- npm run &lt;stage&gt;</code>.</p>
  139. <h3 id="pre--post-scripts">Pre &amp; Post Scripts</h3>
  140. <p>To create “pre” or “post” scripts for any scripts defined in the
  141. <code>"scripts"</code> section of the <code>package.json</code>, simply create another script
  142. <em>with a matching name</em> and add “pre” or “post” to the beginning of them.</p>
  143. <pre lang="json"><code>{
  144. "scripts": {
  145. "precompress": "{{ executes BEFORE the `compress` script }}",
  146. "compress": "{{ run command to compress files }}",
  147. "postcompress": "{{ executes AFTER `compress` script }}"
  148. }
  149. }
  150. </code></pre>
  151. <p>In this example <code>npm run compress</code> would execute these scripts as
  152. described.</p>
  153. <h3 id="life-cycle-scripts">Life Cycle Scripts</h3>
  154. <p>There are some special life cycle scripts that happen only in certain
  155. situations. These scripts happen in addition to the <code>pre&lt;event&gt;</code>, <code>post&lt;event&gt;</code>, and
  156. <code>&lt;event&gt;</code> scripts.</p>
  157. <ul>
  158. <li><code>prepare</code>, <code>prepublish</code>, <code>prepublishOnly</code>, <code>prepack</code>, <code>postpack</code></li>
  159. </ul>
  160. <p><strong>prepare</strong> (since <code>npm@4.0.0</code>)</p>
  161. <ul>
  162. <li>
  163. <p>Runs any time before the package is packed, i.e. during <code>npm publish</code>
  164. and <code>npm pack</code></p>
  165. </li>
  166. <li>
  167. <p>Runs BEFORE the package is packed</p>
  168. </li>
  169. <li>
  170. <p>Runs BEFORE the package is published</p>
  171. </li>
  172. <li>
  173. <p>Runs on local <code>npm install</code> without any arguments</p>
  174. </li>
  175. <li>
  176. <p>Run AFTER <code>prepublish</code>, but BEFORE <code>prepublishOnly</code></p>
  177. </li>
  178. <li>
  179. <p>NOTE: If a package being installed through git contains a <code>prepare</code>
  180. script, its <code>dependencies</code> and <code>devDependencies</code> will be installed, and
  181. the prepare script will be run, before the package is packaged and
  182. installed.</p>
  183. </li>
  184. <li>
  185. <p>As of <code>npm@7</code> these scripts run in the background.
  186. To see the output, run with: <code>--foreground-scripts</code>.</p>
  187. </li>
  188. </ul>
  189. <p><strong>prepublish</strong> (DEPRECATED)</p>
  190. <ul>
  191. <li>Does not run during <code>npm publish</code>, but does run during <code>npm ci</code>
  192. and <code>npm install</code>. See below for more info.</li>
  193. </ul>
  194. <p><strong>prepublishOnly</strong></p>
  195. <ul>
  196. <li>Runs BEFORE the package is prepared and packed, ONLY on <code>npm publish</code>.</li>
  197. </ul>
  198. <p><strong>prepack</strong></p>
  199. <ul>
  200. <li>Runs BEFORE a tarball is packed (on “<code>npm pack</code>”, “<code>npm publish</code>”, and when installing a git dependencies).</li>
  201. <li>NOTE: “<code>npm run pack</code>” is NOT the same as “<code>npm pack</code>”. “<code>npm run pack</code>” is an arbitrary user defined script name, where as, “<code>npm pack</code>” is a CLI defined command.</li>
  202. </ul>
  203. <p><strong>postpack</strong></p>
  204. <ul>
  205. <li>Runs AFTER the tarball has been generated but before it is moved to its final destination (if at all, publish does not save the tarball locally)</li>
  206. </ul>
  207. <h4 id="prepare-and-prepublish">Prepare and Prepublish</h4>
  208. <p><strong>Deprecation Note: prepublish</strong></p>
  209. <p>Since <code>npm@1.1.71</code>, the npm CLI has run the <code>prepublish</code> script for both <code>npm publish</code> and <code>npm install</code>, 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, <a href="https://github.com/npm/npm/issues/10074">very confusing</a>. As of <code>npm@4.0.0</code>, a new event has been introduced, <code>prepare</code>, that preserves this existing behavior. A <em>new</em> event, <code>prepublishOnly</code> has been added as a transitional strategy to allow users to avoid the confusing behavior of existing npm versions and only run on <code>npm publish</code> (for instance, running the tests one last time to ensure they’re in good shape).</p>
  210. <p>See <a href="https://github.com/npm/npm/issues/10074">https://github.com/npm/npm/issues/10074</a> for a much lengthier justification, with further reading, for this change.</p>
  211. <p><strong>Use Cases</strong></p>
  212. <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 target system, use a <code>prepublish</code> script. This includes tasks such as:</p>
  213. <ul>
  214. <li>Compiling CoffeeScript source code into JavaScript.</li>
  215. <li>Creating minified versions of JavaScript source code.</li>
  216. <li>Fetching remote resources that your package will use.</li>
  217. </ul>
  218. <p>The advantage of doing these things at <code>prepublish</code> time is that they can be done once, in a single place, thus reducing complexity and variability. Additionally, this means that:</p>
  219. <ul>
  220. <li>You can depend on <code>coffee-script</code> as a <code>devDependency</code>, and thus
  221. your users don’t need to have it installed.</li>
  222. <li>You don’t need to include minifiers in your package, reducing
  223. the size for your users.</li>
  224. <li>You don’t need to rely on your users having <code>curl</code> or <code>wget</code> or
  225. other system tools on the target machines.</li>
  226. </ul>
  227. <h3 id="life-cycle-operation-order">Life Cycle Operation Order</h3>
  228. <h4 id="npm-cache-add"><a href="../commands/npm-cache.html"><code>npm cache add</code></a></h4>
  229. <ul>
  230. <li><code>prepare</code></li>
  231. </ul>
  232. <h4 id="npm-ci"><a href="../commands/npm-ci.html"><code>npm ci</code></a></h4>
  233. <ul>
  234. <li><code>preinstall</code></li>
  235. <li><code>install</code></li>
  236. <li><code>postinstall</code></li>
  237. <li><code>prepublish</code></li>
  238. <li><code>preprepare</code></li>
  239. <li><code>prepare</code></li>
  240. <li><code>postprepare</code></li>
  241. </ul>
  242. <p>These all run after the actual installation of modules into
  243. <code>node_modules</code>, in order, with no internal actions happening in between</p>
  244. <h4 id="npm-diff"><a href="../commands/npm-diff.html"><code>npm diff</code></a></h4>
  245. <ul>
  246. <li><code>prepare</code></li>
  247. </ul>
  248. <h4 id="npm-install"><a href="../commands/npm-install.html"><code>npm install</code></a></h4>
  249. <p>These also run when you run <code>npm install -g &lt;pkg-name&gt;</code></p>
  250. <ul>
  251. <li><code>preinstall</code></li>
  252. <li><code>install</code></li>
  253. <li><code>postinstall</code></li>
  254. <li><code>prepublish</code></li>
  255. <li><code>preprepare</code></li>
  256. <li><code>prepare</code></li>
  257. <li><code>postprepare</code></li>
  258. </ul>
  259. <p>If there is a <code>binding.gyp</code> file in the root of your package and you
  260. haven’t defined your own <code>install</code> or <code>preinstall</code> scripts, npm will
  261. default the <code>install</code> command to compile using node-gyp via <code>node-gyp rebuild</code></p>
  262. <p>These are run from the scripts of <code>&lt;pkg-name&gt;</code></p>
  263. <h4 id="npm-pack"><a href="../commands/npm-pack.html"><code>npm pack</code></a></h4>
  264. <ul>
  265. <li><code>prepack</code></li>
  266. <li><code>prepare</code></li>
  267. <li><code>postpack</code></li>
  268. </ul>
  269. <h4 id="npm-publish"><a href="../commands/npm-publish.html"><code>npm publish</code></a></h4>
  270. <ul>
  271. <li><code>prepublishOnly</code></li>
  272. <li><code>prepack</code></li>
  273. <li><code>prepare</code></li>
  274. <li><code>postpack</code></li>
  275. <li><code>publish</code></li>
  276. <li><code>postpublish</code></li>
  277. </ul>
  278. <p><code>prepare</code> will not run during <code>--dry-run</code></p>
  279. <h4 id="npm-rebuild"><a href="../commands/npm-rebuild.html"><code>npm rebuild</code></a></h4>
  280. <ul>
  281. <li><code>preinstall</code></li>
  282. <li><code>install</code></li>
  283. <li><code>postinstall</code></li>
  284. <li><code>prepare</code></li>
  285. </ul>
  286. <p><code>prepare</code> is only run if the current directory is a symlink (e.g. with
  287. linked packages)</p>
  288. <h4 id="npm-restart"><a href="../commands/npm-restart.html"><code>npm restart</code></a></h4>
  289. <p>If there is a <code>restart</code> script defined, these events are run, otherwise
  290. <code>stop</code> and <code>start</code> are both run if present, including their <code>pre</code> and
  291. <code>post</code> iterations)</p>
  292. <ul>
  293. <li><code>prerestart</code></li>
  294. <li><code>restart</code></li>
  295. <li><code>postrestart</code></li>
  296. </ul>
  297. <h4 id="npm-run-user-defined"><a href="../commands/npm-run-script.html"><code>npm run &lt;user defined&gt;</code></a></h4>
  298. <ul>
  299. <li><code>pre&lt;user-defined&gt;</code></li>
  300. <li><code>&lt;user-defined&gt;</code></li>
  301. <li><code>post&lt;user-defined&gt;</code></li>
  302. </ul>
  303. <h4 id="npm-start"><a href="../commands/npm-start.html"><code>npm start</code></a></h4>
  304. <ul>
  305. <li><code>prestart</code></li>
  306. <li><code>start</code></li>
  307. <li><code>poststart</code></li>
  308. </ul>
  309. <p>If there is a <code>server.js</code> file in the root of your package, then npm
  310. will default the <code>start</code> command to <code>node server.js</code>. <code>prestart</code> and
  311. <code>poststart</code> will still run in this case.</p>
  312. <h4 id="npm-stop"><a href="../commands/npm-stop.html"><code>npm stop</code></a></h4>
  313. <ul>
  314. <li><code>prestop</code></li>
  315. <li><code>stop</code></li>
  316. <li><code>poststop</code></li>
  317. </ul>
  318. <h4 id="npm-test"><a href="../commands/npm-test.html"><code>npm test</code></a></h4>
  319. <ul>
  320. <li><code>pretest</code></li>
  321. <li><code>test</code></li>
  322. <li><code>posttest</code></li>
  323. </ul>
  324. <h4 id="a-note-on-a-lack-of-npm-uninstall-scripts">A Note on a lack of <a href="../commands/npm-uninstall.html"><code>npm uninstall</code></a> scripts</h4>
  325. <p>While npm v6 had <code>uninstall</code> lifecycle scripts, npm v7 does not. Removal of a package can happen for a wide variety of reasons, and there’s no clear way to currently give the script enough context to be useful.</p>
  326. <p>Reasons for a package removal include:</p>
  327. <ul>
  328. <li>a user directly uninstalled this package</li>
  329. <li>a user uninstalled a dependant package and so this dependency is being uninstalled</li>
  330. <li>a user uninstalled a dependant package but another package also depends on this version</li>
  331. <li>this version has been merged as a duplicate with another version</li>
  332. <li>etc.</li>
  333. </ul>
  334. <p>Due to the lack of necessary context, <code>uninstall</code> lifecycle scripts are not implemented and will not function.</p>
  335. <h3 id="user">User</h3>
  336. <p>When npm is run as root, scripts are always run with the effective uid
  337. and gid of the working directory owner.</p>
  338. <h3 id="environment">Environment</h3>
  339. <p>Package scripts run in an environment where many pieces of information
  340. are made available regarding the setup of npm and the current state of
  341. the process.</p>
  342. <h4 id="path">path</h4>
  343. <p>If you depend on modules that define executable scripts, like test
  344. suites, then those executables will be added to the <code>PATH</code> for
  345. executing the scripts. So, if your package.json has this:</p>
  346. <pre lang="json"><code>{
  347. "name" : "foo",
  348. "dependencies" : {
  349. "bar" : "0.1.x"
  350. },
  351. "scripts": {
  352. "start" : "bar ./test"
  353. }
  354. }
  355. </code></pre>
  356. <p>then you could run <code>npm start</code> to execute the <code>bar</code> script, which is
  357. exported into the <code>node_modules/.bin</code> directory on <code>npm install</code>.</p>
  358. <h4 id="packagejson-vars">package.json vars</h4>
  359. <p>The package.json fields are tacked onto the <code>npm_package_</code> prefix. So,
  360. for instance, if you had <code>{"name":"foo", "version":"1.2.5"}</code> in your
  361. package.json file, then your package scripts would have the
  362. <code>npm_package_name</code> environment variable set to “foo”, and the
  363. <code>npm_package_version</code> set to “1.2.5”. You can access these variables
  364. in your code with <code>process.env.npm_package_name</code> and
  365. <code>process.env.npm_package_version</code>, and so on for other fields.</p>
  366. <p>See <a href="../configuring-npm/package-json.html"><code>package-json.md</code></a> for more on package configs.</p>
  367. <h4 id="current-lifecycle-event">current lifecycle event</h4>
  368. <p>Lastly, the <code>npm_lifecycle_event</code> environment variable is set to
  369. whichever stage of the cycle is being executed. So, you could have a
  370. single script used for different parts of the process which switches
  371. based on what’s currently happening.</p>
  372. <p>Objects are flattened following this format, so if you had
  373. <code>{"scripts":{"install":"foo.js"}}</code> in your package.json, then you’d
  374. see this in the script:</p>
  375. <pre lang="bash"><code>process.env.npm_package_scripts_install === "foo.js"
  376. </code></pre>
  377. <h3 id="examples">Examples</h3>
  378. <p>For example, if your package.json contains this:</p>
  379. <pre lang="json"><code>{
  380. "scripts" : {
  381. "install" : "scripts/install.js",
  382. "postinstall" : "scripts/install.js",
  383. "uninstall" : "scripts/uninstall.js"
  384. }
  385. }
  386. </code></pre>
  387. <p>then <code>scripts/install.js</code> will be called for the install
  388. and post-install stages of the lifecycle, and <code>scripts/uninstall.js</code>
  389. will be called when the package is uninstalled. Since
  390. <code>scripts/install.js</code> is running for two different phases, it would
  391. be wise in this case to look at the <code>npm_lifecycle_event</code> environment
  392. variable.</p>
  393. <p>If you want to run a make command, you can do so. This works just
  394. fine:</p>
  395. <pre lang="json"><code>{
  396. "scripts" : {
  397. "preinstall" : "./configure",
  398. "install" : "make &amp;&amp; make install",
  399. "test" : "make test"
  400. }
  401. }
  402. </code></pre>
  403. <h3 id="exiting">Exiting</h3>
  404. <p>Scripts are run by passing the line as a script argument to <code>sh</code>.</p>
  405. <p>If the script exits with a code other than 0, then this will abort the
  406. process.</p>
  407. <p>Note that these script files don’t have to be Node.js or even
  408. JavaScript programs. They just have to be some kind of executable
  409. file.</p>
  410. <h3 id="best-practices">Best Practices</h3>
  411. <ul>
  412. <li>Don’t exit with a non-zero error code unless you <em>really</em> mean it.
  413. Except for uninstall scripts, this will cause the npm action to
  414. fail, and potentially be rolled back. If the failure is minor or
  415. only will prevent some optional features, then it’s better to just
  416. print a warning and exit successfully.</li>
  417. <li>Try not to use scripts to do what npm can do for you. Read through
  418. <a href="../configuring-npm/package-json.html"><code>package.json</code></a> to see all the things that you can specify and enable
  419. by simply describing your package appropriately. In general, this
  420. will lead to a more robust and consistent state.</li>
  421. <li>Inspect the env to determine where to put things. For instance, if
  422. the <code>npm_config_binroot</code> environment variable is set to <code>/home/user/bin</code>, then
  423. don’t try to install executables into <code>/usr/local/bin</code>. The user
  424. probably set it up that way for a reason.</li>
  425. <li>Don’t prefix your script commands with “sudo”. If root permissions
  426. are required for some reason, then it’ll fail with that error, and
  427. the user will sudo the npm command in question.</li>
  428. <li>Don’t use <code>install</code>. Use a <code>.gyp</code> file for compilation, and <code>prepublish</code>
  429. for anything else. You should almost never have to explicitly set a
  430. preinstall or install script. If you are doing this, please consider if
  431. there is another option. The only valid use of <code>install</code> or <code>preinstall</code>
  432. scripts is for compilation which must be done on the target architecture.</li>
  433. </ul>
  434. <h3 id="see-also">See Also</h3>
  435. <ul>
  436. <li><a href="../commands/npm-run-script.html">npm run-script</a></li>
  437. <li><a href="../configuring-npm/package-json.html">package.json</a></li>
  438. <li><a href="../using-npm/developers.html">npm developers</a></li>
  439. <li><a href="../commands/npm-install.html">npm install</a></li>
  440. </ul>
  441. </div>
  442. <footer id="edit">
  443. <a href="https://github.com/npm/cli/edit/latest/docs/content/using-npm/scripts.md">
  444. <svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;">
  445. <path fill-rule="evenodd" d="M11.013 1.427a1.75 1.75 0 012.474 0l1.086 1.086a1.75 1.75 0 010 2.474l-8.61 8.61c-.21.21-.47.364-.756.445l-3.251.93a.75.75 0 01-.927-.928l.929-3.25a1.75 1.75 0 01.445-.758l8.61-8.61zm1.414 1.06a.25.25 0 00-.354 0L10.811 3.75l1.439 1.44 1.263-1.263a.25.25 0 000-.354l-1.086-1.086zM11.189 6.25L9.75 4.81l-6.286 6.287a.25.25 0 00-.064.108l-.558 1.953 1.953-.558a.249.249 0 00.108-.064l6.286-6.286z"></path>
  446. </svg>
  447. Edit this page on GitHub
  448. </a>
  449. </footer>
  450. </section>
  451. </body></html>