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
path: root/lib
diff options
context:
space:
mode:
authorisaacs <i@izs.me>2011-10-08 04:19:38 +0400
committerisaacs <i@izs.me>2011-10-08 04:19:38 +0400
commit36d0c5d2f3a0c441cd6933fa4a7e2cade7f36b4b (patch)
tree686e9e45f4ccf523c047b5b6fdbdea643a610d27 /lib
parenta7da3073773277d219a469b52fdfcf2f041eafee (diff)
Output builtin config values with 'npm config ls'
Diffstat (limited to 'lib')
-rw-r--r--lib/config.js23
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/config.js b/lib/config.js
index 492ad2daa..4e4eac518 100644
--- a/lib/config.js
+++ b/lib/config.js
@@ -229,6 +229,29 @@ function list (cb) {
msg += eol
}
+ // builtin config file
+ var bconf = ini.configList.list[ini.TRANS.builtin]
+ , bconfKeys = Object.keys(bconf).filter(function (k) {
+ return types[k] === types[k]
+ }).sort(function (a, b) {
+ return a > b ? 1 : -1
+ })
+ if (bconfKeys.length) {
+ var path = require("path")
+ msg += "; builtin config " + path.resolve(__dirname, "../npmrc") + eol
+ bconfKeys.forEach(function (k) {
+ var val = (k.charAt(0) === "_")
+ ? "---sekretz---"
+ : JSON.stringify(bconf[k])
+ if (bconf[k] !== ini.get(k)) {
+ if (!long) return
+ msg += "; " + k + " = " + val
+ + " (overridden)" + eol
+ } else msg += k + " = " + val + eol
+ })
+ msg += eol
+ }
+
// only show defaults if --long
if (!long) {
msg += "; node install prefix = " + process.installPrefix + eol