diff options
author | isaacs <i@izs.me> | 2010-04-26 02:47:13 +0400 |
---|---|---|
committer | isaacs <i@izs.me> | 2010-04-26 03:39:52 +0400 |
commit | f85134fe2a92c840d05e84fb9ac74f061f27c33f (patch) | |
tree | 7adaa393e68d625f57c6a1668b40502a32b6d357 /doc/config.md | |
parent | 87cfc2e1b6f9bd3138d5cd940cc32b76256c6f4d (diff) |
refactor config doc
Diffstat (limited to 'doc/config.md')
-rw-r--r-- | doc/config.md | 75 |
1 files changed, 75 insertions, 0 deletions
diff --git a/doc/config.md b/doc/config.md new file mode 100644 index 000000000..0ee9319a7 --- /dev/null +++ b/doc/config.md @@ -0,0 +1,75 @@ +npm-config(1) -- Manage the npm configuration file +================================================== + +The config command is a way to interact with the `.npmrc` file. This file is a +JSON encoded list of values that npm is concerned with. The first time you run +npm, it will create a conf file filled with default values. + +On exit, the current state of the config is always saved, so that any changes +will be recorded. You may safely modify the file (as long as it's still +parseable JSON), but it is safer to use the npm config commands. + +## Sub-commands + +Config supports the following sub-commands: + +### set + + npm config set key value + +Sets the config key to the value. + +### get + + npm config get key + +Echo the config value to stdout. (NOTE: All the other npm logging is done to +stderr, so pipes should work properly, and you can do `npm get key 2>/dev/null` +to print out JUST the config value.) + +### list + + npm config list + +Show all the config settings. + +**FIXME**: Prints to stderr, but should really be stdout, since the log is what +you're after. + +### delete key + + npm config delete key + +Deletes the key from the configuration file. + +## Config File Settings + +### auto-activate + +Default: true + +Automatically activate a package after installation, if there is not an active +version already. Set to "always" to always activate when installing. + +### root + +Default: ~/.node_libraries + +The root folder where packages are installed and npm keeps its data. + +### registry + +Default: http://registry.npmjs.org/ + +The base URL of the npm package registry. + +### auth + +A base-64 encoded "user:pass" pair. + +**FIXME**: This is not encoded in any kind of security sense. It's just base-64 +encoded strictly so that it can be sent along the wire with HTTP Basic +authentication. An upcoming version of npm will encrypt this and save it back +to the registry as `auth-crypt`, which will be quite a bit more secure. Until +then, use a unique password that you don't mind being compromised. + |