| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -35,29 +35,28 @@ For all of the subcommands, `npm access` will perform actions on the packages | |||
| 35 | 35 | in the current working directory if no package name is passed to the | |
| 36 | 36 | subcommand. | |
| 37 | 37 | ||
| 38 | - * public / restricted: | ||
| 38 | + * public / restricted (deprecated): | ||
| 39 | 39 | Set a package to be either publicly accessible or restricted. | |
| 40 | 40 | ||
| 41 | - * grant / revoke: | ||
| 41 | + * grant / revoke (deprecated): | ||
| 42 | 42 | Add or remove the ability of users and teams to have read-only or read-write | |
| 43 | 43 | access to a package. | |
| 44 | 44 | ||
| 45 | - * 2fa-required / 2fa-not-required: | ||
| 45 | + * 2fa-required / 2fa-not-required (deprecated): | ||
| 46 | 46 | Configure whether a package requires that anyone publishing it have two-factor | |
| 47 | 47 | authentication enabled on their account. | |
| 48 | 48 | ||
| 49 | - * ls-packages: | ||
| 49 | + * ls-packages (deprecated): | ||
| 50 | 50 | Show all of the packages a user or a team is able to access, along with the | |
| 51 | 51 | access level, except for read-only public packages (it won't print the whole | |
| 52 | 52 | registry listing) | |
| 53 | 53 | ||
| 54 | - * ls-collaborators: | ||
| 54 | + * ls-collaborators (deprecated): | ||
| 55 | 55 | Show all of the access privileges for a package. Will only show permissions | |
| 56 | 56 | for packages to which you have at least read access. If `<user>` is passed in, | |
| 57 | 57 | the list is filtered only to teams _that_ user happens to belong to. | |
| 58 | 58 | ||
| 59 | - * edit: | ||
| 60 | - Set the access privileges for a package at once using `$EDITOR`. | ||
| 59 | + * edit (not implemented) | ||
| 61 | 60 | ||
| 62 | 61 | ### Details | |
| 63 | 62 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -232,4 +232,4 @@ This value is not exported to the environment for child processes. | |||
| 232 | 232 | <!-- AUTOGENERATED CONFIG DESCRIPTIONS END --> | |
| 233 | 233 | ## See Also | |
| 234 | 234 | ||
| 235 | - * [dependency selector](/using-npm/dependency-selector) | ||
| 235 | + * [dependency selectors](/using-npm/dependency-selectors) | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -91,6 +91,34 @@ consistent across updates. Set fields in here using the `./configure` | |||
| 91 | 91 | script that comes with npm. This is primarily for distribution maintainers | |
| 92 | 92 | to override default configs in a standard and consistent manner. | |
| 93 | 93 | ||
| 94 | + ### Auth related configuration | ||
| 95 | + | ||
| 96 | + The settings `_auth`, `_authToken`, `username` and `_password` must all be | ||
| 97 | + scoped to a specific registry. This ensures that `npm` will never send | ||
| 98 | + credentials to the wrong host. | ||
| 99 | + | ||
| 100 | + In order to scope these values, they must be prefixed by a URI fragment. | ||
| 101 | + If the credential is meant for any request to a registry on a single host, | ||
| 102 | + the scope may look like `//registry.npmjs.org/:`. If it must be scoped to a | ||
| 103 | + specific path on the host that path may also be provided, such as | ||
| 104 | + `//my-custom-registry.org/unique/path:`. | ||
| 105 | + | ||
| 106 | + ``` | ||
| 107 | + ; bad config | ||
| 108 | + _authToken=MYTOKEN | ||
| 109 | + | ||
| 110 | + ; good config | ||
| 111 | + @myorg:registry=https://somewhere-else.com/myorg | ||
| 112 | + @another:registry=https://somewhere-else.com/another | ||
| 113 | + //registry.npmjs.org/:_authToken=MYTOKEN | ||
| 114 | + ; would apply to both @myorg and @another | ||
| 115 | + ; //somewhere-else.com/:_authToken=MYTOKEN | ||
| 116 | + ; would apply only to @myorg | ||
| 117 | + //somewhere-else.com/myorg/:_authToken=MYTOKEN1 | ||
| 118 | + ; would apply only to @another | ||
| 119 | + //somewhere-else.com/another/:_authToken=MYTOKEN2 | ||
| 120 | + ``` | ||
| 121 | + | ||
| 94 | 122 | ### See also | |
| 95 | 123 | ||
| 96 | 124 | * [npm folders](/configuring-npm/folders) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -144,7 +144,7 @@ const arb = new Arborist({}) | |||
| 144 | 144 | ||
| 145 | 145 | ```js | |
| 146 | 146 | // root-level | |
| 147 | - arb.loadActual((tree) => { | ||
| 147 | + arb.loadActual().then(async (tree) => { | ||
| 148 | 148 | // query all production dependencies | |
| 149 | 149 | const results = await tree.querySelectorAll('.prod') | |
| 150 | 150 | console.log(results) | |
@@ -153,7 +153,7 @@ arb.loadActual((tree) => { | |||
| 153 | 153 | ||
| 154 | 154 | ```js | |
| 155 | 155 | // iterative | |
| 156 | - arb.loadActual((tree) => { | ||
| 156 | + arb.loadActual().then(async (tree) => { | ||
| 157 | 157 | // query for the deduped version of react | |
| 158 | 158 | const results = await tree.querySelectorAll('#react:not(:deduped)') | |
| 159 | 159 | // query the deduped react for git deps | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -169,34 +169,33 @@ <h3 id="description">Description</h3> | |||
| 169 | 169 | subcommand.</p> | |
| 170 | 170 | <ul> | |
| 171 | 171 | <li> | |
| 172 | - <p>public / restricted: | ||
| 172 | + <p>public / restricted (deprecated): | ||
| 173 | 173 | Set a package to be either publicly accessible or restricted.</p> | |
| 174 | 174 | </li> | |
| 175 | 175 | <li> | |
| 176 | - <p>grant / revoke: | ||
| 176 | + <p>grant / revoke (deprecated): | ||
| 177 | 177 | Add or remove the ability of users and teams to have read-only or read-write | |
| 178 | 178 | access to a package.</p> | |
| 179 | 179 | </li> | |
| 180 | 180 | <li> | |
| 181 | - <p>2fa-required / 2fa-not-required: | ||
| 181 | + <p>2fa-required / 2fa-not-required (deprecated): | ||
| 182 | 182 | Configure whether a package requires that anyone publishing it have two-factor | |
| 183 | 183 | authentication enabled on their account.</p> | |
| 184 | 184 | </li> | |
| 185 | 185 | <li> | |
| 186 | - <p>ls-packages: | ||
| 186 | + <p>ls-packages (deprecated): | ||
| 187 | 187 | Show all of the packages a user or a team is able to access, along with the | |
| 188 | 188 | access level, except for read-only public packages (it won't print the whole | |
| 189 | 189 | registry listing)</p> | |
| 190 | 190 | </li> | |
| 191 | 191 | <li> | |
| 192 | - <p>ls-collaborators: | ||
| 192 | + <p>ls-collaborators (deprecated): | ||
| 193 | 193 | Show all of the access privileges for a package. Will only show permissions | |
| 194 | 194 | for packages to which you have at least read access. If <code><user></code> is passed in, | |
| 195 | 195 | the list is filtered only to teams <em>that</em> user happens to belong to.</p> | |
| 196 | 196 | </li> | |
| 197 | 197 | <li> | |
| 198 | - <p>edit: | ||
| 199 | - Set the access privileges for a package at once using <code>$EDITOR</code>.</p> | ||
| 198 | + <p>edit (not implemented)</p> | ||
| 200 | 199 | </li> | |
| 201 | 200 | </ul> | |
| 202 | 201 | <h3 id="details">Details</h3> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -166,7 +166,7 @@ <h3 id="description">Description</h3> | |||
| 166 | 166 | the results to only the paths to the packages named. Note that nested | |
| 167 | 167 | packages will <em>also</em> show the paths to the specified packages. For | |
| 168 | 168 | example, running <code>npm ls promzard</code> in npm's source tree will show:</p> | |
| 169 | - <pre lang="bash"><code>npm@8.18.0 /path/to/npm | ||
| 169 | + <pre lang="bash"><code>npm@8.19.1 /path/to/npm | ||
| 170 | 170 | └─┬ init-package-json@0.0.4 | |
| 171 | 171 | └── promzard@0.1.5 | |
| 172 | 172 | </code></pre> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -344,7 +344,7 @@ <h4 id="include-workspace-root"><code>include-workspace-root</code></h4> | |||
| 344 | 344 | <!-- raw HTML omitted --> | |
| 345 | 345 | <h2 id="see-also">See Also</h2> | |
| 346 | 346 | <ul> | |
| 347 | - <li><a href="../using-npm/dependency-selector.html">dependency selector</a></li> | ||
| 347 | + <li><a href="../using-npm/dependency-selectors.html">dependency selectors</a></li> | ||
| 348 | 348 | </ul> | |
| 349 | 349 | </div> | |
| 350 | 350 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -149,7 +149,7 @@ <h2 id="table-of-contents">Table of contents</h2> | |||
| 149 | 149 | <!-- raw HTML omitted --> | |
| 150 | 150 | <!-- raw HTML omitted --> | |
| 151 | 151 | <h3 id="version">Version</h3> | |
| 152 | - <p>8.18.0</p> | ||
| 152 | + <p>8.19.1</p> | ||
| 153 | 153 | <h3 id="description">Description</h3> | |
| 154 | 154 | <p>npm is the package manager for the Node JavaScript platform. It puts | |
| 155 | 155 | modules in place so that node can find them, and manages dependency | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -142,7 +142,7 @@ <h1 id="npmrc">npmrc</h1> | |||
| 142 | 142 | ||
| 143 | 143 | <section id="table_of_contents"> | |
| 144 | 144 | <h2 id="table-of-contents">Table of contents</h2> | |
| 145 | - <div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#files">Files</a></li><ul><li><a href="#comments">Comments</a></li><li><a href="#per-project-config-file">Per-project config file</a></li><li><a href="#per-user-config-file">Per-user config file</a></li><li><a href="#global-config-file">Global config file</a></li><li><a href="#built-in-config-file">Built-in config file</a></li></ul><li><a href="#see-also">See also</a></li></ul></div> | ||
| 145 | + <div id="_table_of_contents"><ul><li><a href="#description">Description</a></li><li><a href="#files">Files</a></li><ul><li><a href="#comments">Comments</a></li><li><a href="#per-project-config-file">Per-project config file</a></li><li><a href="#per-user-config-file">Per-user config file</a></li><li><a href="#global-config-file">Global config file</a></li><li><a href="#built-in-config-file">Built-in config file</a></li></ul><li><a href="#auth-related-configuration">Auth related configuration</a></li><li><a href="#see-also">See also</a></li></ul></div> | ||
| 146 | 146 | </section> | |
| 147 | 147 | ||
| 148 | 148 | <div id="_content"><h3 id="description">Description</h3> | |
@@ -204,6 +204,29 @@ <h4 id="built-in-config-file">Built-in config file</h4> | |||
| 204 | 204 | consistent across updates. Set fields in here using the <code>./configure</code> | |
| 205 | 205 | script that comes with npm. This is primarily for distribution maintainers | |
| 206 | 206 | to override default configs in a standard and consistent manner.</p> | |
| 207 | + <h3 id="auth-related-configuration">Auth related configuration</h3> | ||
| 208 | + <p>The settings <code>_auth</code>, <code>_authToken</code>, <code>username</code> and <code>_password</code> must all be | ||
| 209 | + scoped to a specific registry. This ensures that <code>npm</code> will never send | ||
| 210 | + credentials to the wrong host.</p> | ||
| 211 | + <p>In order to scope these values, they must be prefixed by a URI fragment. | ||
| 212 | + If the credential is meant for any request to a registry on a single host, | ||
| 213 | + the scope may look like <code>//registry.npmjs.org/:</code>. If it must be scoped to a | ||
| 214 | + specific path on the host that path may also be provided, such as | ||
| 215 | + <code>//my-custom-registry.org/unique/path:</code>.</p> | ||
| 216 | + <pre><code>; bad config | ||
| 217 | + _authToken=MYTOKEN | ||
| 218 | + | ||
| 219 | + ; good config | ||
| 220 | + @myorg:registry=https://somewhere-else.com/myorg | ||
| 221 | + @another:registry=https://somewhere-else.com/another | ||
| 222 | + //registry.npmjs.org/:_authToken=MYTOKEN | ||
| 223 | + ; would apply to both @myorg and @another | ||
| 224 | + ; //somewhere-else.com/:_authToken=MYTOKEN | ||
| 225 | + ; would apply only to @myorg | ||
| 226 | + //somewhere-else.com/myorg/:_authToken=MYTOKEN1 | ||
| 227 | + ; would apply only to @another | ||
| 228 | + //somewhere-else.com/another/:_authToken=MYTOKEN2 | ||
| 229 | + </code></pre> | ||
| 207 | 230 | <h3 id="see-also">See also</h3> | |
| 208 | 231 | <ul> | |
| 209 | 232 | <li><a href="../configuring-npm/folders.html">npm folders</a></li> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -264,14 +264,14 @@ <h3 id="programmatic-usage">Programmatic Usage</h3> | |||
| 264 | 264 | const arb = new Arborist({}) | |
| 265 | 265 | </code></pre> | |
| 266 | 266 | <pre lang="js"><code>// root-level | |
| 267 | - arb.loadActual((tree) => { | ||
| 267 | + arb.loadActual().then(async (tree) => { | ||
| 268 | 268 | // query all production dependencies | |
| 269 | 269 | const results = await tree.querySelectorAll('.prod') | |
| 270 | 270 | console.log(results) | |
| 271 | 271 | }) | |
| 272 | 272 | </code></pre> | |
| 273 | 273 | <pre lang="js"><code>// iterative | |
| 274 | - arb.loadActual((tree) => { | ||
| 274 | + arb.loadActual().then(async (tree) => { | ||
| 275 | 275 | // query for the deduped version of react | |
| 276 | 276 | const results = await tree.querySelectorAll('#react:not(:deduped)') | |
| 277 | 277 | // query the deduped react for git deps | |
| Back | FazBrowse Home | New Git URL |
0 commit comments