| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 31b062d commit 5929b08
125 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -738,3 +738,4 @@ Hollow Man <hollowman@hollowman.ml> | |||
| 738 | 738 | kai zhu <kaizhu256@gmail.com> | |
| 739 | 739 | Alex Woollam <alexjhwoollam@gmail.com> | |
| 740 | 740 | Daniel Fischer <daniel@d-fischer.dev> | |
| 741 | + Yash-Singh1 <saiansh2525@gmail.com> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,3 +1,37 @@ | |||
| 1 | + ## 7.1.0 (2020-12-04) | ||
| 2 | + | ||
| 3 | + ### FEATURES | ||
| 4 | + | ||
| 5 | + * [`6b1575110`](https://github.com/npm/cli/commit/6b15751106beb99234aa4bf39ae05cf40076d42a) | ||
| 6 | + [#2237](https://github.com/npm/cli/pull/2237) | ||
| 7 | + add `npm set-script` command | ||
| 8 | + ([@Yash-Singh1](https://github.com/Yash-Singh1)) | ||
| 9 | + * [`15d7333f8`](https://github.com/npm/cli/commit/15d7333f832e3d68ae16895569f27a27ef86573e) | ||
| 10 | + add interactive `npm exec` | ||
| 11 | + ([@isaacs](https://github.com/isaacs)) | ||
| 12 | + | ||
| 13 | + ### BUG FIXES | ||
| 14 | + | ||
| 15 | + * [`2a1192e4b`](https://github.com/npm/cli/commit/2a1192e4b03acdf6e6e24e58de68f736ab9bb35f) | ||
| 16 | + [#2202](https://github.com/npm/cli/pull/2202) | ||
| 17 | + Do not run interactive `npm exec` in CI when a TTY | ||
| 18 | + ([@isaacs](https://github.com/isaacs)) | ||
| 19 | + | ||
| 20 | + ### DOCUMENTATION | ||
| 21 | + | ||
| 22 | + * [`0599cc37d`](https://github.com/npm/cli/commit/0599cc37df453bf79d47490eb4fca3cd63f67f80) | ||
| 23 | + [#2271](https://github.com/npm/cli/pull/2271) | ||
| 24 | + don't wrap code block | ||
| 25 | + ([@ethomson](https://github.com/ethomson)) | ||
| 26 | + | ||
| 27 | + ### DEPENDENCIES | ||
| 28 | + | ||
| 29 | + * [`def85c726`](https://github.com/npm/cli/commit/def85c72640ffe2d27977c56b7aa06c6f6346ca9) | ||
| 30 | + `@npmcli/arborist@1.0.14` | ||
| 31 | + * fixes running `npm exec` from file system root folder | ||
| 32 | + * [`4c94673ab`](https://github.com/npm/cli/commit/4c94673ab5399d27e5a48e52f7a65b038a456265) | ||
| 33 | + `semver@7.3.4` | ||
| 34 | + | ||
| 1 | 35 | ## 7.0.15 (2020-11-27) | |
| 2 | 36 | ||
| 3 | 37 | ### DEPENDENCIES | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -78,8 +78,8 @@ This command used to be known as `npm tag`, which only created new tags, | |||
| 78 | 78 | and so had a different syntax. | |
| 79 | 79 | ||
| 80 | 80 | Tags must share a namespace with version numbers, because they are | |
| 81 | - specified in the same slot: `npm install <pkg>@<version>` vs `npm install | ||
| 82 | - <pkg>@<tag>`. | ||
| 81 | + specified in the same slot: `npm install <pkg>@<version>` vs | ||
| 82 | + `npm install <pkg>@<tag>`. | ||
| 83 | 83 | ||
| 84 | 84 | Tags that can be interpreted as valid semver ranges will be rejected. For | |
| 85 | 85 | example, `v1.4` cannot be used as a tag, because it is interpreted by | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,9 +16,11 @@ npx <pkg>[@<specifier>] [args...] | |||
| 16 | 16 | npx -p <pkg>[@<specifier>] <cmd> [args...] | |
| 17 | 17 | npx -c '<cmd> [args...]' | |
| 18 | 18 | npx -p <pkg>[@<specifier>] -c '<cmd> [args...]' | |
| 19 | + Run without --call or positional args to open interactive subshell | ||
| 19 | 20 | ||
| 20 | 21 | alias: npm x, npx | |
| 21 | 22 | ||
| 23 | + common options: | ||
| 22 | 24 | --package=<pkg> (may be specified multiple times) | |
| 23 | 25 | -p is a shorthand for --package only when using npx executable | |
| 24 | 26 | -c <cmd> --call=<cmd> (may not be mixed with positional arguments) | |
@@ -30,6 +32,11 @@ This command allows you to run an arbitrary command from an npm package | |||
| 30 | 32 | (either one installed locally, or fetched remotely), in a similar context | |
| 31 | 33 | as running it via `npm run`. | |
| 32 | 34 | ||
| 35 | + Run without positional arguments or `--call`, this allows you to | ||
| 36 | + interactively run commands in the same sort of shell environment that | ||
| 37 | + `package.json` scripts are run. Interactive mode is not supported in CI | ||
| 38 | + environments when standard input is a TTY, to prevent hangs. | ||
| 39 | + | ||
| 33 | 40 | Whatever packages are specified by the `--package` option will be | |
| 34 | 41 | provided in the `PATH` of the executed command, along with any locally | |
| 35 | 42 | installed package executables. The `--package` option may be | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,34 @@ | |||
| 1 | + --- | ||
| 2 | + title: npm-set-script | ||
| 3 | + section: 1 | ||
| 4 | + description: Set tasks in the scripts section of package.json | ||
| 5 | + --- | ||
| 6 | + | ||
| 7 | + ### Synopsis | ||
| 8 | + An npm command that lets you create a task in the scripts section of the package.json. | ||
| 9 | + | ||
| 10 | + ```bash | ||
| 11 | + npm set-script [<script>] [<command>] | ||
| 12 | + ``` | ||
| 13 | + | ||
| 14 | + | ||
| 15 | + **Example:** | ||
| 16 | + | ||
| 17 | + * `npm set-script start "http-server ."` | ||
| 18 | + | ||
| 19 | + ```json | ||
| 20 | + { | ||
| 21 | + "name": "my-project", | ||
| 22 | + "scripts": { | ||
| 23 | + "start": "http-server .", | ||
| 24 | + "test": "some existing value" | ||
| 25 | + } | ||
| 26 | + } | ||
| 27 | + ``` | ||
| 28 | + | ||
| 29 | + ### See Also | ||
| 30 | + | ||
| 31 | + * [npm run-script](/commands/npm-run-script) | ||
| 32 | + * [npm install](/commands/npm-install) | ||
| 33 | + * [npm test](/commands/npm-test) | ||
| 34 | + * [npm start](/commands/npm-start) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -201,7 +201,8 @@ <h3 id="caveats">Caveats</h3> | |||
| 201 | 201 | <p>This command used to be known as <code>npm tag</code>, which only created new tags, | |
| 202 | 202 | and so had a different syntax.</p> | |
| 203 | 203 | <p>Tags must share a namespace with version numbers, because they are | |
| 204 | - specified in the same slot: <code>npm install <pkg>@<version></code> vs <code>npm install <pkg>@<tag></code>.</p> | ||
| 204 | + specified in the same slot: <code>npm install <pkg>@<version></code> vs | ||
| 205 | + <code>npm install <pkg>@<tag></code>.</p> | ||
| 205 | 206 | <p>Tags that can be interpreted as valid semver ranges will be rejected. For | |
| 206 | 207 | example, <code>v1.4</code> cannot be used as a tag, because it is interpreted by | |
| 207 | 208 | semver as <code>>=1.4.0 <1.5.0</code>. See <a href="https://github.com/npm/npm/issues/6082">https://github.com/npm/npm/issues/6082</a>.</p> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -154,9 +154,11 @@ <h2 id="table-of-contents">Table of contents</h2> | |||
| 154 | 154 | npx -p <pkg>[@<specifier>] <cmd> [args...] | |
| 155 | 155 | npx -c '<cmd> [args...]' | |
| 156 | 156 | npx -p <pkg>[@<specifier>] -c '<cmd> [args...]' | |
| 157 | + Run without --call or positional args to open interactive subshell | ||
| 157 | 158 | ||
| 158 | 159 | alias: npm x, npx | |
| 159 | 160 | ||
| 161 | + common options: | ||
| 160 | 162 | --package=<pkg> (may be specified multiple times) | |
| 161 | 163 | -p is a shorthand for --package only when using npx executable | |
| 162 | 164 | -c <cmd> --call=<cmd> (may not be mixed with positional arguments) | |
@@ -165,6 +167,10 @@ <h3 id="description">Description</h3> | |||
| 165 | 167 | <p>This command allows you to run an arbitrary command from an npm package | |
| 166 | 168 | (either one installed locally, or fetched remotely), in a similar context | |
| 167 | 169 | as running it via <code>npm run</code>.</p> | |
| 170 | + <p>Run without positional arguments or <code>--call</code>, this allows you to | ||
| 171 | + interactively run commands in the same sort of shell environment that | ||
| 172 | + <code>package.json</code> scripts are run. Interactive mode is not supported in CI | ||
| 173 | + environments when standard input is a TTY, to prevent hangs.</p> | ||
| 168 | 174 | <p>Whatever packages are specified by the <code>--package</code> option will be | |
| 169 | 175 | provided in the <code>PATH</code> of the executed command, along with any locally | |
| 170 | 176 | installed package executables. The <code>--package</code> option may be | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -156,7 +156,7 @@ <h3 id="description">Description</h3> | |||
| 156 | 156 | limit the results to only the paths to the packages named. Note that | |
| 157 | 157 | nested packages will <em>also</em> show the paths to the specified packages. | |
| 158 | 158 | For example, running <code>npm ls promzard</code> in npm’s source tree will show:</p> | |
| 159 | - <pre lang="bash"><code> npm@7.0.15 /path/to/npm | ||
| 159 | + <pre lang="bash"><code> npm@7.1.0 /path/to/npm | ||
| 160 | 160 | └─┬ init-package-json@0.0.4 | |
| 161 | 161 | └── promzard@0.1.5 | |
| 162 | 162 | </code></pre> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,184 @@ | |||
| 1 | + <html><head> | ||
| 2 | + <title>npm-set-script</title> | ||
| 3 | + <style> | ||
| 4 | + body { | ||
| 5 | + background-color: #ffffff; | ||
| 6 | + color: #24292e; | ||
| 7 | + | ||
| 8 | + margin: 0; | ||
| 9 | + | ||
| 10 | + line-height: 1.5; | ||
| 11 | + | ||
| 12 | + font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji"; | ||
| 13 | + } | ||
| 14 | + #rainbar { | ||
| 15 | + height: 10px; | ||
| 16 | + background-image: linear-gradient(139deg, #fb8817, #ff4b01, #c12127, #e02aff); | ||
| 17 | + } | ||
| 18 | + | ||
| 19 | + a { | ||
| 20 | + text-decoration: none; | ||
| 21 | + color: #0366d6; | ||
| 22 | + } | ||
| 23 | + a:hover { | ||
| 24 | + text-decoration: underline; | ||
| 25 | + } | ||
| 26 | + | ||
| 27 | + pre { | ||
| 28 | + margin: 1em 0px; | ||
| 29 | + padding: 1em; | ||
| 30 | + border: solid 1px #e1e4e8; | ||
| 31 | + border-radius: 6px; | ||
| 32 | + | ||
| 33 | + display: block; | ||
| 34 | + overflow: auto; | ||
| 35 | + | ||
| 36 | + white-space: pre; | ||
| 37 | + | ||
| 38 | + background-color: #f6f8fa; | ||
| 39 | + color: #393a34; | ||
| 40 | + } | ||
| 41 | + code { | ||
| 42 | + font-family: SFMono-Regular, Consolas, "Liberation Mono", Menlo, Courier, monospace; | ||
| 43 | + font-size: 85%; | ||
| 44 | + padding: 0.2em 0.4em; | ||
| 45 | + background-color: #f6f8fa; | ||
| 46 | + color: #393a34; | ||
| 47 | + } | ||
| 48 | + pre > code { | ||
| 49 | + padding: 0; | ||
| 50 | + background-color: inherit; | ||
| 51 | + color: inherit; | ||
| 52 | + } | ||
| 53 | + h1, h2, h3 { | ||
| 54 | + font-weight: 600; | ||
| 55 | + } | ||
| 56 | + | ||
| 57 | + #logobar { | ||
| 58 | + background-color: #333333; | ||
| 59 | + margin: 0 auto; | ||
| 60 | + padding: 1em 4em; | ||
| 61 | + } | ||
| 62 | + #logobar .logo { | ||
| 63 | + float: left; | ||
| 64 | + } | ||
| 65 | + #logobar .title { | ||
| 66 | + font-weight: 600; | ||
| 67 | + color: #dddddd; | ||
| 68 | + float: left; | ||
| 69 | + margin: 5px 0 0 1em; | ||
| 70 | + } | ||
| 71 | + #logobar:after { | ||
| 72 | + content: ""; | ||
| 73 | + display: block; | ||
| 74 | + clear: both; | ||
| 75 | + } | ||
| 76 | + | ||
| 77 | + #content { | ||
| 78 | + margin: 0 auto; | ||
| 79 | + padding: 0 4em; | ||
| 80 | + } | ||
| 81 | + | ||
| 82 | + #table_of_contents > h2 { | ||
| 83 | + font-size: 1.17em; | ||
| 84 | + } | ||
| 85 | + #table_of_contents ul:first-child { | ||
| 86 | + border: solid 1px #e1e4e8; | ||
| 87 | + border-radius: 6px; | ||
| 88 | + padding: 1em; | ||
| 89 | + background-color: #f6f8fa; | ||
| 90 | + color: #393a34; | ||
| 91 | + } | ||
| 92 | + #table_of_contents ul { | ||
| 93 | + list-style-type: none; | ||
| 94 | + padding-left: 1.5em; | ||
| 95 | + } | ||
| 96 | + #table_of_contents li { | ||
| 97 | + font-size: 0.9em; | ||
| 98 | + } | ||
| 99 | + #table_of_contents li a { | ||
| 100 | + color: #000000; | ||
| 101 | + } | ||
| 102 | + | ||
| 103 | + header.title { | ||
| 104 | + border-bottom: solid 1px #e1e4e8; | ||
| 105 | + } | ||
| 106 | + header.title > h1 { | ||
| 107 | + margin-bottom: 0.25em; | ||
| 108 | + } | ||
| 109 | + header.title > .description { | ||
| 110 | + display: block; | ||
| 111 | + margin-bottom: 0.5em; | ||
| 112 | + line-height: 1; | ||
| 113 | + } | ||
| 114 | + | ||
| 115 | + footer#edit { | ||
| 116 | + border-top: solid 1px #e1e4e8; | ||
| 117 | + margin: 3em 0 4em 0; | ||
| 118 | + padding-top: 2em; | ||
| 119 | + } | ||
| 120 | + </style> | ||
| 121 | + </head> | ||
| 122 | + <body> | ||
| 123 | + <div id="banner"> | ||
| 124 | + <div id="rainbar"></div> | ||
| 125 | + <div id="logobar"> | ||
| 126 | + <svg class="logo" role="img" height="32" width="32" viewBox="0 0 700 700"> | ||
| 127 | + <polygon fill="#cb0000" points="0,700 700,700 700,0 0,0"></polygon> | ||
| 128 | + <polygon fill="#ffffff" points="150,550 350,550 350,250 450,250 450,550 550,550 550,150 150,150"></polygon> | ||
| 129 | + </svg> | ||
| 130 | + <div class="title"> | ||
| 131 | + npm command-line interface | ||
| 132 | + </div> | ||
| 133 | + </div> | ||
| 134 | + </div> | ||
| 135 | + | ||
| 136 | + <section id="content"> | ||
| 137 | + <header class="title"> | ||
| 138 | + <h1 id="npm-set-script">npm-set-script</h1> | ||
| 139 | + <span class="description">Set tasks in the scripts section of package.json</span> | ||
| 140 | + </header> | ||
| 141 | + | ||
| 142 | + <section id="table_of_contents"> | ||
| 143 | + <h2 id="table-of-contents">Table of contents</h2> | ||
| 144 | + <div id="_table_of_contents"><ul><li><a href="#synopsis">Synopsis</a></li><li><a href="#see-also">See Also</a></li></ul></div> | ||
| 145 | + </section> | ||
| 146 | + | ||
| 147 | + <div id="_content"><h3 id="synopsis">Synopsis</h3> | ||
| 148 | + <p>An npm command that lets you create a task in the scripts section of the package.json.</p> | ||
| 149 | + <pre lang="bash"><code>npm set-script [<script>] [<command>] | ||
| 150 | + </code></pre> | ||
| 151 | + <p><strong>Example:</strong></p> | ||
| 152 | + <ul> | ||
| 153 | + <li><code>npm set-script start "http-server ."</code></li> | ||
| 154 | + </ul> | ||
| 155 | + <pre lang="json"><code>{ | ||
| 156 | + "name": "my-project", | ||
| 157 | + "scripts": { | ||
| 158 | + "start": "http-server .", | ||
| 159 | + "test": "some existing value" | ||
| 160 | + } | ||
| 161 | + } | ||
| 162 | + </code></pre> | ||
| 163 | + <h3 id="see-also">See Also</h3> | ||
| 164 | + <ul> | ||
| 165 | + <li><a href="../commands/npm-run-script.html">npm run-script</a></li> | ||
| 166 | + <li><a href="../commands/npm-install.html">npm install</a></li> | ||
| 167 | + <li><a href="../commands/npm-test.html">npm test</a></li> | ||
| 168 | + <li><a href="../commands/npm-start.html">npm start</a></li> | ||
| 169 | + </ul> | ||
| 170 | + </div> | ||
| 171 | + | ||
| 172 | + <footer id="edit"> | ||
| 173 | + <a href="https://github.com/npm/cli/edit/latest/docs/content/commands/npm-set-script.md"> | ||
| 174 | + <svg role="img" viewBox="0 0 16 16" width="16" height="16" fill="currentcolor" style="vertical-align: text-bottom; margin-right: 0.3em;"> | ||
| 175 | + <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> | ||
| 176 | + </svg> | ||
| 177 | + Edit this page on GitHub | ||
| 178 | + </a> | ||
| 179 | + </footer> | ||
| 180 | + </section> | ||
| 181 | + | ||
| 182 | + | ||
| 183 | + | ||
| 184 | + </body></html> | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -148,7 +148,7 @@ <h2 id="table-of-contents">Table of contents</h2> | |||
| 148 | 148 | <pre lang="bash"><code>npm <command> [args] | |
| 149 | 149 | </code></pre> | |
| 150 | 150 | <h3 id="version">Version</h3> | |
| 151 | - <p>7.0.15</p> | ||
| 151 | + <p>7.1.0</p> | ||
| 152 | 152 | <h3 id="description">Description</h3> | |
| 153 | 153 | <p>npm is the package manager for the Node JavaScript platform. It puts | |
| 154 | 154 | modules in place so that node can find them, and manages dependency | |
| Back | FazBrowse Home | New Git URL |
0 commit comments