| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,11 +11,7 @@ description: Manipulates packages cache | |||
| 11 | 11 | <!-- see lib/commands/cache.js --> | |
| 12 | 12 | ||
| 13 | 13 | ```bash | |
| 14 | - npm cache add <tarball file> | ||
| 15 | - npm cache add <folder> | ||
| 16 | - npm cache add <tarball url> | ||
| 17 | - npm cache add <git url> | ||
| 18 | - npm cache add <name>@<version> | ||
| 14 | + npm cache add <package-spec> | ||
| 19 | 15 | npm cache clean [<key>] | |
| 20 | 16 | npm cache ls [<name>@<version>] | |
| 21 | 17 | npm cache verify | |
@@ -101,6 +97,7 @@ cache`](/commands/npm-cache) | |||
| 101 | 97 | ||
| 102 | 98 | ### See Also | |
| 103 | 99 | ||
| 100 | + * [package spec](/using-npm/package-spec) | ||
| 104 | 101 | * [npm folders](/configuring-npm/folders) | |
| 105 | 102 | * [npm config](/commands/npm-config) | |
| 106 | 103 | * [npmrc](/configuring-npm/npmrc) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -133,7 +133,7 @@ will *not* run any pre- or post-scripts. | |||
| 133 | 133 | * Type: null or String | |
| 134 | 134 | ||
| 135 | 135 | The shell to use for scripts run with the `npm exec`, `npm run` and `npm | |
| 136 | - init <pkg>` commands. | ||
| 136 | + init <package-spec>` commands. | ||
| 137 | 137 | ||
| 138 | 138 | <!-- automatically generated, do not edit manually --> | |
| 139 | 139 | <!-- see lib/utils/config/definitions.js --> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ description: Deprecate a version of a package | |||
| 11 | 11 | <!-- see lib/commands/deprecate.js --> | |
| 12 | 12 | ||
| 13 | 13 | ```bash | |
| 14 | - npm deprecate <pkg>[@<version>] <message> | ||
| 14 | + npm deprecate <package-spec> <message> | ||
| 15 | 15 | ``` | |
| 16 | 16 | ||
| 17 | 17 | <!-- automatically generated, do not edit manually --> | |
@@ -45,8 +45,8 @@ In this case, a version `my-thing@1.0.0-beta.0` will also be deprecated. | |||
| 45 | 45 | You must be the package owner to deprecate something. See the `owner` and | |
| 46 | 46 | `adduser` help topics. | |
| 47 | 47 | ||
| 48 | - To un-deprecate a package, specify an empty string (`""`) for the `message` | ||
| 49 | - argument. Note that you must use double quotes with no space between them to | ||
| 48 | + To un-deprecate a package, specify an empty string (`""`) for the `message` | ||
| 49 | + argument. Note that you must use double quotes with no space between them to | ||
| 50 | 50 | format an empty string. | |
| 51 | 51 | ||
| 52 | 52 | ### Configuration | |
@@ -82,6 +82,7 @@ password, npm will prompt on the command line for one. | |||
| 82 | 82 | ||
| 83 | 83 | ### See Also | |
| 84 | 84 | ||
| 85 | + * [package spec](/using-npm/package-spec) | ||
| 85 | 86 | * [npm publish](/commands/npm-publish) | |
| 86 | 87 | * [npm registry](/using-npm/registry) | |
| 87 | 88 | * [npm owner](/commands/npm-owner) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,9 +11,9 @@ description: Modify package distribution tags | |||
| 11 | 11 | <!-- see lib/commands/dist-tag.js --> | |
| 12 | 12 | ||
| 13 | 13 | ```bash | |
| 14 | - npm dist-tag add <pkg>@<version> [<tag>] | ||
| 15 | - npm dist-tag rm <pkg> <tag> | ||
| 16 | - npm dist-tag ls [<pkg>] | ||
| 14 | + npm dist-tag add <package-spec (with version)> [<tag>] | ||
| 15 | + npm dist-tag rm <package-spec> <tag> | ||
| 16 | + npm dist-tag ls [<package-spec>] | ||
| 17 | 17 | ||
| 18 | 18 | alias: dist-tags | |
| 19 | 19 | ``` | |
@@ -27,11 +27,11 @@ alias: dist-tags | |||
| 27 | 27 | ||
| 28 | 28 | Add, remove, and enumerate distribution tags on a package: | |
| 29 | 29 | ||
| 30 | - * add: Tags the specified version of the package with the specified tag, or | ||
| 31 | - the `--tag` config if not specified. If you have two-factor | ||
| 32 | - authentication on auth-and-writes then you’ll need to include a one-time | ||
| 33 | - password on the command line with `--otp <one-time password>`, or at the | ||
| 34 | - OTP prompt. | ||
| 30 | + * add: Tags the specified version of the package with the specified tag, | ||
| 31 | + or the `--tag` config if not specified. If you have two-factor | ||
| 32 | + authentication on auth-and-writes then you’ll need to include a | ||
| 33 | + one-time password on the command line with | ||
| 34 | + `--otp <one-time password>`, or at the OTP prompt. | ||
| 35 | 35 | ||
| 36 | 36 | * rm: Clear a tag that is no longer in use from the package. If you have | |
| 37 | 37 | two-factor authentication on auth-and-writes then you’ll need to include | |
@@ -168,6 +168,7 @@ This value is not exported to the environment for child processes. | |||
| 168 | 168 | ||
| 169 | 169 | ### See Also | |
| 170 | 170 | ||
| 171 | + * [package spec](/using-npm/package-spec) | ||
| 171 | 172 | * [npm publish](/commands/npm-publish) | |
| 172 | 173 | * [npm install](/commands/npm-install) | |
| 173 | 174 | * [npm dedupe](/commands/npm-dedupe) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ description: Explain installed packages | |||
| 11 | 11 | <!-- see lib/commands/explain.js --> | |
| 12 | 12 | ||
| 13 | 13 | ```bash | |
| 14 | - npm explain <folder | specifier> | ||
| 14 | + npm explain <package-spec> | ||
| 15 | 15 | ||
| 16 | 16 | alias: why | |
| 17 | 17 | ``` | |
@@ -26,9 +26,10 @@ alias: why | |||
| 26 | 26 | This command will print the chain of dependencies causing a given package | |
| 27 | 27 | to be installed in the current project. | |
| 28 | 28 | ||
| 29 | - Positional arguments can be either folders within `node_modules`, or | ||
| 30 | - `name@version-range` specifiers, which will select the dependency | ||
| 31 | - relationships to explain. | ||
| 29 | + If one or more package specs are provided, then only packages matching | ||
| 30 | + one of the specifiers will have their relationships explained. | ||
| 31 | + | ||
| 32 | + The package spec can also refer to a folder within `./node_modules` | ||
| 32 | 33 | ||
| 33 | 34 | For example, running `npm explain glob` within npm's source tree will show: | |
| 34 | 35 | ||
@@ -110,6 +111,7 @@ This value is not exported to the environment for child processes. | |||
| 110 | 111 | ||
| 111 | 112 | ### See Also | |
| 112 | 113 | ||
| 114 | + * [package spec](/using-npm/package-spec) | ||
| 113 | 115 | * [npm config](/commands/npm-config) | |
| 114 | 116 | * [npmrc](/configuring-npm/npmrc) | |
| 115 | 117 | * [npm folders](/configuring-npm/folders) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,7 +11,7 @@ description: Retrieve funding information | |||
| 11 | 11 | <!-- see lib/commands/fund.js --> | |
| 12 | 12 | ||
| 13 | 13 | ```bash | |
| 14 | - npm fund [[<@scope>/]<pkg>] | ||
| 14 | + npm fund [<package-spec>] | ||
| 15 | 15 | ``` | |
| 16 | 16 | ||
| 17 | 17 | <!-- automatically generated, do not edit manually --> | |
@@ -23,22 +23,22 @@ npm fund [[<@scope>/]<pkg>] | |||
| 23 | 23 | ||
| 24 | 24 | This command retrieves information on how to fund the dependencies of a | |
| 25 | 25 | given project. If no package name is provided, it will list all | |
| 26 | - dependencies that are looking for funding in a tree structure, listing the | ||
| 27 | - type of funding and the url to visit. If a package name is provided then it | ||
| 28 | - tries to open its funding url using the `--browser` config param; if there | ||
| 29 | - are multiple funding sources for the package, the user will be instructed | ||
| 30 | - to pass the `--which` option to disambiguate. | ||
| 26 | + dependencies that are looking for funding in a tree structure, listing | ||
| 27 | + the type of funding and the url to visit. If a package name is provided | ||
| 28 | + then it tries to open its funding url using the `--browser` config | ||
| 29 | + param; if there are multiple funding sources for the package, the user | ||
| 30 | + will be instructed to pass the `--which` option to disambiguate. | ||
| 31 | 31 | ||
| 32 | 32 | The list will avoid duplicated entries and will stack all packages that | |
| 33 | - share the same url as a single entry. Thus, the list does not have the same | ||
| 34 | - shape of the output from `npm ls`. | ||
| 33 | + share the same url as a single entry. Thus, the list does not have the | ||
| 34 | + same shape of the output from `npm ls`. | ||
| 35 | 35 | ||
| 36 | 36 | #### Example | |
| 37 | 37 | ||
| 38 | 38 | ### Workspaces support | |
| 39 | 39 | ||
| 40 | - It's possible to filter the results to only include a single workspace and its | ||
| 41 | - dependencies using the `workspace` config option. | ||
| 40 | + It's possible to filter the results to only include a single workspace | ||
| 41 | + and its dependencies using the `workspace` config option. | ||
| 42 | 42 | ||
| 43 | 43 | #### Example: | |
| 44 | 44 | ||
@@ -58,8 +58,8 @@ test-workspaces-fund@1.0.0 | |||
| 58 | 58 | `-- bar@2.0.0 | |
| 59 | 59 | ``` | |
| 60 | 60 | ||
| 61 | - And here is an example of the expected result when filtering only by | ||
| 62 | - a specific workspace `a` in the same project: | ||
| 61 | + And here is an example of the expected result when filtering only by a | ||
| 62 | + specific workspace `a` in the same project: | ||
| 63 | 63 | ||
| 64 | 64 | ```bash | |
| 65 | 65 | $ npm fund -w a | |
@@ -156,6 +156,7 @@ If there are multiple funding sources, which 1-indexed source URL to open. | |||
| 156 | 156 | ||
| 157 | 157 | ## See Also | |
| 158 | 158 | ||
| 159 | + * [package spec](/using-npm/package-spec) | ||
| 159 | 160 | * [npm install](/commands/npm-install) | |
| 160 | 161 | * [npm docs](/commands/npm-docs) | |
| 161 | 162 | * [npm ls](/commands/npm-ls) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,9 +11,8 @@ description: Create a package.json file | |||
| 11 | 11 | <!-- see lib/commands/init.js --> | |
| 12 | 12 | ||
| 13 | 13 | ```bash | |
| 14 | - npm init [--force|-f|--yes|-y|--scope] | ||
| 14 | + npm init <package-spec> (same as `npx <package-spec>) | ||
| 15 | 15 | npm init <@scope> (same as `npx <@scope>/create`) | |
| 16 | - npm init [<@scope>/]<name> (same as `npx [<@scope>/]create-<name>`) | ||
| 17 | 16 | ||
| 18 | 17 | aliases: create, innit | |
| 19 | 18 | ``` | |
@@ -204,6 +203,39 @@ mistakes, unnecessary performance degradation, and malicious input. | |||
| 204 | 203 | If you don't have a clear idea of what you want to do, it is strongly | |
| 205 | 204 | recommended that you do not use this option! | |
| 206 | 205 | ||
| 206 | + <!-- automatically generated, do not edit manually --> | ||
| 207 | + <!-- see lib/utils/config/definitions.js --> | ||
| 208 | + | ||
| 209 | + #### `scope` | ||
| 210 | + | ||
| 211 | + * Default: the scope of the current project, if any, or "" | ||
| 212 | + * Type: String | ||
| 213 | + | ||
| 214 | + Associate an operation with a scope for a scoped registry. | ||
| 215 | + | ||
| 216 | + Useful when logging in to or out of a private registry: | ||
| 217 | + | ||
| 218 | + ``` | ||
| 219 | + # log in, linking the scope to the custom registry | ||
| 220 | + npm login --scope=@mycorp --registry=https://registry.mycorp.com | ||
| 221 | + | ||
| 222 | + # log out, removing the link and the auth token | ||
| 223 | + npm logout --scope=@mycorp | ||
| 224 | + ``` | ||
| 225 | + | ||
| 226 | + This will cause `@mycorp` to be mapped to the registry for future | ||
| 227 | + installation of packages specified according to the pattern | ||
| 228 | + `@mycorp/package`. | ||
| 229 | + | ||
| 230 | + This will also cause `npm init` to create a scoped package. | ||
| 231 | + | ||
| 232 | + ``` | ||
| 233 | + # accept all defaults, and create a package named "@foo/whatever", | ||
| 234 | + # instead of just named "whatever" | ||
| 235 | + npm init --scope=@foo --yes | ||
| 236 | + ``` | ||
| 237 | + | ||
| 238 | + | ||
| 207 | 239 | <!-- automatically generated, do not edit manually --> | |
| 208 | 240 | <!-- see lib/utils/config/definitions.js --> | |
| 209 | 241 | ||
@@ -284,6 +316,7 @@ This value is not exported to the environment for child processes. | |||
| 284 | 316 | ||
| 285 | 317 | ### See Also | |
| 286 | 318 | ||
| 319 | + * [package spec](/using-npm/package-spec) | ||
| 287 | 320 | * [init-package-json module](http://npm.im/init-package-json) | |
| 288 | 321 | * [package.json](/configuring-npm/package-json) | |
| 289 | 322 | * [npm version](/commands/npm-version) | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -79,7 +79,7 @@ will *not* run any pre- or post-scripts. | |||
| 79 | 79 | * Type: null or String | |
| 80 | 80 | ||
| 81 | 81 | The shell to use for scripts run with the `npm exec`, `npm run` and `npm | |
| 82 | - init <pkg>` commands. | ||
| 82 | + init <package-spec>` commands. | ||
| 83 | 83 | ||
| 84 | 84 | <!-- automatically generated, do not edit manually --> | |
| 85 | 85 | <!-- see lib/utils/config/definitions.js --> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,16 +11,7 @@ description: Install package(s) and run tests | |||
| 11 | 11 | <!-- see lib/commands/install-test.js --> | |
| 12 | 12 | ||
| 13 | 13 | ```bash | |
| 14 | - npm install-test [<@scope>/]<pkg> | ||
| 15 | - npm install-test [<@scope>/]<pkg>@<tag> | ||
| 16 | - npm install-test [<@scope>/]<pkg>@<version> | ||
| 17 | - npm install-test [<@scope>/]<pkg>@<version range> | ||
| 18 | - npm install-test <alias>@npm:<name> | ||
| 19 | - npm install-test <folder> | ||
| 20 | - npm install-test <tarball file> | ||
| 21 | - npm install-test <tarball url> | ||
| 22 | - npm install-test <git:// url> | ||
| 23 | - npm install-test <github username>/<github project> | ||
| 14 | + npm install-test [<package-spec> ...] | ||
| 24 | 15 | ||
| 25 | 16 | alias: it | |
| 26 | 17 | ``` | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,16 +11,7 @@ description: Install a package | |||
| 11 | 11 | <!-- see lib/commands/install.js --> | |
| 12 | 12 | ||
| 13 | 13 | ```bash | |
| 14 | - npm install [<@scope>/]<pkg> | ||
| 15 | - npm install [<@scope>/]<pkg>@<tag> | ||
| 16 | - npm install [<@scope>/]<pkg>@<version> | ||
| 17 | - npm install [<@scope>/]<pkg>@<version range> | ||
| 18 | - npm install <alias>@npm:<name> | ||
| 19 | - npm install <folder> | ||
| 20 | - npm install <tarball file> | ||
| 21 | - npm install <tarball url> | ||
| 22 | - npm install <git:// url> | ||
| 23 | - npm install <github username>/<github project> | ||
| 14 | + npm install [<package-spec> ...] | ||
| 24 | 15 | ||
| 25 | 16 | aliases: add, i, in, ins, inst, insta, instal, isnt, isnta, isntal, isntall | |
| 26 | 17 | ``` | |
| Back | FazBrowse Home | New Git URL |
0 commit comments