Skip to content

[RRFC] Add method for getting help on config option #313

Description

@Yash-Singh1

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions