diff --git a/deps/npm/.npmrc b/deps/npm/.npmrc index e69de29bb2d1d6..63cd3a3b11d069 100644 --- a/deps/npm/.npmrc +++ b/deps/npm/.npmrc @@ -0,0 +1,3 @@ +; This file is automatically added by @npmcli/template-oss. Do not edit. + +package-lock=true diff --git a/deps/npm/docs/README.md b/deps/npm/docs/README.md new file mode 100644 index 00000000000000..5fc7ccf6cd60ac --- /dev/null +++ b/deps/npm/docs/README.md @@ -0,0 +1,5 @@ +# docs + +[![CI - docs](https://github.com/npm/cli/actions/workflows/ci-docs.yml/badge.svg)](https://github.com/npm/cli/actions/workflows/ci-docs.yml) + +Scripts to build the npm docs. diff --git a/deps/npm/docs/content/commands/npm-access.md b/deps/npm/docs/content/commands/npm-access.md index f7a98af6547142..bc481eac16336c 100644 --- a/deps/npm/docs/content/commands/npm-access.md +++ b/deps/npm/docs/content/commands/npm-access.md @@ -11,15 +11,13 @@ description: Set access level on published packages ```bash -npm access public [] -npm access restricted [] +npm access list packages [|| [] +npm access list collaborators [ []] +npm access get status [] +npm access set status=public|private [] +npm access set mfa=none|publish|automation [] npm access grant [] npm access revoke [] -npm access 2fa-required [] -npm access 2fa-not-required [] -npm access ls-packages [||] -npm access ls-collaborators [ []] -npm access edit [] ``` @@ -91,12 +89,17 @@ Management of teams and team memberships is done with the `npm team` command. -#### `registry` +#### `json` -* Default: "https://registry.npmjs.org/" -* Type: URL +* Default: false +* Type: Boolean -The base URL of the npm registry. +Whether or not to output JSON data, rather than the normal output. + +* In `npm pkg set` it enables parsing set values with JSON.parse() before + saving them to your `package.json`. + +Not supported by all npm commands. @@ -115,6 +118,16 @@ password, npm will prompt on the command line for one. +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + + ### See Also diff --git a/deps/npm/docs/content/commands/npm-adduser.md b/deps/npm/docs/content/commands/npm-adduser.md index 700aecb2255b27..710060f838ff79 100644 --- a/deps/npm/docs/content/commands/npm-adduser.md +++ b/deps/npm/docs/content/commands/npm-adduser.md @@ -13,7 +13,7 @@ description: Add a registry user account ```bash npm adduser -aliases: login, add-user +alias: add-user ``` @@ -25,22 +25,12 @@ Note: This command is unaware of workspaces. ### Description -Create or verify a user named `` in the specified registry, and -save the credentials to the `.npmrc` file. If no registry is specified, -the default registry will be used (see [`config`](/using-npm/config)). +Create a new user in the specified registry, and save the credentials to +the `.npmrc` file. If no registry is specified, the default registry +will be used (see [`registry`](/using-npm/registry)). -The username, password, and email are read in from prompts. - -To reset your password, go to - -To change your email address, go to - -You may use this command multiple times with the same user account to -authorize on a new machine. When authenticating on a new machine, -the username, password and email address must all match with -your existing record. - -`npm login` is an alias to `adduser` and behaves exactly the same way. +When using `legacy` for your `auth-type`, the username, password, and +email are read in from prompts. ### Configuration @@ -92,11 +82,8 @@ npm init --scope=@foo --yes #### `auth-type` -* Default: "legacy" -* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn" - -NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be -removed in a future version. +* Default: "web" +* Type: "legacy" or "web" What authentication strategy to use with `login`. diff --git a/deps/npm/docs/content/commands/npm-audit.md b/deps/npm/docs/content/commands/npm-audit.md index 48e0a3161e8f2c..dda1c31c864c44 100644 --- a/deps/npm/docs/content/commands/npm-audit.md +++ b/deps/npm/docs/content/commands/npm-audit.md @@ -109,9 +109,9 @@ the path `/-/npm/v1/security/advisories/bulk`. Any packages in the tree that do not have a `version` field in their package.json file will be ignored. If any `--omit` options are specified -(either via the `--omit` config, or one of the shorthands such as -`--production`, `--only=dev`, and so on), then packages will be omitted -from the submitted payload as appropriate. +(either via the [`--omit` config](/using-npm/config#omit), or one of the +shorthands such as `--production`, `--only=dev`, and so on), then packages will +be omitted from the submitted payload as appropriate. If the registry responds with an error, or with an invalid response, then npm will attempt to load advisory data from the `Quick Audit` endpoint. @@ -188,7 +188,7 @@ vulnerabilities are found _or_ if the remediation is able to successfully fix all vulnerabilities. If vulnerabilities were found the exit code will depend on the -`audit-level` configuration setting. +[`audit-level` config](/using-npm/config#audit-level). ### Examples @@ -453,7 +453,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-bugs.md b/deps/npm/docs/content/commands/npm-bugs.md index 6b45f1f18ac660..af52548389c925 100644 --- a/deps/npm/docs/content/commands/npm-bugs.md +++ b/deps/npm/docs/content/commands/npm-bugs.md @@ -25,8 +25,9 @@ alias: issues This command tries to guess at the likely location of a package's bug tracker URL or the `mailto` URL of the support email, and then tries to -open it using the `--browser` config param. If no package name is provided, it -will search for a `package.json` in the current folder and use the `name` property. +open it using the [`--browser` config](/using-npm/config#browser) param. If no +package name is provided, it will search for a `package.json` in the current +folder and use the `name` property. ### Configuration diff --git a/deps/npm/docs/content/commands/npm-ci.md b/deps/npm/docs/content/commands/npm-ci.md index 3ecd7c6efb0957..af6fc7fcc94e83 100644 --- a/deps/npm/docs/content/commands/npm-ci.md +++ b/deps/npm/docs/content/commands/npm-ci.md @@ -361,7 +361,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-config.md b/deps/npm/docs/content/commands/npm-config.md index 28c6003571de5f..6e0c0b682d7242 100644 --- a/deps/npm/docs/content/commands/npm-config.md +++ b/deps/npm/docs/content/commands/npm-config.md @@ -35,7 +35,7 @@ variables, `npmrc` files, and in some cases, the `package.json` file. See [npmrc](/configuring-npm/npmrc) for more information about the npmrc files. -See [config(7)](/using-npm/config) for a more thorough explanation of the +See [config](/using-npm/config) for a more thorough explanation of the mechanisms involved, and a full list of config options available. The `npm config` command can be used to update and edit the contents diff --git a/deps/npm/docs/content/commands/npm-dedupe.md b/deps/npm/docs/content/commands/npm-dedupe.md index 570e018342f276..da9f406d570243 100644 --- a/deps/npm/docs/content/commands/npm-dedupe.md +++ b/deps/npm/docs/content/commands/npm-dedupe.md @@ -308,7 +308,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-dist-tag.md b/deps/npm/docs/content/commands/npm-dist-tag.md index 123e67dbf3b235..e505fba36414b4 100644 --- a/deps/npm/docs/content/commands/npm-dist-tag.md +++ b/deps/npm/docs/content/commands/npm-dist-tag.md @@ -28,8 +28,8 @@ alias: dist-tags Add, remove, and enumerate distribution tags on a package: * add: Tags the specified version of the package with the specified tag, - or the `--tag` config if not specified. If you have two-factor - authentication on auth-and-writes then you’ll need to include a + or the [`--tag` config](/using-npm/config#tag) if not specified. If you have + two-factor authentication on auth-and-writes then you’ll need to include a one-time password on the command line with `--otp `, or at the OTP prompt. diff --git a/deps/npm/docs/content/commands/npm-docs.md b/deps/npm/docs/content/commands/npm-docs.md index 790d563bdb1fb7..e48695ced005af 100644 --- a/deps/npm/docs/content/commands/npm-docs.md +++ b/deps/npm/docs/content/commands/npm-docs.md @@ -24,10 +24,10 @@ alias: home ### Description This command tries to guess at the likely location of a package's -documentation URL, and then tries to open it using the `--browser` config -param. You can pass multiple package names at once. If no package name is -provided, it will search for a `package.json` in the current folder and use -the `name` property. +documentation URL, and then tries to open it using the +[`--browser` config](/using-npm/config#browser) param. You can pass multiple +package names at once. If no package name is provided, it will search for a +`package.json` in the current folder and use the `name` property. ### Configuration diff --git a/deps/npm/docs/content/commands/npm-exec.md b/deps/npm/docs/content/commands/npm-exec.md index 3d8de1ea54ad6f..7a66fbc27eb086 100644 --- a/deps/npm/docs/content/commands/npm-exec.md +++ b/deps/npm/docs/content/commands/npm-exec.md @@ -240,7 +240,8 @@ $ npx -c 'eslint && say "hooray, lint passed"' ### Workspaces support -You may use the `workspace` or `workspaces` configs in order to run an +You may use the [`workspace`](/using-npm/config#workspace) or +[`workspaces`](/using-npm/config#workspaces) configs in order to run an arbitrary command from an npm package (either one installed locally, or fetched remotely) in the context of the specified workspaces. If no positional argument or `--call` option is provided, it will open an @@ -271,9 +272,9 @@ Assuming the workspace configuration is properly set up at the root level ``` You can execute an arbitrary command from a package in the context of each of -the configured workspaces when using the `workspaces` configuration options, -in this example we're using **eslint** to lint any js file found within each -workspace folder: +the configured workspaces when using the +[`workspaces` config options](/using-npm/config#workspace), in this example +we're using **eslint** to lint any js file found within each workspace folder: ``` npm exec --ws -- eslint ./*.js diff --git a/deps/npm/docs/content/commands/npm-find-dupes.md b/deps/npm/docs/content/commands/npm-find-dupes.md index 4da6c296c6bf6d..590c7e2cbd4385 100644 --- a/deps/npm/docs/content/commands/npm-find-dupes.md +++ b/deps/npm/docs/content/commands/npm-find-dupes.md @@ -232,7 +232,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-fund.md b/deps/npm/docs/content/commands/npm-fund.md index 8db0ce910de967..53100f6716537b 100644 --- a/deps/npm/docs/content/commands/npm-fund.md +++ b/deps/npm/docs/content/commands/npm-fund.md @@ -25,9 +25,10 @@ This command retrieves information on how to fund the dependencies of a given project. If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit. If a package name is provided -then it tries to open its funding url using the `--browser` config -param; if there are multiple funding sources for the package, the user -will be instructed to pass the `--which` option to disambiguate. +then it tries to open its funding url using the +[`--browser` config](/using-npm/config#browser) param; if there are multiple +funding sources for the package, the user will be instructed to pass the +`--which` option to disambiguate. The list will avoid duplicated entries and will stack all packages that share the same url as a single entry. Thus, the list does not have the @@ -38,7 +39,8 @@ same shape of the output from `npm ls`. ### Workspaces support It's possible to filter the results to only include a single workspace -and its dependencies using the `workspace` config option. +and its dependencies using the +[`workspace` config](/using-npm/config#workspace) option. #### Example: diff --git a/deps/npm/docs/content/commands/npm-install-ci-test.md b/deps/npm/docs/content/commands/npm-install-ci-test.md index b886f8ab9599ad..784efdcf46e95b 100644 --- a/deps/npm/docs/content/commands/npm-install-ci-test.md +++ b/deps/npm/docs/content/commands/npm-install-ci-test.md @@ -307,7 +307,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-install-test.md b/deps/npm/docs/content/commands/npm-install-test.md index d27686e731ce16..ec69e081f9dee5 100644 --- a/deps/npm/docs/content/commands/npm-install-test.md +++ b/deps/npm/docs/content/commands/npm-install-test.md @@ -308,7 +308,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-install.md b/deps/npm/docs/content/commands/npm-install.md index 35e0df22777336..7abb5ca16f9fcc 100644 --- a/deps/npm/docs/content/commands/npm-install.md +++ b/deps/npm/docs/content/commands/npm-install.md @@ -127,7 +127,7 @@ into a tarball (b). * `npm install [<@scope>/]`: Do a `@` install, where `` is the "tag" config. (See - [`config`](/using-npm/config). The config's default value is `latest`.) + [`config`](/using-npm/config#tag). The config's default value is `latest`.) In most cases, this will install the version of the modules tagged as `latest` on the npm registry. @@ -698,7 +698,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-link.md b/deps/npm/docs/content/commands/npm-link.md index 8c1b422493bd57..fd6eb69e9b03cd 100644 --- a/deps/npm/docs/content/commands/npm-link.md +++ b/deps/npm/docs/content/commands/npm-link.md @@ -384,7 +384,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-login.md b/deps/npm/docs/content/commands/npm-login.md new file mode 100644 index 00000000000000..a3772dc882a9d3 --- /dev/null +++ b/deps/npm/docs/content/commands/npm-login.md @@ -0,0 +1,110 @@ +--- +title: npm-login +section: 1 +description: Login to a registry user account +--- + +### Synopsis + + + + + +```bash +npm login +``` + + + + + + +Note: This command is unaware of workspaces. + +### Description + +Verify a user in the specified registry, and save the credentials to the +`.npmrc` file. If no registry is specified, the default registry will be +used (see [`config`](/using-npm/config)). + +When using `legacy` for your `auth-type`, the username and password, are +read in from prompts. + +To reset your password, go to + +To change your email address, go to + +You may use this command multiple times with the same user account to +authorize on a new machine. When authenticating on a new machine, +the username, password and email address must all match with +your existing record. + +### Configuration + + + + +#### `registry` + +* Default: "https://registry.npmjs.org/" +* Type: URL + +The base URL of the npm registry. + + + + +#### `scope` + +* Default: the scope of the current project, if any, or "" +* Type: String + +Associate an operation with a scope for a scoped registry. + +Useful when logging in to or out of a private registry: + +``` +# log in, linking the scope to the custom registry +npm login --scope=@mycorp --registry=https://registry.mycorp.com + +# log out, removing the link and the auth token +npm logout --scope=@mycorp +``` + +This will cause `@mycorp` to be mapped to the registry for future +installation of packages specified according to the pattern +`@mycorp/package`. + +This will also cause `npm init` to create a scoped package. + +``` +# accept all defaults, and create a package named "@foo/whatever", +# instead of just named "whatever" +npm init --scope=@foo --yes +``` + + + + + +#### `auth-type` + +* Default: "web" +* Type: "legacy" or "web" + +What authentication strategy to use with `login`. + + + + + + +### See Also + +* [npm registry](/using-npm/registry) +* [npm config](/commands/npm-config) +* [npmrc](/configuring-npm/npmrc) +* [npm owner](/commands/npm-owner) +* [npm whoami](/commands/npm-whoami) +* [npm token](/commands/npm-token) +* [npm profile](/commands/npm-profile) diff --git a/deps/npm/docs/content/commands/npm-ls.md b/deps/npm/docs/content/commands/npm-ls.md index a7936fafc72a2c..bb7fd5cc06f790 100644 --- a/deps/npm/docs/content/commands/npm-ls.md +++ b/deps/npm/docs/content/commands/npm-ls.md @@ -287,7 +287,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-pkg.md b/deps/npm/docs/content/commands/npm-pkg.md index deff7e82c694dd..32772ae080a8bb 100644 --- a/deps/npm/docs/content/commands/npm-pkg.md +++ b/deps/npm/docs/content/commands/npm-pkg.md @@ -153,7 +153,8 @@ Returned values are always in **json** format. ### Workspaces support You can set/get/delete items across your configured workspaces by using the -`workspace` or `workspaces` config options. +[`workspace`](/using-npm/config#workspace) or +[`workspaces`](/using-npm/config#workspaces) config options. For example, setting a `funding` value across all configured workspaces of a project: diff --git a/deps/npm/docs/content/commands/npm-prune.md b/deps/npm/docs/content/commands/npm-prune.md index 28f02f6add1908..064b0e07e4e7a8 100644 --- a/deps/npm/docs/content/commands/npm-prune.md +++ b/deps/npm/docs/content/commands/npm-prune.md @@ -193,7 +193,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-publish.md b/deps/npm/docs/content/commands/npm-publish.md index 536d04988e6849..0c1b777c881bbe 100644 --- a/deps/npm/docs/content/commands/npm-publish.md +++ b/deps/npm/docs/content/commands/npm-publish.md @@ -118,19 +118,19 @@ tarball that will be compared with the local files by default. #### `access` -* Default: 'restricted' for scoped packages, 'public' for unscoped packages +* Default: 'public' for new packages, existing packages it will not change the + current level * Type: null, "restricted", or "public" -When publishing scoped packages, the access level defaults to `restricted`. -If you want your scoped package to be publicly viewable (and installable) -set `--access=public`. The only valid values for `access` are `public` and -`restricted`. Unscoped packages _always_ have an access level of `public`. +If do not want your scoped package to be publicly viewable (and installable) +set `--access=restricted`. -Note: Using the `--access` flag on the `npm publish` command will only set -the package access level on the initial publish of the package. Any -subsequent `npm publish` commands using the `--access` flag will not have an -effect to the access level. To make changes to the access level after the -initial publish use `npm access`. +Unscoped packages can not be set to `restricted`. + +Note: This defaults to not changing the current access level for existing +packages. Specifying a value of `restricted` or `public` during publish will +change the access for an existing package the same way that `npm access set +status` would. diff --git a/deps/npm/docs/content/commands/npm-rebuild.md b/deps/npm/docs/content/commands/npm-rebuild.md index 6a396421213d3d..89fbd763555a04 100644 --- a/deps/npm/docs/content/commands/npm-rebuild.md +++ b/deps/npm/docs/content/commands/npm-rebuild.md @@ -163,7 +163,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-repo.md b/deps/npm/docs/content/commands/npm-repo.md index fc540a9382b235..4d69a922c63a9e 100644 --- a/deps/npm/docs/content/commands/npm-repo.md +++ b/deps/npm/docs/content/commands/npm-repo.md @@ -22,9 +22,10 @@ npm repo [ [ ...]] ### Description This command tries to guess at the likely location of a package's -repository URL, and then tries to open it using the `--browser` config -param. If no package name is provided, it will search for a `package.json` -in the current folder and use the `repository` property. +repository URL, and then tries to open it using the +[`--browser` config](/using-npm/config#browser) param. If no package name is +provided, it will search for a `package.json` in the current folder and use the +`repository` property. ### Configuration diff --git a/deps/npm/docs/content/commands/npm-run-script.md b/deps/npm/docs/content/commands/npm-run-script.md index f606ec6bf59e5e..a68b9b65dcd4f2 100644 --- a/deps/npm/docs/content/commands/npm-run-script.md +++ b/deps/npm/docs/content/commands/npm-run-script.md @@ -68,7 +68,8 @@ The actual shell your script is run within is platform dependent. By default, on Unix-like systems it is the `/bin/sh` command, on Windows it is `cmd.exe`. The actual shell referred to by `/bin/sh` also depends on the system. -You can customize the shell with the `script-shell` configuration. +You can customize the shell with the +[`script-shell` config](/using-npm/config#script-shell). Scripts are run from the root of the package folder, regardless of what the current working directory is when `npm run` is called. If you want your @@ -85,7 +86,8 @@ forgotten. ### Workspaces support -You may use the `workspace` or `workspaces` configs in order to run an +You may use the [`workspace`](/using-npm/config#workspace) or +[`workspaces`](/using-npm/config#workspaces) configs in order to run an arbitrary command from a package's `"scripts"` object in the context of the specified workspaces. If no `"command"` is provided, it will list the available scripts for each of these configured workspaces. @@ -114,7 +116,8 @@ Assuming the workspace configuration is properly set up at the root level ``` And that each of the configured workspaces has a configured `test` script, -we can run tests in all of them using the `workspaces` config: +we can run tests in all of them using the +[`workspaces` config](/using-npm/config#workspaces): ``` npm test --workspaces diff --git a/deps/npm/docs/content/commands/npm-uninstall.md b/deps/npm/docs/content/commands/npm-uninstall.md index e39c7e328b20ad..bea7112ae57191 100644 --- a/deps/npm/docs/content/commands/npm-uninstall.md +++ b/deps/npm/docs/content/commands/npm-uninstall.md @@ -147,7 +147,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-update.md b/deps/npm/docs/content/commands/npm-update.md index 421d04ca3dc583..5e21bdeebbb99c 100644 --- a/deps/npm/docs/content/commands/npm-update.md +++ b/deps/npm/docs/content/commands/npm-update.md @@ -24,9 +24,9 @@ aliases: up, upgrade, udpate ### Description This command will update all the packages listed to the latest version -(specified by the `tag` config), respecting the semver constraints of -both your package and its dependencies (if they also require the same -package). +(specified by the [`tag` config](/using-npm/config#tag)), respecting the semver +constraints of both your package and its dependencies (if they also require the +same package). It will also install missing packages. @@ -435,7 +435,7 @@ This value is not exported to the environment for child processes. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/content/commands/npm-version.md b/deps/npm/docs/content/commands/npm-version.md index 8e3334d7889848..3c6b24d7d9ad81 100644 --- a/deps/npm/docs/content/commands/npm-version.md +++ b/deps/npm/docs/content/commands/npm-version.md @@ -192,18 +192,18 @@ disabled on the command line by running `npm --no-git-tag-version version`. It will fail if the working directory is not clean, unless the `-f` or `--force` flag is set. -If supplied with `-m` or `--message` config option, npm will use it as a -commit message when creating a version commit. If the `message` config -contains `%s` then that will be replaced with the resulting version number. -For example: +If supplied with `-m` or [`--message` config](/using-npm/config#message) option, +npm will use it as a commit message when creating a version commit. If the +`message` config contains `%s` then that will be replaced with the resulting +version number. For example: ```bash npm version patch -m "Upgrade to %s for reasons" ``` -If the `sign-git-tag` config is set, then the tag will be signed using the -`-s` flag to git. Note that you must have a default GPG key set up in your -git config for this to work properly. For example: +If the [`sign-git-tag` config](/using-npm/config#sign-git-tag) is set, then the +tag will be signed using the `-s` flag to git. Note that you must have a default +GPG key set up in your git config for this to work properly. For example: ```bash $ npm config set sign-git-tag true diff --git a/deps/npm/docs/content/commands/npm-view.md b/deps/npm/docs/content/commands/npm-view.md index d9d1daac0cda7d..9e07619c204cff 100644 --- a/deps/npm/docs/content/commands/npm-view.md +++ b/deps/npm/docs/content/commands/npm-view.md @@ -72,6 +72,12 @@ contributor in the list, you can run: npm view express contributors[0].email ``` +If the field value you are querying for is a property of an object, you should run: + +```bash +npm view express time'[4.8.0]' +``` + Multiple fields may be specified, and will be printed one after another. For example, to get all the contributor names and email addresses, you can do this: diff --git a/deps/npm/docs/content/configuring-npm/folders.md b/deps/npm/docs/content/configuring-npm/folders.md index 5bab80ec169c5c..aa1c5738e3a4e0 100644 --- a/deps/npm/docs/content/configuring-npm/folders.md +++ b/deps/npm/docs/content/configuring-npm/folders.md @@ -22,10 +22,10 @@ This document will tell you what it puts where. #### prefix Configuration -The `prefix` config defaults to the location where node is installed. -On most systems, this is `/usr/local`. On Windows, it's `%AppData%\npm`. -On Unix systems, it's one level up, since node is typically installed at -`{prefix}/bin/node` rather than `{prefix}/node.exe`. +The [`prefix` config](/using-npm/config#prefix) defaults to the location where +node is installed. On most systems, this is `/usr/local`. On Windows, it's +`%AppData%\npm`. On Unix systems, it's one level up, since node is typically +installed at `{prefix}/bin/node` rather than `{prefix}/node.exe`. When the `global` flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the @@ -74,13 +74,13 @@ Man pages are not installed on Windows systems. See [`npm cache`](/commands/npm-cache). Cache files are stored in `~/.npm` on Posix, or `%AppData%/npm-cache` on Windows. -This is controlled by the `cache` configuration param. +This is controlled by the [`cache` config](/using-npm/config#cache) param. #### Temp Files Temporary files are stored by default in the folder specified by the -`tmp` config, which defaults to the TMPDIR, TMP, or TEMP environment -variables, or `/tmp` on Unix and `c:\windows\temp` on Windows. +[`tmp` config](/using-npm/config#tmp), which defaults to the TMPDIR, TMP, or +TEMP environment variables, or `/tmp` on Unix and `c:\windows\temp` on Windows. Temp files are given a unique folder under this root for each run of the program, and are deleted upon successful exit. @@ -111,7 +111,7 @@ be found by npm scripts when necessary. #### Global Installation -If the `global` configuration is set to true, then npm will +If the [`global` config](/using-npm/config#global) is set to true, then npm will install packages "globally". For global installation, packages are installed roughly the same way, diff --git a/deps/npm/docs/content/configuring-npm/package-json.md b/deps/npm/docs/content/configuring-npm/package-json.md index 5b4acf187f7772..0abaad2c1ff7f0 100644 --- a/deps/npm/docs/content/configuring-npm/package-json.md +++ b/deps/npm/docs/content/configuring-npm/package-json.md @@ -339,12 +339,14 @@ install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.) To use this, supply a `bin` field in your package.json which is a map of -command name to local file name. When this package is installed -globally, that file will be linked where global bins go so it is -available to run by name. When this package is installed as a -dependency in another package, the file will be linked where it will be -available to that package either directly by `npm exec` or by name in other -scripts when invoking them via `npm run-script`. +command name to local file name. When this package is installed globally, +that file will be either linked inside the global bins directory or +a cmd (Windows Command File) will be created which executes the specified +file in the `bin` field, so it is available to run by `name` or `name.cmd` (on +Windows PowerShell). When this package is installed as a dependency in another +package, the file will be linked where it will be available to that package +either directly by `npm exec` or by name in other scripts when invoking them +via `npm run-script`. For example, myapp could have this: @@ -357,8 +359,10 @@ For example, myapp could have this: } ``` -So, when you install myapp, it'll create a symlink from the `cli.js` script -to `/usr/local/bin/myapp`. +So, when you install myapp, in case of unix-like OS it'll create a symlink +from the `cli.js` script to `/usr/local/bin/myapp` and in case of windows it +will create a cmd file usually at `C:\Users\{Username}\AppData\Roaming\npm\myapp.cmd` +which runs the `cli.js` script. If you have a single executable, and its name should be the name of the package, then you can just supply it as a string. For example: @@ -1028,9 +1032,10 @@ capable of properly installing your program. For example: } ``` -Unless the user has set the `engine-strict` config flag, this field is -advisory only and will only produce warnings when your package is installed -as a dependency. +Unless the user has set the +[`engine-strict` config](/using-npm/config#engine-strict) flag, this field is +advisory only and will only produce warnings when your package is installed as a +dependency. ### os diff --git a/deps/npm/docs/content/using-npm/config.md b/deps/npm/docs/content/using-npm/config.md index cd13237f34dd38..e5d9d081feb4a6 100644 --- a/deps/npm/docs/content/using-npm/config.md +++ b/deps/npm/docs/content/using-npm/config.md @@ -151,19 +151,19 @@ safer to use a registry-provided authentication bearer token stored in the #### `access` -* Default: 'restricted' for scoped packages, 'public' for unscoped packages +* Default: 'public' for new packages, existing packages it will not change the + current level * Type: null, "restricted", or "public" -When publishing scoped packages, the access level defaults to `restricted`. -If you want your scoped package to be publicly viewable (and installable) -set `--access=public`. The only valid values for `access` are `public` and -`restricted`. Unscoped packages _always_ have an access level of `public`. +If do not want your scoped package to be publicly viewable (and installable) +set `--access=restricted`. -Note: Using the `--access` flag on the `npm publish` command will only set -the package access level on the initial publish of the package. Any -subsequent `npm publish` commands using the `--access` flag will not have an -effect to the access level. To make changes to the access level after the -initial publish use `npm access`. +Unscoped packages can not be set to `restricted`. + +Note: This defaults to not changing the current access level for existing +packages. Specifying a value of `restricted` or `public` during publish will +change the access for an existing package the same way that `npm access set +status` would. @@ -217,11 +217,8 @@ exit code. #### `auth-type` -* Default: "legacy" -* Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn" - -NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be -removed in a future version. +* Default: "web" +* Type: "legacy" or "web" What authentication strategy to use with `login`. @@ -910,7 +907,7 @@ number, if not already set in package.json. #### `install-links` -* Default: false +* Default: true * Type: Boolean When set file: protocol dependencies that exist outside of the project root @@ -1710,12 +1707,11 @@ particular, use care when overriding this setting for public packages. * Default: false * Type: Boolean -If true, writes a debug log to `logs-dir` and timing information to -`_timing.json` in the cache, even if the command completes successfully. -`_timing.json` is a newline delimited list of JSON objects. +If true, writes timing information to a process specific json file in the +cache or `logs-dir`. The file name ends with `-timing.json`. You can quickly view it with this [json](https://npm.im/json) command line: -`npm exec -- json -g < ~/.npm/_timing.json`. +`cat ~/.npm/_logs/*-timing.json | npm exec -- json -g`. @@ -2084,31 +2080,6 @@ Alias for --package-lock -#### `sso-poll-frequency` - -* Default: 500 -* Type: Number -* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a - future version of npm in favor of web-based login. - -When used with SSO-enabled `auth-type`s, configures how regularly the -registry should be polled while the user is completing authentication. - - - - -#### `sso-type` - -* Default: "oauth" -* Type: null, "oauth", or "saml" -* DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a - future version of npm in favor of web-based login. - -If `--auth-type=sso`, the type of SSO type to use. - - - - #### `tmp` * Default: The value returned by the Node.js `os.tmpdir()` method diff --git a/deps/npm/docs/content/using-npm/dependency-selectors.md b/deps/npm/docs/content/using-npm/dependency-selectors.md index a9433a537f985c..5fb20bad5f80fb 100644 --- a/deps/npm/docs/content/using-npm/dependency-selectors.md +++ b/deps/npm/docs/content/using-npm/dependency-selectors.md @@ -58,9 +58,48 @@ The [`npm query`](/commands/npm-query) commmand exposes a new dependency selecto - `:extraneous` when a dependency exists but is not defined as a dependency of any node - `:invalid` when a dependency version is out of its ancestors specified range - `:missing` when a dependency is not found on disk -- `:semver()` matching a valid [`node-semver`](https://github.com/npm/node-semver) spec +- `:semver(, [selector], [function])` match a valid [`node-semver`](https://github.com/npm/node-semver) version or range to a selector - `:path()` [glob](https://www.npmjs.com/package/glob) matching based on dependencies path relative to the project - `:type()` [based on currently recognized types](https://github.com/npm/npm-package-arg#result-object) +- `:outdated()` when a dependency is outdated + +##### `:semver(, [selector], [function])` + +The `:semver()` pseudo selector allows comparing fields from each node's `package.json` using [semver](https://github.com/npm/node-semver#readme) methods. It accepts up to 3 parameters, all but the first of which are optional. + +- `spec` a semver version or range +- `selector` an attribute selector for each node (default `[version]`) +- `function` a semver method to apply, one of: `satisfies`, `intersects`, `subset`, `gt`, `gte`, `gtr`, `lt`, `lte`, `ltr`, `eq`, `neq` or the special function `infer` (default `infer`) + +When the special `infer` function is used the `spec` and the actual value from the node are compared. If both are versions, according to `semver.valid()`, `eq` is used. If both values are ranges, according to `!semver.valid()`, `intersects` is used. If the values are mixed types `satisfies` is used. + +Some examples: + +- `:semver(^1.0.0)` returns every node that has a `version` satisfied by the provided range `^1.0.0` +- `:semver(16.0.0, :attr(engines, [node]))` returns every node which has an `engines.node` property satisfying the version `16.0.0` +- `:semver(1.0.0, [version], lt)` every node with a `version` less than `1.0.0` + +##### `:outdated()` + +The `:outdated` pseudo selector retrieves data from the registry and returns information about which of your dependencies are outdated. The type parameter may be one of the following: + +- `any` (default) a version exists that is greater than the current one +- `in-range` a version exists that is greater than the current one, and satisfies at least one if its dependents +- `out-of-range` a version exists that is greater than the current one, does not satisfy at least one of its dependents +- `major` a version exists that is a semver major greater than the current one +- `minor` a version exists that is a semver minor greater than the current one +- `patch` a version exists that is a semver patch greater than the current one + +In addition to the filtering performed by the pseudo selector, some extra data is added to the resulting objects. The following data can be found under the `queryContext` property of each node. + +- `versions` an array of every available version of the given node +- `outdated.inRange` an array of objects, each with a `from` and `versions`, where `from` is the on-disk location of the node that depends on the current node and `versions` is an array of all available versions that satisfies that dependency. This is only populated if `:outdated(in-range)` is used. +- `outdated.outOfRange` an array of objects, identical in shape to `inRange`, but where the `versions` array is every available version that does not satisfy the dependency. This is only populated if `:outdated(out-of-range)` is used. + +Some examples: + +- `:root > :outdated(major)` returns every direct dependency that has a new semver major release +- `.prod:outdated(in-range)` returns production dependencies that have a new release that satisfies at least one of its edges in #### [Attribute Selectors](https://developer.mozilla.org/en-US/docs/Web/CSS/Attribute_selectors) diff --git a/deps/npm/docs/content/using-npm/logging.md b/deps/npm/docs/content/using-npm/logging.md index eb83b167e698b1..e52c19004d5426 100644 --- a/deps/npm/docs/content/using-npm/logging.md +++ b/deps/npm/docs/content/using-npm/logging.md @@ -12,8 +12,7 @@ The `npm` CLI has various mechanisms for showing different levels of information All logs are written to a debug log, with the path to that file printed if the execution of a command fails. -The default location of the logs directory is a directory named `_logs` inside the npm cache. This can be changed -with the `logs-dir` config option. +The default location of the logs directory is a directory named `_logs` inside the npm cache. This can be changed with the `logs-dir` config option. Log files will be removed from the `logs-dir` when the number of log files exceeds `logs-max`, with the oldest logs being deleted first. @@ -58,12 +57,14 @@ The `npm` CLI began hiding the output of lifecycle scripts for `npm install` as ### Timing Information -The `--timing` config can be set which does two things: +The [`--timing` config](/using-npm/config#timing) can be set which does two +things: 1. Always shows the full path to the debug log regardless of command exit status -1. Write timing information to a timing file in the cache or `logs-dir` +1. Write timing information to a process specific timing file in the cache or `logs-dir` -This file is a newline delimited list of JSON objects that can be inspected to see timing data for each task in a `npm` CLI run. +This file contains a `timers` object where the keys are an identifier for the +portion of the process being timed and the value is the number of milliseconds it took to complete. ### Registry Response Headers diff --git a/deps/npm/docs/content/using-npm/package-spec.md b/deps/npm/docs/content/using-npm/package-spec.md index 0d3741018f036f..1ace780019fb3a 100644 --- a/deps/npm/docs/content/using-npm/package-spec.md +++ b/deps/npm/docs/content/using-npm/package-spec.md @@ -101,6 +101,6 @@ Examples: ### See also -[npm-package-arg](https://npm.im/npm-package-arg) -[scope](/using-npm/scope) -[config](/using-npm/config) +* [npm-package-arg](https://npm.im/npm-package-arg) +* [scope](/using-npm/scope) +* [config](/using-npm/config) diff --git a/deps/npm/docs/content/using-npm/registry.md b/deps/npm/docs/content/using-npm/registry.md index 4a265db03f0799..5fab60ff4d49c1 100644 --- a/deps/npm/docs/content/using-npm/registry.md +++ b/deps/npm/docs/content/using-npm/registry.md @@ -26,9 +26,11 @@ The npm public registry is powered by a CouchDB database, of which there is a public mirror at . The registry URL used is determined by the scope of the package (see -[`scope`](/using-npm/scope). If no scope is specified, the default registry is used, which is -supplied by the `registry` config parameter. See [`npm config`](/commands/npm-config), -[`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on managing npm's configuration. +[`scope`](/using-npm/scope). If no scope is specified, the default registry is +used, which is supplied by the [`registry` config](/using-npm/config#registry) +parameter. See [`npm config`](/commands/npm-config), +[`npmrc`](/configuring-npm/npmrc), and [`config`](/using-npm/config) for more on +managing npm's configuration. When the default registry is used in a package-lock or shrinkwrap is has the special meaning of "the currently configured registry". If you create a lock @@ -69,7 +71,7 @@ to force it to be published only to your internal/private registry. See [`package.json`](/configuring-npm/package-json) for more info on what goes in the package.json file. -### Where can I find my own, & other's, published packages? +### Where can I find my (and others') published packages? diff --git a/deps/npm/docs/content/using-npm/scripts.md b/deps/npm/docs/content/using-npm/scripts.md index 2e0a5d1a95e14d..9bc2bf32fe4ff7 100644 --- a/deps/npm/docs/content/using-npm/scripts.md +++ b/deps/npm/docs/content/using-npm/scripts.md @@ -42,12 +42,10 @@ situations. These scripts happen in addition to the `pre`, `post`, * `prepare`, `prepublish`, `prepublishOnly`, `prepack`, `postpack`, `dependencies` **prepare** (since `npm@4.0.0`) -* Runs any time before the package is packed, i.e. during `npm publish` +* Runs BEFORE the package is packed, i.e. during `npm publish` and `npm pack` -* Runs BEFORE the package is packed -* Runs BEFORE the package is published * Runs on local `npm install` without any arguments -* Run AFTER `prepublish`, but BEFORE `prepublishOnly` +* Runs AFTER `prepublish`, but BEFORE `prepublishOnly` * NOTE: If a package being installed through git contains a `prepare` script, its `dependencies` and `devDependencies` will be installed, and diff --git a/deps/npm/docs/output/commands/npm-access.html b/deps/npm/docs/output/commands/npm-access.html index 57d17abbd8f0fc..52415e586aa236 100644 --- a/deps/npm/docs/output/commands/npm-access.html +++ b/deps/npm/docs/output/commands/npm-access.html @@ -142,22 +142,20 @@

