diff options
Diffstat (limited to 'node_modules/npmconf/config-defs.js')
-rw-r--r-- | node_modules/npmconf/config-defs.js | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/node_modules/npmconf/config-defs.js b/node_modules/npmconf/config-defs.js index 7d76f8129..e53c85200 100644 --- a/node_modules/npmconf/config-defs.js +++ b/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: "022" , 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 @@ -294,6 +298,7 @@ exports.types = , "save-exact" : Boolean , "save-optional" : Boolean , "save-prefix": String + , scope : String , searchopts : String , searchexclude: [null, String] , searchsort: [ "name", "-name" |