diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 3b622ed82fa78..ffa194d014c12 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,24 @@ jobs: run: node . run posttest env: DEPLOY_VERSION: testing - + + check_docs: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Use Node.js 14.x + uses: actions/setup-node@v1 + with: + node-version: 14.x + - name: Install dependencies + run: | + node . install --ignore-scripts --no-audit + - name: Rebuild the docs + run: make freshdocs + - name: Git should not be dirty + run: node scripts/git-dirty.js + + licenses: runs-on: ubuntu-latest steps: diff --git a/AUTHORS b/AUTHORS index c3685720598a9..e65d3efdc0466 100644 --- a/AUTHORS +++ b/AUTHORS @@ -789,3 +789,14 @@ Aluneed <31174087+aluneed@users.noreply.github.com> relrelb Cameron Tacklind Demira Dimitrova +AkiJoey +austincho +Nathan Fritz +tripu <1016538+tripu@users.noreply.github.com> +Matsuuu +Anders Kaseorg +John Gee +Ayush Rawal +Nate Green +Jacob Yacovelli +Caleb ツ Everett diff --git a/CHANGELOG.md b/CHANGELOG.md index c36045f27b683..0b44764879332 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,266 @@ +## v7.24.1 (2021-09-23) + +### DEPENDENCIES + +* [`1be8d41e6`](https://github.com/npm/cli/commit/1be8d41e6f23f7a3d8411a31099ab546fbcb5bfa) + `socks-proxy-agent@6.1.0`: + * feat: allow passing tls connection options +* [`eafd55eae`](https://github.com/npm/cli/commit/eafd55eae219a6c15d2857d06b673a67d7f7d060) + `glob@7.2.0` + +### DOCS + +* [`dae5ce305`](https://github.com/npm/cli/commit/dae5ce3055ded57eab8aa3425004c60224a6fe67) + [#3784](https://github.com/npm/cli/issues/3784) + docs: document special meaning of registry.npmjs.com + ([@everett1992](https://github.com/everett1992)) + +## v7.24.0 (2021-09-16) + +### FEATURES + +* [`c7787b3fb`](https://github.com/npm/cli/commit/c7787b3fb7630aab84aae83ebf9a7117c7173b6b) + [`1fbbe1e04`](https://github.com/npm/cli/commit/1fbbe1e04be5d79c7b49910324e64c19ed599eeb) + bundled npm-install-checks ([@wraithgar](https://github.com/wraithgar)) + +### BUG FIXES + +* [`0320bd77e`](https://github.com/npm/cli/commit/0320bd77e2a38f48a88e377df4b122fd21043a83) + [#3739](https://github.com/npm/cli/issues/3739) + fix(view): Show the correct publish date for versions selected by range ([@andersk](https://github.com/andersk)) +* [`e4a521857`](https://github.com/npm/cli/commit/e4a5218573583149af795982a39fa64a4116cdab) + [#3748](https://github.com/npm/cli/issues/3748) + fix(install.sh): don't remove old npm first + ([@wraithgar](https://github.com/wraithgar)) +* [`b4aac345b`](https://github.com/npm/cli/commit/b4aac345b0a7cdec4d713c5be4daea37330b2b26) + [#3754](https://github.com/npm/cli/issues/3754) + fix(config): user-agent properly shows ci + ([@wraithgar](https://github.com/wraithgar)) +* [`b807cd62e`](https://github.com/npm/cli/commit/b807cd62eabe337e3243415c9870ea36d9289e12) + [#3738](https://github.com/npm/cli/issues/3738) + fix(search): return valid json for no results + ([@AyushRawal](https://github.com/AyushRawal)) +* [`2def17a3b`](https://github.com/npm/cli/commit/2def17a3b625b92b40c6185ff4b47e8ed006492c) + [#3760](https://github.com/npm/cli/issues/3760) + fix(install): use configured registry when checking manifest + ([@yacoman89](https://github.com/yacoman89)) +* [`ca792acdd`](https://github.com/npm/cli/commit/ca792acdd4ba683d8415c88188ec6739033fb4fd) + [#3761](https://github.com/npm/cli/issues/3761) + fix(logs): clean args for failed commands + ([@wraithgar](https://github.com/wraithgar)) + +### DEPENDENCIES + +* [`59743972c`](https://github.com/npm/cli/commit/59743972c2ae1d2dd601aaa6c59974c686b1cb29) + [#3747](https://github.com/npm/cli/issues/3747) + fix(did-you-mean): succeed if cwd is not a package + ([@wraithgar](https://github.com/wraithgar)) +* [`ac8e4ad18`](https://github.com/npm/cli/commit/ac8e4ad18a6b726dd2c3abcb0f605701cca0ae2c) + `init-package-json@2.0.5`: + * fix: bin script path +* [`371655a6b`](https://github.com/npm/cli/commit/371655a6b0e6664fec67f16cb247cc9f174a5197) + `minipass@3.1.5`: + * fix: re-emit 'error' event if missed and new listener added + * fix: do not blow up if process is missing + +### DOCUMENTATION + +* [`4d93b484a`](https://github.com/npm/cli/commit/4d93b484abb50e3704fb436db572b93fb36c7ac3) + [#3759](https://github.com/npm/cli/issues/3759) + fix(docs): use correct hyperlink to package-json + ([@nategreen](https://github.com/nategreen)) + +## v7.23.0 (2021-09-09) + +### FEATURES + +* [`6c12500ae`](https://github.com/npm/cli/commit/6c12500ae14a6f8b78e3ab091ee6cc8e2ea9fd23) + [#3731](https://github.com/npm/cli/issues/3731) + feat(install): very strict global npm engines + ([@wraithgar](https://github.com/wraithgar)) + +### BUG FIXES + +* [`1ad093824`](https://github.com/npm/cli/commit/1ad0938243110d983284e8763da41a57b561563d) + [#3732](https://github.com/npm/cli/issues/3732) + fix(error-message): clean urls from 404 error + ([@wraithgar](https://github.com/wraithgar)) + +### DOCUMENTATION + +* [`64f7d1a55`](https://github.com/npm/cli/commit/64f7d1a55db99b1aaf8fb59557b3dedcdcd954a0) + [#3727](https://github.com/npm/cli/issues/3727) + docs(contributing): add note on changes to tooling + ([@darcyclarke](https://github.com/darcyclarke)) +* [`eda9162f2`](https://github.com/npm/cli/commit/eda9162f2db19b512d3af6b0d43201d54045c13a) + [#3715](https://github.com/npm/cli/issues/3715) + Add --if-present flag documentation to workspaces + ([@Matsuuu](https://github.com/Matsuuu)) + +## v7.22.0 (2021-09-02) + +### BUG FIXES +* [`6f431fe23`](https://github.com/npm/cli/commit/6f431fe2325f77b4370f95848359a36fe7a011d1) + [#3690](https://github.com/npm/cli/issues/3690) + Fix one “see also” link + ([@tripu](https://github.com/tripu)) + +### DEPENDENCIES +* [`033e948c9`](https://github.com/npm/cli/commit/033e948c95b3455812e03a860ad1bd96a635e7eb) + `read-package-json@4.1.1`: + * feat: add types lookup + * fix(man): don't lose relative man path +* [`1fa549db0`](https://github.com/npm/cli/commit/1fa549db0955b55fd680a658809a6d97be306b06) + `@npmcli/config@2.3.0`: + * feat: export npm_config_local_prefix and npm_config_global_prefix to the environment +* [`e91578d10`](https://github.com/npm/cli/commit/e91578d10b1d5d930fec32e7070d975af4892140) + `minpass-fetch@1.4.1`: + * Made rejectUnauthorized depend on NODE_TLS_REJECT_UNAUTHORIZED +* [`6125db545`](https://github.com/npm/cli/commit/6125db545315da0217fe7b05062fd0a504c9a45b) + `are-we-there-yet@1.1.6` +* [`0dcda73b0`](https://github.com/npm/cli/commit/0dcda73b022083338c4cb755390a275757b9627b) + `string_decoder@1.3.0` +* [`4b913417c`](https://github.com/npm/cli/commit/4b913417c4e30980505a02eec50810f895dd52d7) + `npmlog@5.0.1` +* [`876c755eb`](https://github.com/npm/cli/commit/876c755eb0dfc215123682f798b5fca415f7c7d9) + `@npmcli/arborist@2.8.3`: + * fix: do not fail adding unresolvable optional dep + +## v7.21.1 (2021-08-26) + +### BUG FIXES + +* [`4e52217cb`](https://github.com/npm/cli/commit/4e52217cb25a697b0f6b0131bcb8c87e0dbcda53) + [#3684](https://github.com/npm/cli/issues/3684) + fix(config): respect --global, --package-lock-only + ([@nlf](https://github.com/nlf)) + +### DEPENDENCIES + +* [`e3878536f`](https://github.com/npm/cli/commit/e3878536f3612d9ddc3002c126cfa9a91021c7db) + `make-fetch-happen@9.1.0`: + * fix: use the same strictSSL default as tls.connect +* [`145f70cc1`](https://github.com/npm/cli/commit/145f70cc1b78dee4ffa53f557fa72d0948696839) + `read-package-json@4.0.1`: + * fix: Add gitHead in subdirectories too + * fix(man): don't resolve paths to man files +* [`3f4d37143`](https://github.com/npm/cli/commit/3f4d371432a1fc8280e73d8467acd0eed0bbef26) + `tar@6.1.11`: + * fix: perf regression on hot string munging path +* [`e63a942c6`](https://github.com/npm/cli/commit/e63a942c685233fa546788981ed9c144220d50e1) + `cacache@15.3.0`: + * feat: introduce @npmcli/fs for tmp dir methods + +### DOCUMENTATION + +* [`957fa6040`](https://github.com/npm/cli/commit/957fa604035992285572f63c38545eea86bbb1ff) + [#3681](https://github.com/npm/cli/issues/3681) + clarify uninstall lifecycle script + ([@fritzy](https://github.com/fritzy)) + +## v7.21.0 (2021-08-19) + +### FEATURES + +* [`ff34d6cd6`](https://github.com/npm/cli/commit/ff34d6cd6f2077962cba1ef9c893a958ac7174f8) + [#3592](https://github.com/npm/cli/issues/3592) + feat(cache): initial implementation of ls and rm + ([@fritzy](https://github.com/fritzy)) + +### BUG FIXES + +* [`32e88c943`](https://github.com/npm/cli/commit/32e88c94387bda6b25f66019793efcda8f01ef6e) + [#3640](https://github.com/npm/cli/issues/3640) + fix(did-you-mean): switch levenshtein libraries + ([@wraithgar](https://github.com/wraithgar)) +* [`487731cd5`](https://github.com/npm/cli/commit/487731cd56a22272c6ff72ef2fa7822368bf63e3) + [#3658](https://github.com/npm/cli/issues/3658) + fix(logging): sanitize logged argv + ([@wraithgar](https://github.com/wraithgar)) +* [`68a19bb02`](https://github.com/npm/cli/commit/68a19bb02aa0d7a566c8e2245f1e524b915faf09) + [#3661](https://github.com/npm/cli/issues/3661) + fix(error-message): look for er.path not er.file + ([@wraithgar](https://github.com/wraithgar)) + +### DEPENDENCIES + +* [`df57f0d53`](https://github.com/npm/cli/commit/df57f0d532d406b3b1409454ea5f2255fcd08248) + `@npmcli/run-script@1.8.6` +* [`8183976cf`](https://github.com/npm/cli/commit/8183976cfa53bab6e9116ec5de97b04225c5d09b) + `normalize-package-data@3.0.3`: + * fix: account for "licence" as spelling variant +* [`f07772401`](https://github.com/npm/cli/commit/f07772401c3712d5f9b0dfeef88e1943229cfa79) + `init-package-json@2.0.4` +* [`991a3bd39`](https://github.com/npm/cli/commit/991a3bd39f0abf8614373f267419c7b8f6e279ac) + `read-package-json@4.0.0` +* [`e9e5ee560`](https://github.com/npm/cli/commit/e9e5ee560e2baf694843df852d027fb9f2dbcb06) + `@npmcli/arborist@2.8.2`: + * fix: treat top-level global packages as "top" nodes + * fix: load global symlinks implicitly as file: deps + * fix(reify): debug crash when extracting into symlink + * fix: node_modules must be a directory + * fix: make Node.children() a case-insensitive Map + * fix(reify): verify existing deps in nm are dirs +* [`b6f40b5f8`](https://github.com/npm/cli/commit/b6f40b5f85094387f2fa8d42b6a624644b8ddcf1) + `tar@6.1.10`: + * fix: prune dirCache properly for unicode, windows + * fix: reserve paths properly for unicode, windows + * fix: prevent path escape using drive-relative paths + * fix: drop dirCache for symlink on all platforms +* [`218cacadc`](https://github.com/npm/cli/commit/218cacadcf35879ce178813c699258e7ffe91fe9) + `is-core-module@2.6.0` +* [`7ac621cd1`](https://github.com/npm/cli/commit/7ac621cd14f2ffbf5c15c3258f537fdfddc21ac6) + `smart-buffer@4.2.0` +* [`94f92de13`](https://github.com/npm/cli/commit/94f92de138432c900b195b71949f4933e872f26a) + `make-fetch-happen@9.0.5` +* [`71cdfd898`](https://github.com/npm/cli/commit/71cdfd8983cd0c61f39bdf91f87d40aad3b081c2) + `spdx-license-ids@3.0.10`: + * update license list to v3.14 + +### DOCUMENTATION + +* [`ff6626ab6`](https://github.com/npm/cli/commit/ff6626ab6ca9b4e189a3bc56a762104927dbeedb) + [#3630](https://github.com/npm/cli/issues/3630) + fix(docs): update npm-publish access flag info + ([@austincho](https://github.com/austincho)) + +## v7.20.6 (2021-08-12) + +### DEPENDENCIES + +* [`5bebf280f`](https://github.com/npm/cli/commit/5bebf280f228e818524f6989caab1cfba1ffaf90) + `tar@6.1.8` + * fix: reserve paths case-insensitively +* [`5d89de44d`](https://github.com/npm/cli/commit/5d89de44daa636dc151eaefcafabb357540d35ce) + `tar@6.1.7`: + * fix: normalize paths on Windows systems +* [`a1bdbea97`](https://github.com/npm/cli/commit/a1bdbea974ebfc6694b4c8ad5da86215c2924dde) + [#3569](https://github.com/npm/cli/issues/3569) + * remove byte-size + ([@wraithgar](https://github.com/wraithgar)) +* [`61782fa85`](https://github.com/npm/cli/commit/61782fa858c278455ce144f975c6b0e3ea2d9944) + `@npmcli/map-workspaces@1.0.4`: + * fix: better error message for duplicate workspace names +* [`b88f770fa`](https://github.com/npm/cli/commit/b88f770faa2651ca0833e1c9eb361e9e07e0bbc3) + `@npmcli/arborist@2.8.1`: + * [#3632] Fix "cannot read property path of null" error in 'npm dedupe' + * fix(shrinkwrap): always set name on the root node + +### DOCUMENTATION + +* [`001f2c1b7`](https://github.com/npm/cli/commit/001f2c1b7e9474049a45709f0e80ee3c474a4ba9) + [#3621](https://github.com/npm/cli/issues/3621) + fix(docs): do not include certain files + ([@AkiJoey](https://github.com/AkiJoey)) +* [`d1812f1a6`](https://github.com/npm/cli/commit/d1812f1a627d6a4d4cb6d07d7735d2d2cc2cf264) + [#3630](https://github.com/npm/cli/issues/3630) + fix(docs): update npm-publish access flag info + ([@austincho](https://github.com/austincho)) +* [`d5a099c7b`](https://github.com/npm/cli/commit/d5a099c7bf62977a5a5d8242c61f323a88e27c73) + [#3615](https://github.com/npm/cli/issues/3615) + fix(readme): add nvm-windows to installers links + ([@Yash-Singh1](https://github.com/Yash-Singh1)) + ## v7.20.5 (2021-08-05) ### DEPENDENCIES diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index ec1c513864c1b..33dff2e8e8b9c 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -4,6 +4,10 @@ All interactions in the **npm** organization on GitHub are considered to be covered by our standard [Code of Conduct](https://docs.npmjs.com/policies/conduct). +## Reporting Bugs + +When submitting a new bug report, please first [search](https://github.com/npm/cli/issues) for an existing or similar report & then use one of our existing [issue templates](https://github.com/npm/cli/issues/new/choose) if you believe you've come across a unique problem. Duplicate issues, or issues that don't use one of our templates may get closed without a response. + ## Development **1. Clone this repository...** @@ -33,7 +37,7 @@ $ npm run test ## Test Coverage -We expect that every new feature or bug fix comes with corresponding tests that validate the solutions. We strive to have as close to, if not exactly, 100% code coverage. +We use [`tap`](https://node-tap.org/) for testing & expect that every new feature or bug fix comes with corresponding tests that validate the solutions. We strive to have as close to, if not exactly, 100% code coverage. **You can find out what the current test coverage percentage is by running...** @@ -51,10 +55,12 @@ We've set up an automated [benchmark](https://github.com/npm/benchmarks) integra You can learn more about this tool, including how to run & configure it manually, [here](https://github.com/npm/benchmarks) -## Dependency Updates +## What _not_ to contribute? + +### Dependencies It should be noted that our team does not accept third-party dependency updates/PRs. We have a [release process](https://github.com/npm/cli/wiki/Release-Process) that includes checks to ensure dependencies are staying up-to-date & will ship security patches for CVEs as they occur. If you submit a PR trying to update our dependencies we will close it with or without a reference to these contribution guidelines. -## Reporting Bugs +### Tools/Automation -When submitting a new bug report, please first [search](https://github.com/npm/cli/issues) for an existing or similar report & then use one of our existing [issue templates](https://github.com/npm/cli/issues/new/choose) if you believe you've come across a unique problem. Duplicate issues, or issues that don't use one of our templates may get closed without a response. +Our core team is responsible for the maintenance of the tooling/automation in this project & we ask collaborators to kindly not make changes to these when contributing (ex. `.github/*`, `.eslintrc.json`, `.licensee.json` etc.) diff --git a/Makefile b/Makefile index 0005223d9921a..6fb39c704ff1d 100644 --- a/Makefile +++ b/Makefile @@ -30,7 +30,12 @@ all: docs docs: mandocs htmldocs +# don't regenerate the snapshot if we're generating +# snapshots, since presumably we just did that. mandocs: dev-deps $(mandocs) + @ ! [ $${npm_lifecycle_event} = "snap" ] && \ + ! [ $${npm_lifecycle_event} = "postsnap" ] && \ + TAP_SNAPSHOT=1 node test/lib/utils/config/definitions.js || true $(version_mandocs): package.json @@ -76,6 +81,12 @@ docs/content/using-npm/config.md: scripts/config-doc.js lib/utils/config/*.js docs/content/commands/npm-%.md: lib/%.js scripts/config-doc-command.js lib/utils/config/*.js node scripts/config-doc-command.js $@ $< +freshdocs: + touch lib/utils/config/definitions.js + touch scripts/config-doc-command.js + touch scripts/config-doc.js + make docs + test: dev-deps node bin/npm-cli.js test @@ -109,4 +120,4 @@ publish: gitclean ls-ok link test smoke-tests docs prune release: gitclean ls-ok docs prune @bash scripts/release.sh -.PHONY: all latest install dev link docs clean uninstall test man docs-clean docsclean release ls-ok dev-deps prune +.PHONY: all latest install dev link docs clean uninstall test man docs-clean docsclean release ls-ok dev-deps prune freshdocs diff --git a/docs/content/commands/npm-access.md b/docs/content/commands/npm-access.md index 6d73d6a5e28ce..1f661c911f47d 100644 --- a/docs/content/commands/npm-access.md +++ b/docs/content/commands/npm-access.md @@ -85,6 +85,7 @@ Management of teams and team memberships is done with the `npm team` command. + #### `registry` * Default: "https://registry.npmjs.org/" @@ -92,6 +93,9 @@ Management of teams and team memberships is done with the `npm team` command. The base URL of the npm registry. + + + #### `otp` * Default: null @@ -103,6 +107,9 @@ when publishing or changing package permissions with `npm access`. If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. + + + ### See Also diff --git a/docs/content/commands/npm-adduser.md b/docs/content/commands/npm-adduser.md index f25d3ccd87ab4..21a31ca940e52 100644 --- a/docs/content/commands/npm-adduser.md +++ b/docs/content/commands/npm-adduser.md @@ -37,6 +37,7 @@ your existing record. + #### `registry` * Default: "https://registry.npmjs.org/" @@ -44,6 +45,9 @@ your existing record. The base URL of the npm registry. + + + #### `scope` * Default: the scope of the current project, if any, or "" @@ -74,6 +78,9 @@ npm init --scope=@foo --yes ``` + + + ### See Also diff --git a/docs/content/commands/npm-audit.md b/docs/content/commands/npm-audit.md index 94b16b27bd7ed..58c614d793db2 100644 --- a/docs/content/commands/npm-audit.md +++ b/docs/content/commands/npm-audit.md @@ -191,6 +191,7 @@ $ npm audit --audit-level=moderate + #### `audit-level` * Default: null @@ -199,6 +200,9 @@ $ npm audit --audit-level=moderate The minimum level of vulnerability for `npm audit` to exit with a non-zero exit code. + + + #### `dry-run` * Default: false @@ -212,6 +216,9 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + + #### `force` * Default: false @@ -237,6 +244,9 @@ mistakes, unnecessary performance degradation, and malicious input. If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! + + + #### `json` * Default: false @@ -249,6 +259,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `package-lock-only` * Default: false @@ -263,6 +276,9 @@ instead of checking `node_modules` and downloading dependencies. For `list` this means the output will be based on the tree described by the `package-lock.json`, rather than the contents of `node_modules`. + + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -281,6 +297,9 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + + #### `workspace` * Default: @@ -294,8 +313,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -303,16 +322,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-bin.md b/docs/content/commands/npm-bin.md index 12984da1d1db7..2d7c1d5b8149e 100644 --- a/docs/content/commands/npm-bin.md +++ b/docs/content/commands/npm-bin.md @@ -20,6 +20,7 @@ Print the folder where npm will install executables. + #### `global` * Default: false @@ -34,6 +35,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + ### See Also diff --git a/docs/content/commands/npm-bugs.md b/docs/content/commands/npm-bugs.md index b8778324b8e4a..f92241a14b95c 100644 --- a/docs/content/commands/npm-bugs.md +++ b/docs/content/commands/npm-bugs.md @@ -23,6 +23,7 @@ will search for a `package.json` in the current folder and use the `name` proper + #### `browser` * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` @@ -35,6 +36,9 @@ terminal. Set to `true` to use default system URL opener. + + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -42,6 +46,9 @@ Set to `true` to use default system URL opener. The base URL of the npm registry. + + + ### See Also diff --git a/docs/content/commands/npm-cache.md b/docs/content/commands/npm-cache.md index e371f196d7c42..6497a3988c938 100644 --- a/docs/content/commands/npm-cache.md +++ b/docs/content/commands/npm-cache.md @@ -77,6 +77,7 @@ verify`. + #### `cache` * Default: Windows: `%LocalAppData%\npm-cache`, Posix: `~/.npm` @@ -85,6 +86,9 @@ verify`. The location of npm's cache directory. See [`npm cache`](/commands/npm-cache) + + + ### See Also diff --git a/docs/content/commands/npm-ci.md b/docs/content/commands/npm-ci.md index 31c92b13c5cdd..1ce50c66d5faf 100644 --- a/docs/content/commands/npm-ci.md +++ b/docs/content/commands/npm-ci.md @@ -69,6 +69,7 @@ cache: + #### `audit` * Default: true @@ -79,6 +80,9 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/commands/npm-audit) for details on what is submitted. + + + #### `ignore-scripts` * Default: false @@ -91,6 +95,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -99,6 +106,9 @@ will *not* run any pre- or post-scripts. The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + + ### See Also diff --git a/docs/content/commands/npm-config.md b/docs/content/commands/npm-config.md index 9e76a23671e86..2d77f045cbc47 100644 --- a/docs/content/commands/npm-config.md +++ b/docs/content/commands/npm-config.md @@ -97,6 +97,7 @@ global config. + #### `json` * Default: false @@ -109,6 +110,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `global` * Default: false @@ -123,6 +127,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + #### `editor` * Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on @@ -131,6 +138,9 @@ folder instead of the current working directory. See The command to run for `npm edit` and `npm config edit`. + + + #### `location` * Default: "user" unless `--global` is passed, which will also set this value @@ -139,6 +149,9 @@ The command to run for `npm edit` and `npm config edit`. When passed to `npm config` this refers to which config file to use. + + + #### `long` * Default: false @@ -146,6 +159,9 @@ When passed to `npm config` this refers to which config file to use. Show extended information in `ls`, `search`, and `help-search`. + + + ### See Also diff --git a/docs/content/commands/npm-dedupe.md b/docs/content/commands/npm-dedupe.md index 324e6a71b7a3e..377e17d814a6f 100644 --- a/docs/content/commands/npm-dedupe.md +++ b/docs/content/commands/npm-dedupe.md @@ -76,6 +76,7 @@ Using `npm find-dupes` will run the command in `--dry-run` mode. + #### `global-style` * Default: false @@ -88,6 +89,9 @@ on will be flattened in their `node_modules` folders. This obviously will eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` will be preferred. + + + #### `legacy-bundling` * Default: false @@ -98,6 +102,9 @@ such as the one included with node 0.8, can install the package. This eliminates all automatic deduping. If used with `global-style` this option will be preferred. + + + #### `strict-peer-deps` * Default: false @@ -117,6 +124,9 @@ When such and override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + + #### `package-lock` * Default: true @@ -129,6 +139,9 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. + + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -147,6 +160,9 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + + #### `ignore-scripts` * Default: false @@ -159,6 +175,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `audit` * Default: true @@ -169,6 +188,9 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/commands/npm-audit) for details on what is submitted. + + + #### `bin-links` * Default: true @@ -181,6 +203,9 @@ Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. + + + #### `fund` * Default: true @@ -190,6 +215,9 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/commands/npm-fund) for details. + + + #### `dry-run` * Default: false @@ -203,6 +231,9 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + + #### `workspace` * Default: @@ -216,8 +247,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -225,16 +256,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-deprecate.md b/docs/content/commands/npm-deprecate.md index b5c0e67144aef..438a54ec6e4f3 100644 --- a/docs/content/commands/npm-deprecate.md +++ b/docs/content/commands/npm-deprecate.md @@ -44,6 +44,7 @@ format an empty string. + #### `registry` * Default: "https://registry.npmjs.org/" @@ -51,6 +52,9 @@ format an empty string. The base URL of the npm registry. + + + #### `otp` * Default: null @@ -62,6 +66,9 @@ when publishing or changing package permissions with `npm access`. If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. + + + ### See Also @@ -69,4 +76,4 @@ password, npm will prompt on the command line for one. * [npm publish](/commands/npm-publish) * [npm registry](/using-npm/registry) * [npm owner](/commands/npm-owner) -* [npm owner](/commands/npm-adduser) +* [npm adduser](/commands/npm-adduser) diff --git a/docs/content/commands/npm-diff.md b/docs/content/commands/npm-diff.md index 479cb63b11213..8d05df779f3ca 100644 --- a/docs/content/commands/npm-diff.md +++ b/docs/content/commands/npm-diff.md @@ -155,6 +155,7 @@ located within the folder `./lib/` and changed lines of code within the + #### `diff` * Default: @@ -162,6 +163,9 @@ located within the folder `./lib/` and changed lines of code within the Define arguments to compare in `npm diff`. + + + #### `diff-name-only` * Default: false @@ -169,6 +173,9 @@ Define arguments to compare in `npm diff`. Prints only filenames when using `npm diff`. + + + #### `diff-unified` * Default: 3 @@ -176,6 +183,9 @@ Prints only filenames when using `npm diff`. The number of lines of context to print in `npm diff`. + + + #### `diff-ignore-all-space` * Default: false @@ -183,6 +193,9 @@ The number of lines of context to print in `npm diff`. Ignore whitespace when comparing lines in `npm diff`. + + + #### `diff-no-prefix` * Default: false @@ -193,6 +206,9 @@ Do not show any source or destination prefix in `npm diff` output. Note: this causes `npm diff` to ignore the `--diff-src-prefix` and `--diff-dst-prefix` configs. + + + #### `diff-src-prefix` * Default: "a/" @@ -200,6 +216,9 @@ Note: this causes `npm diff` to ignore the `--diff-src-prefix` and Source prefix to be used in `npm diff` output. + + + #### `diff-dst-prefix` * Default: "b/" @@ -207,6 +226,9 @@ Source prefix to be used in `npm diff` output. Destination prefix to be used in `npm diff` output. + + + #### `diff-text` * Default: false @@ -214,6 +236,9 @@ Destination prefix to be used in `npm diff` output. Treat all files as text in `npm diff`. + + + #### `global` * Default: false @@ -228,6 +253,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + #### `tag` * Default: "latest" @@ -242,6 +270,9 @@ command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. + + + #### `workspace` * Default: @@ -255,8 +286,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -264,16 +295,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ## See Also diff --git a/docs/content/commands/npm-dist-tag.md b/docs/content/commands/npm-dist-tag.md index 0e4e0ce56c69d..a4e0243aac87b 100644 --- a/docs/content/commands/npm-dist-tag.md +++ b/docs/content/commands/npm-dist-tag.md @@ -92,6 +92,7 @@ not begin with a number or the letter `v`. + #### `workspace` * Default: @@ -105,8 +106,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -114,16 +115,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-docs.md b/docs/content/commands/npm-docs.md index 7f4c860837035..970d17aa829c6 100644 --- a/docs/content/commands/npm-docs.md +++ b/docs/content/commands/npm-docs.md @@ -24,6 +24,7 @@ the `name` property. + #### `browser` * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` @@ -36,6 +37,9 @@ terminal. Set to `true` to use default system URL opener. + + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -43,6 +47,9 @@ Set to `true` to use default system URL opener. The base URL of the npm registry. + + + #### `workspace` * Default: @@ -56,8 +63,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -65,16 +72,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-doctor.md b/docs/content/commands/npm-doctor.md index 839f4261bbbc2..0cce60c7b7b15 100644 --- a/docs/content/commands/npm-doctor.md +++ b/docs/content/commands/npm-doctor.md @@ -106,6 +106,7 @@ reset the cache. + #### `registry` * Default: "https://registry.npmjs.org/" @@ -113,6 +114,9 @@ reset the cache. The base URL of the npm registry. + + + ### See Also diff --git a/docs/content/commands/npm-edit.md b/docs/content/commands/npm-edit.md index 6930844bcae2c..5ae7f2481ae45 100644 --- a/docs/content/commands/npm-edit.md +++ b/docs/content/commands/npm-edit.md @@ -29,6 +29,7 @@ changes to your locally installed copy. + #### `editor` * Default: The EDITOR or VISUAL environment variables, or 'notepad.exe' on @@ -37,6 +38,9 @@ changes to your locally installed copy. The command to run for `npm edit` and `npm config edit`. + + + ### See Also diff --git a/docs/content/commands/npm-exec.md b/docs/content/commands/npm-exec.md index d4ea94371a85c..db23536628e47 100644 --- a/docs/content/commands/npm-exec.md +++ b/docs/content/commands/npm-exec.md @@ -124,6 +124,7 @@ $ npm exec -- foo@latest bar --package=@npmcli/foo + #### `package` * Default: @@ -131,6 +132,9 @@ $ npm exec -- foo@latest bar --package=@npmcli/foo The package to install for [`npm exec`](/commands/npm-exec) + + + #### `call` * Default: "" @@ -144,6 +148,9 @@ npm exec --package yo --package generator-node --call "yo node" ``` + + + #### `workspace` * Default: @@ -157,8 +164,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -166,16 +173,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### Examples diff --git a/docs/content/commands/npm-explain.md b/docs/content/commands/npm-explain.md index 3a87ee8e438ba..5f05cac0f906b 100644 --- a/docs/content/commands/npm-explain.md +++ b/docs/content/commands/npm-explain.md @@ -56,6 +56,7 @@ node_modules/nyc/node_modules/find-up ### Configuration + #### `json` * Default: false @@ -68,6 +69,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `workspace` * Default: @@ -81,8 +85,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -90,6 +94,9 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + ### See Also diff --git a/docs/content/commands/npm-explore.md b/docs/content/commands/npm-explore.md index c4a40cf7229f7..3979da9573db0 100644 --- a/docs/content/commands/npm-explore.md +++ b/docs/content/commands/npm-explore.md @@ -33,6 +33,7 @@ sure to use `npm rebuild ` if you make any changes. + #### `shell` * Default: SHELL environment variable, or "bash" on Posix, or "cmd.exe" on @@ -41,6 +42,9 @@ sure to use `npm rebuild ` if you make any changes. The shell to run for the `npm explore` command. + + + ### See Also diff --git a/docs/content/commands/npm-find-dupes.md b/docs/content/commands/npm-find-dupes.md index 3b28f6443decd..f7dc84f9c5306 100644 --- a/docs/content/commands/npm-find-dupes.md +++ b/docs/content/commands/npm-find-dupes.md @@ -19,6 +19,7 @@ duplications, without actually changing the package tree. + #### `global-style` * Default: false @@ -31,6 +32,9 @@ on will be flattened in their `node_modules` folders. This obviously will eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` will be preferred. + + + #### `legacy-bundling` * Default: false @@ -41,6 +45,9 @@ such as the one included with node 0.8, can install the package. This eliminates all automatic deduping. If used with `global-style` this option will be preferred. + + + #### `strict-peer-deps` * Default: false @@ -60,6 +67,9 @@ When such and override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + + #### `package-lock` * Default: true @@ -72,6 +82,9 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. + + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -90,6 +103,9 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + + #### `ignore-scripts` * Default: false @@ -102,6 +118,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `audit` * Default: true @@ -112,6 +131,9 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/commands/npm-audit) for details on what is submitted. + + + #### `bin-links` * Default: true @@ -124,6 +146,9 @@ Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. + + + #### `fund` * Default: true @@ -133,6 +158,9 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/commands/npm-fund) for details. + + + #### `workspace` * Default: @@ -146,8 +174,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -155,16 +183,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-fund.md b/docs/content/commands/npm-fund.md index ec5f5a37fdb71..606b0a188c554 100644 --- a/docs/content/commands/npm-fund.md +++ b/docs/content/commands/npm-fund.md @@ -66,6 +66,7 @@ test-workspaces-fund@1.0.0 + #### `json` * Default: false @@ -78,6 +79,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `browser` * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` @@ -90,6 +94,9 @@ terminal. Set to `true` to use default system URL opener. + + + #### `unicode` * Default: false on windows, true on mac/unix systems with a unicode locale, @@ -99,6 +106,9 @@ Set to `true` to use default system URL opener. When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. + + + #### `workspace` * Default: @@ -112,8 +122,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -121,6 +131,9 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `which` * Default: null @@ -128,6 +141,9 @@ This value is not exported to the environment for child processes. If there are multiple funding sources, which 1-indexed source URL to open. + + + ## See Also diff --git a/docs/content/commands/npm-help-search.md b/docs/content/commands/npm-help-search.md index 70f4f182d17e3..78553a14ecb01 100644 --- a/docs/content/commands/npm-help-search.md +++ b/docs/content/commands/npm-help-search.md @@ -27,6 +27,7 @@ directly. + #### `long` * Default: false @@ -34,6 +35,9 @@ directly. Show extended information in `ls`, `search`, and `help-search`. + + + ### See Also diff --git a/docs/content/commands/npm-help.md b/docs/content/commands/npm-help.md index 81f55db332eda..a8002eef17156 100644 --- a/docs/content/commands/npm-help.md +++ b/docs/content/commands/npm-help.md @@ -25,6 +25,7 @@ topic, so unique matches are equivalent to specifying a topic name. + #### `viewer` * Default: "man" on Posix, "browser" on Windows @@ -34,6 +35,9 @@ The program to use to view help content. Set to `"browser"` to view html help content in the default web browser. + + + ### See Also diff --git a/docs/content/commands/npm-hook.md b/docs/content/commands/npm-hook.md index 2917375ea38cd..c91bce3075e7b 100644 --- a/docs/content/commands/npm-hook.md +++ b/docs/content/commands/npm-hook.md @@ -87,6 +87,7 @@ $ npm hook rm id-deadbeef + #### `registry` * Default: "https://registry.npmjs.org/" @@ -94,6 +95,9 @@ $ npm hook rm id-deadbeef The base URL of the npm registry. + + + #### `otp` * Default: null @@ -105,6 +109,9 @@ when publishing or changing package permissions with `npm access`. If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. + + + ### See Also diff --git a/docs/content/commands/npm-init.md b/docs/content/commands/npm-init.md index 54c3bdb4b74ab..d5a02494fe49f 100644 --- a/docs/content/commands/npm-init.md +++ b/docs/content/commands/npm-init.md @@ -147,6 +147,7 @@ dot to represent the current directory in that context, e.g: `react-app .`: + #### `yes` * Default: null @@ -155,6 +156,9 @@ dot to represent the current directory in that context, e.g: `react-app .`: Automatically answer "yes" to any prompts that npm might print on the command line. + + + #### `force` * Default: false @@ -180,6 +184,9 @@ mistakes, unnecessary performance degradation, and malicious input. If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! + + + #### `workspace` * Default: @@ -193,8 +200,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -202,16 +209,30 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + ### See Also diff --git a/docs/content/commands/npm-install-ci-test.md b/docs/content/commands/npm-install-ci-test.md index 2640311cf94be..5c37ed8f56128 100644 --- a/docs/content/commands/npm-install-ci-test.md +++ b/docs/content/commands/npm-install-ci-test.md @@ -20,6 +20,7 @@ This command runs `npm ci` followed immediately by `npm test`. + #### `audit` * Default: true @@ -30,6 +31,9 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/commands/npm-audit) for details on what is submitted. + + + #### `ignore-scripts` * Default: false @@ -42,6 +46,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -50,6 +57,9 @@ will *not* run any pre- or post-scripts. The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + + ### See Also diff --git a/docs/content/commands/npm-install-test.md b/docs/content/commands/npm-install-test.md index c8533cafedd7a..c464e5bd0b8c6 100644 --- a/docs/content/commands/npm-install-test.md +++ b/docs/content/commands/npm-install-test.md @@ -29,6 +29,7 @@ takes exactly the same arguments as `npm install`. + #### `save` * Default: true @@ -39,6 +40,9 @@ Save installed packages to a package.json file as dependencies. When used with the `npm rm` command, removes the dependency from package.json. + + + #### `save-exact` * Default: false @@ -47,6 +51,9 @@ package.json. Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. + + + #### `global` * Default: false @@ -61,6 +68,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + #### `global-style` * Default: false @@ -73,6 +83,9 @@ on will be flattened in their `node_modules` folders. This obviously will eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` will be preferred. + + + #### `legacy-bundling` * Default: false @@ -83,6 +96,9 @@ such as the one included with node 0.8, can install the package. This eliminates all automatic deduping. If used with `global-style` this option will be preferred. + + + #### `strict-peer-deps` * Default: false @@ -102,6 +118,9 @@ When such and override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + + #### `package-lock` * Default: true @@ -114,6 +133,9 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. + + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -132,6 +154,9 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + + #### `ignore-scripts` * Default: false @@ -144,6 +169,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `audit` * Default: true @@ -154,6 +182,9 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/commands/npm-audit) for details on what is submitted. + + + #### `bin-links` * Default: true @@ -166,6 +197,9 @@ Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. + + + #### `fund` * Default: true @@ -175,6 +209,9 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/commands/npm-fund) for details. + + + #### `dry-run` * Default: false @@ -188,6 +225,9 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + + #### `workspace` * Default: @@ -201,8 +241,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -210,16 +250,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-install.md b/docs/content/commands/npm-install.md index 70d4c0d46ffeb..a103845d1a675 100644 --- a/docs/content/commands/npm-install.md +++ b/docs/content/commands/npm-install.md @@ -413,6 +413,7 @@ These are some of the most common options related to installation. + #### `save` * Default: true @@ -423,6 +424,9 @@ Save installed packages to a package.json file as dependencies. When used with the `npm rm` command, removes the dependency from package.json. + + + #### `save-exact` * Default: false @@ -431,6 +435,9 @@ package.json. Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. + + + #### `global` * Default: false @@ -445,6 +452,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + #### `global-style` * Default: false @@ -457,6 +467,9 @@ on will be flattened in their `node_modules` folders. This obviously will eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` will be preferred. + + + #### `legacy-bundling` * Default: false @@ -467,6 +480,9 @@ such as the one included with node 0.8, can install the package. This eliminates all automatic deduping. If used with `global-style` this option will be preferred. + + + #### `strict-peer-deps` * Default: false @@ -486,6 +502,9 @@ When such and override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + + #### `package-lock` * Default: true @@ -498,6 +517,9 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. + + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -516,6 +538,9 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + + #### `ignore-scripts` * Default: false @@ -528,6 +553,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `audit` * Default: true @@ -538,6 +566,9 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/commands/npm-audit) for details on what is submitted. + + + #### `bin-links` * Default: true @@ -550,6 +581,9 @@ Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. + + + #### `fund` * Default: true @@ -559,6 +593,9 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/commands/npm-fund) for details. + + + #### `dry-run` * Default: false @@ -572,6 +609,9 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + + #### `workspace` * Default: @@ -585,8 +625,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -594,16 +634,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### Algorithm diff --git a/docs/content/commands/npm-link.md b/docs/content/commands/npm-link.md index c7b385009519a..d4ef41ae96462 100644 --- a/docs/content/commands/npm-link.md +++ b/docs/content/commands/npm-link.md @@ -113,6 +113,7 @@ workspace(s). + #### `save` * Default: true @@ -123,6 +124,9 @@ Save installed packages to a package.json file as dependencies. When used with the `npm rm` command, removes the dependency from package.json. + + + #### `save-exact` * Default: false @@ -131,6 +135,9 @@ package.json. Dependencies saved to package.json will be configured with an exact version rather than using npm's default semver range operator. + + + #### `global` * Default: false @@ -145,6 +152,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + #### `global-style` * Default: false @@ -157,6 +167,9 @@ on will be flattened in their `node_modules` folders. This obviously will eliminate some deduping. If used with `legacy-bundling`, `legacy-bundling` will be preferred. + + + #### `legacy-bundling` * Default: false @@ -167,6 +180,9 @@ such as the one included with node 0.8, can install the package. This eliminates all automatic deduping. If used with `global-style` this option will be preferred. + + + #### `strict-peer-deps` * Default: false @@ -186,6 +202,9 @@ When such and override is performed, a warning is printed, explaining the conflict and the packages involved. If `--strict-peer-deps` is set, then this warning is treated as a failure. + + + #### `package-lock` * Default: true @@ -198,6 +217,9 @@ When package package-locks are disabled, automatic pruning of extraneous modules will also be disabled. To remove extraneous modules with package-locks disabled use `npm prune`. + + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -216,6 +238,9 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + + #### `ignore-scripts` * Default: false @@ -228,6 +253,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `audit` * Default: true @@ -238,6 +266,9 @@ default registry and all registries configured for scopes. See the documentation for [`npm audit`](/commands/npm-audit) for details on what is submitted. + + + #### `bin-links` * Default: true @@ -250,6 +281,9 @@ Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. + + + #### `fund` * Default: true @@ -259,6 +293,9 @@ When "true" displays the message at the end of each `npm install` acknowledging the number of dependencies looking for funding. See [`npm fund`](/commands/npm-fund) for details. + + + #### `dry-run` * Default: false @@ -272,6 +309,9 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + + #### `workspace` * Default: @@ -285,8 +325,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -294,16 +334,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-logout.md b/docs/content/commands/npm-logout.md index 000b1006e8b35..cb7c8496fb479 100644 --- a/docs/content/commands/npm-logout.md +++ b/docs/content/commands/npm-logout.md @@ -29,6 +29,7 @@ connected to that scope, if set. + #### `registry` * Default: "https://registry.npmjs.org/" @@ -36,6 +37,9 @@ connected to that scope, if set. The base URL of the npm registry. + + + #### `scope` * Default: the scope of the current project, if any, or "" @@ -66,6 +70,9 @@ npm init --scope=@foo --yes ``` + + + ### See Also diff --git a/docs/content/commands/npm-ls.md b/docs/content/commands/npm-ls.md index 350f40a9991e5..3b33f0a3605e0 100644 --- a/docs/content/commands/npm-ls.md +++ b/docs/content/commands/npm-ls.md @@ -75,6 +75,7 @@ least the default human-readable `npm ls` output in npm v8. + #### `all` * Default: false @@ -84,6 +85,9 @@ When running `npm outdated` and `npm ls`, setting `--all` will show all outdated or installed packages, rather than only those directly depended upon by the current project. + + + #### `json` * Default: false @@ -96,6 +100,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `long` * Default: false @@ -103,6 +110,9 @@ Not supported by all npm commands. Show extended information in `ls`, `search`, and `help-search`. + + + #### `parseable` * Default: false @@ -111,6 +121,9 @@ Show extended information in `ls`, `search`, and `help-search`. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + + #### `global` * Default: false @@ -125,6 +138,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + #### `depth` * Default: `Infinity` if `--all` is set, otherwise `1` @@ -135,6 +151,9 @@ The depth to go when recursing packages for `npm ls`. If not set, `npm ls` will show only the immediate dependencies of the root project. If `--all` is set, then npm will show all dependencies by default. + + + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -153,6 +172,9 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + + #### `link` * Default: false @@ -160,6 +182,9 @@ variable will be set to `'production'` for all lifecycle scripts. Used with `npm ls`, limiting output to only those packages that are linked. + + + #### `package-lock-only` * Default: false @@ -174,6 +199,9 @@ instead of checking `node_modules` and downloading dependencies. For `list` this means the output will be based on the tree described by the `package-lock.json`, rather than the contents of `node_modules`. + + + #### `unicode` * Default: false on windows, true on mac/unix systems with a unicode locale, @@ -183,6 +211,9 @@ For `list` this means the output will be based on the tree described by the When set to true, npm uses unicode characters in the tree output. When false, it uses ascii characters instead of unicode glyphs. + + + #### `workspace` * Default: @@ -196,8 +227,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -205,16 +236,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-org.md b/docs/content/commands/npm-org.md index 269f5cc3ee5b8..2f08f61152992 100644 --- a/docs/content/commands/npm-org.md +++ b/docs/content/commands/npm-org.md @@ -62,6 +62,7 @@ listing them, and finding specific ones and their roles. + #### `registry` * Default: "https://registry.npmjs.org/" @@ -69,6 +70,9 @@ listing them, and finding specific ones and their roles. The base URL of the npm registry. + + + #### `otp` * Default: null @@ -80,6 +84,9 @@ when publishing or changing package permissions with `npm access`. If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. + + + #### `json` * Default: false @@ -92,6 +99,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `parseable` * Default: false @@ -100,6 +110,9 @@ Not supported by all npm commands. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + + ### See Also diff --git a/docs/content/commands/npm-outdated.md b/docs/content/commands/npm-outdated.md index 40e5feafd4cc6..1b58a6afda64b 100644 --- a/docs/content/commands/npm-outdated.md +++ b/docs/content/commands/npm-outdated.md @@ -88,6 +88,7 @@ A few things to note: + #### `all` * Default: false @@ -97,6 +98,9 @@ When running `npm outdated` and `npm ls`, setting `--all` will show all outdated or installed packages, rather than only those directly depended upon by the current project. + + + #### `json` * Default: false @@ -109,6 +113,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `long` * Default: false @@ -116,6 +123,9 @@ Not supported by all npm commands. Show extended information in `ls`, `search`, and `help-search`. + + + #### `parseable` * Default: false @@ -124,6 +134,9 @@ Show extended information in `ls`, `search`, and `help-search`. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + + #### `global` * Default: false @@ -138,6 +151,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + #### `workspace` * Default: @@ -151,8 +167,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -160,6 +176,9 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + ### See Also diff --git a/docs/content/commands/npm-owner.md b/docs/content/commands/npm-owner.md index da22e899c2ebb..74e7f84af6c80 100644 --- a/docs/content/commands/npm-owner.md +++ b/docs/content/commands/npm-owner.md @@ -39,6 +39,7 @@ on the command line when changing ownership with `--otp`. + #### `registry` * Default: "https://registry.npmjs.org/" @@ -46,6 +47,9 @@ on the command line when changing ownership with `--otp`. The base URL of the npm registry. + + + #### `otp` * Default: null @@ -57,6 +61,9 @@ when publishing or changing package permissions with `npm access`. If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. + + + ### See Also diff --git a/docs/content/commands/npm-pack.md b/docs/content/commands/npm-pack.md index cd4a175919e7e..53945986837b9 100644 --- a/docs/content/commands/npm-pack.md +++ b/docs/content/commands/npm-pack.md @@ -14,6 +14,7 @@ npm pack [[<@scope>/]...] [--dry-run] [--json] + #### `dry-run` * Default: false @@ -27,6 +28,9 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + + #### `json` * Default: false @@ -39,6 +43,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `pack-destination` * Default: "." @@ -46,6 +53,9 @@ Not supported by all npm commands. Directory in which `npm pack` will save tarballs. + + + #### `workspace` * Default: @@ -59,8 +69,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -68,16 +78,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### Description diff --git a/docs/content/commands/npm-ping.md b/docs/content/commands/npm-ping.md index 7c7b66b181b4a..6f1c4582f058f 100644 --- a/docs/content/commands/npm-ping.md +++ b/docs/content/commands/npm-ping.md @@ -29,6 +29,7 @@ Ping error: {*Detail about error} + #### `registry` * Default: "https://registry.npmjs.org/" @@ -36,6 +37,9 @@ Ping error: {*Detail about error} The base URL of the npm registry. + + + ### See Also diff --git a/docs/content/commands/npm-pkg.md b/docs/content/commands/npm-pkg.md index bc96eb8c3af94..beee9c1c4e78a 100644 --- a/docs/content/commands/npm-pkg.md +++ b/docs/content/commands/npm-pkg.md @@ -166,6 +166,7 @@ npm pkg get name version --ws + #### `force` * Default: false @@ -191,6 +192,9 @@ mistakes, unnecessary performance degradation, and malicious input. If you don't have a clear idea of what you want to do, it is strongly recommended that you do not use this option! + + + #### `json` * Default: false @@ -203,6 +207,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `workspace` * Default: @@ -216,8 +223,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -225,16 +232,30 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + ## See Also diff --git a/docs/content/commands/npm-prefix.md b/docs/content/commands/npm-prefix.md index 0523c9e19513d..276a9e9e69910 100644 --- a/docs/content/commands/npm-prefix.md +++ b/docs/content/commands/npm-prefix.md @@ -37,6 +37,7 @@ npm prefix -g + #### `global` * Default: false @@ -51,6 +52,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + ### See Also diff --git a/docs/content/commands/npm-profile.md b/docs/content/commands/npm-profile.md index 079440d785815..cecc48518dbdb 100644 --- a/docs/content/commands/npm-profile.md +++ b/docs/content/commands/npm-profile.md @@ -77,6 +77,7 @@ Some of these commands may not be available on non npmjs.com registries. + #### `registry` * Default: "https://registry.npmjs.org/" @@ -84,6 +85,9 @@ Some of these commands may not be available on non npmjs.com registries. The base URL of the npm registry. + + + #### `json` * Default: false @@ -96,6 +100,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `parseable` * Default: false @@ -104,6 +111,9 @@ Not supported by all npm commands. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + + #### `otp` * Default: null @@ -115,6 +125,9 @@ when publishing or changing package permissions with `npm access`. If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. + + + ### See Also diff --git a/docs/content/commands/npm-prune.md b/docs/content/commands/npm-prune.md index d9b5b068f7a4b..658ab2610e0ed 100644 --- a/docs/content/commands/npm-prune.md +++ b/docs/content/commands/npm-prune.md @@ -37,6 +37,7 @@ this command can help clean up any resulting garbage. + #### `omit` * Default: 'dev' if the `NODE_ENV` environment variable is set to @@ -55,6 +56,9 @@ it will be included. If the resulting omit list includes `'dev'`, then the `NODE_ENV` environment variable will be set to `'production'` for all lifecycle scripts. + + + #### `dry-run` * Default: false @@ -68,6 +72,9 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + + #### `json` * Default: false @@ -80,6 +87,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `workspace` * Default: @@ -93,8 +103,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -102,16 +112,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-publish.md b/docs/content/commands/npm-publish.md index 9eb060a78be29..6958b1066de7f 100644 --- a/docs/content/commands/npm-publish.md +++ b/docs/content/commands/npm-publish.md @@ -108,6 +108,7 @@ built. + #### `tag` * Default: "latest" @@ -122,6 +123,9 @@ command, if no explicit tag is given. When used by the `npm diff` command, this is the tag used to fetch the tarball that will be compared with the local files by default. + + + #### `access` * Default: 'restricted' for scoped packages, 'public' for unscoped packages @@ -133,9 +137,13 @@ 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`. +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`. + + + #### `dry-run` @@ -150,6 +158,9 @@ commands that modify your local installation, eg, `install`, `update`, Note: This is NOT honored by other network related commands, eg `dist-tags`, `owner`, etc. + + + #### `otp` * Default: null @@ -161,6 +172,9 @@ when publishing or changing package permissions with `npm access`. If not set, and a registry response fails with a challenge for a one-time password, npm will prompt on the command line for one. + + + #### `workspace` * Default: @@ -174,8 +188,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -183,16 +197,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-rebuild.md b/docs/content/commands/npm-rebuild.md index 49c822d730526..75e71c60e6810 100644 --- a/docs/content/commands/npm-rebuild.md +++ b/docs/content/commands/npm-rebuild.md @@ -28,6 +28,7 @@ will be rebuilt. + #### `global` * Default: false @@ -42,6 +43,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + #### `bin-links` * Default: true @@ -54,6 +58,9 @@ Set to false to have it not do this. This can be used to work around the fact that some file systems don't support symlinks, even on ostensibly Unix systems. + + + #### `ignore-scripts` * Default: false @@ -66,6 +73,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `workspace` * Default: @@ -79,8 +89,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -88,16 +98,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-repo.md b/docs/content/commands/npm-repo.md index ade08e7d938e7..cd47fde47127e 100644 --- a/docs/content/commands/npm-repo.md +++ b/docs/content/commands/npm-repo.md @@ -21,6 +21,7 @@ in the current folder and use the `repository` property. + #### `browser` * Default: OS X: `"open"`, Windows: `"start"`, Others: `"xdg-open"` @@ -33,6 +34,9 @@ terminal. Set to `true` to use default system URL opener. + + + #### `workspace` * Default: @@ -46,8 +50,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -55,16 +59,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + ### See Also diff --git a/docs/content/commands/npm-restart.md b/docs/content/commands/npm-restart.md index 4b905c2670695..80f8ab77ef018 100644 --- a/docs/content/commands/npm-restart.md +++ b/docs/content/commands/npm-restart.md @@ -38,6 +38,7 @@ If it does _not_ have a `"restart"` script specified, but it does have + #### `ignore-scripts` * Default: false @@ -50,6 +51,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -58,6 +62,9 @@ will *not* run any pre- or post-scripts. The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + + ### See Also diff --git a/docs/content/commands/npm-root.md b/docs/content/commands/npm-root.md index 2d072c16dec00..98d1108d33f75 100644 --- a/docs/content/commands/npm-root.md +++ b/docs/content/commands/npm-root.md @@ -27,6 +27,7 @@ echo "Global packages installed in: ${global_node_modules}" + #### `global` * Default: false @@ -41,6 +42,9 @@ folder instead of the current working directory. See * bin files are linked to `{prefix}/bin` * man pages are linked to `{prefix}/share/man` + + + ### See Also diff --git a/docs/content/commands/npm-run-script.md b/docs/content/commands/npm-run-script.md index 5e3828c40717d..6dd602d03e00a 100644 --- a/docs/content/commands/npm-run-script.md +++ b/docs/content/commands/npm-run-script.md @@ -138,6 +138,7 @@ packages. + #### `workspace` * Default: @@ -151,8 +152,8 @@ Valid values for the `workspace` config are either: * Workspace names * Path to a workspace directory -* Path to a parent workspace directory (will result to selecting all of the - nested workspaces) +* Path to a parent workspace directory (will result in selecting all + workspaces within that folder) When set for the `npm init` command, this may be set to the folder of a workspace which does not yet exist, to create the folder and set it up as a @@ -160,16 +161,44 @@ brand new workspace within the project. This value is not exported to the environment for child processes. + + + #### `workspaces` -* Default: false -* Type: Boolean +* Default: null +* Type: null or Boolean -Enable running a command in the context of **all** the configured +Set to true to run the command in the context of **all** configured workspaces. +Explicitly setting this to false will cause commands like `install` to +ignore workspaces altogether. When not set explicitly: + +- Commands that operate on the `node_modules` tree (install, update, etc.) +will link workspaces into the `node_modules` folder. - Commands that do +other things (test, exec, publish, etc.) will operate on the root project, +_unless_ one or more workspaces are specified in the `workspace` config. + This value is not exported to the environment for child processes. + + + +#### `include-workspace-root` + +* Default: false +* Type: Boolean + +Include the workspace root when workspaces are enabled for a command. + +When false, specifying individual workspaces via the `workspace` config, or +all workspaces via the `workspaces` flag, will cause npm to operate only on +the specified workspaces, and not on the root project. + + + + #### `if-present` * Default: false @@ -182,6 +211,9 @@ it's present and fail if the script fails. This is useful, for example, when running scripts that may only apply for some builds in an otherwise generic CI setup. + + + #### `ignore-scripts` * Default: false @@ -194,6 +226,9 @@ Note that commands explicitly intended to run a particular script, such as will still run their intended script if `ignore-scripts` is set, but they will *not* run any pre- or post-scripts. + + + #### `script-shell` * Default: '/bin/sh' on POSIX systems, 'cmd.exe' on Windows @@ -202,6 +237,9 @@ will *not* run any pre- or post-scripts. The shell to use for scripts run with the `npm exec`, `npm run` and `npm init ` commands. + + + ### See Also diff --git a/docs/content/commands/npm-search.md b/docs/content/commands/npm-search.md index e30287635b56f..252822e719844 100644 --- a/docs/content/commands/npm-search.md +++ b/docs/content/commands/npm-search.md @@ -41,6 +41,7 @@ expression characters in most shells.) + #### `long` * Default: false @@ -48,6 +49,9 @@ expression characters in most shells.) Show extended information in `ls`, `search`, and `help-search`. + + + #### `json` * Default: false @@ -60,6 +64,9 @@ Whether or not to output JSON data, rather than the normal output. Not supported by all npm commands. + + + #### `color` * Default: true unless the NO_COLOR environ is set to something other than '0' @@ -68,6 +75,9 @@ Not supported by all npm commands. If false, never shows colors. If `"always"` then always shows colors. If true, then only prints color codes for tty file descriptors. + + + #### `parseable` * Default: false @@ -76,6 +86,9 @@ true, then only prints color codes for tty file descriptors. Output parseable results from commands that write to standard output. For `npm search`, this will be tab-separated table format. + + + #### `description` * Default: true @@ -83,6 +96,9 @@ Output parseable results from commands that write to standard output. For Show the description in `npm search` + + + #### `searchopts` * Default: "" @@ -90,6 +106,9 @@ Show the description in `npm search` Space-separated options that are always passed to search. + + + #### `searchexclude` * Default: "" @@ -97,6 +116,9 @@ Space-separated options that are always passed to search. Space-separated options that limit the results from search. + + + #### `registry` * Default: "https://registry.npmjs.org/" @@ -104,6 +126,9 @@ Space-separated options that limit the results from search. The base URL of the npm registry. + + + #### `prefer-online` * Default: false @@ -112,6 +137,9 @@ The base URL of the npm registry. If true, staleness checks for cached data will be forced, making the CLI look for updates immediately even for fresh package data. + + + #### `prefer-offline` * Default: false @@ -121,6 +149,9 @@ If true, staleness checks for cached data will be bypassed, but missing data will be requested from the server. To force full offline mode, use `--offline`. + + + #### `offline` * Default: false @@ -129,6 +160,9 @@ will be requested from the server. To force full offline mode, use Force offline mode: no network requests will be done during install. To allow the CLI to fill in missing cache data, see `--prefer-offline`. + + + ### See Also diff --git a/docs/content/commands/npm-set-script.md b/docs/content/commands/npm-set-script.md index c5d5df53203b1..869ceede045ae 100644 --- a/docs/content/commands/npm-set-script.md +++ b/docs/content/commands/npm-set-script.md @@ -30,6 +30,7 @@ npm set-script [