npm-config (3) Linux Manual Page
npm-config — Manage the npm configuration files
Synopsis
npm.commands.config(args, callback) var val = npm.config.get(key) npm.config.set(key, val)
Description
This function acts much the same way as the command-line version. The first element in the array tells config what to do. Possible values are:
- •
set- Sets a config parameter. The second element in
argsis interpreted as the key, and the third element is interpreted as the value.- Sets a config parameter. The second element in
- •
get- Gets the value of a config parameter. The second element in
argsis the key to get the value of.- Gets the value of a config parameter. The second element in
- •
delete(rmordel)- Deletes a parameter from the config. The second element in
argsis the key to delete.- Deletes a parameter from the config. The second element in
- •
list(ls)- Show all configs that aren’t secret. No parameters necessary.
- •
edit:- Opens the config file in the default editor. This command isn’t very useful programmatically, but it is made available.
To programmatically access npm configuration settings, or set them for the duration of a program, use the npm.config.set and npm.config.get functions instead.
See Also
- •
- npm apihelp npm
