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:
-rwxr-xr-xbin/npm-cli.js7
-rw-r--r--doc/cli/config.md10
-rw-r--r--lib/utils/config-defs.js2
3 files changed, 19 insertions, 0 deletions
diff --git a/bin/npm-cli.js b/bin/npm-cli.js
index e0b9f20bb..f29437093 100755
--- a/bin/npm-cli.js
+++ b/bin/npm-cli.js
@@ -49,6 +49,13 @@ if (conf.version) {
return
}
+if (conf.versions) {
+ var v = process.versions
+ v.npm = npm.version
+ console.log(v)
+ return
+}
+
log.info("npm@"+npm.version, "using")
log.info("node@"+process.version, "using")
diff --git a/doc/cli/config.md b/doc/cli/config.md
index 9b3da04c6..5c4750072 100644
--- a/doc/cli/config.md
+++ b/doc/cli/config.md
@@ -682,6 +682,16 @@ If true, output the npm version and exit successfully.
Only relevant when specified explicitly on the command line.
+### versions
+
+* Default: false
+* Type: boolean
+
+If true, output the npm version as well as node's `process.versions`
+hash, and exit successfully.
+
+Only relevant when specified explicitly on the command line.
+
### viewer
* Default: "man" on Posix, "browser" on Windows
diff --git a/lib/utils/config-defs.js b/lib/utils/config-defs.js
index d368c4972..3cecb5052 100644
--- a/lib/utils/config-defs.js
+++ b/lib/utils/config-defs.js
@@ -206,6 +206,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
, userignorefile : path.resolve(home, ".npmignore")
, umask: 022
, version : false
+ , versions : false
, viewer: process.platform === "win32" ? "browser" : "man"
, yes: null
@@ -279,6 +280,7 @@ exports.types =
, userignorefile : path
, umask: Octal
, version : Boolean
+ , versions : Boolean
, viewer: String
, yes: [false, null, Boolean]
, _exit : Boolean