npm-access

Table of contents

- +

Synopsis

-
npm access public [<package>]
-npm access restricted [<package>]
+
npm access list packages [<user>|<scope>|<scope:team> [<package>]
+npm access list collaborators [<package> [<user>]]
+npm access get status [<package>]
+npm access set status=public|private [<package>]
+npm access set mfa=none|publish|automation [<package>]
 npm access grant <read-only|read-write> <scope:team> [<package>]
 npm access revoke <scope:team> [<package>]
-npm access 2fa-required [<package>]
-npm access 2fa-not-required [<package>]
-npm access ls-packages [<user>|<scope>|<scope:team>]
-npm access ls-collaborators [<package> [<user>]]
-npm access edit [<package>]
 
@@ -223,12 +221,17 @@

Configuration

-

registry

+

json

-

The base URL of the npm registry.

+

Whether or not to output JSON data, rather than the normal output.

+
    +
  • In npm pkg set it enables parsing set values with JSON.parse() before +saving them to your package.json.
  • +
+

Not supported by all npm commands.

otp

@@ -242,6 +245,14 @@

otp

password, npm will prompt on the command line for one.

+

registry

+ +

The base URL of the npm registry.

+ +

See Also

    diff --git a/deps/npm/docs/output/commands/npm-adduser.html b/deps/npm/docs/output/commands/npm-adduser.html index d084a5e1f2deaf..eb4740a3ec5605 100644 --- a/deps/npm/docs/output/commands/npm-adduser.html +++ b/deps/npm/docs/output/commands/npm-adduser.html @@ -151,24 +151,18 @@

    Table of contents

    npm adduser
     
    -aliases: login, add-user
    +alias: add-user
     

    Note: This command is unaware of workspaces.

    Description

    -

    Create or verify a user named <username> in the specified registry, and -save the credentials to the .npmrc file. If no registry is specified, -the default registry will be used (see config).

    -

    The username, password, and email are read in from prompts.

    -

    To reset your password, go to https://www.npmjs.com/forgot

    -

    To change your email address, go to https://www.npmjs.com/email-edit

    -

    You may use this command multiple times with the same user account to -authorize on a new machine. When authenticating on a new machine, -the username, password and email address must all match with -your existing record.

    -

    npm login is an alias to adduser and behaves exactly the same way.

    +

    Create a new user in the specified registry, and save the credentials to +the .npmrc file. If no registry is specified, the default registry +will be used (see registry).

    +

    When using legacy for your auth-type, the username, password, and +email are read in from prompts.

    Configuration

    @@ -206,11 +200,9 @@

    scope

    auth-type

      -
    • Default: "legacy"
    • -
    • Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
    • +
    • Default: "web"
    • +
    • Type: "legacy" or "web"
    -

    NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be -removed in a future version.

    What authentication strategy to use with login.

    diff --git a/deps/npm/docs/output/commands/npm-audit.html b/deps/npm/docs/output/commands/npm-audit.html index fa2c4ad52bce9c..3e821dfa738060 100644 --- a/deps/npm/docs/output/commands/npm-audit.html +++ b/deps/npm/docs/output/commands/npm-audit.html @@ -222,9 +222,9 @@

    Bulk Advisory Endpoint

    the path /-/npm/v1/security/advisories/bulk.

    Any packages in the tree that do not have a version field in their package.json file will be ignored. If any --omit options are specified -(either via the --omit config, or one of the shorthands such as ---production, --only=dev, and so on), then packages will be omitted -from the submitted payload as appropriate.

    +(either via the --omit config, or one of the +shorthands such as --production, --only=dev, and so on), then packages will +be omitted from the submitted payload as appropriate.

    If the registry responds with an error, or with an invalid response, then npm will attempt to load advisory data from the Quick Audit endpoint.

    The expected result will contain a set of advisory objects for each @@ -282,7 +282,7 @@

    Exit Code

    vulnerabilities are found or if the remediation is able to successfully fix all vulnerabilities.

    If vulnerabilities were found the exit code will depend on the -audit-level configuration setting.

    +audit-level config.

    Examples

    Scan your project for vulnerabilities and automatically install any compatible updates to vulnerable dependencies:

    @@ -485,7 +485,7 @@

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-bugs.html b/deps/npm/docs/output/commands/npm-bugs.html index 28fdc0c643885a..997d58b816d75c 100644 --- a/deps/npm/docs/output/commands/npm-bugs.html +++ b/deps/npm/docs/output/commands/npm-bugs.html @@ -159,8 +159,9 @@

    Table of contents

    Description

    This command tries to guess at the likely location of a package's bug tracker URL or the mailto URL of the support email, and then tries to -open it using the --browser config param. If no package name is provided, it -will search for a package.json in the current folder and use the name property.

    +open it using the --browser config param. If no +package name is provided, it will search for a package.json in the current +folder and use the name property.

    Configuration

    diff --git a/deps/npm/docs/output/commands/npm-ci.html b/deps/npm/docs/output/commands/npm-ci.html index a67ad8237e7548..5576331664c5b9 100644 --- a/deps/npm/docs/output/commands/npm-ci.html +++ b/deps/npm/docs/output/commands/npm-ci.html @@ -431,7 +431,7 @@

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-config.html b/deps/npm/docs/output/commands/npm-config.html index 184895e036fc0a..f31d35755aea3b 100644 --- a/deps/npm/docs/output/commands/npm-config.html +++ b/deps/npm/docs/output/commands/npm-config.html @@ -166,7 +166,7 @@

    Description

    variables, npmrc files, and in some cases, the package.json file.

    See npmrc for more information about the npmrc files.

    -

    See config(7) for a more thorough explanation of the +

    See config for a more thorough explanation of the mechanisms involved, and a full list of config options available.

    The npm config command can be used to update and edit the contents of the user and global npmrc files.

    diff --git a/deps/npm/docs/output/commands/npm-dedupe.html b/deps/npm/docs/output/commands/npm-dedupe.html index 89d62caf702327..ef1d8fae9757c2 100644 --- a/deps/npm/docs/output/commands/npm-dedupe.html +++ b/deps/npm/docs/output/commands/npm-dedupe.html @@ -382,7 +382,7 @@

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-dist-tag.html b/deps/npm/docs/output/commands/npm-dist-tag.html index a6cdc6230b2057..eb3bc125ba8388 100644 --- a/deps/npm/docs/output/commands/npm-dist-tag.html +++ b/deps/npm/docs/output/commands/npm-dist-tag.html @@ -163,8 +163,8 @@

    Description

    • add: Tags the specified version of the package with the specified tag, -or the --tag config if not specified. If you have two-factor -authentication on auth-and-writes then you’ll need to include a +or the --tag config if not specified. If you have +two-factor authentication on auth-and-writes then you’ll need to include a one-time password on the command line with --otp <one-time password>, or at the OTP prompt.

    • diff --git a/deps/npm/docs/output/commands/npm-docs.html b/deps/npm/docs/output/commands/npm-docs.html index 8155100d2259d9..dc40a2dda7e4a1 100644 --- a/deps/npm/docs/output/commands/npm-docs.html +++ b/deps/npm/docs/output/commands/npm-docs.html @@ -158,10 +158,10 @@

      Table of contents

      Description

      This command tries to guess at the likely location of a package's -documentation URL, and then tries to open it using the --browser config -param. You can pass multiple package names at once. If no package name is -provided, it will search for a package.json in the current folder and use -the name property.

      +documentation URL, and then tries to open it using the +--browser config param. You can pass multiple +package names at once. If no package name is provided, it will search for a +package.json in the current folder and use the name property.

      Configuration

      diff --git a/deps/npm/docs/output/commands/npm-exec.html b/deps/npm/docs/output/commands/npm-exec.html index 917d71db366883..3c9e9a297f8c04 100644 --- a/deps/npm/docs/output/commands/npm-exec.html +++ b/deps/npm/docs/output/commands/npm-exec.html @@ -319,7 +319,8 @@

      Examples

      $ npx -c 'eslint && say "hooray, lint passed"'

Workspaces support

-

You may use the workspace or workspaces configs in order to run an +

You may use the workspace or +workspaces configs in order to run an arbitrary command from an npm package (either one installed locally, or fetched remotely) in the context of the specified workspaces. If no positional argument or --call option is provided, it will open an @@ -343,9 +344,9 @@

Workspaces support

}

