From 6b68c1aaa282205eb4d47dbc81909c11851f7e06 Mon Sep 17 00:00:00 2001 From: Wassim Chegham <1699357+manekinekko@users.noreply.github.com> Date: Thu, 24 Feb 2022 18:46:37 +0100 Subject: [PATCH] docs: auto-generate npm usage for each command (#4450) Closes #4189 * docs: auto-generate synopsis sections * feat: improve usage auto-generation' * chore: auto-generate npm usage for each command * docs: print default usage when usage is missing * docs: add special case for npx * fix: remove optional chaining --- docs/content/commands/npm-access.md | 12 +- docs/content/commands/npm-adduser.md | 11 +- docs/content/commands/npm-audit.md | 14 ++- docs/content/commands/npm-bin.md | 11 +- docs/content/commands/npm-bugs.md | 13 ++- docs/content/commands/npm-cache.md | 24 ++-- docs/content/commands/npm-ci.md | 11 ++ docs/content/commands/npm-completion.md | 11 +- docs/content/commands/npm-config.md | 11 +- docs/content/commands/npm-dedupe.md | 30 ++++- docs/content/commands/npm-deprecate.md | 11 +- docs/content/commands/npm-diff.md | 13 ++- docs/content/commands/npm-dist-tag.md | 11 +- docs/content/commands/npm-docs.md | 11 +- docs/content/commands/npm-doctor.md | 9 ++ docs/content/commands/npm-edit.md | 11 +- docs/content/commands/npm-exec.md | 21 ++-- docs/content/commands/npm-explain.md | 9 ++ docs/content/commands/npm-explore.md | 9 ++ docs/content/commands/npm-find-dupes.md | 11 ++ docs/content/commands/npm-fund.md | 12 +- docs/content/commands/npm-help-search.md | 9 ++ docs/content/commands/npm-help.md | 11 ++ docs/content/commands/npm-hook.md | 13 ++- docs/content/commands/npm-init.md | 18 ++- docs/content/commands/npm-install-ci-test.md | 11 +- docs/content/commands/npm-install-test.md | 37 +++++-- docs/content/commands/npm-install.md | 38 ++++--- docs/content/commands/npm-link.md | 22 +++- docs/content/commands/npm-logout.md | 11 +- docs/content/commands/npm-ls.md | 11 +- docs/content/commands/npm-org.md | 17 ++- docs/content/commands/npm-outdated.md | 9 ++ docs/content/commands/npm-owner.md | 11 +- docs/content/commands/npm-pack.md | 11 +- docs/content/commands/npm-ping.md | 11 +- docs/content/commands/npm-pkg.md | 15 ++- docs/content/commands/npm-prefix.md | 9 ++ docs/content/commands/npm-profile.md | 16 ++- docs/content/commands/npm-prune.md | 11 +- docs/content/commands/npm-publish.md | 14 ++- docs/content/commands/npm-rebuild.md | 9 ++ docs/content/commands/npm-repo.md | 9 ++ docs/content/commands/npm-restart.md | 9 ++ docs/content/commands/npm-root.md | 11 +- docs/content/commands/npm-run-script.md | 13 ++- docs/content/commands/npm-search.md | 11 +- docs/content/commands/npm-set-script.md | 9 ++ docs/content/commands/npm-shrinkwrap.md | 9 ++ docs/content/commands/npm-star.md | 9 ++ docs/content/commands/npm-stars.md | 10 ++ docs/content/commands/npm-start.md | 9 ++ docs/content/commands/npm-stop.md | 9 ++ docs/content/commands/npm-team.md | 19 +++- docs/content/commands/npm-test.md | 11 +- docs/content/commands/npm-token.md | 16 ++- docs/content/commands/npm-uninstall.md | 22 +++- docs/content/commands/npm-unstar.md | 9 ++ docs/content/commands/npm-update.md | 31 +++++- docs/content/commands/npm-version.md | 15 ++- docs/content/commands/npm-view.md | 13 ++- docs/content/commands/npm-whoami.md | 11 +- docs/content/commands/npm.md | 5 +- docs/content/commands/npx.md | 24 ++-- scripts/config-doc-command.js | 111 ++++++++++++++++--- 65 files changed, 821 insertions(+), 164 deletions(-) diff --git a/docs/content/commands/npm-access.md b/docs/content/commands/npm-access.md index 1f661c911f47d..162e94f1fec02 100644 --- a/docs/content/commands/npm-access.md +++ b/docs/content/commands/npm-access.md @@ -6,21 +6,27 @@ description: Set access level on published packages ### Synopsis + + + + ```bash npm access public [] npm access restricted [] - npm access grant [] npm access revoke [] - npm access 2fa-required [] npm access 2fa-not-required [] - npm access ls-packages [||] npm access ls-collaborators [ []] npm access edit [] ``` + + + + + ### Description Used to set access controls on private packages. diff --git a/docs/content/commands/npm-adduser.md b/docs/content/commands/npm-adduser.md index 21a31ca940e52..06eeb379c4dd8 100644 --- a/docs/content/commands/npm-adduser.md +++ b/docs/content/commands/npm-adduser.md @@ -6,12 +6,21 @@ description: Add a registry user account ### Synopsis + + + + ```bash -npm adduser [--registry=url] [--scope=@orgname] [--auth-type=legacy] +npm adduser aliases: login, add-user ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-audit.md b/docs/content/commands/npm-audit.md index 58c614d793db2..323d38f64c14f 100644 --- a/docs/content/commands/npm-audit.md +++ b/docs/content/commands/npm-audit.md @@ -6,13 +6,19 @@ description: Run a security audit ### Synopsis -```bash -npm audit [--json] [--production] [--audit-level=(low|moderate|high|critical)] -npm audit fix [--force|--package-lock-only|--dry-run|--production|--only=(dev|prod)] + + + -common options: [--production] [--only=(dev|prod)] +```bash +npm audit [fix] ``` + + + + + ### Description The audit command submits a description of the dependencies configured in diff --git a/docs/content/commands/npm-bin.md b/docs/content/commands/npm-bin.md index 2d7c1d5b8149e..94b72cfd5c81c 100644 --- a/docs/content/commands/npm-bin.md +++ b/docs/content/commands/npm-bin.md @@ -6,10 +6,19 @@ description: Display npm bin folder ### Synopsis + + + + ```bash -npm bin [-g|--global] +npm bin ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-bugs.md b/docs/content/commands/npm-bugs.md index f92241a14b95c..aeddeb848e81b 100644 --- a/docs/content/commands/npm-bugs.md +++ b/docs/content/commands/npm-bugs.md @@ -6,12 +6,21 @@ description: Report bugs for a package in a web browser ### Synopsis + + + + ```bash -npm bugs [ [ ...]] +npm bugs [] -aliases: issues +alias: issues ``` + + + + + ### Description This command tries to guess at the likely location of a package's bug diff --git a/docs/content/commands/npm-cache.md b/docs/content/commands/npm-cache.md index 6497a3988c938..091e26e8a7182 100644 --- a/docs/content/commands/npm-cache.md +++ b/docs/content/commands/npm-cache.md @@ -6,18 +6,26 @@ description: Manipulates packages cache ### Synopsis -```bash -npm cache add ... -npm cache add ... -npm cache add ... -npm cache add @... - -npm cache clean -aliases: npm cache clear, npm cache rm + + + +```bash +npm cache add +npm cache add +npm cache add +npm cache add +npm cache add @ +npm cache clean [] +npm cache ls [@] npm cache verify ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-ci.md b/docs/content/commands/npm-ci.md index 1ce50c66d5faf..4490fea9a0bb7 100644 --- a/docs/content/commands/npm-ci.md +++ b/docs/content/commands/npm-ci.md @@ -6,10 +6,21 @@ description: Install a project with a clean slate ### Synopsis + + + + ```bash npm ci + +aliases: clean-install, ic, install-clean, isntall-clean ``` + + + + + ### Description This command is similar to [`npm install`](/commands/npm-install), except diff --git a/docs/content/commands/npm-completion.md b/docs/content/commands/npm-completion.md index 9dbd960913f27..d73a98f2e50f7 100644 --- a/docs/content/commands/npm-completion.md +++ b/docs/content/commands/npm-completion.md @@ -6,10 +6,19 @@ description: Tab Completion for npm ### Synopsis + + + + ```bash -source <(npm completion) +npm completion ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-config.md b/docs/content/commands/npm-config.md index 2d77f045cbc47..a66a198ce42d1 100644 --- a/docs/content/commands/npm-config.md +++ b/docs/content/commands/npm-config.md @@ -6,18 +6,25 @@ description: Manage the npm configuration files ### Synopsis + + + + ```bash npm config set = [= ...] npm config get [ [ ...]] npm config delete [ ...] npm config list [--json] npm config edit -npm set = [= ...] -npm get [ [ ...]] alias: c ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-dedupe.md b/docs/content/commands/npm-dedupe.md index 53d2e64272a67..b5a64831c0bba 100644 --- a/docs/content/commands/npm-dedupe.md +++ b/docs/content/commands/npm-dedupe.md @@ -6,13 +6,21 @@ description: Reduce duplication in the package tree ### Synopsis + + + + ```bash npm dedupe -npm ddp -aliases: ddp +alias: ddp ``` + + + + + ### Description Searches the local package tree and attempts to simplify the overall @@ -145,6 +153,24 @@ 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`. +This configuration does not affect `npm ci`. + + + + +#### `save` + +* Default: `true` unless when using `npm update` or `npm dedupe` where it + defaults to `false` +* Type: Boolean + +Save installed packages to a `package.json` file as dependencies. + +When used with the `npm rm` command, removes the dependency from +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. + diff --git a/docs/content/commands/npm-deprecate.md b/docs/content/commands/npm-deprecate.md index 438a54ec6e4f3..4345120d3744b 100644 --- a/docs/content/commands/npm-deprecate.md +++ b/docs/content/commands/npm-deprecate.md @@ -6,10 +6,19 @@ description: Deprecate a version of a package ### Synopsis + + + + ```bash -npm deprecate [@] +npm deprecate [@] ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-diff.md b/docs/content/commands/npm-diff.md index 8d05df779f3ca..c4c9eafdb3524 100644 --- a/docs/content/commands/npm-diff.md +++ b/docs/content/commands/npm-diff.md @@ -6,14 +6,19 @@ description: The registry diff command ### Synopsis + + + + ```bash npm diff [...] -npm diff --diff= [...] -npm diff --diff= [--diff=] [...] -npm diff --diff= [--diff=] [...] -npm diff [--diff-ignore-all-space] [--diff-name-only] [...] ``` + + + + + ### Description Similar to its `git diff` counterpart, this command will print diff patches diff --git a/docs/content/commands/npm-dist-tag.md b/docs/content/commands/npm-dist-tag.md index a4e0243aac87b..a0f306cd4970d 100644 --- a/docs/content/commands/npm-dist-tag.md +++ b/docs/content/commands/npm-dist-tag.md @@ -6,14 +6,23 @@ description: Modify package distribution tags ### Synopsis + + + + ```bash npm dist-tag add @ [] npm dist-tag rm npm dist-tag ls [] -aliases: dist-tags +alias: dist-tags ``` + + + + + ### Description Add, remove, and enumerate distribution tags on a package: diff --git a/docs/content/commands/npm-docs.md b/docs/content/commands/npm-docs.md index 970d17aa829c6..8d5a278286a88 100644 --- a/docs/content/commands/npm-docs.md +++ b/docs/content/commands/npm-docs.md @@ -6,12 +6,21 @@ description: Open documentation for a package in a web browser ### Synopsis + + + + ```bash npm docs [ [ ...]] -aliases: home +alias: home ``` + + + + + ### Description This command tries to guess at the likely location of a package's diff --git a/docs/content/commands/npm-doctor.md b/docs/content/commands/npm-doctor.md index 0cce60c7b7b15..7fb63bab16e83 100644 --- a/docs/content/commands/npm-doctor.md +++ b/docs/content/commands/npm-doctor.md @@ -6,10 +6,19 @@ description: Check your npm environment ### Synopsis + + + + ```bash npm doctor ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-edit.md b/docs/content/commands/npm-edit.md index 5ae7f2481ae45..39fc49592c571 100644 --- a/docs/content/commands/npm-edit.md +++ b/docs/content/commands/npm-edit.md @@ -6,10 +6,19 @@ description: Edit an installed package ### Synopsis + + + + ```bash -npm edit +npm edit [/...] ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-exec.md b/docs/content/commands/npm-exec.md index d154f5780b9c9..3645e336b9da9 100644 --- a/docs/content/commands/npm-exec.md +++ b/docs/content/commands/npm-exec.md @@ -6,26 +6,23 @@ description: Run a command from a local or remote npm package ### Synopsis + + + + ```bash npm exec -- [@] [args...] npm exec --package=[@] -- [args...] npm exec -c ' [args...]' npm exec --package=foo -c ' [args...]' -npm exec [--ws] [-w [@] [args...] -npx -p [@] [args...] -npx -c ' [args...]' -npx -p [@] -c ' [args...]' -Run without --call or positional args to open interactive subshell +alias: x +``` -alias: npm x, npx + + -common options: ---package= (may be specified multiple times) --p is a shorthand for --package only when using npx executable --c --call= (may not be mixed with positional arguments) -``` + ### Description diff --git a/docs/content/commands/npm-explain.md b/docs/content/commands/npm-explain.md index 5f05cac0f906b..765221056585d 100644 --- a/docs/content/commands/npm-explain.md +++ b/docs/content/commands/npm-explain.md @@ -6,12 +6,21 @@ description: Explain installed packages ### Synopsis + + + + ```bash npm explain alias: why ``` + + + + + ### Description This command will print the chain of dependencies causing a given package diff --git a/docs/content/commands/npm-explore.md b/docs/content/commands/npm-explore.md index 3979da9573db0..90753c7e09199 100644 --- a/docs/content/commands/npm-explore.md +++ b/docs/content/commands/npm-explore.md @@ -6,10 +6,19 @@ description: Browse an installed package ### Synopsis + + + + ```bash npm explore [ -- ] ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-find-dupes.md b/docs/content/commands/npm-find-dupes.md index f7dc84f9c5306..f7366fa6375d1 100644 --- a/docs/content/commands/npm-find-dupes.md +++ b/docs/content/commands/npm-find-dupes.md @@ -6,10 +6,19 @@ description: Find duplication in the package tree ### Synopsis + + + + ```bash npm find-dupes ``` + + + + + ### Description Runs `npm dedupe` in `--dry-run` mode, making npm only output the @@ -82,6 +91,8 @@ 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`. +This configuration does not affect `npm ci`. + diff --git a/docs/content/commands/npm-fund.md b/docs/content/commands/npm-fund.md index 606b0a188c554..5b96e91ab8ccb 100644 --- a/docs/content/commands/npm-fund.md +++ b/docs/content/commands/npm-fund.md @@ -6,11 +6,19 @@ description: Retrieve funding information ### Synopsis + + + + ```bash -npm fund [] -npm fund [-w ] +npm fund [[<@scope>/]] ``` + + + + + ### Description This command retrieves information on how to fund the dependencies of a diff --git a/docs/content/commands/npm-help-search.md b/docs/content/commands/npm-help-search.md index 78553a14ecb01..152f9f6bec16f 100644 --- a/docs/content/commands/npm-help-search.md +++ b/docs/content/commands/npm-help-search.md @@ -6,10 +6,19 @@ description: Search npm help documentation ### Synopsis + + + + ```bash npm help-search ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-help.md b/docs/content/commands/npm-help.md index a8002eef17156..83c595db696b9 100644 --- a/docs/content/commands/npm-help.md +++ b/docs/content/commands/npm-help.md @@ -6,10 +6,21 @@ description: Get help on npm ### Synopsis + + + + ```bash npm help [] + +alias: hlep ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-hook.md b/docs/content/commands/npm-hook.md index c91bce3075e7b..4a9805d02f9d4 100644 --- a/docs/content/commands/npm-hook.md +++ b/docs/content/commands/npm-hook.md @@ -6,13 +6,22 @@ description: Manage registry hooks ### Synopsis + + + + ```bash +npm hook add [--type=] npm hook ls [pkg] -npm hook add -npm hook update [secret] npm hook rm +npm hook update ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-init.md b/docs/content/commands/npm-init.md index e9212a37e0f25..d9c03aef41504 100644 --- a/docs/content/commands/npm-init.md +++ b/docs/content/commands/npm-init.md @@ -6,13 +6,23 @@ description: Create a package.json file ### Synopsis + + + + ```bash -npm init [--yes|-y|--scope] -npm init <@scope> (same as `npm exec <@scope>/create`) -npm init [<@scope>/] (same as `npm exec [<@scope>/]create-`) -npm init [-w ] [args...] +npm init [--force|-f|--yes|-y|--scope] +npm init <@scope> (same as `npx <@scope>/create`) +npm init [<@scope>/] (same as `npx [<@scope>/]create-`) + +aliases: create, innit ``` + + + + + ### Description `npm init ` can be used to set up a new or existing npm diff --git a/docs/content/commands/npm-install-ci-test.md b/docs/content/commands/npm-install-ci-test.md index 5c37ed8f56128..5ad67604541d1 100644 --- a/docs/content/commands/npm-install-ci-test.md +++ b/docs/content/commands/npm-install-ci-test.md @@ -6,12 +6,21 @@ description: Install a project with a clean slate and run tests ### Synopsis + + + + ```bash npm install-ci-test -alias: npm cit +alias: cit ``` + + + + + ### Description This command runs `npm ci` followed immediately by `npm test`. diff --git a/docs/content/commands/npm-install-test.md b/docs/content/commands/npm-install-test.md index c464e5bd0b8c6..ed39c6705a484 100644 --- a/docs/content/commands/npm-install-test.md +++ b/docs/content/commands/npm-install-test.md @@ -6,20 +6,30 @@ description: Install package(s) and run tests ### Synopsis + + + + ```bash -npm install-test (with no args, in package dir) -npm install-test [<@scope>/] -npm install-test [<@scope>/]@ -npm install-test [<@scope>/]@ -npm install-test [<@scope>/]@ +npm install-test [<@scope>/] +npm install-test [<@scope>/]@ +npm install-test [<@scope>/]@ +npm install-test [<@scope>/]@ +npm install-test @npm: +npm install-test npm install-test npm install-test -npm install-test +npm install-test +npm install-test / -alias: npm it -common options: [--save|--save-dev|--save-optional] [--save-exact] [--dry-run] +alias: it ``` + + + + + ### Description This command runs an `npm install` followed immediately by an `npm test`. It @@ -32,13 +42,16 @@ takes exactly the same arguments as `npm install`. #### `save` -* Default: true +* Default: `true` unless when using `npm update` or `npm dedupe` where it + defaults to `false` * Type: Boolean -Save installed packages to a package.json file as dependencies. +Save installed packages to a `package.json` file as dependencies. When used with the `npm rm` command, removes the dependency from -package.json. +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. @@ -133,6 +146,8 @@ 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`. +This configuration does not affect `npm ci`. + diff --git a/docs/content/commands/npm-install.md b/docs/content/commands/npm-install.md index b4f8da8373d05..66193e733133b 100644 --- a/docs/content/commands/npm-install.md +++ b/docs/content/commands/npm-install.md @@ -6,23 +6,30 @@ description: Install a package ### Synopsis + + + + ```bash -npm install (with no args, in package dir) -npm install [<@scope>/] -npm install [<@scope>/]@ -npm install [<@scope>/]@ -npm install [<@scope>/]@ +npm install [<@scope>/] +npm install [<@scope>/]@ +npm install [<@scope>/]@ +npm install [<@scope>/]@ npm install @npm: -npm install :/ -npm install +npm install npm install npm install -npm install +npm install +npm install / -aliases: npm i, npm add -common options: [-P|--save-prod|-D|--save-dev|-O|--save-optional|--save-peer] [-E|--save-exact] [-B|--save-bundle] [--no-save] [--dry-run] +aliases: i, in, ins, inst, insta, instal, isnt, isnta, isntal, add ``` + + + + + ### Description This command installs a package and any packages that it depends on. If the @@ -425,13 +432,16 @@ These are some of the most common options related to installation. #### `save` -* Default: true +* Default: `true` unless when using `npm update` or `npm dedupe` where it + defaults to `false` * Type: Boolean -Save installed packages to a package.json file as dependencies. +Save installed packages to a `package.json` file as dependencies. When used with the `npm rm` command, removes the dependency from -package.json. +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. @@ -526,6 +536,8 @@ 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`. +This configuration does not affect `npm ci`. + diff --git a/docs/content/commands/npm-link.md b/docs/content/commands/npm-link.md index d4ef41ae96462..892b55496c9b6 100644 --- a/docs/content/commands/npm-link.md +++ b/docs/content/commands/npm-link.md @@ -6,13 +6,22 @@ description: Symlink a package folder ### Synopsis + + + + ```bash npm link (in package dir) npm link [<@scope>/][@] -alias: npm ln +alias: ln ``` + + + + + ### Description This is handy for installing your own stuff, so that you can work on it and @@ -116,13 +125,16 @@ workspace(s). #### `save` -* Default: true +* Default: `true` unless when using `npm update` or `npm dedupe` where it + defaults to `false` * Type: Boolean -Save installed packages to a package.json file as dependencies. +Save installed packages to a `package.json` file as dependencies. When used with the `npm rm` command, removes the dependency from -package.json. +`package.json`. + +Will also prevent writing to `package-lock.json` if set to `false`. @@ -217,6 +229,8 @@ 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`. +This configuration does not affect `npm ci`. + diff --git a/docs/content/commands/npm-logout.md b/docs/content/commands/npm-logout.md index cb7c8496fb479..f0dd5cb856eae 100644 --- a/docs/content/commands/npm-logout.md +++ b/docs/content/commands/npm-logout.md @@ -6,10 +6,19 @@ description: Log out of the registry ### Synopsis + + + + ```bash -npm logout [--registry=] [--scope=<@scope>] +npm logout ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-ls.md b/docs/content/commands/npm-ls.md index 3b33f0a3605e0..0f06e131f414b 100644 --- a/docs/content/commands/npm-ls.md +++ b/docs/content/commands/npm-ls.md @@ -6,12 +6,21 @@ description: List installed packages ### Synopsis + + + + ```bash npm ls [[<@scope>/] ...] -aliases: list, la, ll +alias: list ``` + + + + + ### Description This command will print to stdout all the versions of packages that are diff --git a/docs/content/commands/npm-org.md b/docs/content/commands/npm-org.md index 2f08f61152992..975581c860df6 100644 --- a/docs/content/commands/npm-org.md +++ b/docs/content/commands/npm-org.md @@ -6,12 +6,23 @@ description: Manage orgs ### Synopsis + + + + ```bash -npm org set [developer | admin | owner] -npm org rm -npm org ls [] +npm org set orgname username [developer | admin | owner] +npm org rm orgname username +npm org ls orgname [] + +alias: ogr ``` + + + + + Note: This command is unaware of workspaces. ### Example diff --git a/docs/content/commands/npm-outdated.md b/docs/content/commands/npm-outdated.md index 1b58a6afda64b..6fa026550e747 100644 --- a/docs/content/commands/npm-outdated.md +++ b/docs/content/commands/npm-outdated.md @@ -6,10 +6,19 @@ description: Check for outdated packages ### Synopsis + + + + ```bash npm outdated [[<@scope>/] ...] ``` + + + + + ### Description This command will check the registry to see if any (or, specific) installed diff --git a/docs/content/commands/npm-owner.md b/docs/content/commands/npm-owner.md index 74e7f84af6c80..0779984e19a9d 100644 --- a/docs/content/commands/npm-owner.md +++ b/docs/content/commands/npm-owner.md @@ -6,14 +6,23 @@ description: Manage package owners ### Synopsis + + + + ```bash npm owner add [<@scope>/] npm owner rm [<@scope>/] npm owner ls [<@scope>/] -aliases: author +alias: author ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-pack.md b/docs/content/commands/npm-pack.md index 53945986837b9..c834f643ac0bb 100644 --- a/docs/content/commands/npm-pack.md +++ b/docs/content/commands/npm-pack.md @@ -6,10 +6,19 @@ description: Create a tarball from a package ### Synopsis + + + + ```bash -npm pack [[<@scope>/]...] [--dry-run] [--json] +npm pack [[<@scope>/]...] ``` + + + + + ### Configuration diff --git a/docs/content/commands/npm-ping.md b/docs/content/commands/npm-ping.md index c59a56e611e54..161d7292f8c97 100644 --- a/docs/content/commands/npm-ping.md +++ b/docs/content/commands/npm-ping.md @@ -6,10 +6,19 @@ description: Ping npm registry ### Synopsis + + + + ```bash -npm ping [--registry ] +npm ping ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-pkg.md b/docs/content/commands/npm-pkg.md index beee9c1c4e78a..8f6cbecf958fd 100644 --- a/docs/content/commands/npm-pkg.md +++ b/docs/content/commands/npm-pkg.md @@ -6,12 +6,21 @@ description: Manages your package.json ### Synopsis + + + + ```bash -npm pkg get [ [. ...]] -npm pkg set = [.= ...] -npm pkg delete [. ...] +npm pkg set = [= ...] +npm pkg get [ [ ...]] +npm pkg delete [ ...] ``` + + + + + ### Description A command that automates the management of `package.json` files. diff --git a/docs/content/commands/npm-prefix.md b/docs/content/commands/npm-prefix.md index 276a9e9e69910..39328bcc88a14 100644 --- a/docs/content/commands/npm-prefix.md +++ b/docs/content/commands/npm-prefix.md @@ -6,10 +6,19 @@ description: Display prefix ### Synopsis + + + + ```bash npm prefix [-g] ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-profile.md b/docs/content/commands/npm-profile.md index cecc48518dbdb..af1f9d8aa1063 100644 --- a/docs/content/commands/npm-profile.md +++ b/docs/content/commands/npm-profile.md @@ -6,14 +6,22 @@ description: Change settings on your registry profile ### Synopsis + + + + ```bash -npm profile get [--json|--parseable] [] -npm profile set [--json|--parseable] -npm profile set password -npm profile enable-2fa [auth-and-writes|auth-only] +npm profile enable-2fa [auth-only|auth-and-writes] npm profile disable-2fa +npm profile get [] +npm profile set ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-prune.md b/docs/content/commands/npm-prune.md index 658ab2610e0ed..49420e5b9d99c 100644 --- a/docs/content/commands/npm-prune.md +++ b/docs/content/commands/npm-prune.md @@ -6,10 +6,19 @@ description: Remove extraneous packages ### Synopsis + + + + ```bash -npm prune [[<@scope>/]...] [--production] [--dry-run] [--json] +npm prune [[<@scope>/]...] ``` + + + + + ### Description This command removes "extraneous" packages. If a package name is provided, diff --git a/docs/content/commands/npm-publish.md b/docs/content/commands/npm-publish.md index 6958b1066de7f..ce6e1c1012c8e 100644 --- a/docs/content/commands/npm-publish.md +++ b/docs/content/commands/npm-publish.md @@ -6,13 +6,19 @@ description: Publish a package ### Synopsis -```bash -npm publish [|] [--tag ] [--access ] [--otp otpcode] [--dry-run] + + + -Publishes '.' if no argument supplied -Sets tag 'latest' if no --tag specified +```bash +npm publish [] ``` + + + + + ### Description Publishes a package to the registry so that it can be installed by name. diff --git a/docs/content/commands/npm-rebuild.md b/docs/content/commands/npm-rebuild.md index 75e71c60e6810..ecb4a7ce34c62 100644 --- a/docs/content/commands/npm-rebuild.md +++ b/docs/content/commands/npm-rebuild.md @@ -6,12 +6,21 @@ description: Rebuild a package ### Synopsis + + + + ```bash npm rebuild [[<@scope>/][@] ...] alias: rb ``` + + + + + ### Description This command runs the `npm build` command on the matched folders. This is diff --git a/docs/content/commands/npm-repo.md b/docs/content/commands/npm-repo.md index cd47fde47127e..e14f07012a248 100644 --- a/docs/content/commands/npm-repo.md +++ b/docs/content/commands/npm-repo.md @@ -6,10 +6,19 @@ description: Open package repository page in the browser ### Synopsis + + + + ```bash npm repo [ [ ...]] ``` + + + + + ### Description This command tries to guess at the likely location of a package's diff --git a/docs/content/commands/npm-restart.md b/docs/content/commands/npm-restart.md index 80f8ab77ef018..f01cd014e7435 100644 --- a/docs/content/commands/npm-restart.md +++ b/docs/content/commands/npm-restart.md @@ -6,10 +6,19 @@ description: Restart a package ### Synopsis + + + + ```bash npm restart [-- ] ``` + + + + + ### Description This restarts a project. It is equivalent to running `npm run-script diff --git a/docs/content/commands/npm-root.md b/docs/content/commands/npm-root.md index 98d1108d33f75..40b58e4b33d0b 100644 --- a/docs/content/commands/npm-root.md +++ b/docs/content/commands/npm-root.md @@ -6,10 +6,19 @@ description: Display npm root ### Synopsis + + + + ```bash -npm root [-g] +npm root ``` + + + + + ### Description Print the effective `node_modules` folder to standard out. diff --git a/docs/content/commands/npm-run-script.md b/docs/content/commands/npm-run-script.md index 6dd602d03e00a..79b7c9a25780e 100644 --- a/docs/content/commands/npm-run-script.md +++ b/docs/content/commands/npm-run-script.md @@ -6,14 +6,21 @@ description: Run arbitrary package scripts ### Synopsis + + + + ```bash -npm run-script [--if-present] [--silent] [-- ] -npm run-script [--workspace=] -npm run-script [--workspaces] +npm run-script [-- ] aliases: run, rum, urn ``` + + + + + ### Description This runs an arbitrary command from a package's `"scripts"` object. If no diff --git a/docs/content/commands/npm-search.md b/docs/content/commands/npm-search.md index 252822e719844..db6a12bafabf1 100644 --- a/docs/content/commands/npm-search.md +++ b/docs/content/commands/npm-search.md @@ -6,12 +6,21 @@ description: Search for packages ### Synopsis + + + + ```bash -npm search [-l|--long] [--json] [--parseable] [--no-description] [search terms ...] +npm search [search terms ...] aliases: s, se, find ``` + + + + + Note: This command is unaware of workspaces. ### Description diff --git a/docs/content/commands/npm-set-script.md b/docs/content/commands/npm-set-script.md index 869ceede045ae..2d8e87db85219 100644 --- a/docs/content/commands/npm-set-script.md +++ b/docs/content/commands/npm-set-script.md @@ -7,10 +7,19 @@ description: Set tasks in the scripts section of package.json ### Synopsis An npm command that lets you create a task in the `scripts` section of the `package.json`. + + + + ```bash npm set-script [