Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-07-30 20:47:24 +0400
committerisaacs <i@izs.me>2011-07-30 20:47:24 +0400
commit701a8210a527948791794c191aac5671a18d09d5 (patch)
tree33857062690b4e4759da23860ad76d7f098e2ba4 /README.md
parent8923b80796770da810f41b93634c4bbb6a8f2482 (diff)
Confusion about args vs conf
Diffstat (limited to 'README.md')
-rw-r--r--README.md10
1 files changed, 10 insertions, 0 deletions
diff --git a/README.md b/README.md
index fb64b95db..e4ba245c1 100644
--- a/README.md
+++ b/README.md
@@ -153,6 +153,16 @@ npm.load(myConfigObject, function (er) {
})
```
+The `load` function takes an object hash of the command-line configs.
+The various `npm.commands.<cmd>` functions take an **array** of
+positional argument **strings**. The last argument to any
+`npm.commands.<cmd>` function is a callback. Some commands take other
+optional arguments. Read the source.
+
+You cannot set configs individually for any single npm function at this
+time. Since `npm` is a singleton, any call to `npm.config.set` will
+change the value for *all* npm commands in that process.
+
See `./bin/npm.js` for an example of pulling config values off of the
command line arguments using nopt. You may also want to check out `npm
help config` to learn about all the options you can set there.