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-01-02 09:30:51 +0300
committerisaacs <i@izs.me>2011-01-02 09:30:51 +0300
commit765b03d1009b24f0b3d1ee7f3b5bb98869e0ed54 (patch)
tree71455d11df87d53d5d3fc452d85880eac9fe04a6 /lib/utils/default-config.js
parentce9a1db60ae643d4a7f9139396ed0a81e6eb22cb (diff)
sort default configs
Diffstat (limited to 'lib/utils/default-config.js')
-rw-r--r--lib/utils/default-config.js59
1 files changed, 31 insertions, 28 deletions
diff --git a/lib/utils/default-config.js b/lib/utils/default-config.js
index 5b63215d1..1e8024463 100644
--- a/lib/utils/default-config.js
+++ b/lib/utils/default-config.js
@@ -2,49 +2,52 @@
var log = require("./log")
, path = require("path")
, hasSSL = false
+ , sslWorks = false
+ , semver = require("./semver")
+
try {
hasSSL = !!(process.binding("crypto") && require("crypto"))
} catch (ex) {}
+//
+// TODO: Change this version when node's SSL client can upload properly.
+//
+if (hasSSL) {
+ sslWorks = require("./semver").gt(process.version, "9999.9999.9999-9999")
+}
+
if (!process.execPath) {
process.execPath = path.join(process.installPrefix, "bin", "node")
}
var stdio = process.binding("stdio")
+
module.exports =
{ "auto-activate" : "always"
- , "update-dependents" : true
, "auto-deactivate" : true
- , "tar" : process.env.TAR || "tar"
- , "gzipbin" : process.env.GZIPBIN || "gzip"
- , tag : "latest"
- , proxy : process.env.http_proxy || null
- , root : path.join(process.execPath, "..", "..", "lib", "node")
- , globalconfig : path.join(process.execPath, "..", "..", "etc", "npmrc")
- , userconfig : path.join(process.env.HOME, ".npmrc")
, binroot : path.dirname(process.execPath)
+ , browser : "open"
+ , color : true
+ , description : true
, dev : false
- , loglevel : "info"
- , manroot : path.join(process.execPath, "..", "..", "share", "man")
, editor : process.env.EDITOR
- , tmproot : (process.env.TMPDIR || "/tmp")
- , _exit : true
- // a stream or a file descriptor of a socket
- // a file fd will sorta work too, but not awesomely.
- , logfd : stdio.stderrFD
- , outfd : stdio.stdoutFD
- , color : true
- , recursive : false
, force : false
- , prune : undefined // if set to boolean false, then that means "never"
+ , globalconfig : path.join(process.execPath, "..", "..", "etc", "npmrc")
+ , gzipbin : process.env.GZIPBIN || "gzip"
, listopts: ""
+ , logfd : stdio.stderrFD
+ , loglevel : "info"
+ , manroot : path.join(process.execPath, "..", "..", "share", "man")
, "must-install" : true
- , "browser" : "open"
- // show the description in npm ls
- , description : true
- //
- // TODO: Fix when node's SSL client can upload properly.
- // , registry : hasSSL ? "https://registry.npmjs.org/"
- // : "http://registry.npmjs.org/"
- //
- , registry : "http://registry.npmjs.org/"
+ , outfd : stdio.stdoutFD
+ , proxy : process.env.http_proxy || null
+ , prune : undefined // if set to boolean false, then that means "never"
+ , recursive : false
+ , registry : "http"+(sslWorks ? "s" : "")+"://registry.npmjs.org/"
+ , root : path.join(process.execPath, "..", "..", "lib", "node")
+ , tag : "latest"
+ , tar : process.env.TAR || "tar"
+ , tmproot : (process.env.TMPDIR || "/tmp")
+ , "update-dependents" : true
+ , userconfig : path.join(process.env.HOME, ".npmrc")
+ , _exit : true
}