summaryrefslogtreecommitdiff
path: root/deps/npm/node_modules
diff options
context:
space:
mode:
Diffstat (limited to 'deps/npm/node_modules')
-rw-r--r--deps/npm/node_modules/glob/package.json2
-rw-r--r--deps/npm/node_modules/graceful-fs/graceful-fs.js2
-rw-r--r--deps/npm/node_modules/graceful-fs/package.json10
-rw-r--r--deps/npm/node_modules/graceful-fs/test/readdir-sort.js21
-rw-r--r--deps/npm/node_modules/nopt/README.md8
-rw-r--r--deps/npm/node_modules/nopt/lib/nopt.js213
-rw-r--r--deps/npm/node_modules/nopt/package.json12
-rw-r--r--deps/npm/node_modules/nopt/test/basic.js235
-rw-r--r--deps/npm/node_modules/npm-registry-client/lib/adduser.js3
-rw-r--r--deps/npm/node_modules/npm-registry-client/lib/deprecate.js2
-rw-r--r--deps/npm/node_modules/npm-registry-client/lib/get.js8
-rw-r--r--deps/npm/node_modules/npm-registry-client/lib/publish.js7
-rw-r--r--deps/npm/node_modules/npm-registry-client/lib/star.js2
-rw-r--r--deps/npm/node_modules/npm-registry-client/lib/unpublish.js3
-rw-r--r--deps/npm/node_modules/npm-registry-client/package.json10
-rw-r--r--deps/npm/node_modules/npm-registry-client/test/adduser-update.js2
-rw-r--r--deps/npm/node_modules/npm-registry-client/test/publish-again.js2
-rw-r--r--deps/npm/node_modules/read-installed/README.md13
-rw-r--r--deps/npm/node_modules/read-installed/package.json26
-rw-r--r--deps/npm/node_modules/read-installed/read-installed.js28
-rw-r--r--deps/npm/node_modules/read-installed/test/basic.js29
-rw-r--r--deps/npm/node_modules/read-installed/test/dev.js22
-rw-r--r--deps/npm/node_modules/read-installed/test/fixtures/peer-at-latest/node_modules/strong-task-emitter/package.json10
-rw-r--r--deps/npm/node_modules/read-installed/test/noargs.js21
-rw-r--r--deps/npm/node_modules/read-installed/test/peer-dep-at-latest.js14
25 files changed, 434 insertions, 271 deletions
diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json
index 3ae510111..59b75afe3 100644
--- a/deps/npm/node_modules/glob/package.json
+++ b/deps/npm/node_modules/glob/package.json
@@ -35,5 +35,5 @@
},
"homepage": "https://github.com/isaacs/node-glob",
"_id": "glob@3.2.7",
- "_from": "glob@~3.2.6"
+ "_from": "glob@3.2.7"
}
diff --git a/deps/npm/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/graceful-fs/graceful-fs.js
index 1865f92cc..baf957d8b 100644
--- a/deps/npm/node_modules/graceful-fs/graceful-fs.js
+++ b/deps/npm/node_modules/graceful-fs/graceful-fs.js
@@ -86,6 +86,8 @@ ReaddirReq.prototype.process = function() {
}
ReaddirReq.prototype.done = function(er, files) {
+ if (files && files.sort)
+ files = files.sort()
Req.prototype.done.call(this, er, files)
onclose()
}
diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json
index 1b4a21c75..9de02f6e3 100644
--- a/deps/npm/node_modules/graceful-fs/package.json
+++ b/deps/npm/node_modules/graceful-fs/package.json
@@ -6,7 +6,7 @@
},
"name": "graceful-fs",
"description": "A drop-in replacement for fs, making various improvements.",
- "version": "2.0.1",
+ "version": "2.0.2",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-graceful-fs.git"
@@ -38,11 +38,11 @@
"EACCESS"
],
"license": "BSD",
- "readme": "# graceful-fs\n\ngraceful-fs functions as a drop-in replacement for the fs module,\nmaking various improvements.\n\nThe improvements are meant to normalize behavior across different\nplatforms and environments, and to make filesystem access more\nresilient to errors.\n\n## Improvements over fs module\n\ngraceful-fs:\n\n* Queues up `open` and `readdir` calls, and retries them once\n something closes if there is an EMFILE error from too many file\n descriptors.\n* fixes `lchmod` for Node versions prior to 0.6.2.\n* implements `fs.lutimes` if possible. Otherwise it becomes a noop.\n* ignores `EINVAL` and `EPERM` errors in `chown`, `fchown` or\n `lchown` if the user isn't root.\n* makes `lchmod` and `lchown` become noops, if not available.\n* retries reading a file if `read` results in EAGAIN error.\n\nOn Windows, it retries renaming a file for up to one second if `EACCESS`\nor `EPERM` error occurs, likely because antivirus software has locked\nthe directory.\n",
- "readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/node-graceful-fs/issues"
},
- "_id": "graceful-fs@2.0.1",
- "_from": "graceful-fs@~2.0.0"
+ "readme": "ERROR: No README data found!",
+ "homepage": "https://github.com/isaacs/node-graceful-fs",
+ "_id": "graceful-fs@2.0.2",
+ "_from": "graceful-fs@latest"
}
diff --git a/deps/npm/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/graceful-fs/test/readdir-sort.js
new file mode 100644
index 000000000..aeaedf1c1
--- /dev/null
+++ b/deps/npm/node_modules/graceful-fs/test/readdir-sort.js
@@ -0,0 +1,21 @@
+var test = require("tap").test
+var fs = require("fs")
+
+var readdir = fs.readdir
+fs.readdir = function(path, cb) {
+ process.nextTick(function() {
+ cb(null, ["b", "z", "a"])
+ })
+}
+
+var g = require("../")
+
+test("readdir reorder", function (t) {
+ g.readdir("whatevers", function (er, files) {
+ if (er)
+ throw er
+ console.error(files)
+ t.same(files, [ "a", "b", "z" ])
+ t.end()
+ })
+})
diff --git a/deps/npm/node_modules/nopt/README.md b/deps/npm/node_modules/nopt/README.md
index f290da8f4..96798a1da 100644
--- a/deps/npm/node_modules/nopt/README.md
+++ b/deps/npm/node_modules/nopt/README.md
@@ -61,12 +61,12 @@ $ node my-program.js -fp --foofoo
$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.
{ foo: "Mr. Foo", argv: { remain: ["-fp"] } }
-$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.
-{ blatzk: 1000, flag: true, pick: true }
-
-$ node my-program.js --blatzk true -fp # but they need a value
+$ node my-program.js --blatzk -fp # unknown opts are ok.
{ blatzk: true, flag: true, pick: true }
+$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value
+{ blatzk: 1000, flag: true, pick: true }
+
$ node my-program.js --no-blatzk -fp # unless they start with "no-"
{ blatzk: false, flag: true, pick: true }
diff --git a/deps/npm/node_modules/nopt/lib/nopt.js b/deps/npm/node_modules/nopt/lib/nopt.js
index 20f3b5b1d..0bacba68f 100644
--- a/deps/npm/node_modules/nopt/lib/nopt.js
+++ b/deps/npm/node_modules/nopt/lib/nopt.js
@@ -125,6 +125,7 @@ function validateString (data, k, val) {
}
function validatePath (data, k, val) {
+ if (val === true) return false
data[k] = path.resolve(String(val))
return true
}
@@ -327,6 +328,9 @@ function parse (args, data, remain, types, shorthands) {
continue
}
+ if (types[arg] === String && la === undefined)
+ la = ""
+
if (la && la.match(/^-{2,}$/)) {
la = undefined
i --
@@ -401,212 +405,3 @@ function resolveShort (arg, shorthands, shortAbbr, abbrevs) {
return shorthands[arg]
}
-
-if (module === require.main) {
-var assert = require("assert")
- , util = require("util")
-
- , shorthands =
- { s : ["--loglevel", "silent"]
- , d : ["--loglevel", "info"]
- , dd : ["--loglevel", "verbose"]
- , ddd : ["--loglevel", "silly"]
- , noreg : ["--no-registry"]
- , reg : ["--registry"]
- , "no-reg" : ["--no-registry"]
- , silent : ["--loglevel", "silent"]
- , verbose : ["--loglevel", "verbose"]
- , h : ["--usage"]
- , H : ["--usage"]
- , "?" : ["--usage"]
- , help : ["--usage"]
- , v : ["--version"]
- , f : ["--force"]
- , desc : ["--description"]
- , "no-desc" : ["--no-description"]
- , "local" : ["--no-global"]
- , l : ["--long"]
- , p : ["--parseable"]
- , porcelain : ["--parseable"]
- , g : ["--global"]
- }
-
- , types =
- { aoa: Array
- , nullstream: [null, Stream]
- , date: Date
- , str: String
- , browser : String
- , cache : path
- , color : ["always", Boolean]
- , depth : Number
- , description : Boolean
- , dev : Boolean
- , editor : path
- , force : Boolean
- , global : Boolean
- , globalconfig : path
- , group : [String, Number]
- , gzipbin : String
- , logfd : [Number, Stream]
- , loglevel : ["silent","win","error","warn","info","verbose","silly"]
- , long : Boolean
- , "node-version" : [false, String]
- , npaturl : url
- , npat : Boolean
- , "onload-script" : [false, String]
- , outfd : [Number, Stream]
- , parseable : Boolean
- , pre: Boolean
- , prefix: path
- , proxy : url
- , "rebuild-bundle" : Boolean
- , registry : url
- , searchopts : String
- , searchexclude: [null, String]
- , shell : path
- , t: [Array, String]
- , tag : String
- , tar : String
- , tmp : path
- , "unsafe-perm" : Boolean
- , usage : Boolean
- , user : String
- , username : String
- , userconfig : path
- , version : Boolean
- , viewer: path
- , _exit : Boolean
- }
-
-; [["-v", {version:true}, []]
- ,["---v", {version:true}, []]
- ,["ls -s --no-reg connect -d",
- {loglevel:"info",registry:null},["ls","connect"]]
- ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
- ,["ls --registry blargle", {}, ["ls"]]
- ,["--no-registry", {registry:null}, []]
- ,["--no-color true", {color:false}, []]
- ,["--no-color false", {color:true}, []]
- ,["--no-color", {color:false}, []]
- ,["--color false", {color:false}, []]
- ,["--color --logfd 7", {logfd:7,color:true}, []]
- ,["--color=true", {color:true}, []]
- ,["--logfd=10", {logfd:10}, []]
- ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
- ,["--tmp=tmp -tar=gtar",
- {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
- ,["--logfd x", {}, []]
- ,["a -true -- -no-false", {true:true},["a","-no-false"]]
- ,["a -no-false", {false:false},["a"]]
- ,["a -no-no-true", {true:true}, ["a"]]
- ,["a -no-no-no-false", {false:false}, ["a"]]
- ,["---NO-no-No-no-no-no-nO-no-no"+
- "-No-no-no-no-no-no-no-no-no"+
- "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
- "-no-body-can-do-the-boogaloo-like-I-do"
- ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
- ,["we are -no-strangers-to-love "+
- "--you-know=the-rules --and=so-do-i "+
- "---im-thinking-of=a-full-commitment "+
- "--no-you-would-get-this-from-any-other-guy "+
- "--no-gonna-give-you-up "+
- "-no-gonna-let-you-down=true "+
- "--no-no-gonna-run-around false "+
- "--desert-you=false "+
- "--make-you-cry false "+
- "--no-tell-a-lie "+
- "--no-no-and-hurt-you false"
- ,{"strangers-to-love":false
- ,"you-know":"the-rules"
- ,"and":"so-do-i"
- ,"you-would-get-this-from-any-other-guy":false
- ,"gonna-give-you-up":false
- ,"gonna-let-you-down":false
- ,"gonna-run-around":false
- ,"desert-you":false
- ,"make-you-cry":false
- ,"tell-a-lie":false
- ,"and-hurt-you":false
- },["we", "are"]]
- ,["-t one -t two -t three"
- ,{t: ["one", "two", "three"]}
- ,[]]
- ,["-t one -t null -t three four five null"
- ,{t: ["one", "null", "three"]}
- ,["four", "five", "null"]]
- ,["-t foo"
- ,{t:["foo"]}
- ,[]]
- ,["--no-t"
- ,{t:["false"]}
- ,[]]
- ,["-no-no-t"
- ,{t:["true"]}
- ,[]]
- ,["-aoa one -aoa null -aoa 100"
- ,{aoa:["one", null, 100]}
- ,[]]
- ,["-str 100"
- ,{str:"100"}
- ,[]]
- ,["--color always"
- ,{color:"always"}
- ,[]]
- ,["--no-nullstream"
- ,{nullstream:null}
- ,[]]
- ,["--nullstream false"
- ,{nullstream:null}
- ,[]]
- ,["--notadate=2011-01-25"
- ,{notadate: "2011-01-25"}
- ,[]]
- ,["--date 2011-01-25"
- ,{date: new Date("2011-01-25")}
- ,[]]
- ,["-cl 1"
- ,{config: true, length: 1}
- ,[]
- ,{config: Boolean, length: Number, clear: Boolean}
- ,{c: "--config", l: "--length"}]
- ,["--acount bla"
- ,{"acount":true}
- ,["bla"]
- ,{account: Boolean, credentials: Boolean, options: String}
- ,{a:"--account", c:"--credentials",o:"--options"}]
- ,["--clear"
- ,{clear:true}
- ,[]
- ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
- ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
- ,["--file -"
- ,{"file":"-"}
- ,[]
- ,{file:String}
- ,{}]
- ,["--file -"
- ,{"file":true}
- ,["-"]
- ,{file:Boolean}
- ,{}]
- ].forEach(function (test) {
- var argv = test[0].split(/\s+/)
- , opts = test[1]
- , rem = test[2]
- , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0)
- , parsed = actual.argv
- delete actual.argv
- console.log(util.inspect(actual, false, 2, true), parsed.remain)
- for (var i in opts) {
- var e = JSON.stringify(opts[i])
- , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
- if (e && typeof e === "object") {
- assert.deepEqual(e, a)
- } else {
- assert.equal(e, a)
- }
- }
- assert.deepEqual(rem, parsed.remain)
- })
-}
diff --git a/deps/npm/node_modules/nopt/package.json b/deps/npm/node_modules/nopt/package.json
index d773dc6b3..40036f69c 100644
--- a/deps/npm/node_modules/nopt/package.json
+++ b/deps/npm/node_modules/nopt/package.json
@@ -1,6 +1,6 @@
{
"name": "nopt",
- "version": "2.1.2",
+ "version": "2.2.0",
"description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.",
"author": {
"name": "Isaac Z. Schlueter",
@@ -9,7 +9,7 @@
},
"main": "lib/nopt.js",
"scripts": {
- "test": "node lib/nopt.js"
+ "test": "tap test/*.js"
},
"repository": {
"type": "git",
@@ -25,11 +25,15 @@
"dependencies": {
"abbrev": "1"
},
- "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk 1000 -fp # unknown opts are ok.\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --blatzk true -fp # but they need a value\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n",
+ "devDependencies": {
+ "tap": "~0.4.8"
+ },
+ "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n",
"readmeFilename": "README.md",
"bugs": {
"url": "https://github.com/isaacs/nopt/issues"
},
- "_id": "nopt@2.1.2",
+ "homepage": "https://github.com/isaacs/nopt",
+ "_id": "nopt@2.2.0",
"_from": "nopt@latest"
}
diff --git a/deps/npm/node_modules/nopt/test/basic.js b/deps/npm/node_modules/nopt/test/basic.js
new file mode 100644
index 000000000..1a6789463
--- /dev/null
+++ b/deps/npm/node_modules/nopt/test/basic.js
@@ -0,0 +1,235 @@
+var nopt = require("../")
+ , test = require('tap').test
+
+
+test("passing a string results in a string", function (t) {
+ var parsed = nopt({ key: String }, {}, ["--key", "myvalue"], 0)
+ t.same(parsed.key, "myvalue")
+ t.end()
+})
+
+// https://github.com/npm/nopt/issues/31
+test("Empty String results in empty string, not true", function (t) {
+ var parsed = nopt({ empty: String }, {}, ["--empty"], 0)
+ t.same(parsed.empty, "")
+ t.end()
+})
+
+test("other tests", function (t) {
+
+ var util = require("util")
+ , Stream = require("stream")
+ , path = require("path")
+ , url = require("url")
+
+ , shorthands =
+ { s : ["--loglevel", "silent"]
+ , d : ["--loglevel", "info"]
+ , dd : ["--loglevel", "verbose"]
+ , ddd : ["--loglevel", "silly"]
+ , noreg : ["--no-registry"]
+ , reg : ["--registry"]
+ , "no-reg" : ["--no-registry"]
+ , silent : ["--loglevel", "silent"]
+ , verbose : ["--loglevel", "verbose"]
+ , h : ["--usage"]
+ , H : ["--usage"]
+ , "?" : ["--usage"]
+ , help : ["--usage"]
+ , v : ["--version"]
+ , f : ["--force"]
+ , desc : ["--description"]
+ , "no-desc" : ["--no-description"]
+ , "local" : ["--no-global"]
+ , l : ["--long"]
+ , p : ["--parseable"]
+ , porcelain : ["--parseable"]
+ , g : ["--global"]
+ }
+
+ , types =
+ { aoa: Array
+ , nullstream: [null, Stream]
+ , date: Date
+ , str: String
+ , browser : String
+ , cache : path
+ , color : ["always", Boolean]
+ , depth : Number
+ , description : Boolean
+ , dev : Boolean
+ , editor : path
+ , force : Boolean
+ , global : Boolean
+ , globalconfig : path
+ , group : [String, Number]
+ , gzipbin : String
+ , logfd : [Number, Stream]
+ , loglevel : ["silent","win","error","warn","info","verbose","silly"]
+ , long : Boolean
+ , "node-version" : [false, String]
+ , npaturl : url
+ , npat : Boolean
+ , "onload-script" : [false, String]
+ , outfd : [Number, Stream]
+ , parseable : Boolean
+ , pre: Boolean
+ , prefix: path
+ , proxy : url
+ , "rebuild-bundle" : Boolean
+ , registry : url
+ , searchopts : String
+ , searchexclude: [null, String]
+ , shell : path
+ , t: [Array, String]
+ , tag : String
+ , tar : String
+ , tmp : path
+ , "unsafe-perm" : Boolean
+ , usage : Boolean
+ , user : String
+ , username : String
+ , userconfig : path
+ , version : Boolean
+ , viewer: path
+ , _exit : Boolean
+ , path: path
+ }
+
+ ; [["-v", {version:true}, []]
+ ,["---v", {version:true}, []]
+ ,["ls -s --no-reg connect -d",
+ {loglevel:"info",registry:null},["ls","connect"]]
+ ,["ls ---s foo",{loglevel:"silent"},["ls","foo"]]
+ ,["ls --registry blargle", {}, ["ls"]]
+ ,["--no-registry", {registry:null}, []]
+ ,["--no-color true", {color:false}, []]
+ ,["--no-color false", {color:true}, []]
+ ,["--no-color", {color:false}, []]
+ ,["--color false", {color:false}, []]
+ ,["--color --logfd 7", {logfd:7,color:true}, []]
+ ,["--color=true", {color:true}, []]
+ ,["--logfd=10", {logfd:10}, []]
+ ,["--tmp=/tmp -tar=gtar",{tmp:"/tmp",tar:"gtar"},[]]
+ ,["--tmp=tmp -tar=gtar",
+ {tmp:path.resolve(process.cwd(), "tmp"),tar:"gtar"},[]]
+ ,["--logfd x", {}, []]
+ ,["a -true -- -no-false", {true:true},["a","-no-false"]]
+ ,["a -no-false", {false:false},["a"]]
+ ,["a -no-no-true", {true:true}, ["a"]]
+ ,["a -no-no-no-false", {false:false}, ["a"]]
+ ,["---NO-no-No-no-no-no-nO-no-no"+
+ "-No-no-no-no-no-no-no-no-no"+
+ "-no-no-no-no-NO-NO-no-no-no-no-no-no"+
+ "-no-body-can-do-the-boogaloo-like-I-do"
+ ,{"body-can-do-the-boogaloo-like-I-do":false}, []]
+ ,["we are -no-strangers-to-love "+
+ "--you-know=the-rules --and=so-do-i "+
+ "---im-thinking-of=a-full-commitment "+
+ "--no-you-would-get-this-from-any-other-guy "+
+ "--no-gonna-give-you-up "+
+ "-no-gonna-let-you-down=true "+
+ "--no-no-gonna-run-around false "+
+ "--desert-you=false "+
+ "--make-you-cry false "+
+ "--no-tell-a-lie "+
+ "--no-no-and-hurt-you false"
+ ,{"strangers-to-love":false
+ ,"you-know":"the-rules"
+ ,"and":"so-do-i"
+ ,"you-would-get-this-from-any-other-guy":false
+ ,"gonna-give-you-up":false
+ ,"gonna-let-you-down":false
+ ,"gonna-run-around":false
+ ,"desert-you":false
+ ,"make-you-cry":false
+ ,"tell-a-lie":false
+ ,"and-hurt-you":false
+ },["we", "are"]]
+ ,["-t one -t two -t three"
+ ,{t: ["one", "two", "three"]}
+ ,[]]
+ ,["-t one -t null -t three four five null"
+ ,{t: ["one", "null", "three"]}
+ ,["four", "five", "null"]]
+ ,["-t foo"
+ ,{t:["foo"]}
+ ,[]]
+ ,["--no-t"
+ ,{t:["false"]}
+ ,[]]
+ ,["-no-no-t"
+ ,{t:["true"]}
+ ,[]]
+ ,["-aoa one -aoa null -aoa 100"
+ ,{aoa:["one", null, 100]}
+ ,[]]
+ ,["-str 100"
+ ,{str:"100"}
+ ,[]]
+ ,["--color always"
+ ,{color:"always"}
+ ,[]]
+ ,["--no-nullstream"
+ ,{nullstream:null}
+ ,[]]
+ ,["--nullstream false"
+ ,{nullstream:null}
+ ,[]]
+ ,["--notadate=2011-01-25"
+ ,{notadate: "2011-01-25"}
+ ,[]]
+ ,["--date 2011-01-25"
+ ,{date: new Date("2011-01-25")}
+ ,[]]
+ ,["-cl 1"
+ ,{config: true, length: 1}
+ ,[]
+ ,{config: Boolean, length: Number, clear: Boolean}
+ ,{c: "--config", l: "--length"}]
+ ,["--acount bla"
+ ,{"acount":true}
+ ,["bla"]
+ ,{account: Boolean, credentials: Boolean, options: String}
+ ,{a:"--account", c:"--credentials",o:"--options"}]
+ ,["--clear"
+ ,{clear:true}
+ ,[]
+ ,{clear:Boolean,con:Boolean,len:Boolean,exp:Boolean,add:Boolean,rep:Boolean}
+ ,{c:"--con",l:"--len",e:"--exp",a:"--add",r:"--rep"}]
+ ,["--file -"
+ ,{"file":"-"}
+ ,[]
+ ,{file:String}
+ ,{}]
+ ,["--file -"
+ ,{"file":true}
+ ,["-"]
+ ,{file:Boolean}
+ ,{}]
+ ,["--path"
+ ,{"path":null}
+ ,[]]
+ ,["--path ."
+ ,{"path":process.cwd()}
+ ,[]]
+ ].forEach(function (test) {
+ var argv = test[0].split(/\s+/)
+ , opts = test[1]
+ , rem = test[2]
+ , actual = nopt(test[3] || types, test[4] || shorthands, argv, 0)
+ , parsed = actual.argv
+ delete actual.argv
+ for (var i in opts) {
+ var e = JSON.stringify(opts[i])
+ , a = JSON.stringify(actual[i] === undefined ? null : actual[i])
+ if (e && typeof e === "object") {
+ t.deepEqual(e, a)
+ } else {
+ t.equal(e, a)
+ }
+ }
+ t.deepEqual(rem, parsed.remain)
+ })
+ t.end()
+})
diff --git a/deps/npm/node_modules/npm-registry-client/lib/adduser.js b/deps/npm/node_modules/npm-registry-client/lib/adduser.js
index 2684063cc..aebf71d67 100644
--- a/deps/npm/node_modules/npm-registry-client/lib/adduser.js
+++ b/deps/npm/node_modules/npm-registry-client/lib/adduser.js
@@ -81,7 +81,8 @@ function adduser (username, password, email, cb) {
this.log.verbose("adduser", "update existing user")
return this.request('GET'
- , '/-/user/org.couchdb.user:'+encodeURIComponent(username)
+ , '/-/user/org.couchdb.user:'+encodeURIComponent(username) +
+ '?write=true'
, function (er, data, json, response) {
if (er || data.error) {
return cb(er, data, json, response)
diff --git a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js
index 221e8adf4..4a2f9af24 100644
--- a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js
+++ b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js
@@ -14,7 +14,7 @@ function deprecate (name, ver, message, cb) {
var users = {}
- this.get(name, function (er, data) {
+ this.get(name + '?write=true', function (er, data) {
if (er) return cb(er)
// filter all the versions that match
Object.keys(data.versions).filter(function (v) {
diff --git a/deps/npm/node_modules/npm-registry-client/lib/get.js b/deps/npm/node_modules/npm-registry-client/lib/get.js
index eeb716e85..bb6d525b8 100644
--- a/deps/npm/node_modules/npm-registry-client/lib/get.js
+++ b/deps/npm/node_modules/npm-registry-client/lib/get.js
@@ -31,9 +31,15 @@ function get (uri, timeout, nofollow, staleOk, cb) {
var cacheUri = uri
// on windows ":" is not an allowed character in a foldername
- cacheUri = cacheUri.replace(/:/g, '_')
+ cacheUri = cacheUri.replace(/:/g, '_').replace(/\?write=true$/, '')
var cache = path.join(this.conf.get('cache'), cacheUri, ".cache.json")
+ // If the GET is part of a write operation (PUT or DELETE), then
+ // skip past the cache entirely, but still save the results.
+ if (uri.match(/\?write=true$/))
+ return get_.call(this, uri, timeout, cache, null, null, nofollow, staleOk, cb)
+
+
fs.stat(cache, function (er, stat) {
if (!er) fs.readFile(cache, function (er, data) {
try { data = JSON.parse(data) }
diff --git a/deps/npm/node_modules/npm-registry-client/lib/publish.js b/deps/npm/node_modules/npm-registry-client/lib/publish.js
index acc0ca81c..d6525eb78 100644
--- a/deps/npm/node_modules/npm-registry-client/lib/publish.js
+++ b/deps/npm/node_modules/npm-registry-client/lib/publish.js
@@ -18,8 +18,8 @@ function publish (data, tarball, cb) {
return cb(er)
}
- if (data.name !== encodeURIComponent(data.name).toLowerCase())
- return cb(new Error('invalid name: must be lowercase and url-safe'))
+ if (data.name !== encodeURIComponent(data.name))
+ return cb(new Error('invalid name: must be url-safe'))
var ver = semver.clean(data.version)
if (!ver)
@@ -95,7 +95,8 @@ function putFirst (data, tardata, stat, username, email, cb) {
return cb(er, parsed, json, res)
// let's see what versions are already published.
- this.request("GET", data.name, function (er, current) {
+ var getUrl = data.name + "?write=true"
+ this.request("GET", getUrl, function (er, current) {
if (er)
return cb(er)
putNext.call(this, data.version, root, current, cb)
diff --git a/deps/npm/node_modules/npm-registry-client/lib/star.js b/deps/npm/node_modules/npm-registry-client/lib/star.js
index 5b7ab4afe..5c2375d04 100644
--- a/deps/npm/node_modules/npm-registry-client/lib/star.js
+++ b/deps/npm/node_modules/npm-registry-client/lib/star.js
@@ -7,7 +7,7 @@ function star (package, starred, cb) {
var users = {}
- this.request("GET", package, function (er, fullData) {
+ this.request("GET", package + '?write=true', function (er, fullData) {
if (er) return cb(er)
fullData = { _id: fullData._id
diff --git a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js
index 9aaac1b70..4bbbb347e 100644
--- a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js
+++ b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js
@@ -14,7 +14,8 @@ var semver = require("semver")
function unpublish (name, ver, cb) {
if (typeof cb !== "function") cb = ver, ver = null
- this.get(name, null, -1, true, function (er, data) {
+ var u = name + '?write=true'
+ this.get(u, null, -1, true, function (er, data) {
if (er) {
this.log.info("unpublish", name+" not published")
return cb()
diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json
index d9e22e289..70869bc2e 100644
--- a/deps/npm/node_modules/npm-registry-client/package.json
+++ b/deps/npm/node_modules/npm-registry-client/package.json
@@ -6,7 +6,7 @@
},
"name": "npm-registry-client",
"description": "Client for the npm registry",
- "version": "0.4.0",
+ "version": "0.4.4",
"repository": {
"url": "git://github.com/isaacs/npm-registry-client"
},
@@ -38,10 +38,6 @@
"url": "https://github.com/isaacs/npm-registry-client/issues"
},
"homepage": "https://github.com/isaacs/npm-registry-client",
- "_id": "npm-registry-client@0.4.0",
- "dist": {
- "shasum": "30d0c178b7f2e54183a6a3fc9fe4071eb10290bf"
- },
- "_from": "npm-registry-client@0.4.0",
- "_resolved": "https://registry.npmjs.org/npm-registry-client/-/npm-registry-client-0.4.0.tgz"
+ "_id": "npm-registry-client@0.4.4",
+ "_from": "npm-registry-client@latest"
}
diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js
index 03a1edbb2..1d70c5a78 100644
--- a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js
+++ b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js
@@ -32,7 +32,7 @@ tap.test("update a user acct", function (t) {
res.json({error: "conflict"})
})
- server.expect("GET", "/-/user/org.couchdb.user:username", function (req, res) {
+ server.expect("GET", "/-/user/org.couchdb.user:username?write=true", function (req, res) {
t.equal(req.method, "GET")
res.json(userdata)
})
diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again.js b/deps/npm/node_modules/npm-registry-client/test/publish-again.js
index 0170a6f3a..011fbaf5a 100644
--- a/deps/npm/node_modules/npm-registry-client/test/publish-again.js
+++ b/deps/npm/node_modules/npm-registry-client/test/publish-again.js
@@ -36,7 +36,7 @@ tap.test("publish again", function (t) {
})
})
- server.expect("/npm-registry-client", function (req, res) {
+ server.expect("/npm-registry-client?write=true", function (req, res) {
t.equal(req.method, "GET")
t.ok(lastTime)
for (var i in lastTime.versions) {
diff --git a/deps/npm/node_modules/read-installed/README.md b/deps/npm/node_modules/read-installed/README.md
index 616371ef9..535a8496f 100644
--- a/deps/npm/node_modules/read-installed/README.md
+++ b/deps/npm/node_modules/read-installed/README.md
@@ -5,12 +5,21 @@ structure with all the data.
npm uses this.
+## 1.0.0
+
+Breaking changes in `1.0.0`:
+
+The second argument is now an `Object` that contains the following keys:
+
+ * `depth` optional, defaults to Infinity
+ * `log` optional log Function
+ * `dev` optional, dev=true to mark devDeps as extraneous
+
## Usage
```javascript
var readInstalled = require("read-installed")
-// depth is optional, defaults to Infinity
-readInstalled(folder, depth, logFunction, function (er, data) {
+readInstalled(folder, { depth, log, dev }, function (er, data) {
...
})
```
diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json
index 41f16e288..16836d266 100644
--- a/deps/npm/node_modules/read-installed/package.json
+++ b/deps/npm/node_modules/read-installed/package.json
@@ -1,23 +1,39 @@
{
"name": "read-installed",
"description": "Read all the installed packages in a folder, and return a tree structure with all the data.",
- "version": "0.2.5",
+ "version": "1.0.0",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/read-installed"
},
"main": "read-installed.js",
"scripts": {
- "test": "node test/basic.js"
+ "test": "tap ./test/"
},
"dependencies": {
"semver": "2",
"slide": "~1.1.3",
- "read-package-json": "1"
+ "read-package-json": "1",
+ "graceful-fs": "~2"
},
"optionalDependencies": {
"graceful-fs": "~2"
},
- "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
- "license": "ISC"
+ "author": {
+ "name": "Isaac Z. Schlueter",
+ "email": "i@izs.me",
+ "url": "http://blog.izs.me/"
+ },
+ "license": "ISC",
+ "devDependencies": {
+ "tap": "~0.4.8"
+ },
+ "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## 1.0.0\n\nBreaking changes in `1.0.0`:\n\nThe second argument is now an `Object` that contains the following keys:\n\n * `depth` optional, defaults to Infinity\n * `log` optional log Function\n * `dev` optional, dev=true to mark devDeps as extraneous\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\nreadInstalled(folder, { depth, log, dev }, function (er, data) {\n ...\n})\n```\n",
+ "readmeFilename": "README.md",
+ "bugs": {
+ "url": "https://github.com/isaacs/read-installed/issues"
+ },
+ "homepage": "https://github.com/isaacs/read-installed",
+ "_id": "read-installed@1.0.0",
+ "_from": "read-installed@latest"
}
diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js
index 2920d7d66..9ca482dab 100644
--- a/deps/npm/node_modules/read-installed/read-installed.js
+++ b/deps/npm/node_modules/read-installed/read-installed.js
@@ -101,17 +101,14 @@ var url = require("url")
module.exports = readInstalled
-function readInstalled (folder, depth_, log_, cb_) {
- var depth = Infinity, log = function () {}, cb
- for (var i = 1; i < arguments.length - 1; i++) {
- if (typeof arguments[i] === 'number')
- depth = arguments[i]
- else if (typeof arguments[i] === 'function')
- log = arguments[i]
+function readInstalled (folder, opts, cb) {
+ if (typeof opts === 'function') {
+ cb = opts
+ opts = {}
}
- cb = arguments[i]
+ var depth = Infinity || opts.depth, log = function () {} || opts.log, dev = false || opts.dev
- readInstalled_(folder, null, null, null, 0, depth, function (er, obj) {
+ readInstalled_(folder, null, null, null, 0, depth, dev, function (er, obj) {
if (er) return cb(er)
// now obj has all the installed things, where they're installed
// figure out the inheritance links, now that the object is built.
@@ -121,7 +118,7 @@ function readInstalled (folder, depth_, log_, cb_) {
}
var rpSeen = {}
-function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) {
+function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, dev, cb) {
var installed
, obj
, real
@@ -177,7 +174,7 @@ function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) {
obj.realName = name || obj.name
obj.dependencies = obj.dependencies || {}
- // "foo":"http://blah" is always presumed valid
+ // "foo":"http://blah" and "foo":"latest" are always presumed valid
if (reqver
&& semver.validRange(reqver, true)
&& !semver.satisfies(obj.version, reqver, true)) {
@@ -186,7 +183,7 @@ function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) {
if (parent
&& !(name in parent.dependencies)
- && !(name in (parent.devDependencies || {}))) {
+ && (dev || !(name in (parent.devDependencies || {})))) {
obj.extraneous = true
}
obj.path = obj.path || folder
@@ -198,7 +195,7 @@ function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) {
//if (depth >= maxDepth) return cb(null, obj)
asyncMap(installed, function (pkg, cb) {
var rv = obj.dependencies[pkg]
- if (!rv && obj.devDependencies) rv = obj.devDependencies[pkg]
+ if (!rv && obj.devDependencies && !dev) rv = obj.devDependencies[pkg]
if (depth >= maxDepth) {
// just try to get the version number
var pkgfolder = path.resolve(folder, "node_modules", pkg)
@@ -220,6 +217,7 @@ function readInstalled_ (folder, parent, name, reqver, depth, maxDepth, cb) {
readInstalled_( path.resolve(folder, "node_modules/"+pkg)
, obj, pkg, obj.dependencies[pkg], depth + 1, maxDepth
+ , dev
, cb )
}, function (er, installedData) {
@@ -285,9 +283,9 @@ function findUnmet (obj, log) {
r = r.link ? null : r.parent
continue
}
+ // "foo":"http://blah" and "foo":"latest" are always presumed valid
if ( typeof deps[d] === "string"
- // url deps presumed innocent.
- && !url.parse(deps[d]).protocol
+ && semver.validRange(deps[d], true)
&& !semver.satisfies(found.version, deps[d], true)) {
// the bad thing will happen
log("unmet dependency", obj.path + " requires "+d+"@'"+deps[d]
diff --git a/deps/npm/node_modules/read-installed/test/basic.js b/deps/npm/node_modules/read-installed/test/basic.js
index 2b0c03983..a6c5ff546 100644
--- a/deps/npm/node_modules/read-installed/test/basic.js
+++ b/deps/npm/node_modules/read-installed/test/basic.js
@@ -1,15 +1,26 @@
var readInstalled = require("../read-installed.js")
-var util = require("util")
-console.error("testing")
+var json = require("../package.json")
+var known = [].concat(Object.keys(json.dependencies)
+ , Object.keys(json.optionalDependencies)
+ , Object.keys(json.devDependencies)).sort()
+var test = require("tap").test
+var path = require("path")
-var called = 0
-readInstalled(process.cwd(), console.error, function (er, map) {
- console.error(called ++)
- if (er) return console.error(er.stack || er.message)
- cleanup(map)
- console.error(util.inspect(map, true, 10, true))
+test("make sure that it works", function (t) {
+ readInstalled(path.join(__dirname, "../"), {
+ log: console.error
+ }, function (er, map) {
+ t.notOk(er, "er should be bull")
+ t.ok(map, "map should be data")
+ if (er) return console.error(er.stack || er.message)
+ cleanup(map)
+ var deps = Object.keys(map.dependencies).sort()
+ t.equal(known.length, deps.length, "array lengths are equal")
+ t.deepEqual(known, deps, "arrays should be equal")
+ t.notOk(map.dependencies.tap.extraneous, 'extraneous not set on devDep')
+ t.end()
+ })
})
-
var seen = []
function cleanup (map) {
if (seen.indexOf(map) !== -1) return
diff --git a/deps/npm/node_modules/read-installed/test/dev.js b/deps/npm/node_modules/read-installed/test/dev.js
new file mode 100644
index 000000000..104761745
--- /dev/null
+++ b/deps/npm/node_modules/read-installed/test/dev.js
@@ -0,0 +1,22 @@
+var readInstalled = require("../read-installed.js")
+var test = require("tap").test
+var json = require("../package.json")
+var path = require("path")
+var known = [].concat(Object.keys(json.dependencies)
+ , Object.keys(json.optionalDependencies)
+ , Object.keys(json.devDependencies)).sort()
+
+test("make sure that it works without dev deps", function (t) {
+ readInstalled(path.join(__dirname, "../"), {
+ log: console.error
+ , dev: true }, function (er, map) {
+ t.notOk(er, "er should be bull")
+ t.ok(map, "map should be data")
+ if (er) return console.error(er.stack || er.message)
+ var deps = Object.keys(map.dependencies).sort()
+ t.equal(deps.length, known.length, "array lengths are equal")
+ t.deepEqual(deps, known, "arrays should be equal")
+ t.ok(map.dependencies.tap.extraneous, 'extraneous is set on devDep')
+ t.end()
+ })
+})
diff --git a/deps/npm/node_modules/read-installed/test/fixtures/peer-at-latest/node_modules/strong-task-emitter/package.json b/deps/npm/node_modules/read-installed/test/fixtures/peer-at-latest/node_modules/strong-task-emitter/package.json
new file mode 100644
index 000000000..8824f5387
--- /dev/null
+++ b/deps/npm/node_modules/read-installed/test/fixtures/peer-at-latest/node_modules/strong-task-emitter/package.json
@@ -0,0 +1,10 @@
+{
+ "name": "strong-task-emitter",
+ "version": "0.0.4",
+ "dependencies": {
+ "debug": "latest"
+ },
+ "_id": "strong-task-emitter@0.0.4",
+ "_from": "strong-task-emitter@0.0.4",
+ "_resolved": "https://registry.npmjs.org/strong-task-emitter/-/strong-task-emitter-0.0.4.tgz"
+}
diff --git a/deps/npm/node_modules/read-installed/test/noargs.js b/deps/npm/node_modules/read-installed/test/noargs.js
new file mode 100644
index 000000000..0de5ba430
--- /dev/null
+++ b/deps/npm/node_modules/read-installed/test/noargs.js
@@ -0,0 +1,21 @@
+var readInstalled = require("../read-installed.js")
+var test = require("tap").test
+var json = require("../package.json")
+var path = require("path")
+var known = [].concat(Object.keys(json.dependencies)
+ , Object.keys(json.optionalDependencies)
+ , Object.keys(json.devDependencies)).sort()
+
+test("make sure that it works without dev deps", function (t) {
+ readInstalled(path.join(__dirname, "../"), function (er, map) {
+ t.notOk(er, "er should be bull")
+ t.ok(map, "map should be data")
+ if (er) return console.error(er.stack || er.message)
+ var deps = Object.keys(map.dependencies).sort()
+ t.equal(deps.length, known.length, "array lengths are equal")
+ t.deepEqual(deps, known, "arrays should be equal")
+ t.notOk(map.dependencies.tap.extraneous, 'extraneous is set on devDep')
+ t.end()
+ })
+})
+
diff --git a/deps/npm/node_modules/read-installed/test/peer-dep-at-latest.js b/deps/npm/node_modules/read-installed/test/peer-dep-at-latest.js
new file mode 100644
index 000000000..8f2436fa1
--- /dev/null
+++ b/deps/npm/node_modules/read-installed/test/peer-dep-at-latest.js
@@ -0,0 +1,14 @@
+var readInstalled = require('../read-installed.js')
+var test = require('tap').test
+var path = require('path');
+
+test('"latest" version is valid', function(t) {
+ // This test verifies npm#3860
+ readInstalled(
+ path.join(__dirname, 'fixtures/peer-at-latest'),
+ { log: console.error },
+ function(err, map) {
+ t.notOk(map.dependencies.debug.invalid, 'debug@latest is satisfied by a peer')
+ t.end()
+ })
+})