Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add cli params to npm set, npm get #6481

Merged
merged 3 commits into from
May 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions lib/commands/get.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Get extends BaseCommand {
static description = 'Get a value from the npm configuration'
static name = 'get'
static usage = ['[<key> ...] (See `npm config`)']
static params = ['long']
static ignoreImplicitWorkspace = false

// TODO
Expand Down
1 change: 1 addition & 0 deletions lib/commands/set.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ class Set extends BaseCommand {
static description = 'Set a value in the npm configuration'
static name = 'set'
static usage = ['<key>=<value> [<key>=<value> ...] (See `npm config`)']
static params = ['global', 'location']
static ignoreImplicitWorkspace = false

// TODO
Expand Down
11 changes: 9 additions & 2 deletions tap-snapshots/test/lib/docs.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -2638,6 +2638,9 @@ Get a value from the npm configuration
Usage:
npm get [<key> ...] (See \`npm config\`)
Options:
[-l|--long]
Run "npm help get" for more info
\`\`\`bash
Expand All @@ -2646,7 +2649,7 @@ npm get [<key> ...] (See \`npm config\`)
Note: This command is unaware of workspaces.
NO PARAMS
#### \`long\`
`

exports[`test/lib/docs.js TAP usage help > must match snapshot 1`] = `
Expand Down Expand Up @@ -3531,6 +3534,9 @@ Set a value in the npm configuration
Usage:
npm set <key>=<value> [<key>=<value> ...] (See \`npm config\`)
Options:
[-g|--global] [-L|--location <global|user|project>]
Run "npm help set" for more info
\`\`\`bash
Expand All @@ -3539,7 +3545,8 @@ npm set <key>=<value> [<key>=<value> ...] (See \`npm config\`)
Note: This command is unaware of workspaces.
NO PARAMS
#### \`global\`
#### \`location\`
`

exports[`test/lib/docs.js TAP usage shrinkwrap > must match snapshot 1`] = `
Expand Down