You can execute an arbitrary command from a package in the context of each of -the configured workspaces when using the workspaces configuration options, -in this example we're using eslint to lint any js file found within each -workspace folder:

+the configured workspaces when using the +workspaces config options, in this example +we're using eslint to lint any js file found within each workspace folder:

npm exec --ws -- eslint ./*.js
 

Filtering workspaces

diff --git a/deps/npm/docs/output/commands/npm-find-dupes.html b/deps/npm/docs/output/commands/npm-find-dupes.html index 0e3ee0856096ab..063adaa81e9cb3 100644 --- a/deps/npm/docs/output/commands/npm-find-dupes.html +++ b/deps/npm/docs/output/commands/npm-find-dupes.html @@ -326,7 +326,7 @@

include-workspace-root

    -
  • Default: false
  • +
  • Default: true
  • Type: Boolean

When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-fund.html b/deps/npm/docs/output/commands/npm-fund.html index 08389cb45ba6c0..47874fab7338c6 100644 --- a/deps/npm/docs/output/commands/npm-fund.html +++ b/deps/npm/docs/output/commands/npm-fund.html @@ -159,16 +159,18 @@

Description

given project. If no package name is provided, it will list all dependencies that are looking for funding in a tree structure, listing the type of funding and the url to visit. If a package name is provided -then it tries to open its funding url using the --browser config -param; if there are multiple funding sources for the package, the user -will be instructed to pass the --which option to disambiguate.

+then it tries to open its funding url using the +--browser config param; if there are multiple +funding sources for the package, the user will be instructed to pass the +--which option to disambiguate.

The list will avoid duplicated entries and will stack all packages that share the same url as a single entry. Thus, the list does not have the same shape of the output from npm ls.

Example

Workspaces support

It's possible to filter the results to only include a single workspace -and its dependencies using the workspace config option.

+and its dependencies using the +workspace config option.

Example:

Here's an example running npm fund in a project with a configured workspace a:

diff --git a/deps/npm/docs/output/commands/npm-install-ci-test.html b/deps/npm/docs/output/commands/npm-install-ci-test.html index f7d6e04649c48b..3b3fac9411975a 100644 --- a/deps/npm/docs/output/commands/npm-install-ci-test.html +++ b/deps/npm/docs/output/commands/npm-install-ci-test.html @@ -388,7 +388,7 @@

include-workspace-root

    -
  • Default: false
  • +
  • Default: true
  • Type: Boolean

When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-install-test.html b/deps/npm/docs/output/commands/npm-install-test.html index bf2ad29400f570..c3a46c99dde2f4 100644 --- a/deps/npm/docs/output/commands/npm-install-test.html +++ b/deps/npm/docs/output/commands/npm-install-test.html @@ -389,7 +389,7 @@

include-workspace-root

    -
  • Default: false
  • +
  • Default: true
  • Type: Boolean

When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-install.html b/deps/npm/docs/output/commands/npm-install.html index 7702ab5c167750..36e0b0f6c93b79 100644 --- a/deps/npm/docs/output/commands/npm-install.html +++ b/deps/npm/docs/output/commands/npm-install.html @@ -249,7 +249,7 @@

Description

  • npm install [<@scope>/]<name>:

    Do a <name>@<tag> install, where <tag> is the "tag" config. (See -config. The config's default value is latest.)

    +config. The config's default value is latest.)

    In most cases, this will install the version of the modules tagged as latest on the npm registry.

    Example:

    @@ -715,7 +715,7 @@

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-link.html b/deps/npm/docs/output/commands/npm-link.html index cd31a3ee0dfd25..e162b8a71e5391 100644 --- a/deps/npm/docs/output/commands/npm-link.html +++ b/deps/npm/docs/output/commands/npm-link.html @@ -440,7 +440,7 @@

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-login.html b/deps/npm/docs/output/commands/npm-login.html new file mode 100644 index 00000000000000..f1334ca00dcb10 --- /dev/null +++ b/deps/npm/docs/output/commands/npm-login.html @@ -0,0 +1,238 @@ + + +npm-login + + + +

    + +
    +
    +

    npm-login

    +Login to a registry user account +
    + +
    +

    Table of contents

    + +
    + +

    Synopsis

    + + + +
    npm login
    +
    + + + +

    Note: This command is unaware of workspaces.

    +

    Description

    +

    Verify a user in the specified registry, and save the credentials to the +.npmrc file. If no registry is specified, the default registry will be +used (see config).

    +

    When using legacy for your auth-type, the username and password, are +read in from prompts.

    +

    To reset your password, go to https://www.npmjs.com/forgot

    +

    To change your email address, go to https://www.npmjs.com/email-edit

    +

    You may use this command multiple times with the same user account to +authorize on a new machine. When authenticating on a new machine, +the username, password and email address must all match with +your existing record.

    +

    Configuration

    + + + +

    registry

    + +

    The base URL of the npm registry.

    + + +

    scope

    +
      +
    • Default: the scope of the current project, if any, or ""
    • +
    • Type: String
    • +
    +

    Associate an operation with a scope for a scoped registry.

    +

    Useful when logging in to or out of a private registry:

    +
    # log in, linking the scope to the custom registry
    +npm login --scope=@mycorp --registry=https://registry.mycorp.com
    +
    +# log out, removing the link and the auth token
    +npm logout --scope=@mycorp
    +
    +

    This will cause @mycorp to be mapped to the registry for future +installation of packages specified according to the pattern +@mycorp/package.

    +

    This will also cause npm init to create a scoped package.

    +
    # accept all defaults, and create a package named "@foo/whatever",
    +# instead of just named "whatever"
    +npm init --scope=@foo --yes
    +
    + + +

    auth-type

    +
      +
    • Default: "web"
    • +
    • Type: "legacy" or "web"
    • +
    +

    What authentication strategy to use with login.

    + + + +

    See Also

    + +
    + + +
    + + + + \ No newline at end of file diff --git a/deps/npm/docs/output/commands/npm-ls.html b/deps/npm/docs/output/commands/npm-ls.html index 3733fe5747ca73..1cb0ce4ac9a16c 100644 --- a/deps/npm/docs/output/commands/npm-ls.html +++ b/deps/npm/docs/output/commands/npm-ls.html @@ -166,7 +166,7 @@

    Description

    the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

    -
    npm@8.19.2 /path/to/npm
    +
    npm@9.0.0-pre.3 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     
    @@ -368,7 +368,7 @@

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-pkg.html b/deps/npm/docs/output/commands/npm-pkg.html index 95635ee6028383..afa589aa248586 100644 --- a/deps/npm/docs/output/commands/npm-pkg.html +++ b/deps/npm/docs/output/commands/npm-pkg.html @@ -245,7 +245,8 @@

    Description

    Workspaces support

    You can set/get/delete items across your configured workspaces by using the -workspace or workspaces config options.

    +workspace or +workspaces config options.

    For example, setting a funding value across all configured workspaces of a project:

    npm pkg set funding=https://example.com --ws
    diff --git a/deps/npm/docs/output/commands/npm-prune.html b/deps/npm/docs/output/commands/npm-prune.html
    index 0a248629bd8291..eac7379586ed4c 100644
    --- a/deps/npm/docs/output/commands/npm-prune.html
    +++ b/deps/npm/docs/output/commands/npm-prune.html
    @@ -293,7 +293,7 @@ 

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-publish.html b/deps/npm/docs/output/commands/npm-publish.html index 019295ab1f0c66..84eae3143c1159 100644 --- a/deps/npm/docs/output/commands/npm-publish.html +++ b/deps/npm/docs/output/commands/npm-publish.html @@ -242,18 +242,16 @@

    tag

    access

      -
    • Default: 'restricted' for scoped packages, 'public' for unscoped packages
    • +
    • Default: 'public' for new packages, existing packages it will not change the +current level
    • Type: null, "restricted", or "public"
    -

    When publishing scoped packages, the access level defaults to restricted. -If you want your scoped package to be publicly viewable (and installable) -set --access=public. The only valid values for access are public and -restricted. Unscoped packages always have an access level of public.

    -

    Note: Using the --access flag on the npm publish command will only set -the package access level on the initial publish of the package. Any -subsequent npm publish commands using the --access flag will not have an -effect to the access level. To make changes to the access level after the -initial publish use npm access.

    +

    If do not want your scoped package to be publicly viewable (and installable) +set --access=restricted.

    +

    Unscoped packages can not be set to restricted.

    +

    Note: This defaults to not changing the current access level for existing +packages. Specifying a value of restricted or public during publish will +change the access for an existing package the same way that npm access set status would.

    dry-run

    diff --git a/deps/npm/docs/output/commands/npm-rebuild.html b/deps/npm/docs/output/commands/npm-rebuild.html index 2fdd821d592d13..72ce6484c2572f 100644 --- a/deps/npm/docs/output/commands/npm-rebuild.html +++ b/deps/npm/docs/output/commands/npm-rebuild.html @@ -273,7 +273,7 @@

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-repo.html b/deps/npm/docs/output/commands/npm-repo.html index 24197ef0ea193c..f300da637db0d7 100644 --- a/deps/npm/docs/output/commands/npm-repo.html +++ b/deps/npm/docs/output/commands/npm-repo.html @@ -156,9 +156,10 @@

    Table of contents

    Description

    This command tries to guess at the likely location of a package's -repository URL, and then tries to open it using the --browser config -param. If no package name is provided, it will search for a package.json -in the current folder and use the repository property.

    +repository URL, and then tries to open it using the +--browser config param. If no package name is +provided, it will search for a package.json in the current folder and use the +repository property.

    Configuration

    diff --git a/deps/npm/docs/output/commands/npm-run-script.html b/deps/npm/docs/output/commands/npm-run-script.html index 5b1150cf4b9b3f..445ca637d74384 100644 --- a/deps/npm/docs/output/commands/npm-run-script.html +++ b/deps/npm/docs/output/commands/npm-run-script.html @@ -188,7 +188,8 @@

    Description

    on Unix-like systems it is the /bin/sh command, on Windows it is cmd.exe. The actual shell referred to by /bin/sh also depends on the system. -You can customize the shell with the script-shell configuration.

    +You can customize the shell with the +script-shell config.

    Scripts are run from the root of the package folder, regardless of what the current working directory is when npm run is called. If you want your script to use different behavior based on what subdirectory you're in, you @@ -200,7 +201,8 @@

    Description

    fails, you will be given a warning to run npm install, just in case you've forgotten.

    Workspaces support

    -

    You may use the workspace or workspaces configs in order to run an +

    You may use the workspace or +workspaces configs in order to run an arbitrary command from a package's "scripts" object in the context of the specified workspaces. If no "command" is provided, it will list the available scripts for each of these configured workspaces.

    @@ -222,7 +224,8 @@

    Workspaces support

    }

    And that each of the configured workspaces has a configured test script, -we can run tests in all of them using the workspaces config:

    +we can run tests in all of them using the +workspaces config:

    npm test --workspaces
     

    Filtering workspaces

    diff --git a/deps/npm/docs/output/commands/npm-uninstall.html b/deps/npm/docs/output/commands/npm-uninstall.html index 9823201dbc812d..0e2ba45adc641e 100644 --- a/deps/npm/docs/output/commands/npm-uninstall.html +++ b/deps/npm/docs/output/commands/npm-uninstall.html @@ -251,7 +251,7 @@

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-update.html b/deps/npm/docs/output/commands/npm-update.html index d88ea8578bacef..d43545f686eee9 100644 --- a/deps/npm/docs/output/commands/npm-update.html +++ b/deps/npm/docs/output/commands/npm-update.html @@ -158,9 +158,9 @@

    Table of contents

    Description

    This command will update all the packages listed to the latest version -(specified by the tag config), respecting the semver constraints of -both your package and its dependencies (if they also require the same -package).

    +(specified by the tag config), respecting the semver +constraints of both your package and its dependencies (if they also require the +same package).

    It will also install missing packages.

    If the -g flag is specified, this command will update globally installed packages.

    @@ -477,7 +477,7 @@

    include-workspace-root

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root diff --git a/deps/npm/docs/output/commands/npm-version.html b/deps/npm/docs/output/commands/npm-version.html index 3bab12fec165a7..3f99840f834c7b 100644 --- a/deps/npm/docs/output/commands/npm-version.html +++ b/deps/npm/docs/output/commands/npm-version.html @@ -295,15 +295,15 @@

    Description

    disabled on the command line by running npm --no-git-tag-version version. It will fail if the working directory is not clean, unless the -f or --force flag is set.

    -

    If supplied with -m or --message config option, npm will use it as a -commit message when creating a version commit. If the message config -contains %s then that will be replaced with the resulting version number. -For example:

    +

    If supplied with -m or --message config option, +npm will use it as a commit message when creating a version commit. If the +message config contains %s then that will be replaced with the resulting +version number. For example:

    npm version patch -m "Upgrade to %s for reasons"
     
    -

    If the sign-git-tag config is set, then the tag will be signed using the --s flag to git. Note that you must have a default GPG key set up in your -git config for this to work properly. For example:

    +

    If the sign-git-tag config is set, then the +tag will be signed using the -s flag to git. Note that you must have a default +GPG key set up in your git config for this to work properly. For example:

    $ npm config set sign-git-tag true
     $ npm version patch
     
    diff --git a/deps/npm/docs/output/commands/npm-view.html b/deps/npm/docs/output/commands/npm-view.html
    index 2b74e28f3b9256..3e9d0cc103dfb4 100644
    --- a/deps/npm/docs/output/commands/npm-view.html
    +++ b/deps/npm/docs/output/commands/npm-view.html
    @@ -186,6 +186,9 @@ 

    Description

    contributor in the list, you can run:

    npm view express contributors[0].email
     
    +

    If the field value you are querying for is a property of an object, you should run:

    +
    npm view express time'[4.8.0]'
    +

    Multiple fields may be specified, and will be printed one after another. For example, to get all the contributor names and email addresses, you can do this:

    diff --git a/deps/npm/docs/output/commands/npm.html b/deps/npm/docs/output/commands/npm.html index 1be4ac89284580..181b721078b1a7 100644 --- a/deps/npm/docs/output/commands/npm.html +++ b/deps/npm/docs/output/commands/npm.html @@ -149,7 +149,7 @@

    Table of contents

    Version

    -

    8.19.2

    +

    9.0.0-pre.3

    Description

    npm is the package manager for the Node JavaScript platform. It puts modules in place so that node can find them, and manages dependency diff --git a/deps/npm/docs/output/configuring-npm/folders.html b/deps/npm/docs/output/configuring-npm/folders.html index 2968dacd5ee78b..74a287a4025588 100644 --- a/deps/npm/docs/output/configuring-npm/folders.html +++ b/deps/npm/docs/output/configuring-npm/folders.html @@ -159,10 +159,10 @@

    tl;dr

  • If you need both, then install it in both places, or use npm link.
  • prefix Configuration

    -

    The prefix config defaults to the location where node is installed. -On most systems, this is /usr/local. On Windows, it's %AppData%\npm. -On Unix systems, it's one level up, since node is typically installed at -{prefix}/bin/node rather than {prefix}/node.exe.

    +

    The prefix config defaults to the location where +node is installed. On most systems, this is /usr/local. On Windows, it's +%AppData%\npm. On Unix systems, it's one level up, since node is typically +installed at {prefix}/bin/node rather than {prefix}/node.exe.

    When the global flag is set, npm installs things into this prefix. When it is not set, it uses the root of the current package, or the current working directory if not in a package already.

    @@ -195,11 +195,11 @@

    Man Pages

    Cache

    See npm cache. Cache files are stored in ~/.npm on Posix, or %AppData%/npm-cache on Windows.

    -

    This is controlled by the cache configuration param.

    +

    This is controlled by the cache config param.

    Temp Files

    Temporary files are stored by default in the folder specified by the -tmp config, which defaults to the TMPDIR, TMP, or TEMP environment -variables, or /tmp on Unix and c:\windows\temp on Windows.

    +tmp config, which defaults to the TMPDIR, TMP, or +TEMP environment variables, or /tmp on Unix and c:\windows\temp on Windows.

    Temp files are given a unique folder under this root for each run of the program, and are deleted upon successful exit.

    More Information

    @@ -221,7 +221,7 @@

    More Information

    Any bin files are symlinked to ./node_modules/.bin/, so that they may be found by npm scripts when necessary.

    Global Installation

    -

    If the global configuration is set to true, then npm will +

    If the global config is set to true, then npm will install packages "globally".

    For global installation, packages are installed roughly the same way, but using the folders described above.

    diff --git a/deps/npm/docs/output/configuring-npm/package-json.html b/deps/npm/docs/output/configuring-npm/package-json.html index 7fdc03e3eaf5aa..8f6c839be6d524 100644 --- a/deps/npm/docs/output/configuring-npm/package-json.html +++ b/deps/npm/docs/output/configuring-npm/package-json.html @@ -402,12 +402,14 @@

    bin

    install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.)

    To use this, supply a bin field in your package.json which is a map of -command name to local file name. When this package is installed -globally, that file will be linked where global bins go so it is -available to run by name. When this package is installed as a -dependency in another package, the file will be linked where it will be -available to that package either directly by npm exec or by name in other -scripts when invoking them via npm run-script.

    +command name to local file name. When this package is installed globally, +that file will be either linked inside the global bins directory or +a cmd (Windows Command File) will be created which executes the specified +file in the bin field, so it is available to run by name or name.cmd (on +Windows PowerShell). When this package is installed as a dependency in another +package, the file will be linked where it will be available to that package +either directly by npm exec or by name in other scripts when invoking them +via npm run-script.

    For example, myapp could have this:

    {
       "bin": {
    @@ -415,8 +417,10 @@ 

    bin

    } }
    -

    So, when you install myapp, it'll create a symlink from the cli.js script -to /usr/local/bin/myapp.

    +

    So, when you install myapp, in case of unix-like OS it'll create a symlink +from the cli.js script to /usr/local/bin/myapp and in case of windows it +will create a cmd file usually at C:\Users\{Username}\AppData\Roaming\npm\myapp.cmd +which runs the cli.js script.

    If you have a single executable, and its name should be the name of the package, then you can just supply it as a string. For example:

    {
    @@ -924,9 +928,10 @@ 

    engines

    } }
    -

    Unless the user has set the engine-strict config flag, this field is -advisory only and will only produce warnings when your package is installed -as a dependency.

    +

    Unless the user has set the +engine-strict config flag, this field is +advisory only and will only produce warnings when your package is installed as a +dependency.

    os

    You can specify which operating systems your module will run on:

    diff --git a/deps/npm/docs/output/using-npm/config.html b/deps/npm/docs/output/using-npm/config.html index 42880a27025546..ef1315ce7ae559 100644 --- a/deps/npm/docs/output/using-npm/config.html +++ b/deps/npm/docs/output/using-npm/config.html @@ -142,7 +142,7 @@

    config

    Table of contents

    -
    +

    Description

    @@ -268,18 +268,16 @@

    _auth

    access

      -
    • Default: 'restricted' for scoped packages, 'public' for unscoped packages
    • +
    • Default: 'public' for new packages, existing packages it will not change the +current level
    • Type: null, "restricted", or "public"
    -

    When publishing scoped packages, the access level defaults to restricted. -If you want your scoped package to be publicly viewable (and installable) -set --access=public. The only valid values for access are public and -restricted. Unscoped packages always have an access level of public.

    -

    Note: Using the --access flag on the npm publish command will only set -the package access level on the initial publish of the package. Any -subsequent npm publish commands using the --access flag will not have an -effect to the access level. To make changes to the access level after the -initial publish use npm access.

    +

    If do not want your scoped package to be publicly viewable (and installable) +set --access=restricted.

    +

    Unscoped packages can not be set to restricted.

    +

    Note: This defaults to not changing the current access level for existing +packages. Specifying a value of restricted or public during publish will +change the access for an existing package the same way that npm access set status would.

    all

    @@ -323,11 +321,9 @@

    audit-level

    auth-type

      -
    • Default: "legacy"
    • -
    • Type: "legacy", "web", "sso", "saml", "oauth", or "webauthn"
    • +
    • Default: "web"
    • +
    • Type: "legacy" or "web"
    -

    NOTE: auth-type values "sso", "saml", "oauth", and "webauthn" will be -removed in a future version.

    What authentication strategy to use with login.

    @@ -878,7 +874,7 @@

    init-version

      -
    • Default: false
    • +
    • Default: true
    • Type: Boolean

    When set file: protocol dependencies that exist outside of the project root @@ -1513,11 +1509,10 @@

    timing

  • Default: false
  • Type: Boolean
  • -

    If true, writes a debug log to logs-dir and timing information to -_timing.json in the cache, even if the command completes successfully. -_timing.json is a newline delimited list of JSON objects.

    +

    If true, writes timing information to a process specific json file in the +cache or logs-dir. The file name ends with -timing.json.

    You can quickly view it with this json command line: -npm exec -- json -g < ~/.npm/_timing.json.

    +cat ~/.npm/_logs/*-timing.json | npm exec -- json -g.

    umask

    @@ -1818,27 +1813,6 @@

    shrinkwrap

    Alias for --package-lock

    -

    sso-poll-frequency

    -
      -
    • Default: 500
    • -
    • Type: Number
    • -
    • DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a -future version of npm in favor of web-based login.
    • -
    -

    When used with SSO-enabled auth-types, configures how regularly the -registry should be polled while the user is completing authentication.

    - - -

    sso-type

    -
      -
    • Default: "oauth"
    • -
    • Type: null, "oauth", or "saml"
    • -
    • DEPRECATED: The --auth-type method of SSO/SAML/OAuth will be removed in a -future version of npm in favor of web-based login.
    • -
    -

    If --auth-type=sso, the type of SSO type to use.

    - -

    tmp

    • Default: The value returned by the Node.js os.tmpdir() method diff --git a/deps/npm/docs/output/using-npm/dependency-selectors.html b/deps/npm/docs/output/using-npm/dependency-selectors.html index 31ab2bb5b7c326..fcd4a7ecbcde77 100644 --- a/deps/npm/docs/output/using-npm/dependency-selectors.html +++ b/deps/npm/docs/output/using-npm/dependency-selectors.html @@ -198,9 +198,45 @@

      Pseudo Selectors

    • :extraneous when a dependency exists but is not defined as a dependency of any node
    • :invalid when a dependency version is out of its ancestors specified range
    • :missing when a dependency is not found on disk
    • -
    • :semver(<spec>) matching a valid node-semver spec
    • +
    • :semver(<spec>, [selector], [function]) match a valid node-semver version or range to a selector
    • :path(<path>) glob matching based on dependencies path relative to the project
    • :type(<type>) based on currently recognized types
    • +
    • :outdated(<type>) when a dependency is outdated
    • +
    +
    :semver(<spec>, [selector], [function])
    +

    The :semver() pseudo selector allows comparing fields from each node's package.json using semver methods. It accepts up to 3 parameters, all but the first of which are optional.

    +
      +
    • spec a semver version or range
    • +
    • selector an attribute selector for each node (default [version])
    • +
    • function a semver method to apply, one of: satisfies, intersects, subset, gt, gte, gtr, lt, lte, ltr, eq, neq or the special function infer (default infer)
    • +
    +

    When the special infer function is used the spec and the actual value from the node are compared. If both are versions, according to semver.valid(), eq is used. If both values are ranges, according to !semver.valid(), intersects is used. If the values are mixed types satisfies is used.

    +

    Some examples:

    +
      +
    • :semver(^1.0.0) returns every node that has a version satisfied by the provided range ^1.0.0
    • +
    • :semver(16.0.0, :attr(engines, [node])) returns every node which has an engines.node property satisfying the version 16.0.0
    • +
    • :semver(1.0.0, [version], lt) every node with a version less than 1.0.0
    • +
    +
    :outdated(<type>)
    +

    The :outdated pseudo selector retrieves data from the registry and returns information about which of your dependencies are outdated. The type parameter may be one of the following:

    +
      +
    • any (default) a version exists that is greater than the current one
    • +
    • in-range a version exists that is greater than the current one, and satisfies at least one if its dependents
    • +
    • out-of-range a version exists that is greater than the current one, does not satisfy at least one of its dependents
    • +
    • major a version exists that is a semver major greater than the current one
    • +
    • minor a version exists that is a semver minor greater than the current one
    • +
    • patch a version exists that is a semver patch greater than the current one
    • +
    +

    In addition to the filtering performed by the pseudo selector, some extra data is added to the resulting objects. The following data can be found under the queryContext property of each node.

    +
      +
    • versions an array of every available version of the given node
    • +
    • outdated.inRange an array of objects, each with a from and versions, where from is the on-disk location of the node that depends on the current node and versions is an array of all available versions that satisfies that dependency. This is only populated if :outdated(in-range) is used.
    • +
    • outdated.outOfRange an array of objects, identical in shape to inRange, but where the versions array is every available version that does not satisfy the dependency. This is only populated if :outdated(out-of-range) is used.
    • +
    +

    Some examples:

    +
      +
    • :root > :outdated(major) returns every direct dependency that has a new semver major release
    • +
    • .prod:outdated(in-range) returns production dependencies that have a new release that satisfies at least one of its edges in

    Attribute Selectors

    The attribute selector evaluates the key/value pairs in package.json if they are Strings.

    diff --git a/deps/npm/docs/output/using-npm/logging.html b/deps/npm/docs/output/using-npm/logging.html index 078ebde7b8501b..28043793447881 100644 --- a/deps/npm/docs/output/using-npm/logging.html +++ b/deps/npm/docs/output/using-npm/logging.html @@ -149,8 +149,7 @@

    Table of contents

    The npm CLI has various mechanisms for showing different levels of information back to end-users for certain commands, configurations & environments.

    Setting Log File Location

    All logs are written to a debug log, with the path to that file printed if the execution of a command fails.

    -

    The default location of the logs directory is a directory named _logs inside the npm cache. This can be changed -with the logs-dir config option.

    +

    The default location of the logs directory is a directory named _logs inside the npm cache. This can be changed with the logs-dir config option.

    Log files will be removed from the logs-dir when the number of log files exceeds logs-max, with the oldest logs being deleted first.

    To turn off logs completely set --logs-max=0.

    Setting Log Levels

    @@ -184,12 +183,14 @@
    Aliases

    foreground-scripts

    The npm CLI began hiding the output of lifecycle scripts for npm install as of v7. Notably, this means you will not see logs/output from packages that may be using "install scripts" to display information back to you or from your own project's scripts defined in package.json. If you'd like to change this behavior & log this output you can set foreground-scripts to true.

    Timing Information

    -

    The --timing config can be set which does two things:

    +

    The --timing config can be set which does two +things:

    1. Always shows the full path to the debug log regardless of command exit status
    2. -
    3. Write timing information to a timing file in the cache or logs-dir
    4. +
    5. Write timing information to a process specific timing file in the cache or logs-dir
    -

    This file is a newline delimited list of JSON objects that can be inspected to see timing data for each task in a npm CLI run.

    +

    This file contains a timers object where the keys are an identifier for the +portion of the process being timed and the value is the number of milliseconds it took to complete.

    Registry Response Headers

    npm-notice

    The npm CLI reads from & logs any npm-notice headers that are returned from the configured registry. This mechanism can be used by third-party registries to provide useful information when network-dependent requests occur.

    diff --git a/deps/npm/docs/output/using-npm/package-spec.html b/deps/npm/docs/output/using-npm/package-spec.html index 2b0855737bc269..b1d7026f6184f3 100644 --- a/deps/npm/docs/output/using-npm/package-spec.html +++ b/deps/npm/docs/output/using-npm/package-spec.html @@ -234,9 +234,11 @@

    git urls

  • npm/cli#c12ea07
  • See also

    -

    npm-package-arg -scope -config

    +