| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 8d1c471 commit b89c7ae
748 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -138,7 +138,8 @@ Package descriptors have the following fields: | |||
| 138 | 138 | the case of packages fetched from the registry, this will be a url to a | |
| 139 | 139 | tarball. In the case of git dependencies, this will be the full git url | |
| 140 | 140 | with commit sha. In the case of link dependencies, this will be the | |
| 141 | - location of the link target. | ||
| 141 | + location of the link target. `registry.npmjs.org` is a magic value meaning | ||
| 142 | + "the currently configured registry". | ||
| 142 | 143 | ||
| 143 | 144 | * integrity: A `sha512` or `sha1` [Standard Subresource | |
| 144 | 145 | Integrity](https://w3c.github.io/webappsec/specs/subresourceintegrity/) | |
@@ -201,7 +202,8 @@ Dependency objects have the following fields: | |||
| 201 | 202 | ||
| 202 | 203 | * resolved: For registry sources this is path of the tarball relative to | |
| 203 | 204 | the registry URL. If the tarball URL isn't on the same server as the | |
| 204 | - registry URL then this is a complete URL. | ||
| 205 | + registry URL then this is a complete URL. `registry.npmjs.org` is a magic | ||
| 206 | + value meaning "the currently configured registry". | ||
| 205 | 207 | ||
| 206 | 208 | * bundled: If true, this is the bundled dependency and will be installed | |
| 207 | 209 | by the parent module. When installing, this module will be extracted | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -30,6 +30,13 @@ The registry URL used is determined by the scope of the package (see | |||
| 30 | 30 | supplied by the `registry` config parameter. See [`npm config`](/commands/npm-config), | |
| 31 | 31 | [`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on managing npm's configuration. | |
| 32 | 32 | ||
| 33 | + When the default registry is used in a package-lock or shrinkwrap is has the | ||
| 34 | + special meaning of "the currently configured registry". If you create a lock | ||
| 35 | + file while using the default registry you can switch to another registry and | ||
| 36 | + npm will install packages from the new registry, but if you create a lock | ||
| 37 | + file while using a custom registry packages will be installed from that | ||
| 38 | + registry even after you change to another registry. | ||
| 39 | + | ||
| 33 | 40 | ### Does npm send any information about me back to the registry? | |
| 34 | 41 | ||
| 35 | 42 | Yes. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -98,7 +98,8 @@ desired, with `npm access` or on the npmjs.com website. | |||
| 98 | 98 | ||
| 99 | 99 | Scopes can be associated with a separate registry. This allows you to | |
| 100 | 100 | seamlessly use a mix of packages from the primary npm registry and one or more | |
| 101 | - private registries, such as npm Enterprise. | ||
| 101 | + private registries, such as [GitHub Packages](https://github.com/features/packages) or the open source [Verdaccio](https://verdaccio.org) | ||
| 102 | + project. | ||
| 102 | 103 | ||
| 103 | 104 | You can associate a scope with a registry at login, e.g. | |
| 104 | 105 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -176,6 +176,22 @@ npm run test --workspaces | |||
| 176 | 176 | ||
| 177 | 177 | Will run the `test` script in both `./packages/a` and `./packages/b`. | |
| 178 | 178 | ||
| 179 | + Commands will be run in each workspace in the order they appear in your `package.json` | ||
| 180 | + | ||
| 181 | + ``` | ||
| 182 | + { | ||
| 183 | + "workspaces": [ "packages/a", "packages/b" ] | ||
| 184 | + } | ||
| 185 | + ``` | ||
| 186 | + | ||
| 187 | + Order of run is different with: | ||
| 188 | + | ||
| 189 | + ``` | ||
| 190 | + { | ||
| 191 | + "workspaces": [ "packages/b", "packages/a" ] | ||
| 192 | + } | ||
| 193 | + ``` | ||
| 194 | + | ||
| 179 | 195 | ### Ignoring missing scripts | |
| 180 | 196 | ||
| 181 | 197 | It is not required for all of the workspaces to implement scripts run with the `npm run` command. | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -159,7 +159,7 @@ <h3 id="description">Description</h3> | |||
| 159 | 159 | the results to only the paths to the packages named. Note that nested | |
| 160 | 160 | packages will <em>also</em> show the paths to the specified packages. For | |
| 161 | 161 | example, running <code>npm ls promzard</code> in npm’s source tree will show:</p> | |
| 162 | - <pre lang="bash"><code>npm@7.24.0 /path/to/npm | ||
| 162 | + <pre lang="bash"><code>npm@8.0.0 /path/to/npm | ||
| 163 | 163 | └─┬ init-package-json@0.0.4 | |
| 164 | 164 | └── promzard@0.1.5 | |
| 165 | 165 | </code></pre> | |
| 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.24.0</p> | ||
| 151 | + <p>8.0.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 | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -262,7 +262,8 @@ <h4 id="packages"><code>packages</code></h4> | |||
| 262 | 262 | the case of packages fetched from the registry, this will be a url to a | |
| 263 | 263 | tarball. In the case of git dependencies, this will be the full git url | |
| 264 | 264 | with commit sha. In the case of link dependencies, this will be the | |
| 265 | - location of the link target.</p> | ||
| 265 | + location of the link target. <code>registry.npmjs.org</code> is a magic value meaning | ||
| 266 | + “the currently configured registry”.</p> | ||
| 266 | 267 | </li> | |
| 267 | 268 | <li> | |
| 268 | 269 | <p>integrity: A <code>sha512</code> or <code>sha1</code> <a href="https://w3c.github.io/webappsec/specs/subresourceintegrity/">Standard Subresource | |
@@ -334,7 +335,8 @@ <h4 id="dependencies">dependencies</h4> | |||
| 334 | 335 | <li> | |
| 335 | 336 | <p>resolved: For registry sources this is path of the tarball relative to | |
| 336 | 337 | the registry URL. If the tarball URL isn’t on the same server as the | |
| 337 | - registry URL then this is a complete URL.</p> | ||
| 338 | + registry URL then this is a complete URL. <code>registry.npmjs.org</code> is a magic | ||
| 339 | + value meaning “the currently configured registry”.</p> | ||
| 338 | 340 | </li> | |
| 339 | 341 | <li> | |
| 340 | 342 | <p>bundled: If true, this is the bundled dependency and will be installed | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -163,6 +163,12 @@ <h2 id="table-of-contents">Table of contents</h2> | |||
| 163 | 163 | <a href="../using-npm/scope.html"><code>scope</code></a>. If no scope is specified, the default registry is used, which is | |
| 164 | 164 | supplied by the <code>registry</code> config parameter. See <a href="../commands/npm-config.html"><code>npm config</code></a>, | |
| 165 | 165 | <a href="../configuring-npm/npmrc.html"><code>npmrc</code></a>, and <a href="../using-npm/config.html"><code>config</code></a> for more on managing npm’s configuration.</p> | |
| 166 | + <p>When the default registry is used in a package-lock or shrinkwrap is has the | ||
| 167 | + special meaning of “the currently configured registry”. If you create a lock | ||
| 168 | + file while using the default registry you can switch to another registry and | ||
| 169 | + npm will install packages from the new registry, but if you create a lock | ||
| 170 | + file while using a custom registry packages will be installed from that | ||
| 171 | + registry even after you change to another registry.</p> | ||
| 166 | 172 | <h3 id="does-npm-send-any-information-about-me-back-to-the-registry">Does npm send any information about me back to the registry?</h3> | |
| 167 | 173 | <p>Yes.</p> | |
| 168 | 174 | <p>When making requests of the registry npm adds two headers with information | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -206,7 +206,8 @@ <h4 id="publishing-private-scoped-packages-to-the-npm-registry">Publishing priva | |||
| 206 | 206 | <h3 id="associating-a-scope-with-a-registry">Associating a scope with a registry</h3> | |
| 207 | 207 | <p>Scopes can be associated with a separate registry. This allows you to | |
| 208 | 208 | seamlessly use a mix of packages from the primary npm registry and one or more | |
| 209 | - private registries, such as npm Enterprise.</p> | ||
| 209 | + private registries, such as <a href="https://github.com/features/packages">GitHub Packages</a> or the open source <a href="https://verdaccio.org">Verdaccio</a> | ||
| 210 | + project.</p> | ||
| 210 | 211 | <p>You can associate a scope with a registry at login, e.g.</p> | |
| 211 | 212 | <pre lang="bash"><code>npm login --registry=http://reg.example.com --scope=@myco | |
| 212 | 213 | </code></pre> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -264,6 +264,16 @@ <h3 id="running-commands-in-the-context-of-workspaces">Running commands in the c | |||
| 264 | 264 | <pre><code>npm run test --workspaces | |
| 265 | 265 | </code></pre> | |
| 266 | 266 | <p>Will run the <code>test</code> script in both <code>./packages/a</code> and <code>./packages/b</code>.</p> | |
| 267 | + <p>Commands will be run in each workspace in the order they appear in your <code>package.json</code></p> | ||
| 268 | + <pre><code>{ | ||
| 269 | + "workspaces": [ "packages/a", "packages/b" ] | ||
| 270 | + } | ||
| 271 | + </code></pre> | ||
| 272 | + <p>Order of run is different with:</p> | ||
| 273 | + <pre><code>{ | ||
| 274 | + "workspaces": [ "packages/b", "packages/a" ] | ||
| 275 | + } | ||
| 276 | + </code></pre> | ||
| 267 | 277 | <h3 id="ignoring-missing-scripts">Ignoring missing scripts</h3> | |
| 268 | 278 | <p>It is not required for all of the workspaces to implement scripts run with the <code>npm run</code> command.</p> | |
| 269 | 279 | <p>By running the command with the <code>--if-present</code> flag, npm will ignore workspaces missing target script.</p> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments