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-04-27 05:39:50 +0400
committerisaacs <i@izs.me>2011-04-27 05:39:50 +0400
commit94e3d6eea3674a5f4969c69699cec762e8ab9398 (patch)
tree47f1a1082b159dd05d47f0e39c7cee6da02aab79
parenta39d274b9faa272184b87779b9ba8d1e88ba5d55 (diff)
Allow load without any cb.
The better to test stuff out in the repl.
-rw-r--r--npm.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/npm.js b/npm.js
index 399d0a117..b0bafc0ca 100644
--- a/npm.js
+++ b/npm.js
@@ -155,6 +155,8 @@ var loaded = false
npm.load = function (conf, cb_) {
if (!cb_ && typeof conf === "function") cb_ = conf , conf = {}
+ if (!cb_) cb_ = function () {}
+ if (!conf) conf = {}
loadListeners.push(cb_)
if (loaded) return cb()
if (loading) return
@@ -179,6 +181,7 @@ npm.load = function (conf, cb_) {
onload = false
}
}
+
log.waitForConfig()
which(process.argv[0], function (er, node) {
if (!er && node !== process.execPath) {