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:
-rw-r--r--lib/version.js3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/version.js b/lib/version.js
index f83eedd71..95d5ff2ee 100644
--- a/lib/version.js
+++ b/lib/version.js
@@ -38,6 +38,9 @@ function version (args, silent, cb_) {
if (data && data.name && data.version) {
v[data.name] = data.version
}
+ if (npm.config.get("json")) {
+ v = JSON.stringify(v, null, 2)
+ }
console.log(v)
return cb_()
}