summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules/npmconf
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules/npmconf')
-rw-r--r--deps/npm/node_modules/npmconf/config-defs.js43
-rw-r--r--deps/npm/node_modules/npmconf/lib/load-cafile.js31
-rw-r--r--deps/npm/node_modules/npmconf/lib/load-prefix.js70
-rw-r--r--deps/npm/node_modules/npmconf/lib/set-user.js5
-rw-r--r--deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json32
-rw-r--r--deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js21
-rw-r--r--deps/npm/node_modules/npmconf/npmconf.js89
-rw-r--r--deps/npm/node_modules/npmconf/package.json12
-rw-r--r--deps/npm/node_modules/npmconf/test/00-setup.js13
-rw-r--r--deps/npm/node_modules/npmconf/test/basic.js4
-rw-r--r--deps/npm/node_modules/npmconf/test/builtin.js4
-rw-r--r--deps/npm/node_modules/npmconf/test/certfile.js17
-rw-r--r--deps/npm/node_modules/npmconf/test/fixtures/multi-ca32
-rw-r--r--deps/npm/node_modules/npmconf/test/project.js4
-rw-r--r--deps/npm/node_modules/npmconf/test/save.js10
15 files changed, 283 insertions, 104 deletions
diff --git a/deps/npm/node_modules/npmconf/config-defs.js b/deps/npm/node_modules/npmconf/config-defs.js
index 7d76f81291..66f4f1b47c 100644
--- a/deps/npm/node_modules/npmconf/config-defs.js
+++ b/deps/npm/node_modules/npmconf/config-defs.js
@@ -7,14 +7,15 @@ var path = require("path")
, semver = require("semver")
, stableFamily = semver.parse(process.version)
, nopt = require("nopt")
- , os = require('os')
+ , os = require("os")
, osenv = require("osenv")
+var log
try {
- var log = require("npmlog")
+ log = require("npmlog")
} catch (er) {
- var util = require('util')
- var log = { warn: function (m) {
+ var util = require("util")
+ log = { warn: function (m) {
console.warn(m + util.format.apply(util, [].slice.call(arguments, 1)))
} }
}
@@ -48,7 +49,7 @@ nopt.typeDefs.semver = { type: semver, validate: validateSemver }
nopt.typeDefs.Octal = { type: Octal, validate: validateOctal }
nopt.typeDefs.Stream = { type: Stream, validate: validateStream }
-nopt.invalidHandler = function (k, val, type, data) {
+nopt.invalidHandler = function (k, val, type) {
log.warn("invalid config", k + "=" + JSON.stringify(val))
if (Array.isArray(type)) {
@@ -118,6 +119,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
, browser : null
, ca: null
+ , cafile: null
, cache : cache
@@ -153,7 +155,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
: process.env.SUDO_GID || (process.getgid && process.getgid())
, heading: "npm"
, "ignore-scripts": false
- , "init-module": path.resolve(home, '.npm-init.js')
+ , "init-module": path.resolve(home, ".npm-init.js")
, "init.author.name" : ""
, "init.author.email" : ""
, "init.author.url" : ""
@@ -190,6 +192,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
, "save-exact" : false
, "save-optional" : false
, "save-prefix": "^"
+ //, scope : ""
, searchopts: ""
, searchexclude: null
, searchsort: "name"
@@ -210,7 +213,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
, user : process.platform === "win32" ? 0 : "nobody"
, username : ""
, userconfig : path.resolve(home, ".npmrc")
- , umask: 022
+ , umask: process.umask ? process.umask() : parseInt("022", 8)
, version : false
, versions : false
, viewer: process.platform === "win32" ? "browser" : "man"
@@ -224,6 +227,7 @@ exports.types =
, "bin-links": Boolean
, browser : [null, String]
, ca: [null, String, Array]
+ , cafile : path
, cache : path
, "cache-lock-stale": Number
, "cache-lock-retries": Number
@@ -262,16 +266,7 @@ exports.types =
, link: Boolean
// local-address must be listed as an IP for a local network interface
// must be IPv4 due to node bug
- , "local-address" : Object.keys(os.networkInterfaces()).map(function (nic) {
- return os.networkInterfaces()[nic].filter(function (addr) {
- return addr.family === "IPv4"
- })
- .map(function (addr) {
- return addr.address
- })
- }).reduce(function (curr, next) {
- return curr.concat(next)
- }, [])
+ , "local-address" : getLocalAddresses()
, loglevel : ["silent","win","error","warn","http","info","verbose","silly"]
, logstream : Stream
, long : Boolean
@@ -294,6 +289,7 @@ exports.types =
, "save-exact" : Boolean
, "save-optional" : Boolean
, "save-prefix": String
+ //, scope : String
, searchopts : String
, searchexclude: [null, String]
, searchsort: [ "name", "-name"
@@ -322,6 +318,19 @@ exports.types =
, _password: String
}
+function getLocalAddresses() {
+ Object.keys(os.networkInterfaces()).map(function (nic) {
+ return os.networkInterfaces()[nic].filter(function (addr) {
+ return addr.family === "IPv4"
+ })
+ .map(function (addr) {
+ return addr.address
+ })
+ }).reduce(function (curr, next) {
+ return curr.concat(next)
+ }, []).concat(undefined)
+}
+
exports.shorthands =
{ s : ["--loglevel", "silent"]
, d : ["--loglevel", "info"]
diff --git a/deps/npm/node_modules/npmconf/lib/load-cafile.js b/deps/npm/node_modules/npmconf/lib/load-cafile.js
new file mode 100644
index 0000000000..b8c9fff233
--- /dev/null
+++ b/deps/npm/node_modules/npmconf/lib/load-cafile.js
@@ -0,0 +1,31 @@
+module.exports = loadCAFile
+
+var fs = require('fs')
+
+function loadCAFile(cafilePath, cb) {
+ if (!cafilePath)
+ return process.nextTick(cb)
+
+ fs.readFile(cafilePath, 'utf8', afterCARead.bind(this))
+
+ function afterCARead(er, cadata) {
+ if (er)
+ return cb(er)
+
+ var delim = '-----END CERTIFICATE-----'
+ var output
+
+ output = cadata
+ .split(delim)
+ .filter(function(xs) {
+ return !!xs.trim()
+ })
+ .map(function(xs) {
+ return xs.trimLeft() + delim
+ })
+
+ this.set('ca', output)
+ cb(null)
+ }
+
+}
diff --git a/deps/npm/node_modules/npmconf/lib/load-prefix.js b/deps/npm/node_modules/npmconf/lib/load-prefix.js
index c161b06495..bb39d9c98d 100644
--- a/deps/npm/node_modules/npmconf/lib/load-prefix.js
+++ b/deps/npm/node_modules/npmconf/lib/load-prefix.js
@@ -1,51 +1,49 @@
module.exports = loadPrefix
var findPrefix = require("./find-prefix.js")
-var mkdirp = require("mkdirp")
var path = require('path')
function loadPrefix (cb) {
var cli = this.list[0]
- // try to guess at a good node_modules location.
- var p
- , gp
-
- if (!Object.prototype.hasOwnProperty.call(cli, "prefix")) {
- p = process.cwd()
- } else {
- p = this.get("prefix")
- }
- gp = this.get("prefix")
-
- findPrefix(p, function (er, p) {
- Object.defineProperty(this, "localPrefix",
- { get : function () { return p }
- , set : function (r) { return p = r }
- , enumerable : true
- })
- // the prefix MUST exist, or else nothing works.
- if (!this.get("global")) {
- mkdirp(p, next.bind(this))
- } else {
- next.bind(this)(er)
- }
- }.bind(this))
+ Object.defineProperty(this, "prefix",
+ { set : function (prefix) {
+ var g = this.get("global")
+ this[g ? 'globalPrefix' : 'localPrefix'] = prefix
+ }.bind(this)
+ , get : function () {
+ var g = this.get("global")
+ return g ? this.globalPrefix : this.localPrefix
+ }.bind(this)
+ , enumerable : true
+ })
- gp = path.resolve(gp)
Object.defineProperty(this, "globalPrefix",
- { get : function () { return gp }
- , set : function (r) { return gp = r }
+ { set : function (prefix) {
+ this.set('prefix', prefix)
+ }.bind(this)
+ , get : function () {
+ return path.resolve(this.get("prefix"))
+ }.bind(this)
, enumerable : true
})
- // the prefix MUST exist, or else nothing works.
- mkdirp(gp, next.bind(this))
- var i = 2
- var errState = null
- function next (er) {
- if (errState) return
- if (er) return cb(errState = er)
- if (--i === 0) return cb()
+ var p
+ Object.defineProperty(this, "localPrefix",
+ { set : function (prefix) { p = prefix },
+ get : function () { return p }
+ , enumerable: true })
+
+ // try to guess at a good node_modules location.
+ // If we are *explicitly* given a prefix on the cli, then
+ // always use that. otherwise, infer local prefix from cwd.
+ if (Object.prototype.hasOwnProperty.call(cli, "prefix")) {
+ p = path.resolve(cli.prefix)
+ process.nextTick(cb)
+ } else {
+ findPrefix(process.cwd(), function (er, found) {
+ p = found
+ cb(er)
+ }.bind(this))
}
}
diff --git a/deps/npm/node_modules/npmconf/lib/set-user.js b/deps/npm/node_modules/npmconf/lib/set-user.js
index 2e7774aec3..cf29b1ace2 100644
--- a/deps/npm/node_modules/npmconf/lib/set-user.js
+++ b/deps/npm/node_modules/npmconf/lib/set-user.js
@@ -1,10 +1,13 @@
module.exports = setUser
+var Conf = require('../npmconf.js').Conf
+var assert = require('assert')
var path = require('path')
var fs = require('fs')
function setUser (cb) {
- var defaultConf = Object.getPrototypeOf(this.root)
+ var defaultConf = this.root
+ assert(defaultConf !== Object.prototype)
// If global, leave it as-is.
// If not global, then set the user to the owner of the prefix folder.
diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json
index f96627c728..2dff2917c0 100644
--- a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json
+++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json
@@ -1,6 +1,6 @@
{
"name": "proto-list",
- "version": "1.2.2",
+ "version": "1.2.3",
"description": "A utility for managing a prototype chain",
"main": "./proto-list.js",
"author": {
@@ -22,24 +22,30 @@
"devDependencies": {
"tap": "0"
},
- "readme": "A list of objects, bound by their prototype chain.\n\nUsed in npm's config stuff.\n",
- "_id": "proto-list@1.2.2",
- "dist": {
- "shasum": "48b88798261ec2c4a785720cdfec6200d57d3326",
- "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.2.tgz"
+ "gitHead": "44d76897176861d176a53ed3f3fc5e05cdee7643",
+ "bugs": {
+ "url": "https://github.com/isaacs/proto-list/issues"
+ },
+ "homepage": "https://github.com/isaacs/proto-list",
+ "_id": "proto-list@1.2.3",
+ "_shasum": "6235554a1bca1f0d15e3ca12ca7329d5def42bd9",
+ "_from": "proto-list@~1.2.1",
+ "_npmVersion": "1.4.14",
+ "_npmUser": {
+ "name": "isaacs",
+ "email": "i@izs.me"
},
"maintainers": [
{
"name": "isaacs",
"email": "i@izs.me"
- },
- {
- "name": "substack",
- "email": "mail@substack.net"
}
],
+ "dist": {
+ "shasum": "6235554a1bca1f0d15e3ca12ca7329d5def42bd9",
+ "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz"
+ },
"directories": {},
- "_shasum": "48b88798261ec2c4a785720cdfec6200d57d3326",
- "_from": "proto-list@~1.2.1",
- "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.2.tgz"
+ "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz",
+ "readme": "ERROR: No README data found!"
}
diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js
index 67d250387c..b55c25c052 100644
--- a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js
+++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js
@@ -1,6 +1,13 @@
module.exports = ProtoList
+function setProto(obj, proto) {
+ if (typeof Object.setPrototypeOf === "function")
+ return Object.setPrototypeOf(obj, proto)
+ else
+ obj.__proto__ = proto
+}
+
function ProtoList () {
this.list = []
var root = null
@@ -9,7 +16,7 @@ function ProtoList () {
set: function (r) {
root = r
if (this.list.length) {
- this.list[this.list.length - 1].__proto__ = r
+ setProto(this.list[this.list.length - 1], r)
}
},
enumerable: true,
@@ -35,24 +42,24 @@ ProtoList.prototype =
, push : function (obj) {
if (typeof obj !== "object") obj = {valueOf:obj}
if (this.list.length >= 1) {
- this.list[this.list.length - 1].__proto__ = obj
+ setProto(this.list[this.list.length - 1], obj)
}
- obj.__proto__ = this.root
+ setProto(obj, this.root)
return this.list.push(obj)
}
, pop : function () {
if (this.list.length >= 2) {
- this.list[this.list.length - 2].__proto__ = this.root
+ setProto(this.list[this.list.length - 2], this.root)
}
return this.list.pop()
}
, unshift : function (obj) {
- obj.__proto__ = this.list[0] || this.root
+ setProto(obj, this.list[0] || this.root)
return this.list.unshift(obj)
}
, shift : function () {
if (this.list.length === 1) {
- this.list[0].__proto__ = this.root
+ setProto(this.list[0], this.root)
}
return this.list.shift()
}
@@ -74,7 +81,7 @@ ProtoList.prototype =
// handle injections
var ret = this.list.splice.apply(this.list, arguments)
for (var i = 0, l = this.list.length; i < l; i++) {
- this.list[i].__proto__ = this.list[i + 1] || this.root
+ setProto(this.list[i], this.list[i + 1] || this.root)
}
return ret
}
diff --git a/deps/npm/node_modules/npmconf/npmconf.js b/deps/npm/node_modules/npmconf/npmconf.js
index aa2c7b2e6e..248220a8fe 100644
--- a/deps/npm/node_modules/npmconf/npmconf.js
+++ b/deps/npm/node_modules/npmconf/npmconf.js
@@ -103,16 +103,38 @@ function load_(builtin, rc, cli, cb) {
conf.add(cli, 'cli')
conf.addEnv()
- conf.loadExtras(function(er) {
+ conf.loadPrefix(function(er) {
if (er)
return cb(er)
- if (!conf.get('global')) {
- var projectConf = path.resolve(conf.localPrefix, '.npmrc')
+ // If you're doing `npm --userconfig=~/foo.npmrc` then you'd expect
+ // that ~/.npmrc won't override the stuff in ~/foo.npmrc (or, indeed
+ // be used at all).
+ //
+ // However, if the cwd is ~, then ~/.npmrc is the home for the project
+ // config, and will override the userconfig.
+ //
+ // If you're not setting the userconfig explicitly, then it will be loaded
+ // twice, which is harmless but excessive. If you *are* setting the
+ // userconfig explicitly then it will override your explicit intent, and
+ // that IS harmful and unexpected.
+ //
+ // Solution: Do not load project config file that is the same as either
+ // the default or resolved userconfig value. npm will log a "verbose"
+ // message about this when it happens, but it is a rare enough edge case
+ // that we don't have to be super concerned about it.
+ var projectConf = path.resolve(conf.localPrefix, '.npmrc')
+ var defaultUserConfig = rc.get('userconfig')
+ var resolvedUserConfig = conf.get('userconfig')
+ if (!conf.get('global') &&
+ projectConf !== defaultUserConfig &&
+ projectConf !== resolvedUserConfig) {
conf.addFile(projectConf, 'project')
conf.once('load', afterPrefix)
+ } else {
+ conf.add({}, 'project')
+ afterPrefix()
}
- else return afterPrefix()
})
function afterPrefix() {
@@ -139,12 +161,34 @@ function load_(builtin, rc, cli, cb) {
conf.root = defaults
conf.add(rc.shift(), 'builtin')
conf.once('load', function () {
- // warn about invalid bits.
- validate(conf)
- exports.loaded = conf
- cb(null, conf)
+ conf.loadExtras(afterExtras)
})
}
+
+ function afterExtras(er) {
+ if (er)
+ return cb(er)
+
+ // warn about invalid bits.
+ validate(conf)
+
+ var cafile = conf.get('cafile')
+
+ if (cafile) {
+ return conf.loadCAFile(cafile, finalize)
+ }
+
+ finalize()
+ }
+
+ function finalize(er, cadata) {
+ if (er) {
+ return cb(er)
+ }
+
+ exports.loaded = conf
+ cb(er, conf)
+ }
}
// Basically the same as CC, but:
@@ -169,18 +213,20 @@ function Conf (base) {
}
Conf.prototype.loadPrefix = require('./lib/load-prefix.js')
+Conf.prototype.loadCAFile = require('./lib/load-cafile.js')
Conf.prototype.loadUid = require('./lib/load-uid.js')
Conf.prototype.setUser = require('./lib/set-user.js')
Conf.prototype.findPrefix = require('./lib/find-prefix.js')
Conf.prototype.loadExtras = function(cb) {
- this.loadPrefix(function(er) {
+ this.setUser(function(er) {
if (er)
return cb(er)
- this.setUser(function(er) {
+ this.loadUid(function(er) {
if (er)
return cb(er)
- this.loadUid(cb)
+ // Without prefix, nothing will ever work
+ mkdirp(this.prefix, cb)
}.bind(this))
}.bind(this))
}
@@ -228,9 +274,12 @@ Conf.prototype.save = function (where, cb) {
this._saving ++
var mode = where === 'user' ? 0600 : 0666
- if (!data.trim())
- fs.unlink(target.path, done)
- else {
+ if (!data.trim()) {
+ fs.unlink(target.path, function (er) {
+ // ignore the possible error (e.g. the file doesn't exist)
+ done(null)
+ })
+ } else {
mkdirp(path.dirname(target.path), function (er) {
if (er)
return then(er)
@@ -303,14 +352,16 @@ Conf.prototype.addEnv = function (env) {
env = env || process.env
var conf = {}
Object.keys(env)
- .filter(function (k) { return k.match(/^npm_config_[^_]/i) })
+ .filter(function (k) { return k.match(/^npm_config_/i) })
.forEach(function (k) {
if (!env[k])
return
- conf[k.replace(/^npm_config_/i, '')
- .toLowerCase()
- .replace(/_/g, '-')] = env[k]
+ // leave first char untouched, even if
+ // it is a "_" - convert all other to "-"
+ var p = k.replace(/^npm_config_/, '')
+ .replace(/(?!^)_/g, '-')
+ conf[p] = env[k]
})
return CC.prototype.addEnv.call(this, '', conf, 'env')
}
@@ -378,4 +429,6 @@ function validate (cl) {
cl.list.forEach(function (conf, level) {
nopt.clean(conf, configDefs.types)
})
+
+ nopt.clean(cl.root, configDefs.types)
}
diff --git a/deps/npm/node_modules/npmconf/package.json b/deps/npm/node_modules/npmconf/package.json
index f6727d98ff..a0e1bbbd77 100644
--- a/deps/npm/node_modules/npmconf/package.json
+++ b/deps/npm/node_modules/npmconf/package.json
@@ -1,6 +1,6 @@
{
"name": "npmconf",
- "version": "1.0.1",
+ "version": "1.1.4",
"description": "The config thing npm uses",
"main": "npmconf.js",
"directories": {
@@ -11,9 +11,9 @@
"inherits": "~2.0.0",
"ini": "^1.2.0",
"mkdirp": "~0.3.3",
- "nopt": "2",
+ "nopt": "~3.0.1",
"once": "~1.3.0",
- "osenv": "0.0.3",
+ "osenv": "^0.1.0",
"semver": "2",
"uid-number": "0.0.5"
},
@@ -42,12 +42,12 @@
"license": "BSD",
"readme": "# npmconf\n\nThe config thing npm uses\n\nIf you are interested in interacting with the config settings that npm\nuses, then use this module.\n\nHowever, if you are writing a new Node.js program, and want\nconfiguration functionality similar to what npm has, but for your\nown thing, then I'd recommend using [rc](https://github.com/dominictarr/rc),\nwhich is probably what you want.\n\nIf I were to do it all over again, that's what I'd do for npm. But,\nalas, there are many systems depending on many of the particulars of\nnpm's configuration setup, so it's not worth the cost of changing.\n\n## USAGE\n\n```javascript\nvar npmconf = require('npmconf')\n\n// pass in the cli options that you read from the cli\n// or whatever top-level configs you want npm to use for now.\nnpmconf.load({some:'configs'}, function (er, conf) {\n // do stuff with conf\n conf.get('some', 'cli') // 'configs'\n conf.get('username') // 'joebobwhatevers'\n conf.set('foo', 'bar', 'user')\n conf.save('user', function (er) {\n // foo = bar is now saved to ~/.npmrc or wherever\n })\n})\n```\n",
"readmeFilename": "README.md",
- "gitHead": "7da0322e33d6116378f6a2206d8b8fa113c06e4b",
+ "gitHead": "3662624af0834159c35843fcf850469c09e0873c",
"bugs": {
"url": "https://github.com/isaacs/npmconf/issues"
},
"homepage": "https://github.com/isaacs/npmconf",
- "_id": "npmconf@1.0.1",
- "_shasum": "3503d12c6585395b0d8378d76e2d4a2453a23328",
+ "_id": "npmconf@1.1.4",
+ "_shasum": "2ac5d080206d4bfb9abc01bd34f083f93ae1603c",
"_from": "npmconf@latest"
}
diff --git a/deps/npm/node_modules/npmconf/test/00-setup.js b/deps/npm/node_modules/npmconf/test/00-setup.js
index 79cbbb127f..27e1069159 100644
--- a/deps/npm/node_modules/npmconf/test/00-setup.js
+++ b/deps/npm/node_modules/npmconf/test/00-setup.js
@@ -14,6 +14,19 @@ Object.keys(process.env).forEach(function (k) {
process.env.npm_config_userconfig = exports.userconfig
process.env.npm_config_other_env_thing = 1000
process.env.random_env_var = 'asdf'
+process.env.npm_config__underbar_env_thing = 'underful'
+
+exports.envData = {
+ userconfig: exports.userconfig,
+ '_underbar-env-thing': 'underful',
+ 'other-env-thing': '1000'
+}
+exports.envDataFix = {
+ userconfig: exports.userconfig,
+ '_underbar-env-thing': 'underful',
+ 'other-env-thing': 1000,
+}
+
if (module === require.main) {
// set the globalconfig in the userconfig
diff --git a/deps/npm/node_modules/npmconf/test/basic.js b/deps/npm/node_modules/npmconf/test/basic.js
index f17f0fb8e0..29d708b3a6 100644
--- a/deps/npm/node_modules/npmconf/test/basic.js
+++ b/deps/npm/node_modules/npmconf/test/basic.js
@@ -31,8 +31,8 @@ var ucData =
path: '/',
httponly: true } }
-var envData = { userconfig: common.userconfig, 'other-env-thing': '1000' }
-var envDataFix = { userconfig: common.userconfig, 'other-env-thing': 1000 }
+var envData = common.envData
+var envDataFix = common.envDataFix
var gcData = { 'package-config:foo': 'boo' }
diff --git a/deps/npm/node_modules/npmconf/test/builtin.js b/deps/npm/node_modules/npmconf/test/builtin.js
index 0a305d2a65..15cb9083aa 100644
--- a/deps/npm/node_modules/npmconf/test/builtin.js
+++ b/deps/npm/node_modules/npmconf/test/builtin.js
@@ -29,8 +29,8 @@ var ucData =
path: '/',
httponly: true } }
-var envData = { userconfig: common.userconfig, 'other-env-thing': '1000' }
-var envDataFix = { userconfig: common.userconfig, 'other-env-thing': 1000 }
+var envData = common.envData
+var envDataFix = common.envDataFix
var gcData = { 'package-config:foo': 'boo' }
diff --git a/deps/npm/node_modules/npmconf/test/certfile.js b/deps/npm/node_modules/npmconf/test/certfile.js
new file mode 100644
index 0000000000..3dfb6e90f9
--- /dev/null
+++ b/deps/npm/node_modules/npmconf/test/certfile.js
@@ -0,0 +1,17 @@
+var test = require('tap').test
+var npmconf = require('../npmconf.js')
+var common = require('./00-setup.js')
+var path = require('path')
+var fs = require('fs')
+
+test('cafile loads as ca', function (t) {
+ var cafile = path.join(__dirname, 'fixtures', 'multi-ca')
+
+ npmconf.load({cafile: cafile}, function (er, conf) {
+ if (er) throw er
+
+ t.same(conf.get('cafile'), cafile)
+ t.same(conf.get('ca').join('\n'), fs.readFileSync(cafile, 'utf8').trim())
+ t.end()
+ })
+})
diff --git a/deps/npm/node_modules/npmconf/test/fixtures/multi-ca b/deps/npm/node_modules/npmconf/test/fixtures/multi-ca
new file mode 100644
index 0000000000..0bc922b25c
--- /dev/null
+++ b/deps/npm/node_modules/npmconf/test/fixtures/multi-ca
@@ -0,0 +1,32 @@
+-----BEGIN CERTIFICATE-----
+MIICjTCCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx
+NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz
+dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw
+ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu
+ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2
+ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp
+miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ5iQHmkwlYDTL2fTgVfw0C
+AQOjgaswgagwZAYDVR0ZAQH/BFowWDBWMFQxCzAJBgNVBAYTAlVTMTYwNAYDVQQK
+Ey1OYXRpAAAAACBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x
+DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR
+MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB
+AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21
+X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3
+WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO
+-----END CERTIFICATE-----
+-----BEGIN CERTIFICATE-----
+AAAAAACCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx
+NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz
+dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw
+ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu
+ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2
+ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp
+miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ5iQHmkwlYDTL2fTgVfw0C
+AQOjgaswgagwZAYDVR0ZAQH/BFowWDBWMFQxCzAJBgNVBAYTAlVTMTYwNAYDVQQK
+Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x
+DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR
+MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB
+AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21
+X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3
+WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO
+-----END CERTIFICATE-----
diff --git a/deps/npm/node_modules/npmconf/test/project.js b/deps/npm/node_modules/npmconf/test/project.js
index 04e063855b..fa21e43d22 100644
--- a/deps/npm/node_modules/npmconf/test/project.js
+++ b/deps/npm/node_modules/npmconf/test/project.js
@@ -33,8 +33,8 @@ var ucData =
path: '/',
httponly: true } }
-var envData = { userconfig: common.userconfig, 'other-env-thing': '1000' }
-var envDataFix = { userconfig: common.userconfig, 'other-env-thing': 1000 }
+var envData = common.envData
+var envDataFix = common.envDataFix
var gcData = { 'package-config:foo': 'boo' }
diff --git a/deps/npm/node_modules/npmconf/test/save.js b/deps/npm/node_modules/npmconf/test/save.js
index 05230cd0a6..64b114449e 100644
--- a/deps/npm/node_modules/npmconf/test/save.js
+++ b/deps/npm/node_modules/npmconf/test/save.js
@@ -72,3 +72,13 @@ test('saving configs', function (t) {
})
})
+test('setting prefix', function (t) {
+ npmconf.load(function (er, conf) {
+ if (er)
+ throw er
+
+ conf.prefix = 'newvalue'
+ t.same(conf.prefix, 'newvalue');
+ t.end();
+ })
+})