From 2bcb9ab7bcd474590f109bd04c43ba8e39a90dfa Mon Sep 17 00:00:00 2001 From: isaacs Date: Tue, 21 Aug 2012 15:29:03 -0700 Subject: [PATCH] npm: Upgrade to 1.1.55 --- deps/npm/.travis.yml | 4 - deps/npm/AUTHORS | 2 + deps/npm/doc/cli/dedupe.md | 53 ++++ deps/npm/doc/cli/index.md | 4 + deps/npm/html/api/bin.html | 2 +- deps/npm/html/api/bugs.html | 2 +- deps/npm/html/api/commands.html | 2 +- deps/npm/html/api/config.html | 2 +- deps/npm/html/api/deprecate.html | 2 +- deps/npm/html/api/docs.html | 2 +- deps/npm/html/api/edit.html | 2 +- deps/npm/html/api/explore.html | 2 +- deps/npm/html/api/help-search.html | 2 +- deps/npm/html/api/init.html | 2 +- deps/npm/html/api/install.html | 2 +- deps/npm/html/api/link.html | 2 +- deps/npm/html/api/load.html | 2 +- deps/npm/html/api/ls.html | 2 +- deps/npm/html/api/npm.html | 4 +- deps/npm/html/api/outdated.html | 2 +- deps/npm/html/api/owner.html | 2 +- deps/npm/html/api/pack.html | 2 +- deps/npm/html/api/prefix.html | 2 +- deps/npm/html/api/prune.html | 2 +- deps/npm/html/api/publish.html | 2 +- deps/npm/html/api/rebuild.html | 2 +- deps/npm/html/api/restart.html | 2 +- deps/npm/html/api/root.html | 2 +- deps/npm/html/api/run-script.html | 2 +- deps/npm/html/api/search.html | 2 +- deps/npm/html/api/shrinkwrap.html | 2 +- deps/npm/html/api/start.html | 2 +- deps/npm/html/api/stop.html | 2 +- deps/npm/html/api/submodule.html | 2 +- deps/npm/html/api/tag.html | 2 +- deps/npm/html/api/test.html | 2 +- deps/npm/html/api/uninstall.html | 2 +- deps/npm/html/api/unpublish.html | 2 +- deps/npm/html/api/update.html | 2 +- deps/npm/html/api/version.html | 2 +- deps/npm/html/api/view.html | 2 +- deps/npm/html/api/whoami.html | 2 +- deps/npm/html/doc/README.html | 2 +- deps/npm/html/doc/adduser.html | 2 +- deps/npm/html/doc/bin.html | 2 +- deps/npm/html/doc/bugs.html | 2 +- deps/npm/html/doc/build.html | 2 +- deps/npm/html/doc/bundle.html | 2 +- deps/npm/html/doc/cache.html | 2 +- deps/npm/html/doc/changelog.html | 2 +- deps/npm/html/doc/coding-style.html | 2 +- deps/npm/html/doc/completion.html | 2 +- deps/npm/html/doc/config.html | 2 +- deps/npm/html/doc/dedupe.html | 92 ++++++ deps/npm/html/doc/deprecate.html | 2 +- deps/npm/html/doc/developers.html | 2 +- deps/npm/html/doc/disputes.html | 2 +- deps/npm/html/doc/docs.html | 2 +- deps/npm/html/doc/edit.html | 2 +- deps/npm/html/doc/explore.html | 2 +- deps/npm/html/doc/faq.html | 2 +- deps/npm/html/doc/folders.html | 2 +- deps/npm/html/doc/help-search.html | 2 +- deps/npm/html/doc/help.html | 2 +- deps/npm/html/doc/index.html | 6 +- deps/npm/html/doc/init.html | 2 +- deps/npm/html/doc/install.html | 2 +- deps/npm/html/doc/json.html | 2 +- deps/npm/html/doc/link.html | 2 +- deps/npm/html/doc/list.html | 4 +- deps/npm/html/doc/npm.html | 4 +- deps/npm/html/doc/outdated.html | 2 +- deps/npm/html/doc/owner.html | 2 +- deps/npm/html/doc/pack.html | 2 +- deps/npm/html/doc/prefix.html | 2 +- deps/npm/html/doc/prune.html | 2 +- deps/npm/html/doc/publish.html | 2 +- deps/npm/html/doc/rebuild.html | 2 +- deps/npm/html/doc/registry.html | 2 +- deps/npm/html/doc/removing-npm.html | 2 +- deps/npm/html/doc/restart.html | 2 +- deps/npm/html/doc/root.html | 2 +- deps/npm/html/doc/run-script.html | 2 +- deps/npm/html/doc/scripts.html | 2 +- deps/npm/html/doc/search.html | 2 +- deps/npm/html/doc/semver.html | 2 +- deps/npm/html/doc/shrinkwrap.html | 2 +- deps/npm/html/doc/star.html | 2 +- deps/npm/html/doc/start.html | 2 +- deps/npm/html/doc/stop.html | 2 +- deps/npm/html/doc/submodule.html | 2 +- deps/npm/html/doc/tag.html | 2 +- deps/npm/html/doc/test.html | 2 +- deps/npm/html/doc/uninstall.html | 2 +- deps/npm/html/doc/unpublish.html | 2 +- deps/npm/html/doc/update.html | 2 +- deps/npm/html/doc/version.html | 2 +- deps/npm/html/doc/view.html | 2 +- deps/npm/html/doc/whoami.html | 2 +- deps/npm/lib/dedupe.js | 334 +++++++++++++++++++++ deps/npm/lib/npm.js | 44 +-- deps/npm/lib/publish.js | 15 +- deps/npm/lib/utils/error-handler.js | 6 + deps/npm/lib/utils/fetch.js | 7 +- deps/npm/lib/utils/find-prefix.js | 1 - deps/npm/lib/view.js | 2 +- deps/npm/man/man1/dedupe.1 | 90 ++++++ deps/npm/man/man1/index.1 | 3 + deps/npm/man/man1/list.1 | 2 +- deps/npm/man/man1/npm.1 | 2 +- deps/npm/man/man3/npm.3 | 2 +- deps/npm/node_modules/couch-login/couch-login.js | 2 +- deps/npm/node_modules/couch-login/package.json | 6 +- deps/npm/node_modules/mkdirp/.gitignore.orig | 2 - deps/npm/node_modules/mkdirp/.gitignore.rej | 5 - deps/npm/node_modules/mkdirp/examples/pow.js.orig | 6 - deps/npm/node_modules/mkdirp/examples/pow.js.rej | 19 -- deps/npm/node_modules/mkdirp/index.js | 28 +- deps/npm/node_modules/mkdirp/package.json | 19 +- deps/npm/node_modules/node-gyp/addon.gypi | 3 + deps/npm/node_modules/node-gyp/lib/build.js | 6 +- deps/npm/node_modules/node-gyp/lib/node-gyp.js | 1 + deps/npm/node_modules/node-gyp/package.json | 4 +- deps/npm/node_modules/node-uuid/.npmignore | 2 - deps/npm/node_modules/node-uuid/LICENSE.md | 3 - deps/npm/node_modules/node-uuid/README.md | 199 ------------ deps/npm/node_modules/node-uuid/package.json | 14 - deps/npm/node_modules/node-uuid/uuid.js | 249 --------------- .../npm/node_modules/npm-registry-client/README.md | 32 +- deps/npm/node_modules/npm-registry-client/index.js | 82 ++--- .../npm-registry-client/lib/adduser.js | 46 ++- .../node_modules/npm-registry-client/lib/get.js | 24 +- .../npm-registry-client/lib/publish.js | 18 +- .../npm-registry-client/lib/request.js | 55 ++-- .../node_modules/npm-registry-client/lib/star.js | 6 +- .../node_modules/npm-registry-client/package.json | 9 +- .../npm-registry-client/test/retries.js | 6 +- deps/npm/node_modules/npmconf/npmconf.js | 18 +- deps/npm/node_modules/npmconf/package.json | 8 +- deps/npm/node_modules/read-installed/package.json | 6 +- .../node_modules/read-installed/read-installed.js | 2 + .../node_modules/read-package-json/package.json | 6 +- .../node_modules/read-package-json/read-json.js | 2 +- deps/npm/node_modules/read/README.md | 15 + deps/npm/node_modules/read/lib/read.js | 15 +- .../read/node_modules/mute-stream/mute.js | 15 + .../read/node_modules/mute-stream/package.json | 7 +- .../read/node_modules/mute-stream/test/basic.js | 12 + deps/npm/node_modules/read/package.json | 8 +- deps/npm/node_modules/read/test/basic.js | 7 +- deps/npm/node_modules/read/test/defaults.js | 7 +- deps/npm/node_modules/read/test/many.js | 7 +- deps/npm/node_modules/request/README.md | 2 +- deps/npm/node_modules/request/aws2.js | 128 -------- deps/npm/node_modules/request/main.js | 148 +++++++-- deps/npm/node_modules/request/package.json | 6 +- deps/npm/node_modules/request/tests/server.js | 14 +- deps/npm/node_modules/request/tests/test-body.js | 39 ++- .../node_modules/request/tests/test-defaults.js | 35 ++- .../request/tests/test-follow-all-303.js | 30 ++ .../node_modules/request/tests/test-follow-all.js | 35 +++ .../request/tests/test-https-strict.js | 6 +- deps/npm/node_modules/request/tests/test-https.js | 6 +- deps/npm/node_modules/request/tests/test-params.js | 6 +- .../tests/test-protocol-changing-redirect.js | 60 ++++ deps/npm/node_modules/request/tests/test-s3.js | 13 - deps/npm/node_modules/request/tests/test-tunnel.js | 6 +- deps/npm/node_modules/request/tunnel.js | 1 + deps/npm/package.json | 10 +- deps/npm/test/tap/publish-config.js | 41 +++ 170 files changed, 1377 insertions(+), 1051 deletions(-) delete mode 100644 deps/npm/.travis.yml create mode 100644 deps/npm/doc/cli/dedupe.md create mode 100644 deps/npm/html/doc/dedupe.html create mode 100644 deps/npm/lib/dedupe.js create mode 100644 deps/npm/man/man1/dedupe.1 delete mode 100644 deps/npm/node_modules/mkdirp/.gitignore.orig delete mode 100644 deps/npm/node_modules/mkdirp/.gitignore.rej delete mode 100644 deps/npm/node_modules/mkdirp/examples/pow.js.orig delete mode 100644 deps/npm/node_modules/mkdirp/examples/pow.js.rej delete mode 100644 deps/npm/node_modules/node-uuid/.npmignore delete mode 100644 deps/npm/node_modules/node-uuid/LICENSE.md delete mode 100644 deps/npm/node_modules/node-uuid/README.md delete mode 100644 deps/npm/node_modules/node-uuid/package.json delete mode 100644 deps/npm/node_modules/node-uuid/uuid.js delete mode 100644 deps/npm/node_modules/request/aws2.js create mode 100644 deps/npm/node_modules/request/tests/test-follow-all-303.js create mode 100644 deps/npm/node_modules/request/tests/test-follow-all.js create mode 100644 deps/npm/node_modules/request/tests/test-protocol-changing-redirect.js delete mode 100644 deps/npm/node_modules/request/tests/test-s3.js create mode 100644 deps/npm/test/tap/publish-config.js diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml deleted file mode 100644 index a385519..0000000 --- a/deps/npm/.travis.yml +++ /dev/null @@ -1,4 +0,0 @@ -language: node_js -before_install: "make &>out || cat out; rm out" -node_js: - - 0.8 diff --git a/deps/npm/AUTHORS b/deps/npm/AUTHORS index 57fdf6a..d1306ad 100644 --- a/deps/npm/AUTHORS +++ b/deps/npm/AUTHORS @@ -75,3 +75,5 @@ Don Park Kei Son Nicolas Morel Mark Dube +Maxim Bogushevich +Justin Beckwith diff --git a/deps/npm/doc/cli/dedupe.md b/deps/npm/doc/cli/dedupe.md new file mode 100644 index 0000000..220329a --- /dev/null +++ b/deps/npm/doc/cli/dedupe.md @@ -0,0 +1,53 @@ +npm-dedupe(1) -- Reduce duplication +=================================== + +## SYNOPSIS + + npm dedupe [package names...] + +## DESCRIPTION + +Searches the local package tree and attempts to simplify the overall +structure by moving dependencies further up the tree, where they can +be more effectively shared by multiple dependent packages. + +For example, consider this dependency graph: + + a + +-- b <-- depends on c@1.0.x + | `-- c@1.0.3 + `-- d <-- depends on c@~1.0.9 + `-- c@1.0.10 + +In this case, `npm-dedupe(1)` will transform the tree to: + + a + +-- b + +-- d + `-- c@1.0.10 + +Because of the hierarchical nature of node's module lookup, b and d +will both get their dependency met by the single c package at the root +level of the tree. + +If a suitable version exists at the target location in the tree +already, then it will be left untouched, but the other duplicates will +be deleted. + +If no suitable version can be found, then a warning is printed, and +nothing is done. + +If any arguments are supplied, then they are filters, and only the +named packages will be touched. + +Note that this operation transforms the dependency tree, and may +result in packages getting updated versions, perhaps from the npm +registry. + +This feature is experimental, and may change in future versions. + +## SEE ALSO + +* npm-ls(1) +* npm-update(1) +* npm-install(1) diff --git a/deps/npm/doc/cli/index.md b/deps/npm/doc/cli/index.md index ee88f3d..b2ffd13 100644 --- a/deps/npm/doc/cli/index.md +++ b/deps/npm/doc/cli/index.md @@ -46,6 +46,10 @@ npm-index(1) -- Index of all npm documentation Manage the npm configuration file +## npm-dedupe(1) + + Reduce duplication + ## npm-deprecate(1) Deprecate a version of a package diff --git a/deps/npm/html/api/bin.html b/deps/npm/html/api/bin.html index d3650c2..8aa2d95 100644 --- a/deps/npm/html/api/bin.html +++ b/deps/npm/html/api/bin.html @@ -19,7 +19,7 @@

