npm / npm/rfcs

[RRFC] Add method for getting help on config option

Open
#313 2 comments 3 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
777
Forks
267
PR merge metrics
No merged PRs in 30d

Description

Motivation ("The Why")

Some configuration keys are not self-explanatory by their name. This will require someone to search up the configuration name online. A faster and simpler way that can even work offline would be to add in a help method on the npm config command in the CLI. I am aware of the npm help 7 config command, but that gives extra information for each configuration key. A method to get the help output for a single configuration key would be much more useful.

Example
$ npm config help also

- Default: null
- Type: String

When "dev" or "development" and running local npm shrinkwrap, npm outdated, or npm update, is an alias for --dev.

$ npm config help init-author-name

- Default: ""
- Type: String

The value npm init should use by default for the package author's name.

$ npm config help loglevel

- Default: "notice"
- Type: String
- Values: "silent", "error", "warn", "notice", "http", "timing", "info", "verbose", "silly"

What level of logs to report. On failure, all logs are written to npm-debug.log in the current working directory.

Any logs of a higher level than the setting are shown. The default is "notice".

$ npm config --help

npm config set <key> <value>
npm config get [<key>]
npm config delete <key>
npm config help <key>
npm config list [--json]
npm config edit
npm set <key> <value>
npm get [<key>]

alias: c

As seen above, the help output gives details on the key.

How
  • Store the help output that will have to be returned for each key
  • Log the output when the CLI asks for it
Current Behaviour

No help command on config.

Desired Behaviour

There is a help command on config.

References

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the npm config CLI entry point and the referenced npm config documentation. Determine how configuration-key help is stored and how the command should format and return one key's details, including unknown-key behavior. Done means npm config help provides the requested details and npm config --help documents the command.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.