This function should not be used programmatically. Instead, just refer to the npm.bin member.

- + + diff --git a/deps/npm/html/doc/deprecate.html b/deps/npm/html/doc/deprecate.html index 68f7d30..b21e768 100644 --- a/deps/npm/html/doc/deprecate.html +++ b/deps/npm/html/doc/deprecate.html @@ -29,7 +29,7 @@ something like this:

- + -``` - -Or in node.js: - -``` -npm install node-uuid -``` - -```javascript -var uuid = require('node-uuid'); -``` - -Then create some ids ... - -```javascript -// Generate a v1 (time-based) id -uuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' - -// Generate a v4 (random) id -uuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1' -``` - -## API - -### uuid.v1([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v1 (timestamp-based) UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomnly generated ID. See note 1. - * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence. Default: An internally maintained clockseq is used. - * `msecs` - (Number | Date) Time in milliseconds since unix Epoch. Default: The current time is used. - * `nsecs` - (Number between 0-9999) additional time, in 100-nanosecond units. Ignored if `msecs` is unspecified. Default: internal uuid counter is used, as per 4.2.1.2. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Notes: - -1. The randomly generated node id is only guaranteed to stay constant for the lifetime of the current JS runtime. (Future versions of this module may use persistent storage mechanisms to extend this guarantee.) - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v1({ - node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab], - clockseq: 0x1234, - msecs: new Date('2011-11-01').getTime(), - nsecs: 5678 -}); // -> "710b962e-041c-11e1-9234-0123456789ab" -``` - -Example: In-place generation of two binary IDs - -```javascript -// Generate two ids in an array -var arr = new Array(32); // -> [] -uuid.v1(null, arr, 0); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15] -uuid.v1(null, arr, 16); // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15 02 a3 1c b0 14 32 11 e1 85 58 0b 48 8e 4f c1 15] - -// Optionally use uuid.unparse() to get stringify the ids -uuid.unparse(buffer); // -> '02a2ce90-1432-11e1-8558-0b488e4fc115' -uuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115' -``` - -### uuid.v4([`options` [, `buffer` [, `offset`]]]) - -Generate and return a RFC4122 v4 UUID. - -* `options` - (Object) Optional uuid state to apply. Properties may include: - - * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values - * `rng` - (Function) Random # generator to use. Set to one of the built-in generators - `uuid.mathRNG` (all platforms), `uuid.nodeRNG` (node.js only), `uuid.whatwgRNG` (WebKit only) - or a custom function that returns an array[16] of byte values. - -* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. -* `offset` - (Number) Starting index in `buffer` at which to begin writing. - -Returns `buffer`, if specified, otherwise the string form of the UUID - -Example: Generate string UUID with fully-specified options - -```javascript -uuid.v4({ - random: [ - 0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea, - 0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36 - ] -}); -// -> "109156be-c4fb-41ea-b1b4-efe1671c5836" -``` - -Example: Generate two IDs in a single buffer - -```javascript -var buffer = new Array(32); // (or 'new Buffer' in node.js) -uuid.v4(null, buffer, 0); -uuid.v4(null, buffer, 16); -``` - -### uuid.parse(id[, buffer[, offset]]) -### uuid.unparse(buffer[, offset]) - -Parse and unparse UUIDs - - * `id` - (String) UUID(-like) string - * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used - * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0 - -Example parsing and unparsing a UUID string - -```javascript -var bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> -var string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10' -``` - -### uuid.noConflict() - -(Browsers only) Set `uuid` property back to it's previous value. - -Returns the node-uuid object. - -Example: - -```javascript -var myUuid = uuid.noConflict(); -myUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a' -``` - -## Deprecated APIs - -Support for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version. - -### uuid([format [, buffer [, offset]]]) - -uuid() has become uuid.v4(), and the `format` argument is now implicit in the `buffer` argument. (i.e. if you specify a buffer, the format is assumed to be binary). - -### uuid.BufferClass - -The class of container created when generating binary uuid data if no buffer argument is specified. This is expected to go away, with no replacement API. - -## Testing - -In node.js - -``` -> cd test -> node uuid.js -``` - -In Browser - -``` -open test/test.html -``` - -### Benchmarking - -Requires node.js - -``` -npm install uuid uuid-js -node test/benchmark.js -``` - -For a more complete discussion of node-uuid performance, please see the `benchmark/README.md` file, and the [benchmark wiki](https://github.com/broofa/node-uuid/wiki/Benchmark) - -For browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance). - -## Release notes - -v1.3.2: -* Improve tests and handling of v1() options (Issue #24) -* Expose RNG option to allow for perf testing with different generators - -v1.3: -* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)! -* Support for node.js crypto API -* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code diff --git a/deps/npm/node_modules/node-uuid/package.json b/deps/npm/node_modules/node-uuid/package.json deleted file mode 100644 index 9df0da9..0000000 --- a/deps/npm/node_modules/node-uuid/package.json +++ /dev/null @@ -1,14 +0,0 @@ -{ - "name" : "node-uuid", - "description" : "Rigorous implementation of RFC4122 (v1 and v4) UUIDs.", - "url" : "http://github.com/broofa/node-uuid", - "keywords" : ["uuid", "guid", "rfc4122"], - "author" : "Robert Kieffer ", - "contributors" : [ - {"name": "Christoph Tavan ", "github": "https://github.com/ctavan"} - ], - "dependencies" : {}, - "lib" : ".", - "main" : "./uuid.js", - "version" : "1.3.3" -} diff --git a/deps/npm/node_modules/node-uuid/uuid.js b/deps/npm/node_modules/node-uuid/uuid.js deleted file mode 100644 index 27f1d12..0000000 --- a/deps/npm/node_modules/node-uuid/uuid.js +++ /dev/null @@ -1,249 +0,0 @@ -// node-uuid/uuid.js -// -// Copyright (c) 2010 Robert Kieffer -// Dual licensed under the MIT and GPL licenses. -// Documentation and details at https://github.com/broofa/node-uuid -(function() { - var _global = this; - - // Unique ID creation requires a high quality random # generator, but - // Math.random() does not guarantee "cryptographic quality". So we feature - // detect for more robust APIs, normalizing each method to return 128-bits - // (16 bytes) of random data. - var mathRNG, nodeRNG, whatwgRNG; - - // Math.random()-based RNG. All platforms, very fast, unknown quality - var _rndBytes = new Array(16); - mathRNG = function() { - var r, b = _rndBytes, i = 0; - - for (var i = 0, r; i < 16; i++) { - if ((i & 0x03) == 0) r = Math.random() * 0x100000000; - b[i] = r >>> ((i & 0x03) << 3) & 0xff; - } - - return b; - } - - // WHATWG crypto-based RNG - http://wiki.whatwg.org/wiki/Crypto - // WebKit only (currently), moderately fast, high quality - if (_global.crypto && crypto.getRandomValues) { - var _rnds = new Uint32Array(4); - whatwgRNG = function() { - crypto.getRandomValues(_rnds); - - for (var c = 0 ; c < 16; c++) { - _rndBytes[c] = _rnds[c >> 2] >>> ((c & 0x03) * 8) & 0xff; - } - return _rndBytes; - } - } - - // Node.js crypto-based RNG - http://nodejs.org/docs/v0.6.2/api/crypto.html - // Node.js only, moderately fast, high quality - try { - var _rb = require('crypto').randomBytes; - nodeRNG = _rb && function() { - return _rb(16); - }; - } catch (e) {} - - // Select RNG with best quality - var _rng = nodeRNG || whatwgRNG || mathRNG; - - // Buffer class to use - var BufferClass = typeof(Buffer) == 'function' ? Buffer : Array; - - // Maps for number <-> hex string conversion - var _byteToHex = []; - var _hexToByte = {}; - for (var i = 0; i < 256; i++) { - _byteToHex[i] = (i + 0x100).toString(16).substr(1); - _hexToByte[_byteToHex[i]] = i; - } - - // **`parse()` - Parse a UUID into it's component bytes** - function parse(s, buf, offset) { - var i = (buf && offset) || 0, ii = 0; - - buf = buf || []; - s.toLowerCase().replace(/[0-9a-f]{2}/g, function(byte) { - if (ii < 16) { // Don't overflow! - buf[i + ii++] = _hexToByte[byte]; - } - }); - - // Zero out remaining bytes if string was short - while (ii < 16) { - buf[i + ii++] = 0; - } - - return buf; - } - - // **`unparse()` - Convert UUID byte array (ala parse()) into a string** - function unparse(buf, offset) { - var i = offset || 0, bth = _byteToHex; - return bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + '-' + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]] + - bth[buf[i++]] + bth[buf[i++]]; - } - - // **`v1()` - Generate time-based UUID** - // - // Inspired by https://github.com/LiosK/UUID.js - // and http://docs.python.org/library/uuid.html - - // random #'s we need to init node and clockseq - var _seedBytes = _rng(); - - // Per 4.5, create and 48-bit node id, (47 random bits + multicast bit = 1) - var _nodeId = [ - _seedBytes[0] | 0x01, - _seedBytes[1], _seedBytes[2], _seedBytes[3], _seedBytes[4], _seedBytes[5] - ]; - - // Per 4.2.2, randomize (14 bit) clockseq - var _clockseq = (_seedBytes[6] << 8 | _seedBytes[7]) & 0x3fff; - - // Previous uuid creation time - var _lastMSecs = 0, _lastNSecs = 0; - - // See https://github.com/broofa/node-uuid for API details - function v1(options, buf, offset) { - var i = buf && offset || 0; - var b = buf || []; - - options = options || {}; - - var clockseq = options.clockseq != null ? options.clockseq : _clockseq; - - // UUID timestamps are 100 nano-second units since the Gregorian epoch, - // (1582-10-15 00:00). JSNumbers aren't precise enough for this, so - // time is handled internally as 'msecs' (integer milliseconds) and 'nsecs' - // (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00. - var msecs = options.msecs != null ? options.msecs : new Date().getTime(); - - // Per 4.2.1.2, use count of uuid's generated during the current clock - // cycle to simulate higher resolution clock - var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1; - - // Time since last uuid creation (in msecs) - var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000; - - // Per 4.2.1.2, Bump clockseq on clock regression - if (dt < 0 && options.clockseq == null) { - clockseq = clockseq + 1 & 0x3fff; - } - - // Reset nsecs if clock regresses (new clockseq) or we've moved onto a new - // time interval - if ((dt < 0 || msecs > _lastMSecs) && options.nsecs == null) { - nsecs = 0; - } - - // Per 4.2.1.2 Throw error if too many uuids are requested - if (nsecs >= 10000) { - throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec'); - } - - _lastMSecs = msecs; - _lastNSecs = nsecs; - _clockseq = clockseq; - - // Per 4.1.4 - Convert from unix epoch to Gregorian epoch - msecs += 12219292800000; - - // `time_low` - var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000; - b[i++] = tl >>> 24 & 0xff; - b[i++] = tl >>> 16 & 0xff; - b[i++] = tl >>> 8 & 0xff; - b[i++] = tl & 0xff; - - // `time_mid` - var tmh = (msecs / 0x100000000 * 10000) & 0xfffffff; - b[i++] = tmh >>> 8 & 0xff; - b[i++] = tmh & 0xff; - - // `time_high_and_version` - b[i++] = tmh >>> 24 & 0xf | 0x10; // include version - b[i++] = tmh >>> 16 & 0xff; - - // `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant) - b[i++] = clockseq >>> 8 | 0x80; - - // `clock_seq_low` - b[i++] = clockseq & 0xff; - - // `node` - var node = options.node || _nodeId; - for (var n = 0; n < 6; n++) { - b[i + n] = node[n]; - } - - return buf ? buf : unparse(b); - } - - // **`v4()` - Generate random UUID** - - // See https://github.com/broofa/node-uuid for API details - function v4(options, buf, offset) { - // Deprecated - 'format' argument, as supported in v1.2 - var i = buf && offset || 0; - - if (typeof(options) == 'string') { - buf = options == 'binary' ? new BufferClass(16) : null; - options = null; - } - options = options || {}; - - var rnds = options.random || (options.rng || _rng)(); - - // Per 4.4, set bits for version and `clock_seq_hi_and_reserved` - rnds[6] = (rnds[6] & 0x0f) | 0x40; - rnds[8] = (rnds[8] & 0x3f) | 0x80; - - // Copy bytes to buffer, if provided - if (buf) { - for (var ii = 0; ii < 16; ii++) { - buf[i + ii] = rnds[ii]; - } - } - - return buf || unparse(rnds); - } - - // Export public API - var uuid = v4; - uuid.v1 = v1; - uuid.v4 = v4; - uuid.parse = parse; - uuid.unparse = unparse; - uuid.BufferClass = BufferClass; - - // Export RNG options - uuid.mathRNG = mathRNG; - uuid.nodeRNG = nodeRNG; - uuid.whatwgRNG = whatwgRNG; - - if (typeof(module) != 'undefined') { - // Play nice with node.js - module.exports = uuid; - } else { - // Play nice with browsers - var _previousRoot = _global.uuid; - - // **`noConflict()` - (browser only) to reset global 'uuid' var** - uuid.noConflict = function() { - _global.uuid = _previousRoot; - return uuid; - } - _global.uuid = uuid; - } -}()); diff --git a/deps/npm/node_modules/npm-registry-client/README.md b/deps/npm/node_modules/npm-registry-client/README.md index dbeb944..4b180a0 100644 --- a/deps/npm/node_modules/npm-registry-client/README.md +++ b/deps/npm/node_modules/npm-registry-client/README.md @@ -8,7 +8,7 @@ It handles all the caching and HTTP calls. ```javascript var RegClient = require('npm-registry-client') -var client = new RegClient(options) +var client = new RegClient(config) client.get("npm", "latest", 1000, function (er, data, raw, res) { // error is an error if there was a problem. @@ -18,29 +18,43 @@ client.get("npm", "latest", 1000, function (er, data, raw, res) { }) ``` -# Options +# Configuration + +This program is designed to work with +[npmconf](https://npmjs.org/package/npmconf), but you can also pass in +a plain-jane object with the appropriate configs, and it'll shim it +for you. Any configuration thingie that has get/set/del methods will +also be accepted. * `registry` **Required** {String} URL to the registry * `cache` **Required** {String} Path to the cache folder -* `alwaysAuth` {Boolean} Auth even for GET requests. +* `always-auth` {Boolean} Auth even for GET requests. * `auth` {String} A base64-encoded `username:password` * `email` {String} User's email address * `tag` {String} The default tag to use when publishing new packages. Default = `"latest"` * `ca` {String} Cerficate signing authority certificates to trust. -* `strictSSL` {Boolean} Whether or not to be strict with SSL +* `strict-ssl` {Boolean} Whether or not to be strict with SSL certificates. Default = `true` -* `userAgent` {String} User agent header to send. Default = +* `user-agent` {String} User agent header to send. Default = `"node/{process.version}"` * `log` {Object} The logger to use. Defaults to `require("npmlog")` if that works, otherwise logs are disabled. -* `retries` {Number} Number of times to retry on GET failures. +* `fetch-retries` {Number} Number of times to retry on GET failures. Default=2 -* `retryFactor` {Number} `factor` setting for `node-retry`. Default=10 -* `retryMinTimeout` {Number} `minTimeout` setting for `node-retry`. +* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10 +* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`. Default=10000 (10 seconds) -* `retryMaxTimeout` {Number} `maxTimeout` setting for `node-retry`. +* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`. Default=60000 (60 seconds) +* `proxy` {URL} The url to proxy requests through. +* `https-proxy` {URL} The url to proxy https requests through. + Defaults to be the same as `proxy` if unset. +* `_auth` {String} The base64-encoded authorization header. +* `username` `_password` {String} Username/password to use to generate + `_auth` if not supplied. +* `_token` {Object} A token for use with + [couch-login](https://npmjs.org/package/couch-login) # client.request(method, where, [what], [etag], [nofollow], cb) diff --git a/deps/npm/node_modules/npm-registry-client/index.js b/deps/npm/node_modules/npm-registry-client/index.js index 377f787..8d321b8 100644 --- a/deps/npm/node_modules/npm-registry-client/index.js +++ b/deps/npm/node_modules/npm-registry-client/index.js @@ -19,78 +19,48 @@ try { function noop () {} -function RegClient (options) { +function RegClient (conf) { + // accept either a plain-jane object, or a npmconf object + // with a "get" method. + if (typeof conf.get !== 'function') { + var data = conf + conf = { get: function (k) { return data[k] } + , set: function (k, v) { data[k] = v } + , del: function (k) { delete data[k] } } + } + + this.conf = conf + // if provided, then the registry needs to be a url. // if it's not provided, then we're just using the cache only. - var registry = options.registry + var registry = conf.get('registry') if (registry) { registry = url.parse(registry) if (!registry.protocol) throw new Error( 'Invalid registry: ' + registry.url) - this.registry = registry.href - if (this.registry.slice(-1) !== '/') { - this.registry += '/' + registry = registry.href + if (registry.slice(-1) !== '/') { + registry += '/' } + this.conf.set('registry', registry) } else { - this.registry = null + registry = null } - this.retries = options.retries || 2 - this.retryFactor = options.retryFactor || 10 - this.retryMinTimeout = options.retryMinTimeout || 10000 - this.retryMaxTimeout = options.retryMaxTimeout || 60000 - - this.cache = options.cache - if (!this.cache) throw new Error("Cache dir is required") - - this.alwaysAuth = options.alwaysAuth || false + if (!conf.get('cache')) throw new Error("Cache dir is required") - this.auth = options.auth || null - if (this.auth) { - var a = new Buffer(this.auth, "base64").toString() - a = a.split(":") - this.username = a.shift() - this.password = a.join(":") - } else { - this.username = options.username - this.password = options.password - - // if username and password are set, but auth isn't, use them. - if (this.username && this.password) { - var a = this.username + ":" + this.password - this.auth = new Buffer(a, "utf8").toString("base64") - } - } - - if (this.auth && !this.alwaysAuth && this.registry) { + var auth = this.conf.get('_auth') + var alwaysAuth = this.conf.get('always-auth') + if (auth && !alwaysAuth && registry) { // if we're always authing, then we just send the // user/pass on every thing. otherwise, create a // session, and use that. - this.token = options.token - this.couchLogin = new CouchLogin(this.registry, this.token) - this.couchLogin.proxy = this.proxy - } - - this.email = options.email || null - this.defaultTag = options.tag || "latest" - - this.ca = options.ca || null - - this.strictSSL = options.strictSSL - if (this.strictSSL === undefined) this.strictSSL = true - - this.userAgent = options.userAgent - if (this.userAgent === undefined) { - this.userAgent = 'node/' + process.version + var token = this.conf.get('_token') + this.couchLogin = new CouchLogin(registry, token) + this.couchLogin.proxy = this.conf.get('proxy') } - this.cacheMin = options.cacheMin || 0 - this.cacheMax = options.cacheMax || Infinity - - this.proxy = options.proxy - this.httpsProxy = options.httpsProxy || options.proxy - - this.log = options.log || npmlog + this.log = conf.log || conf.get('log') || npmlog } require('fs').readdirSync(__dirname + "/lib").forEach(function (f) { 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 f940ca1..7106e44 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/adduser.js +++ b/deps/npm/node_modules/npm-registry-client/lib/adduser.js @@ -1,18 +1,12 @@ - module.exports = adduser -var uuid = require("node-uuid") - , crypto - -try { -} catch (ex) {} +var crypto = require('crypto') function sha (s) { return crypto.createHash("sha1").update(s).digest("hex") } function adduser (username, password, email, cb) { - if (!crypto) crypto = require("crypto") password = ("" + (password || "")).trim() if (!password) return cb(new Error("No password supplied.")) @@ -27,7 +21,7 @@ function adduser (username, password, email, cb) { "Sorry, ':' chars are not allowed in passwords.\n"+ "See for why.")) - var salt = uuid() + var salt = crypto.randomBytes(30).toString('hex') , userobj = { name : username , salt : salt @@ -41,18 +35,18 @@ function adduser (username, password, email, cb) { // pluck off any other username/password/token. it needs to be the // same as the user we're becoming now. replace them on error. - var pre = { username: this.username - , password: this.password - , auth: this.auth - , token: this.token } - - this.token = null + var pre = { username: this.conf.get('username') + , password: this.conf.get('_password') + , auth: this.conf.get('_auth') + , token: this.conf.get('_token') } + + this.conf.del('_token') + this.conf.del('username') + this.conf.del('_auth') + this.conf.del('_password') if (this.couchLogin) { this.couchLogin.token = null } - this.username = null - this.password = null - this.auth = null cb = done.call(this, cb, pre) @@ -72,13 +66,13 @@ function adduser (username, password, email, cb) { , function (error, data, json, response) { // if it worked, then we just created a new user, and all is well. // but if we're updating a current record, then it'll 409 first - if (error && !this.auth) { + if (error && !this.conf.get('_auth')) { // must be trying to re-auth on a new machine. // use this info as auth var b = new Buffer(username + ":" + password) - this.auth = b.toString("base64") - this.username = username - this.password = password + this.conf.set('_auth', b.toString("base64")) + this.conf.set('username', username) + this.conf.set('_password', password) } if (!error || !response || response.statusCode !== 409) { @@ -114,16 +108,16 @@ function done (cb, pre) { } // there was some kind of error, re-instate previous auth/token/etc. - this.token = pre.token + this.conf.set('_token', pre.token) if (this.couchLogin) { - this.couchLogin.token = this.token + this.couchLogin.token = pre.token if (this.couchLogin.tokenSet) { this.couchLogin.tokenSet(pre.token) } } - this.username = pre.username - this.password = pre.password - this.auth = pre.auth + this.conf.set('username', pre.username) + this.conf.set('_password', pre.password) + this.conf.set('_auth', pre.auth) this.log.verbose("adduser", "back", [error, data, json]) if (!error) { 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 835eb4c..584a986 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/get.js +++ b/deps/npm/node_modules/npm-registry-client/lib/get.js @@ -12,10 +12,10 @@ function get (uri, timeout, nofollow, staleOk, cb) { if (typeof cb !== "function") cb = timeout, timeout = -1 if (typeof cb !== "function") cb = version, version = null - timeout = Math.min(timeout, this.cacheMax) - timeout = Math.max(timeout, this.cacheMin) + timeout = Math.min(timeout, this.conf.get('cache-max') || 0) + timeout = Math.max(timeout, this.conf.get('cache-min') || Infinity) - if (!this.registry) timeout = Infinity + if (!this.conf.get('registry')) timeout = Infinity if ( process.env.COMP_CWORD !== undefined && process.env.COMP_LINE !== undefined @@ -29,7 +29,7 @@ function get (uri, timeout, nofollow, staleOk, cb) { return requestAll.call(this, cb) } - var cache = path.join(this.cache, uri, ".cache.json") + var cache = path.join(this.conf.get('cache'), uri, ".cache.json") fs.stat(cache, function (er, stat) { if (!er) fs.readFile(cache, function (er, data) { try { data = JSON.parse(data) } @@ -41,9 +41,9 @@ function get (uri, timeout, nofollow, staleOk, cb) { } function requestAll (cb) { - var cache = path.join(this.cache, "/-/all", ".cache.json") + var cache = path.join(this.conf.get('cache'), "/-/all", ".cache.json") - mkdir(path.join(this.cache, "-", "all"), function (er) { + mkdir(path.join(this.conf.get('cache'), "-", "all"), function (er) { fs.readFile(cache, function (er, data) { if (er) return requestAll_.call(this, 0, {}, cb) try { @@ -74,7 +74,7 @@ function requestAll_ (c, data, cb) { uri = "/-/all" } - var cache = path.join(this.cache, "-/all", ".cache.json") + var cache = path.join(this.conf.get('cache'), "-/all", ".cache.json") this.request('GET', uri, function (er, updates, _, res) { if (er) return cb(er, data) var headers = res.headers @@ -143,20 +143,20 @@ function get_ (uri, timeout, cache, stat, data, nofollow, staleOk, cb) { } function saveToCache (cache, data, saved) { - if (this.cacheStat) { - var cs = this.cacheStat + if (this._cacheStat) { + var cs = this._cacheStat return saveToCache_.call(this, cache, data, cs.uid, cs.gid, saved) } - fs.stat(this.cache, function (er, st) { + fs.stat(this.conf.get('cache'), function (er, st) { if (er) { return fs.stat(process.env.HOME || "", function (er, st) { // if this fails, oh well. if (er) return saved() - this.cacheStat = st + this._cacheStat = st return saveToCache.call(this, cache, data, saved) }.bind(this)) } - this.cacheStat = st || { uid: null, gid: null } + this._cacheStat = st || { uid: null, gid: null } return saveToCache.call(this, cache, data, saved) }.bind(this)) } 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 11aa599..b44b801 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/publish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/publish.js @@ -6,8 +6,14 @@ var path = require("path") function publish (data, tarball, cb) { - if (!this.email || !this.auth || !this.username) { - return cb(new Error("auth and email required for publishing")) + var email = this.conf.get('email') + var auth = this.conf.get('_auth') + var username = this.conf.get('username') + + if (!email || !auth || !username) { + var er = new Error("auth and email required for publishing") + er.code = 'ENEEDAUTH' + return cb(er) } // add the dist-url to the data, pointing at the tarball. @@ -15,7 +21,7 @@ function publish (data, tarball, cb) { // if the {version} is already there, then fail. // then: // PUT the data to {config.registry}/{data.name}/{data.version} - var registry = this.registry + var registry = this.conf.get('registry') var fullData = { _id : data.name @@ -25,8 +31,8 @@ function publish (data, tarball, cb) { , versions : {} , readme: data.readme || "" , maintainers : - [ { name : this.username - , email : this.email + [ { name : username + , email : email } ] } @@ -58,7 +64,7 @@ function publish (data, tarball, cb) { var dataURI = encodeURIComponent(data.name) + "/" + encodeURIComponent(data.version) - var tag = data.tag || this.defaultTag || "latest" + var tag = data.tag || this.conf.get('tag') || "latest" dataURI += "/-tag/" + tag // let's see what versions are already published. diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js index 486226a..8d90572 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ b/deps/npm/node_modules/npm-registry-client/lib/request.js @@ -13,7 +13,8 @@ function regRequest (method, where, what, etag, nofollow, cb_) { if (typeof cb_ !== "function") cb_ = etag, etag = null if (typeof cb_ !== "function") cb_ = what, what = null - if (!this.registry) return cb(new Error( + var registry = this.conf.get('registry') + if (!registry) return cb(new Error( "No registry url provided: " + method + " " + where)) // Since there are multiple places where an error could occur, @@ -29,13 +30,11 @@ function regRequest (method, where, what, etag, nofollow, cb_) { return cb(new Error("favicon.ico isn't a package, it's a picture.")) } - var registry = this.registry - var adduserChange = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)\/-rev/ , adduserNew = /^\/?-\/user\/org\.couchdb\.user:([^\/]+)/ , nu = where.match(adduserNew) , uc = where.match(adduserChange) - , isUpload = what || this.alwaysAuth + , isUpload = what || this.conf.get('always-auth') , isDel = method === "DELETE" , authRequired = isUpload && !nu || uc || isDel @@ -62,27 +61,30 @@ function regRequest (method, where, what, etag, nofollow, cb_) { } var remote = url.parse(where) - , auth = this.auth + , auth = this.conf.get('_auth') - if (authRequired && !this.alwaysAuth) { + if (authRequired && !this.conf.get('always-auth')) { var couch = this.couchLogin - , token = couch && (this.token || couch.token) + , token = couch && (this.conf.get('_token') || couch.token) , validToken = token && couch.valid(token) if (!validToken) token = null - else this.token = token + else this.conf.set('_token', token) if (couch && !token) { // login to get a valid token - var a = { name: this.username, password: this.password } + var a = { name: this.conf.get('username'), + password: this.conf.get('_password') } var args = arguments return this.couchLogin.login(a, function (er, cr, data) { if (er || !couch.valid(couch.token)) { er = er || new Error('login error') return cb(er, cr, data) } - this.token = this.couchLogin.token - return regRequest.call(this, method, where, what, etag, nofollow, cb_) + this.conf.set('_token', this.couchLogin.token) + return regRequest.call(this, + method, where, what, + etag, nofollow, cb_) }.bind(this)) } } @@ -101,11 +103,12 @@ function regRequest (method, where, what, etag, nofollow, cb_) { // Tuned to spread 3 attempts over about a minute. // See formula at . var operation = retry.operation({ - retries: this.retries, - factor: this.retryFactor, - minTimeout: this.retryMinTimeout, - maxTimeout: this.retryMaxTimeout + retries: this.conf.get('fetch-retries') || 2, + factor: this.conf.get('fetch-retry-factor'), + minTimeout: this.conf.get('fetch-retry-mintimeout') || 10000, + maxTimeout: this.conf.get('fetch-retry-maxtimeout') || 60000 }) + var self = this operation.attempt(function (currentAttempt) { self.log.info("retry", "registry request attempt " + currentAttempt @@ -118,8 +121,8 @@ function regRequest (method, where, what, etag, nofollow, cb_) { var timeout = statusCode === 408 var serverError = statusCode >= 500 var statusRetry = !statusCode || timeout || serverError - if (reauth && this.auth && this.token) { - this.token = null + if (reauth && this.conf.get('_auth') && this.conf.get('_token')) { + this.conf.del('_token') this.couchLogin.token = null return regRequest.call(this, method, where, what, etag, nofollow, cb_) } @@ -140,10 +143,12 @@ function makeRequest (method, remote, where, what, etag, nofollow, tok, cb_) { cb_.apply(null, arguments) } + var strict = this.conf.get('strict-ssl') + if (strict === undefined) strict = true var opts = { url: remote , method: method - , ca: this.ca - , strictSSL: this.strictSSL } + , ca: this.conf.get('ca') + , strictSSL: strict } , headers = opts.headers = {} if (etag) { this.log.verbose("etag", etag) @@ -156,10 +161,12 @@ function makeRequest (method, remote, where, what, etag, nofollow, tok, cb_) { headers.accept = "application/json" - headers["user-agent"] = this.userAgent + headers["user-agent"] = this.conf.get('user-agent') || + 'node/' + process.version - opts.proxy = remote.protocol === "https:" - ? this.httpsProxy : this.proxy + var p = this.conf.get('proxy') + var sp = this.conf.get('https-proxy') || p + opts.proxy = remote.protocol === "https:" ? sp : p // figure out wth 'what' is if (what) { @@ -259,7 +266,7 @@ function requestDone (method, where, cb) { , caches = p.map(function (part) { return _ = path.join(_, part) }).map(function (cache) { - return path.join(this.cache, cache, ".cache.json") + return path.join(this.conf.get('cache'), cache, ".cache.json") }, this) // if the method is DELETE, then also remove the thing itself. @@ -267,7 +274,7 @@ function requestDone (method, where, cb) { // That's what you get for deleting stuff. Don't do that. if (method === "DELETE") { p = p.slice(0, p.indexOf("-rev")) - caches.push(path.join(this.cache, p.join("/"))) + caches.push(path.join(this.conf.get('cache'), p.join("/"))) } asyncMap(caches, rm, function () {}) 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 36a6612..5b7ab4a 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/star.js +++ b/deps/npm/node_modules/npm-registry-client/lib/star.js @@ -2,7 +2,7 @@ module.exports = star function star (package, starred, cb) { - if (!this.username) return cb(new Error( + if (!this.conf.get('username')) return cb(new Error( "Must be logged in to star/unstar packages")) var users = {} @@ -16,10 +16,10 @@ function star (package, starred, cb) { if (starred) { this.log.info("starring", fullData._id) - fullData.users[this.username] = true + fullData.users[this.conf.get('username')] = true this.log.verbose("starring", fullData) } else { - delete fullData.users[this.username] + delete fullData.users[this.conf.get('username')] this.log.info("unstarring", fullData._id) this.log.verbose("unstarring", fullData) } diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index 709027a..7ee3487 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.1.4", + "version": "0.2.5", "repository": { "url": "git://github.com/isaacs/npm-registry-client" }, @@ -15,7 +15,6 @@ "test": "tap test/*.js" }, "dependencies": { - "node-uuid": "~1.3.3", "request": "~2.9.202", "graceful-fs": "~1.1.8", "semver": "~1.0.14", @@ -34,7 +33,7 @@ "npmlog": "" }, "license": "BSD", - "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(options)\n\nclient.get(\"npm\", \"latest\", 1000, function (er, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Options\n\n* `registry` **Required** {String} URL to the registry\n* `cache` **Required** {String} Path to the cache folder\n* `alwaysAuth` {Boolean} Auth even for GET requests.\n* `auth` {String} A base64-encoded `username:password`\n* `email` {String} User's email address\n* `tag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `ca` {String} Cerficate signing authority certificates to trust.\n* `strictSSL` {Boolean} Whether or not to be strict with SSL\n certificates. Default = `true`\n* `userAgent` {String} User agent header to send. Default =\n `\"node/{process.version}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `retries` {Number} Number of times to retry on GET failures.\n Default=2\n* `retryFactor` {Number} `factor` setting for `node-retry`. Default=10\n* `retryMinTimeout` {Number} `minTimeout` setting for `node-retry`.\n Default=10000 (10 seconds)\n* `retryMaxTimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default=60000 (60 seconds)\n\n# client.request(method, where, [what], [etag], [nofollow], cb)\n\n* `method` {String} HTTP method\n* `where` {String} Path to request on the server\n* `what` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON.\n* `etag` {String} The cached ETag\n* `nofollow` {Boolean} Prevent following 302/301 responses\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a request to the registry. All the other methods are wrappers\naround this. one.\n\n# client.adduser(username, password, email, cb)\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `cb` {Function}\n\nAdd a user account to the registry, or verify the credentials.\n\n# client.get(url, [timeout], [nofollow], [staleOk], cb)\n\n* `url` {String} The url path to fetch\n* `timeout` {Number} Number of seconds old that a cached copy must be\n before a new request will be made.\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `staleOk` {Boolean} If there's cached data available, then return that\n to the callback quickly, and update the cache the background.\n\nFetches data from the registry via a GET request, saving it in\nthe cache folder with the ETag.\n\n# client.publish(data, tarball, [readme], cb)\n\n* `data` {Object} Package data\n* `tarball` {String | Stream} Filename or stream of the package tarball\n* `readme` {String} Contents of the README markdown file\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder. However, it\ncan accept a gzipped tar stream or a filename to a tarball.\n\n# client.star(package, starred, cb)\n\n* `package` {String} Name of the package to star\n* `starred` {Boolean} True to star the package, false to unstar it.\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or\nunstar a package, though other writes do require that the user be the\npackage owner.\n\n# client.tag(project, version, tag, cb)\n\n* `project` {String} Project name\n* `version` {String} Version to tag\n* `tag` {String} Tag name to apply\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag`\nwill fetch the specified version.\n\n# client.unpublish(name, [ver], cb)\n\n* `name` {String} package name\n* `ver` {String} version to unpublish. Leave blank to unpublish all\n versions.\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When\nthe last version us unpublished, the entire document is removed from the\ndatabase.\n\n# client.upload(where, file, [etag], [nofollow], cb)\n\n* `where` {String} URL path to upload to\n* `file` {String | Stream} Either the filename or a readable stream\n* `etag` {String} Cache ETag\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `cb` {Function}\n\nUpload an attachment. Mostly used by `client.publish()`.\n", - "_id": "npm-registry-client@0.1.4", - "_from": "npm-registry-client@latest" + "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\n\nclient.get(\"npm\", \"latest\", 1000, function (er, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Configuration\n\nThis program is designed to work with\n[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\na plain-jane object with the appropriate configs, and it'll shim it\nfor you. Any configuration thingie that has get/set/del methods will\nalso be accepted.\n\n* `registry` **Required** {String} URL to the registry\n* `cache` **Required** {String} Path to the cache folder\n* `always-auth` {Boolean} Auth even for GET requests.\n* `auth` {String} A base64-encoded `username:password`\n* `email` {String} User's email address\n* `tag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `ca` {String} Cerficate signing authority certificates to trust.\n* `strict-ssl` {Boolean} Whether or not to be strict with SSL\n certificates. Default = `true`\n* `user-agent` {String} User agent header to send. Default =\n `\"node/{process.version}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `fetch-retries` {Number} Number of times to retry on GET failures.\n Default=2\n* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\n* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\n Default=10000 (10 seconds)\n* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default=60000 (60 seconds)\n* `proxy` {URL} The url to proxy requests through.\n* `https-proxy` {URL} The url to proxy https requests through.\n Defaults to be the same as `proxy` if unset.\n* `_auth` {String} The base64-encoded authorization header.\n* `username` `_password` {String} Username/password to use to generate\n `_auth` if not supplied.\n* `_token` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login)\n\n# client.request(method, where, [what], [etag], [nofollow], cb)\n\n* `method` {String} HTTP method\n* `where` {String} Path to request on the server\n* `what` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON.\n* `etag` {String} The cached ETag\n* `nofollow` {Boolean} Prevent following 302/301 responses\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a request to the registry. All the other methods are wrappers\naround this. one.\n\n# client.adduser(username, password, email, cb)\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `cb` {Function}\n\nAdd a user account to the registry, or verify the credentials.\n\n# client.get(url, [timeout], [nofollow], [staleOk], cb)\n\n* `url` {String} The url path to fetch\n* `timeout` {Number} Number of seconds old that a cached copy must be\n before a new request will be made.\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `staleOk` {Boolean} If there's cached data available, then return that\n to the callback quickly, and update the cache the background.\n\nFetches data from the registry via a GET request, saving it in\nthe cache folder with the ETag.\n\n# client.publish(data, tarball, [readme], cb)\n\n* `data` {Object} Package data\n* `tarball` {String | Stream} Filename or stream of the package tarball\n* `readme` {String} Contents of the README markdown file\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder. However, it\ncan accept a gzipped tar stream or a filename to a tarball.\n\n# client.star(package, starred, cb)\n\n* `package` {String} Name of the package to star\n* `starred` {Boolean} True to star the package, false to unstar it.\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or\nunstar a package, though other writes do require that the user be the\npackage owner.\n\n# client.tag(project, version, tag, cb)\n\n* `project` {String} Project name\n* `version` {String} Version to tag\n* `tag` {String} Tag name to apply\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag`\nwill fetch the specified version.\n\n# client.unpublish(name, [ver], cb)\n\n* `name` {String} package name\n* `ver` {String} version to unpublish. Leave blank to unpublish all\n versions.\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When\nthe last version us unpublished, the entire document is removed from the\ndatabase.\n\n# client.upload(where, file, [etag], [nofollow], cb)\n\n* `where` {String} URL path to upload to\n* `file` {String | Stream} Either the filename or a readable stream\n* `etag` {String} Cache ETag\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `cb` {Function}\n\nUpload an attachment. Mostly used by `client.publish()`.\n", + "_id": "npm-registry-client@0.2.5", + "_from": "npm-registry-client@~0.2.4" } diff --git a/deps/npm/node_modules/npm-registry-client/test/retries.js b/deps/npm/node_modules/npm-registry-client/test/retries.js index 500abf2..8f0e63f 100644 --- a/deps/npm/node_modules/npm-registry-client/test/retries.js +++ b/deps/npm/node_modules/npm-registry-client/test/retries.js @@ -5,9 +5,9 @@ var pkg = { _id: 'some-package@1.2.3', name: 'some-package', version: '1.2.3' } var client = new RC({ - retries: 6 - , retryMinTimeout: 10 - , retryMaxTimeout: 100 + 'fetch-retries': 6 + , 'fetch-retry-mintimeout': 10 + , 'fetch-retry-maxtimeout': 100 , cache: __dirname + '/fixtures/cache' , registry: 'http://localhost:' + server.port }) diff --git a/deps/npm/node_modules/npmconf/npmconf.js b/deps/npm/node_modules/npmconf/npmconf.js index da4b422..41ba251 100644 --- a/deps/npm/node_modules/npmconf/npmconf.js +++ b/deps/npm/node_modules/npmconf/npmconf.js @@ -9,6 +9,7 @@ var path = require('path') var nopt = require('nopt') var ini = require('ini') var Octal = configDefs.Octal +var mkdirp = require('mkdirp') exports.load = load exports.Conf = Conf @@ -174,18 +175,23 @@ Conf.prototype.save = function (where, cb) { then = then.bind(this) done = done.bind(this) this._saving ++ + var mode = where === 'user' ? 0600 : 0666 if (!data.trim()) fs.unlink(target.path, done) else { - fs.writeFile(target.path, data, 'utf8', function (er) { + mkdirp(path.dirname(target.path), function (er) { if (er) return then(er) - if (where === 'user' && myUid && myGid) - fs.chown(target.path, +myUid, +myGid, then) - else - then() - }.bind(this)) + fs.writeFile(target.path, data, 'utf8', function (er) { + if (er) + return then(er) + if (where === 'user' && myUid && myGid) + fs.chown(target.path, +myUid, +myGid, then) + else + then() + }) + }) } function then (er) { diff --git a/deps/npm/node_modules/npmconf/package.json b/deps/npm/node_modules/npmconf/package.json index 3a50fe9..8995ddf 100644 --- a/deps/npm/node_modules/npmconf/package.json +++ b/deps/npm/node_modules/npmconf/package.json @@ -1,6 +1,6 @@ { "name": "npmconf", - "version": "0.0.6", + "version": "0.0.8", "description": "The config thing npm uses", "main": "npmconf.js", "directories": { @@ -10,6 +10,8 @@ "config-chain": "~1.1.1", "inherits": "~1.0.0", "once": "~1.1.1", + "mkdirp": "~0.3.3", + "osenv": "0.0.3", "nopt": "~2.0.0" }, "devDependencies": {}, @@ -37,6 +39,6 @@ "nopt": "~2.0.0" }, "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", - "_id": "npmconf@0.0.6", - "_from": "npmconf@latest" + "_id": "npmconf@0.0.8", + "_from": "npmconf@~0.0.6" } diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json index 3e703bf..b122b54 100644 --- a/deps/npm/node_modules/read-installed/package.json +++ b/deps/npm/node_modules/read-installed/package.json @@ -1,7 +1,7 @@ { "name": "read-installed", "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", - "version": "0.0.1", + "version": "0.0.2", "repository": { "type": "git", "url": "git://github.com/isaacs/read-installed" @@ -27,6 +27,6 @@ "url": "http://blog.izs.me/" }, "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## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// depth is optional, defaults to Infinity\nreadInstalled(folder, depth, function (er, data) {\n ...\n})\n```\n", - "_id": "read-installed@0.0.1", - "_from": "read-installed" + "_id": "read-installed@0.0.2", + "_from": "read-installed@0" } diff --git a/deps/npm/node_modules/read-installed/read-installed.js b/deps/npm/node_modules/read-installed/read-installed.js index be39422..cb77dba 100644 --- a/deps/npm/node_modules/read-installed/read-installed.js +++ b/deps/npm/node_modules/read-installed/read-installed.js @@ -286,6 +286,8 @@ function findUnmet (obj) { +found.path+",\nwhich is version "+found.version ) found.invalid = true + } else { + found.extraneous = false } deps[d] = found } diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index 42d0611..8e56b11 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -1,6 +1,6 @@ { "name": "read-package-json", - "version": "0.1.3", + "version": "0.1.4", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -31,6 +31,6 @@ "graceful-fs": "~1.1.8" }, "readme": "# read-package-json\n\nThis is the thing that npm uses to read package.json files. It\nvalidates some stuff, and loads some default things.\n\nIt keeps a cache of the files you've read, so that you don't end\nup reading the same package.json file multiple times.\n\nNote that if you just want to see what's literally in the package.json\nfile, you can usually do `var data = require('some-module/package.json')`.\n\nThis module is basically only needed by npm, but it's handy to see what\nnpm will see when it looks at your package.\n\n## Usage\n\n```javascript\nvar readJson = require('read-package-json')\n\nreadJson('/path/to/package.json', function (er, data) {\n if (er) {\n console.error(\"There was an error reading the file\")\n return\n }\n\n console.error('the package data is', data)\n}\n```\n\n## readJson(file, cb)\n\n* `file` {String} The path to the package.json file\n* `cb` {Function}\n\nReads the JSON file and does the things.\n\n## `package.json` Fields\n\nSee `man 5 package.json` or `npm help json`.\n\n## readJson.log\n\nBy default this is a reference to the `npmlog` module. But if that\nmodule can't be found, then it'll be set to just a dummy thing that does\nnothing.\n\nReplace with your own `{log,warn,error}` object for fun loggy time.\n\n## readJson.extras(file, data, cb)\n\nRun all the extra stuff relative to the file, with the parsed data.\n\nModifies the data as it does stuff. Calls the cb when it's done.\n\n## readJson.extraSet = [fn, fn, ...]\n\nArray of functions that are called by `extras`. Each one receives the\narguments `fn(file, data, cb)` and is expected to call `cb(er, data)`\nwhen done or when an error occurs.\n\nOrder is indeterminate, so each function should be completely\nindependent.\n\nMix and match!\n\n## readJson.cache\n\nThe `lru-cache` object that readJson uses to not read the same file over\nand over again. See\n[lru-cache](https://github.com/isaacs/node-lru-cache) for details.\n\n## Other Relevant Files Besides `package.json`\n\nSome other files have an effect on the resulting data object, in the\nfollowing ways:\n\n### `README?(.*)`\n\nIf there is a `README` or `README.*` file present, then npm will attach\na `readme` field to the data with the contents of this file.\n\nOwing to the fact that roughly 100% of existing node modules have\nMarkdown README files, it will generally be assumed to be Markdown,\nregardless of the extension. Please plan accordingly.\n\n### `server.js`\n\nIf there is a `server.js` file, and there is not already a\n`scripts.start` field, then `scripts.start` will be set to `node\nserver.js`.\n\n### `AUTHORS`\n\nIf there is not already a `contributors` field, then the `contributors`\nfield will be set to the contents of the `AUTHORS` file, split by lines,\nand parsed.\n\n### `bindings.gyp`\n\nIf a bindings.gyp file exists, and there is not already a\n`scripts.install` field, then the `scripts.install` field will be set to\n`node-gyp rebuild`.\n\n### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of ` : ` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n", - "_id": "read-package-json@0.1.3", - "_from": "read-package-json@~0.1.1" + "_id": "read-package-json@0.1.4", + "_from": "read-package-json@~0.1.3" } diff --git a/deps/npm/node_modules/read-package-json/read-json.js b/deps/npm/node_modules/read-package-json/read-json.js index 837c6b7..17e8b43 100644 --- a/deps/npm/node_modules/read-package-json/read-json.js +++ b/deps/npm/node_modules/read-package-json/read-json.js @@ -254,7 +254,7 @@ function mans (file, data, cb) { function mans_ (file, data, mans, cb) { var m = data.directories && data.directories.man data.man = mans.map(function (mf) { - return path.resolve(m, mf) + return path.resolve(path.dirname(file), m, mf) }) return cb(null, data) } diff --git a/deps/npm/node_modules/read/README.md b/deps/npm/node_modules/read/README.md index 01aa8e7..2edefdf 100644 --- a/deps/npm/node_modules/read/README.md +++ b/deps/npm/node_modules/read/README.md @@ -33,6 +33,21 @@ Every option is optional. If silent is true, and the input is a TTY, then read will set raw mode, and read character by character. +## COMPATIBILITY + +This module works sort of with node 0.6. It does not work with node +versions less than 0.6. It is best on node 0.8. + +On node version 0.6, it will remove all listeners on the input +stream's `data` and `keypress` events, because the readline module did +not fully clean up after itself in that version of node, and did not +make it possible to clean up after it in a way that has no potential +for side effects. + +Additionally, some of the readline options (like `terminal`) will not +function in versions of node before 0.8, because they were not +implemented in the builtin readline module. + ## CONTRIBUTING Patches welcome. diff --git a/deps/npm/node_modules/read/lib/read.js b/deps/npm/node_modules/read/lib/read.js index 4b0e303..4b8a422 100644 --- a/deps/npm/node_modules/read/lib/read.js +++ b/deps/npm/node_modules/read/lib/read.js @@ -23,7 +23,13 @@ function read (opts, cb) { var def = opts.default || '' var terminal = !!(opts.terminal || output.isTTY) var rlOpts = { input: input, output: output, terminal: terminal } - var rl = readline.createInterface(rlOpts) + + if (process.version.match(/^v0\.6/)) { + var rl = readline.createInterface(rlOpts.input, rlOpts.output) + } else { + var rl = readline.createInterface(rlOpts) + } + var prompt = (opts.prompt || '').trim() + ' ' var silent = opts.silent var editDef = false @@ -69,6 +75,13 @@ function read (opts, cb) { function done () { called = true rl.close() + + if (process.version.match(/^v0\.6/)) { + rl.input.removeAllListeners('data') + rl.input.removeAllListeners('keypress') + rl.input.pause() + } + clearTimeout(timer) output.mute() output.end() diff --git a/deps/npm/node_modules/read/node_modules/mute-stream/mute.js b/deps/npm/node_modules/read/node_modules/mute-stream/mute.js index f0c3550..7746618 100644 --- a/deps/npm/node_modules/read/node_modules/mute-stream/mute.js +++ b/deps/npm/node_modules/read/node_modules/mute-stream/mute.js @@ -63,6 +63,21 @@ function setIsTTY (isTTY) { }) } +Object.defineProperty(MuteStream.prototype, 'rows', { + get: function () { + return( this._dest ? this._dest.rows + : this._src ? this._src.rows + : undefined ) + }, enumerable: true, configurable: true }) + +Object.defineProperty(MuteStream.prototype, 'columns', { + get: function () { + return( this._dest ? this._dest.columns + : this._src ? this._src.columns + : undefined ) + }, enumerable: true, configurable: true }) + + MuteStream.prototype.pipe = function (dest) { this._dest = dest return Stream.prototype.pipe.call(this, dest) diff --git a/deps/npm/node_modules/read/node_modules/mute-stream/package.json b/deps/npm/node_modules/read/node_modules/mute-stream/package.json index ff942b8..629b5be 100644 --- a/deps/npm/node_modules/read/node_modules/mute-stream/package.json +++ b/deps/npm/node_modules/read/node_modules/mute-stream/package.json @@ -1,6 +1,6 @@ { "name": "mute-stream", - "version": "0.0.2", + "version": "0.0.3", "main": "mute.js", "directories": { "test": "test" @@ -28,9 +28,6 @@ "license": "BSD", "description": "Bytes go in, but they don't come out (when muted).", "readme": "# mute-stream\n\nBytes go in, but they don't come out (when muted).\n\nThis is a basic pass-through stream, but when muted, the bytes are\nsilently dropped, rather than being passed through.\n\n## Usage\n\n```javascript\nvar MuteStream = require('mute-stream')\n\nvar ms = new MuteStream(options)\n\nms.pipe(process.stdout)\nms.write('foo') // writes 'foo' to stdout\nms.mute()\nms.write('bar') // does not write 'bar'\nms.unmute()\nms.write('baz') // writes 'baz' to stdout\n\n// can also be used to mute incoming data\nvar ms = new MuteStream\ninput.pipe(ms)\n\nms.on('data', function (c) {\n console.log('data: ' + c)\n})\n\ninput.emit('data', 'foo') // logs 'foo'\nms.mute()\ninput.emit('data', 'bar') // does not log 'bar'\nms.unmute()\ninput.emit('data', 'baz') // logs 'baz'\n```\n\n## Options\n\nAll options are optional.\n\n* `replace` Set to a string to replace each character with the\n specified string when muted. (So you can show `****` instead of the\n password, for example.)\n\n## ms.mute()\n\nSet `muted` to `true`. Turns `.write()` into a no-op.\n\n## ms.unmute()\n\nSet `muted` to `false`\n\n## ms.isTTY\n\nTrue if the pipe destination is a TTY, or if the incoming pipe source is\na TTY.\n\n## Other stream methods...\n\nThe other standard readable and writable stream methods are all\navailable. The MuteStream object acts as a facade to its pipe source\nand destination.\n", - "_id": "mute-stream@0.0.2", - "dist": { - "shasum": "75d4466df24a57e80fec806bda88561cd0560d2d" - }, + "_id": "mute-stream@0.0.3", "_from": "mute-stream@~0.0.2" } diff --git a/deps/npm/node_modules/read/node_modules/mute-stream/test/basic.js b/deps/npm/node_modules/read/node_modules/mute-stream/test/basic.js index 473f827..2d1f6ae 100644 --- a/deps/npm/node_modules/read/node_modules/mute-stream/test/basic.js +++ b/deps/npm/node_modules/read/node_modules/mute-stream/test/basic.js @@ -89,17 +89,29 @@ tap.test('outgoing', function (t) { tap.test('isTTY', function (t) { var str = new PassThrough str.isTTY = true + str.columns=80 + str.rows=24 var ms = new MS t.equal(ms.isTTY, false) + t.equal(ms.columns, undefined) + t.equal(ms.rows, undefined) ms.pipe(str) t.equal(ms.isTTY, true) + t.equal(ms.columns, 80) + t.equal(ms.rows, 24) str.isTTY = false t.equal(ms.isTTY, false) + t.equal(ms.columns, 80) + t.equal(ms.rows, 24) str.isTTY = true t.equal(ms.isTTY, true) + t.equal(ms.columns, 80) + t.equal(ms.rows, 24) ms.isTTY = false t.equal(ms.isTTY, false) + t.equal(ms.columns, 80) + t.equal(ms.rows, 24) ms = new MS t.equal(ms.isTTY, false) diff --git a/deps/npm/node_modules/read/package.json b/deps/npm/node_modules/read/package.json index 79e5b7c..f76034e 100644 --- a/deps/npm/node_modules/read/package.json +++ b/deps/npm/node_modules/read/package.json @@ -1,6 +1,6 @@ { "name": "read", - "version": "1.0.3", + "version": "1.0.4", "main": "lib/read.js", "dependencies": { "mute-stream": "~0.0.2" @@ -25,7 +25,7 @@ "scripts": { "test": "tap test/*.js" }, - "readme": "## read\n\nFor reading user input from stdin.\n\nSimilar to the `readline` builtin's `question()` method, but with a\nfew more features.\n\n## USAGE\n\n```javascript\nvar read = require(\"read\")\nread(options, callback)\n```\n\nThe callback gets called with either the user input, or the default\nspecified, or an error, as `callback(error, result, isDefault)`\nnode style.\n\n## OPTIONS\n\nEvery option is optional.\n\n* `prompt` What to write to stdout before reading input.\n* `silent` Don't echo the output as the user types it.\n* `replace` Replace silenced characters with the supplied character value.\n* `timeout` Number of ms to wait for user input before giving up.\n* `default` The default value if the user enters nothing.\n* `edit` Allow the user to edit the default value.\n* `terminal` Treat the output as a TTY, whether it is or not.\n* `stdin` Readable stream to get input data from. (default `process.stdin`)\n* `stdout` Writeable stream to write prompts to. (default: `process.stdout`)\n\nIf silent is true, and the input is a TTY, then read will set raw\nmode, and read character by character.\n\n## CONTRIBUTING\n\nPatches welcome.\n", - "_id": "read@1.0.3", - "_from": "read@~1" + "readme": "## read\n\nFor reading user input from stdin.\n\nSimilar to the `readline` builtin's `question()` method, but with a\nfew more features.\n\n## USAGE\n\n```javascript\nvar read = require(\"read\")\nread(options, callback)\n```\n\nThe callback gets called with either the user input, or the default\nspecified, or an error, as `callback(error, result, isDefault)`\nnode style.\n\n## OPTIONS\n\nEvery option is optional.\n\n* `prompt` What to write to stdout before reading input.\n* `silent` Don't echo the output as the user types it.\n* `replace` Replace silenced characters with the supplied character value.\n* `timeout` Number of ms to wait for user input before giving up.\n* `default` The default value if the user enters nothing.\n* `edit` Allow the user to edit the default value.\n* `terminal` Treat the output as a TTY, whether it is or not.\n* `stdin` Readable stream to get input data from. (default `process.stdin`)\n* `stdout` Writeable stream to write prompts to. (default: `process.stdout`)\n\nIf silent is true, and the input is a TTY, then read will set raw\nmode, and read character by character.\n\n## COMPATIBILITY\n\nThis module works sort of with node 0.6. It does not work with node\nversions less than 0.6. It is best on node 0.8.\n\nOn node version 0.6, it will remove all listeners on the input\nstream's `data` and `keypress` events, because the readline module did\nnot fully clean up after itself in that version of node, and did not\nmake it possible to clean up after it in a way that has no potential\nfor side effects.\n\nAdditionally, some of the readline options (like `terminal`) will not\nfunction in versions of node before 0.8, because they were not\nimplemented in the builtin readline module.\n\n## CONTRIBUTING\n\nPatches welcome.\n", + "_id": "read@1.0.4", + "_from": "read@~1.0.3" } diff --git a/deps/npm/node_modules/read/test/basic.js b/deps/npm/node_modules/read/test/basic.js index c90c410..f5324b4 100644 --- a/deps/npm/node_modules/read/test/basic.js +++ b/deps/npm/node_modules/read/test/basic.js @@ -5,6 +5,11 @@ if (process.argv[2] === 'child') { return child() } +var CLOSE = 'close' +if (process.version.match(/^v0\.6/)) { + CLOSE = 'exit' +} + var spawn = require('child_process').spawn tap.test('basic', function (t) { @@ -31,7 +36,7 @@ tap.test('basic', function (t) { console.error('result %j', c.toString()) }) - child.on('close', function () { + child.on(CLOSE, function () { result = JSON.parse(result) t.same(result, {"user":"a user","pass":"a password","verify":"a password","passMatch":true}) t.equal(output, 'Username: (test-user) Password: (