deps: upgrade to npm 2.14.18
authorKat Marchán <kzm@sykosomatic.org>
Mon, 15 Feb 2016 18:27:42 +0000 (10:27 -0800)
committerMyles Borins <mborins@us.ibm.com>
Wed, 2 Mar 2016 22:01:11 +0000 (14:01 -0800)
PR-URL: https://github.com/nodejs/node/pull/5245
Reviewed-By: Myles Borins <mborins@us.ibm.com>
440 files changed:
deps/npm/CHANGELOG.md
deps/npm/html/doc/README.html
deps/npm/html/doc/api/npm-bin.html
deps/npm/html/doc/api/npm-bugs.html
deps/npm/html/doc/api/npm-cache.html
deps/npm/html/doc/api/npm-commands.html
deps/npm/html/doc/api/npm-config.html
deps/npm/html/doc/api/npm-deprecate.html
deps/npm/html/doc/api/npm-docs.html
deps/npm/html/doc/api/npm-edit.html
deps/npm/html/doc/api/npm-explore.html
deps/npm/html/doc/api/npm-help-search.html
deps/npm/html/doc/api/npm-init.html
deps/npm/html/doc/api/npm-install.html
deps/npm/html/doc/api/npm-link.html
deps/npm/html/doc/api/npm-load.html
deps/npm/html/doc/api/npm-ls.html
deps/npm/html/doc/api/npm-outdated.html
deps/npm/html/doc/api/npm-owner.html
deps/npm/html/doc/api/npm-pack.html
deps/npm/html/doc/api/npm-ping.html
deps/npm/html/doc/api/npm-prefix.html
deps/npm/html/doc/api/npm-prune.html
deps/npm/html/doc/api/npm-publish.html
deps/npm/html/doc/api/npm-rebuild.html
deps/npm/html/doc/api/npm-repo.html
deps/npm/html/doc/api/npm-restart.html
deps/npm/html/doc/api/npm-root.html
deps/npm/html/doc/api/npm-run-script.html
deps/npm/html/doc/api/npm-search.html
deps/npm/html/doc/api/npm-shrinkwrap.html
deps/npm/html/doc/api/npm-start.html
deps/npm/html/doc/api/npm-stop.html
deps/npm/html/doc/api/npm-tag.html
deps/npm/html/doc/api/npm-test.html
deps/npm/html/doc/api/npm-uninstall.html
deps/npm/html/doc/api/npm-unpublish.html
deps/npm/html/doc/api/npm-update.html
deps/npm/html/doc/api/npm-version.html
deps/npm/html/doc/api/npm-view.html
deps/npm/html/doc/api/npm-whoami.html
deps/npm/html/doc/api/npm.html
deps/npm/html/doc/cli/npm-access.html
deps/npm/html/doc/cli/npm-adduser.html
deps/npm/html/doc/cli/npm-bin.html
deps/npm/html/doc/cli/npm-bugs.html
deps/npm/html/doc/cli/npm-build.html
deps/npm/html/doc/cli/npm-bundle.html
deps/npm/html/doc/cli/npm-cache.html
deps/npm/html/doc/cli/npm-completion.html
deps/npm/html/doc/cli/npm-config.html
deps/npm/html/doc/cli/npm-dedupe.html
deps/npm/html/doc/cli/npm-deprecate.html
deps/npm/html/doc/cli/npm-dist-tag.html
deps/npm/html/doc/cli/npm-docs.html
deps/npm/html/doc/cli/npm-edit.html
deps/npm/html/doc/cli/npm-explore.html
deps/npm/html/doc/cli/npm-help-search.html
deps/npm/html/doc/cli/npm-help.html
deps/npm/html/doc/cli/npm-init.html
deps/npm/html/doc/cli/npm-install-test.html
deps/npm/html/doc/cli/npm-install.html
deps/npm/html/doc/cli/npm-link.html
deps/npm/html/doc/cli/npm-logout.html
deps/npm/html/doc/cli/npm-ls.html
deps/npm/html/doc/cli/npm-outdated.html
deps/npm/html/doc/cli/npm-owner.html
deps/npm/html/doc/cli/npm-pack.html
deps/npm/html/doc/cli/npm-ping.html
deps/npm/html/doc/cli/npm-prefix.html
deps/npm/html/doc/cli/npm-prune.html
deps/npm/html/doc/cli/npm-publish.html
deps/npm/html/doc/cli/npm-rebuild.html
deps/npm/html/doc/cli/npm-repo.html
deps/npm/html/doc/cli/npm-restart.html
deps/npm/html/doc/cli/npm-rm.html
deps/npm/html/doc/cli/npm-root.html
deps/npm/html/doc/cli/npm-run-script.html
deps/npm/html/doc/cli/npm-search.html
deps/npm/html/doc/cli/npm-shrinkwrap.html
deps/npm/html/doc/cli/npm-star.html
deps/npm/html/doc/cli/npm-stars.html
deps/npm/html/doc/cli/npm-start.html
deps/npm/html/doc/cli/npm-stop.html
deps/npm/html/doc/cli/npm-tag.html
deps/npm/html/doc/cli/npm-team.html
deps/npm/html/doc/cli/npm-test.html
deps/npm/html/doc/cli/npm-uninstall.html
deps/npm/html/doc/cli/npm-unpublish.html
deps/npm/html/doc/cli/npm-update.html
deps/npm/html/doc/cli/npm-version.html
deps/npm/html/doc/cli/npm-view.html
deps/npm/html/doc/cli/npm-whoami.html
deps/npm/html/doc/cli/npm.html
deps/npm/html/doc/files/npm-folders.html
deps/npm/html/doc/files/npm-global.html
deps/npm/html/doc/files/npm-json.html
deps/npm/html/doc/files/npmrc.html
deps/npm/html/doc/files/package.json.html
deps/npm/html/doc/index.html
deps/npm/html/doc/misc/npm-coding-style.html
deps/npm/html/doc/misc/npm-config.html
deps/npm/html/doc/misc/npm-developers.html
deps/npm/html/doc/misc/npm-disputes.html
deps/npm/html/doc/misc/npm-faq.html [deleted file]
deps/npm/html/doc/misc/npm-index.html
deps/npm/html/doc/misc/npm-orgs.html
deps/npm/html/doc/misc/npm-registry.html
deps/npm/html/doc/misc/npm-scope.html
deps/npm/html/doc/misc/npm-scripts.html
deps/npm/html/doc/misc/removing-npm.html
deps/npm/html/doc/misc/semver.html
deps/npm/man/man1/npm-ls.1
deps/npm/man/man1/npm.1
deps/npm/man/man3/npm.3
deps/npm/man/man7/npm-faq.7 [deleted file]
deps/npm/node_modules/ansi/History.md
deps/npm/node_modules/ansi/LICENSE [new file with mode: 0644]
deps/npm/node_modules/ansi/lib/ansi.js
deps/npm/node_modules/ansi/package.json
deps/npm/node_modules/columnify/columnify.js
deps/npm/node_modules/columnify/index.js
deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/.travis.yml
deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/LICENSE
deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/README.md
deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/clone.js
deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/package.json
deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html [new file with mode: 0644]
deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html [new file with mode: 0644]
deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.js
deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/package.json
deps/npm/node_modules/columnify/package.json
deps/npm/node_modules/columnify/utils.js
deps/npm/node_modules/config-chain/node_modules/proto-list/package.json
deps/npm/node_modules/config-chain/package.json
deps/npm/node_modules/config-chain/test/save.js
deps/npm/node_modules/fs-write-stream-atomic/index.js
deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/package.json
deps/npm/node_modules/fs-write-stream-atomic/test/basic.js
deps/npm/node_modules/fs-write-stream-atomic/test/chown.js [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js [new file with mode: 0644]
deps/npm/node_modules/fs-write-stream-atomic/test/toolong.js
deps/npm/node_modules/graceful-fs/README.md
deps/npm/node_modules/graceful-fs/graceful-fs.js
deps/npm/node_modules/graceful-fs/package.json
deps/npm/node_modules/init-package-json/README.md
deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/glob/README.md [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/glob/common.js [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/glob/glob.js [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/glob/package.json [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/glob/sync.js [new file with mode: 0644]
deps/npm/node_modules/init-package-json/node_modules/promzard/package.json
deps/npm/node_modules/init-package-json/package.json
deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/License [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js [new file with mode: 0644]
deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js [new file with mode: 0644]
deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/.npmignore
deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE [new file with mode: 0644]
deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/README.md
deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/index.js
deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/History.md
deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/License [moved from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/LICENSE with 83% similarity]
deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/node_modules/delegates/package.json
deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/README.md
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/index.js
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/has-unicode/test/index.js
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/LICENSE
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/README.md
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/index.js
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE [deleted file]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md [deleted file]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js [deleted file]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json [deleted file]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/README.md [deleted file]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/index.js [deleted file]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md [deleted file]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js [deleted file]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json [deleted file]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/LICENSE [moved from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE with 89% similarity]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/README.md [new file with mode: 0644]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/index.js [new file with mode: 0644]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/package.json [moved from deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json with 62% similarity]
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/node_modules/lodash._createpadding/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padleft/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/LICENSE
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/node_modules/lodash.repeat/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/node_modules/lodash._createpadding/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.padright/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/package.json
deps/npm/node_modules/npmlog/node_modules/gauge/progress-bar.js
deps/npm/node_modules/npmlog/node_modules/gauge/test/progress-bar.js
deps/npm/node_modules/npmlog/package.json
deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE [new file with mode: 0644]
deps/npm/node_modules/read-package-json/node_modules/glob/README.md [new file with mode: 0644]
deps/npm/node_modules/read-package-json/node_modules/glob/common.js [new file with mode: 0644]
deps/npm/node_modules/read-package-json/node_modules/glob/glob.js [new file with mode: 0644]
deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js [new file with mode: 0644]
deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license [new file with mode: 0644]
deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json [new file with mode: 0644]
deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md [new file with mode: 0644]
deps/npm/node_modules/read-package-json/node_modules/glob/package.json [new file with mode: 0644]
deps/npm/node_modules/read-package-json/node_modules/glob/sync.js [new file with mode: 0644]
deps/npm/node_modules/read-package-json/package.json
deps/npm/node_modules/read-package-json/zunda [new file with mode: 0644]
deps/npm/node_modules/request/.eslintrc [deleted file]
deps/npm/node_modules/request/CHANGELOG.md
deps/npm/node_modules/request/README.md
deps/npm/node_modules/request/lib/har.js
deps/npm/node_modules/request/lib/multipart.js
deps/npm/node_modules/request/lib/tunnel.js
deps/npm/node_modules/request/node_modules/aws-sign2/package.json
deps/npm/node_modules/request/node_modules/aws4/.npmignore [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/.travis.yml [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/LICENSE [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/README.md [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/aws4.js [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/example.js [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/aws4/package.json [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/bl/.jshintrc [deleted file]
deps/npm/node_modules/request/node_modules/bl/.travis.yml
deps/npm/node_modules/request/node_modules/bl/bl.js
deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/doc/stream.markdown
deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_readable.js
deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/lib/_stream_writable.js
deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/core-util-is/package.json
deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/process-nextick-args/package.json
deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/string_decoder/package.json
deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/node_modules/util-deprecate/package.json
deps/npm/node_modules/request/node_modules/bl/node_modules/readable-stream/package.json
deps/npm/node_modules/request/node_modules/bl/package.json
deps/npm/node_modules/request/node_modules/bl/test/basic-test.js [deleted file]
deps/npm/node_modules/request/node_modules/bl/test/sauce.js [deleted file]
deps/npm/node_modules/request/node_modules/bl/test/test.js
deps/npm/node_modules/request/node_modules/caseless/package.json
deps/npm/node_modules/request/node_modules/combined-stream/node_modules/delayed-stream/package.json
deps/npm/node_modules/request/node_modules/combined-stream/package.json
deps/npm/node_modules/request/node_modules/extend/.eslintrc [deleted file]
deps/npm/node_modules/request/node_modules/extend/package.json
deps/npm/node_modules/request/node_modules/forever-agent/package.json
deps/npm/node_modules/request/node_modules/form-data/node_modules/async/CHANGELOG.md
deps/npm/node_modules/request/node_modules/form-data/node_modules/async/README.md
deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.js
deps/npm/node_modules/request/node_modules/form-data/node_modules/async/dist/async.min.js
deps/npm/node_modules/request/node_modules/form-data/node_modules/async/lib/async.js
deps/npm/node_modules/request/node_modules/form-data/node_modules/async/package.json
deps/npm/node_modules/request/node_modules/form-data/package.json
deps/npm/node_modules/request/node_modules/har-validator/README.md
deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/ansi-styles/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/index.js
deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/escape-string-regexp/readme.md
deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/has-ansi/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/node_modules/supports-color/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/chalk/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/node_modules/graceful-readlink/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/commander/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/formats.js
deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-function/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/node_modules/is-property/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/generate-object-property/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/jsonpointer/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc [deleted file]
deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/index.js
deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/package.json
deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/node_modules/pinkie/readme.md
deps/npm/node_modules/request/node_modules/har-validator/node_modules/pinkie-promise/package.json
deps/npm/node_modules/request/node_modules/har-validator/package.json
deps/npm/node_modules/request/node_modules/hawk/README.md
deps/npm/node_modules/request/node_modules/hawk/dist/client.js
deps/npm/node_modules/request/node_modules/hawk/example/usage.js
deps/npm/node_modules/request/node_modules/hawk/lib/client.js
deps/npm/node_modules/request/node_modules/hawk/lib/index.js
deps/npm/node_modules/request/node_modules/hawk/lib/server.js
deps/npm/node_modules/request/node_modules/hawk/lib/utils.js
deps/npm/node_modules/request/node_modules/hawk/node_modules/boom/package.json
deps/npm/node_modules/request/node_modules/hawk/node_modules/cryptiles/package.json
deps/npm/node_modules/request/node_modules/hawk/node_modules/hoek/package.json
deps/npm/node_modules/request/node_modules/hawk/node_modules/sntp/package.json
deps/npm/node_modules/request/node_modules/hawk/package.json
deps/npm/node_modules/request/node_modules/hawk/test/readme.js
deps/npm/node_modules/request/node_modules/hawk/test/server.js
deps/npm/node_modules/request/node_modules/hawk/test/uri.js
deps/npm/node_modules/request/node_modules/hawk/test/utils.js
deps/npm/node_modules/request/node_modules/http-signature/CHANGES.md
deps/npm/node_modules/request/node_modules/http-signature/http_signing.md
deps/npm/node_modules/request/node_modules/http-signature/lib/signer.js
deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/AUTHORS [moved from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/AUTHORS with 100% similarity]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/CHANGES.md [moved from deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/CHANGES.md with 100% similarity]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/README.md
deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/assert.js
deps/npm/node_modules/request/node_modules/http-signature/node_modules/assert-plus/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/extsprintf/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/json-schema/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/node_modules/verror/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/jsprim/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/.npmignore
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-conv
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign [new file with mode: 0755]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-verify [new file with mode: 0755]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ed-compat.js
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/key.js
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/lib/ssh-buffer.js
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-sign.1 [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-verify.1 [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/asn1/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/README.md [deleted file]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/assert.js [deleted file]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/package.json [deleted file]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/README.md
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/etc/dashdash.bash_completion.in [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/lib/dashdash.js
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md [deleted file]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js [deleted file]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json [deleted file]
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/ecc-jsbn/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jodid25519/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/jsbn/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/README.md
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/tweetnacl/package.json
deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/package.json
deps/npm/node_modules/request/node_modules/http-signature/package.json
deps/npm/node_modules/request/node_modules/is-typedarray/package.json
deps/npm/node_modules/request/node_modules/isstream/.jshintrc [deleted file]
deps/npm/node_modules/request/node_modules/isstream/package.json
deps/npm/node_modules/request/node_modules/json-stringify-safe/package.json
deps/npm/node_modules/request/node_modules/mime-types/HISTORY.md
deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/HISTORY.md
deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/README.md
deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/db.json
deps/npm/node_modules/request/node_modules/mime-types/node_modules/mime-db/package.json
deps/npm/node_modules/request/node_modules/mime-types/package.json
deps/npm/node_modules/request/node_modules/node-uuid/package.json
deps/npm/node_modules/request/node_modules/oauth-sign/index.js
deps/npm/node_modules/request/node_modules/oauth-sign/package.json
deps/npm/node_modules/request/node_modules/qs/.eslintrc [deleted file]
deps/npm/node_modules/request/node_modules/qs/.travis.yml
deps/npm/node_modules/request/node_modules/qs/CHANGELOG.md
deps/npm/node_modules/request/node_modules/qs/README.md
deps/npm/node_modules/request/node_modules/qs/Readme.md
deps/npm/node_modules/request/node_modules/qs/bower.json
deps/npm/node_modules/request/node_modules/qs/component.json
deps/npm/node_modules/request/node_modules/qs/dist/qs.js
deps/npm/node_modules/request/node_modules/qs/lib/index.js [changed mode: 0644->0755]
deps/npm/node_modules/request/node_modules/qs/lib/parse.js [changed mode: 0644->0755]
deps/npm/node_modules/request/node_modules/qs/lib/stringify.js [changed mode: 0644->0755]
deps/npm/node_modules/request/node_modules/qs/lib/utils.js [changed mode: 0644->0755]
deps/npm/node_modules/request/node_modules/qs/package.json
deps/npm/node_modules/request/node_modules/qs/test/index.js [new file with mode: 0644]
deps/npm/node_modules/request/node_modules/qs/test/parse.js [changed mode: 0644->0755]
deps/npm/node_modules/request/node_modules/qs/test/stringify.js [changed mode: 0644->0755]
deps/npm/node_modules/request/node_modules/qs/test/utils.js [changed mode: 0644->0755]
deps/npm/node_modules/request/node_modules/stringstream/package.json
deps/npm/node_modules/request/node_modules/tough-cookie/package.json
deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc [deleted file]
deps/npm/node_modules/request/package.json
deps/npm/node_modules/request/request.js
deps/npm/node_modules/retry/Readme.md
deps/npm/node_modules/retry/lib/retry.js
deps/npm/node_modules/retry/lib/retry_operation.js
deps/npm/node_modules/retry/package.json
deps/npm/node_modules/rimraf/README.md
deps/npm/node_modules/rimraf/node_modules/glob/LICENSE [new file with mode: 0644]
deps/npm/node_modules/rimraf/node_modules/glob/README.md [new file with mode: 0644]
deps/npm/node_modules/rimraf/node_modules/glob/common.js [new file with mode: 0644]
deps/npm/node_modules/rimraf/node_modules/glob/glob.js [new file with mode: 0644]
deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js [new file with mode: 0644]
deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/license [new file with mode: 0644]
deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json [new file with mode: 0644]
deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md [new file with mode: 0644]
deps/npm/node_modules/rimraf/node_modules/glob/package.json [new file with mode: 0644]
deps/npm/node_modules/rimraf/node_modules/glob/sync.js [new file with mode: 0644]
deps/npm/node_modules/rimraf/package.json
deps/npm/node_modules/rimraf/rimraf.js
deps/npm/node_modules/spdx-license-ids/package.json
deps/npm/node_modules/spdx-license-ids/spdx-license-ids.json
deps/npm/node_modules/which/.npmignore [new file with mode: 0644]
deps/npm/node_modules/which/README.md
deps/npm/node_modules/which/node_modules/isexe/.npmignore [new file with mode: 0644]
deps/npm/node_modules/which/node_modules/isexe/README.md [new file with mode: 0644]
deps/npm/node_modules/which/node_modules/isexe/access.js [new file with mode: 0644]
deps/npm/node_modules/which/node_modules/isexe/index.js [new file with mode: 0644]
deps/npm/node_modules/which/node_modules/isexe/mode.js [new file with mode: 0644]
deps/npm/node_modules/which/node_modules/isexe/package.json [new file with mode: 0644]
deps/npm/node_modules/which/node_modules/isexe/test/basic.js [new file with mode: 0644]
deps/npm/node_modules/which/node_modules/isexe/windows.js [new file with mode: 0644]
deps/npm/node_modules/which/package.json
deps/npm/node_modules/which/test/basic.js
deps/npm/node_modules/which/test/windows.js [new file with mode: 0644]
deps/npm/node_modules/which/which.js
deps/npm/package.json

index 3b4673d..2f27bf6 100644 (file)
@@ -1,3 +1,60 @@
+### v2.14.18 (2016-02-04):
+
+Clearly our docs are perfect after all those wonderful PRs, 'cause this week's
+gonna be all about dependency updates. Note: There is a small security-related
+fix included here!
+
+#### SECURITY-RELATED DEPENDENCY UPDATE
+
+* [`5c095ef`](https://github.com/npm/npm/commit/5c095eff8dc006980d4d083f2007e4dacff23be3)
+  [#11341](https://github.com/npm/npm/pull/11341)
+  `request@2.69.0`: Includes security-related dependency updates involving
+  `hawk` and `is-my-json-valid`
+  ([@remy](https://github.com/remy) and [@simov](https://github.com/simov))
+
+#### OTHER DEPENDENCY UPDATES
+
+* [`f9c2668`](https://github.com/npm/npm/commit/f9c2668ca3e6e2602d91250ce61280e5e12d0a00)
+  `which@1.2.4`
+  ([@isaacs](https://github.com/isaacs))
+* [`2907c43`](https://github.com/npm/npm/commit/2907c43ad4ef87e5f730c2576f680d6837fcbad0)
+  `spdx-license-ids@1.2.0`
+  ([@shinnn](https://github.com/shinnn))
+* [`7734069`](https://github.com/npm/npm/commit/773406960bf7f4a87b2ecb6ebf593c62d0e9f95d)
+  `rimraf@2.5.1`
+  ([@isaacs](https://github.com/isaacs))
+* [`f4b39a7`](https://github.com/npm/npm/commit/f4b39a7dd5e1335d92aa22c46d99abb33f271b8b)
+  `retry@0.9.0`
+  ([@tim-kos](https://github.com/tim-kos))
+* [`ded1e7a`](https://github.com/npm/npm/commit/ded1e7a1c9c7bec29bb7c30a8f85546670e75b56)
+  Nest `retry@0.8.0` inside `npm-registry-client` to prevent invalid
+  dependency issue until the latter gets a dependency update.
+  ([@zkat](https://github.com/zkat))
+* [`ab9f867`](https://github.com/npm/npm/commit/ab9f8679f9687f91ad03adaab6211a897aeebbae)
+  `read-package-json@2.0.3`
+  ([@iarna](https://github.com/iarna))
+* [`b638c41`](https://github.com/npm/npm/commit/b638c41607bb936b9eaaceba2aeeda1d34e3a9b2)
+  `npmlog@2.0.2`
+  ([@iarna](https://github.com/iarna))
+* [`49f34af`](https://github.com/npm/npm/commit/49f34af463a674359269025d8438feb6a7c69960)
+  `init-package-json@1.9.3`
+  ([@iarna](https://github.com/iarna))
+* [`2305dab`](https://github.com/npm/npm/commit/2305dab4e7bff09bb7686cec653cf1e663dbf15d)
+  `graceful-fs@4.1.3`: Fixed `.close()` not being patched.
+  ([@isaacs](https://github.com/isaacs))
+* [`18496d9`](https://github.com/npm/npm/commit/18496d9a0fff94e3652655998e8333056aa52b15)
+  `fs-write-stream-atomic@1.0.8`
+  ([@iarna](https://github.com/iarna))
+* [`6637bc7`](https://github.com/npm/npm/commit/6637bc7a0e194d82554cd7c91e1794018fef5943)
+  `config-chain@1.1.10`
+  ([@dominictarr](https://github.com/dominictarr))
+* [`4222bad`](https://github.com/npm/npm/commit/4222badffed9e9edacea6a8a96a99a164d376158)
+  `columnify@1.5.4`
+  ([@timoxley](https://github.com/timoxley))
+* [`df9016f`](https://github.com/npm/npm/commit/df9016f327a2a9ce492ebc75b882b03069438e13)
+  `ansi@0.3.1`: Added a license file.
+  ([@TooTallNate](https://github.com/TooTallNate))
+
 ### v2.14.17 (2016-01-28):
 
 Another week, another small LTS release!
index 1206ad3..e9bc5c0 100644 (file)
@@ -127,5 +127,5 @@ will no doubt tell you to put the output in a gist or email.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@2.14.17</p>
+<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@2.14.18</p>
 
index 275871c..8f2987a 100644 (file)
@@ -28,5 +28,5 @@ to the <code>npm.bin</code> property.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-bin &mdash; npm@2.14.17</p>
+<p id="footer">npm-bin &mdash; npm@2.14.18</p>
 
index 852e9c4..248d8d0 100644 (file)
@@ -33,5 +33,5 @@ friendly for programmatic use.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-bugs &mdash; npm@2.14.17</p>
+<p id="footer">npm-bugs &mdash; npm@2.14.18</p>
 
index 7e5c516..f3ca217 100644 (file)
@@ -42,5 +42,5 @@ incrementation.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-cache &mdash; npm@2.14.17</p>
+<p id="footer">npm-cache &mdash; npm@2.14.18</p>
 
index adeed91..864842e 100644 (file)
@@ -36,5 +36,5 @@ usage, or <code>man 3 npm-&lt;command&gt;</code> for programmatic usage.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-commands &mdash; npm@2.14.17</p>
+<p id="footer">npm-commands &mdash; npm@2.14.18</p>
 
index 9c9eb71..5dc06ab 100644 (file)
@@ -57,5 +57,5 @@ functions instead.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-config &mdash; npm@2.14.17</p>
+<p id="footer">npm-config &mdash; npm@2.14.18</p>
 
index 5b68ae8..0dec035 100644 (file)
@@ -47,5 +47,5 @@ a deprecation warning to all who attempt to install it.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-deprecate &mdash; npm@2.14.17</p>
+<p id="footer">npm-deprecate &mdash; npm@2.14.18</p>
 
index e2957d6..81ec547 100644 (file)
@@ -33,5 +33,5 @@ friendly for programmatic use.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-docs &mdash; npm@2.14.17</p>
+<p id="footer">npm-docs &mdash; npm@2.14.18</p>
 
index 7ac01a3..68305bb 100644 (file)
@@ -36,5 +36,5 @@ and how this is used.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-edit &mdash; npm@2.14.17</p>
+<p id="footer">npm-edit &mdash; npm@2.14.18</p>
 
index b9f74d5..9051c44 100644 (file)
@@ -31,5 +31,5 @@ sure to use <code>npm rebuild &lt;pkg&gt;</code> if you make any changes.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-explore &mdash; npm@2.14.17</p>
+<p id="footer">npm-explore &mdash; npm@2.14.18</p>
 
index e04fb09..9666cf3 100644 (file)
@@ -44,5 +44,5 @@ Name of the file that matched</li>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-help-search &mdash; npm@2.14.17</p>
+<p id="footer">npm-help-search &mdash; npm@2.14.18</p>
 
index 2c4f279..f7335c5 100644 (file)
@@ -39,5 +39,5 @@ then go ahead and use this programmatically.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-init &mdash; npm@2.14.17</p>
+<p id="footer">npm-init &mdash; npm@2.14.18</p>
 
index 7da1c1a..b84313c 100644 (file)
@@ -32,5 +32,5 @@ installed or when an error has been encountered.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-install &mdash; npm@2.14.17</p>
+<p id="footer">npm-install &mdash; npm@2.14.18</p>
 
index a9bb5da..3a7cc0e 100644 (file)
@@ -42,5 +42,5 @@ the package in the current working directory</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-link &mdash; npm@2.14.17</p>
+<p id="footer">npm-link &mdash; npm@2.14.18</p>
 
index 7cb0a5b..6a35301 100644 (file)
@@ -37,5 +37,5 @@ config object.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-load &mdash; npm@2.14.17</p>
+<p id="footer">npm-load &mdash; npm@2.14.18</p>
 
index 5292fff..d07a4b3 100644 (file)
@@ -63,5 +63,5 @@ dependency will only be output once.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-ls &mdash; npm@2.14.17</p>
+<p id="footer">npm-ls &mdash; npm@2.14.18</p>
 
index 32b27c0..46c63d0 100644 (file)
@@ -28,5 +28,5 @@ currently outdated.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-outdated &mdash; npm@2.14.17</p>
+<p id="footer">npm-outdated &mdash; npm@2.14.18</p>
 
index 2e3543a..3adc419 100644 (file)
@@ -47,5 +47,5 @@ that is not implemented at this time.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-owner &mdash; npm@2.14.17</p>
+<p id="footer">npm-owner &mdash; npm@2.14.18</p>
 
index aad905d..3087f86 100644 (file)
@@ -33,5 +33,5 @@ overwritten the second time.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-pack &mdash; npm@2.14.17</p>
+<p id="footer">npm-pack &mdash; npm@2.14.18</p>
 
index e924290..dc66eae 100644 (file)
@@ -29,4 +29,4 @@ to npm registries.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-ping &mdash; npm@2.14.17</p>
+<p id="footer">npm-ping &mdash; npm@2.14.18</p>
index a19c3bc..4269b3d 100644 (file)
@@ -29,5 +29,5 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-prefix &mdash; npm@2.14.17</p>
+<p id="footer">npm-prefix &mdash; npm@2.14.18</p>
 
index 1b14bdc..8916b4c 100644 (file)
@@ -30,5 +30,5 @@ package&#39;s dependencies list.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-prune &mdash; npm@2.14.17</p>
+<p id="footer">npm-prune &mdash; npm@2.14.18</p>
 
index 399c3e2..0be714c 100644 (file)
@@ -46,5 +46,5 @@ the registry.  Overwrites when the &quot;force&quot; environment variable is set
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-publish &mdash; npm@2.14.17</p>
+<p id="footer">npm-publish &mdash; npm@2.14.18</p>
 
index fe78452..5bc1d33 100644 (file)
@@ -30,5 +30,5 @@ the new binary. If no &#39;packages&#39; parameter is specify, every package wil
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-rebuild &mdash; npm@2.14.17</p>
+<p id="footer">npm-rebuild &mdash; npm@2.14.18</p>
 
index 764be47..9efce70 100644 (file)
@@ -33,5 +33,5 @@ friendly for programmatic use.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-repo &mdash; npm@2.14.17</p>
+<p id="footer">npm-repo &mdash; npm@2.14.18</p>
 
index 00e5d45..5f6cd28 100644 (file)
@@ -52,5 +52,5 @@ behavior will be accompanied by an increase in major version number</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-restart &mdash; npm@2.14.17</p>
+<p id="footer">npm-restart &mdash; npm@2.14.18</p>
 
index 8e7b016..ead845c 100644 (file)
@@ -29,5 +29,5 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-root &mdash; npm@2.14.17</p>
+<p id="footer">npm-root &mdash; npm@2.14.18</p>
 
index 89bea3c..d4e1816 100644 (file)
@@ -41,5 +41,5 @@ assumed to be the command to run. All other elements are ignored.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-run-script &mdash; npm@2.14.17</p>
+<p id="footer">npm-run-script &mdash; npm@2.14.18</p>
 
index 88344e6..1c61b9c 100644 (file)
@@ -53,5 +53,5 @@ like).</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-search &mdash; npm@2.14.17</p>
+<p id="footer">npm-search &mdash; npm@2.14.18</p>
 
index eae3b5c..d01c03d 100644 (file)
@@ -33,5 +33,5 @@ been saved.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-shrinkwrap &mdash; npm@2.14.17</p>
+<p id="footer">npm-shrinkwrap &mdash; npm@2.14.18</p>
 
index 630ba60..fd1c8aa 100644 (file)
@@ -28,5 +28,5 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-start &mdash; npm@2.14.17</p>
+<p id="footer">npm-start &mdash; npm@2.14.18</p>
 
index 56717b7..eedef15 100644 (file)
@@ -28,5 +28,5 @@ in the <code>packages</code> parameter.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-stop &mdash; npm@2.14.17</p>
+<p id="footer">npm-stop &mdash; npm@2.14.18</p>
 
index 551a87b..ec56dce 100644 (file)
@@ -36,5 +36,5 @@ used. For more information about how to set this config, check
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-tag &mdash; npm@2.14.17</p>
+<p id="footer">npm-tag &mdash; npm@2.14.18</p>
 
index 2f6d8e9..9b216de 100644 (file)
@@ -30,5 +30,5 @@ in the <code>packages</code> parameter.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-test &mdash; npm@2.14.17</p>
+<p id="footer">npm-test &mdash; npm@2.14.18</p>
 
index d5c99b3..1916bc4 100644 (file)
@@ -30,5 +30,5 @@ uninstalled or when an error has been encountered.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-uninstall &mdash; npm@2.14.17</p>
+<p id="footer">npm-uninstall &mdash; npm@2.14.18</p>
 
index f615e70..3bc0ee3 100644 (file)
@@ -33,5 +33,5 @@ the root package entry is removed from the registry entirely.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-unpublish &mdash; npm@2.14.17</p>
+<p id="footer">npm-unpublish &mdash; npm@2.14.18</p>
 
index f72c7d3..b433a92 100644 (file)
@@ -33,5 +33,5 @@ parameter will be called when done or when an error occurs.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-update &mdash; npm@2.14.17</p>
+<p id="footer">npm-update &mdash; npm@2.14.18</p>
 
index a92fb6f..a08a8d8 100644 (file)
@@ -32,5 +32,5 @@ not have exactly one element. The only element should be a version number.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-version &mdash; npm@2.14.17</p>
+<p id="footer">npm-version &mdash; npm@2.14.18</p>
 
index db48e83..589a8e2 100644 (file)
@@ -81,5 +81,5 @@ the field name.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-view &mdash; npm@2.14.17</p>
+<p id="footer">npm-view &mdash; npm@2.14.18</p>
 
index 8fe4097..d961eb4 100644 (file)
@@ -29,5 +29,5 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-whoami &mdash; npm@2.14.17</p>
+<p id="footer">npm-whoami &mdash; npm@2.14.18</p>
 
index 8ae62dc..a204def 100644 (file)
@@ -23,7 +23,7 @@ npm.load([configObject, ]function (er, npm) {
   npm.commands.install([&quot;package&quot;], cb)
 })
 </code></pre><h2 id="version">VERSION</h2>
-<p>2.14.17</p>
+<p>2.14.18</p>
 <h2 id="description">DESCRIPTION</h2>
 <p>This is the API documentation for npm.
 To find documentation of the command line
@@ -109,5 +109,5 @@ method names.  Use the <code>npm.deref</code> method to find the real name.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm &mdash; npm@2.14.17</p>
+<p id="footer">npm &mdash; npm@2.14.18</p>
 
index 095e805..678705b 100644 (file)
@@ -84,5 +84,5 @@ with an HTTP 402 status code (logically enough), unless you use
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-access &mdash; npm@2.14.17</p>
+<p id="footer">npm-access &mdash; npm@2.14.18</p>
 
index 41b7c7a..1065fce 100644 (file)
@@ -68,5 +68,5 @@ precedence over any global configuration.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-adduser &mdash; npm@2.14.17</p>
+<p id="footer">npm-adduser &mdash; npm@2.14.18</p>
 
index 76e76aa..3db350a 100644 (file)
@@ -35,5 +35,5 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-bin &mdash; npm@2.14.17</p>
+<p id="footer">npm-bin &mdash; npm@2.14.18</p>
 
index cf1ea0e..707a6cb 100644 (file)
@@ -54,5 +54,5 @@ a <code>package.json</code> in the current folder and use the <code>name</code>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-bugs &mdash; npm@2.14.17</p>
+<p id="footer">npm-bugs &mdash; npm@2.14.18</p>
 
index e8f1551..4d9a8b5 100644 (file)
@@ -40,5 +40,5 @@ directly, run:</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-build &mdash; npm@2.14.17</p>
+<p id="footer">npm-build &mdash; npm@2.14.18</p>
 
index bdc9202..f737ca5 100644 (file)
@@ -31,5 +31,5 @@ install packages into the local space.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-bundle &mdash; npm@2.14.17</p>
+<p id="footer">npm-bundle &mdash; npm@2.14.18</p>
 
index 8052bd3..521d121 100644 (file)
@@ -81,5 +81,5 @@ they do not make an HTTP request to the registry.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-cache &mdash; npm@2.14.17</p>
+<p id="footer">npm-cache &mdash; npm@2.14.18</p>
 
index 4edcfa4..a6714fd 100644 (file)
@@ -42,5 +42,5 @@ completions based on the arguments.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-completion &mdash; npm@2.14.17</p>
+<p id="footer">npm-completion &mdash; npm@2.14.18</p>
 
index 4a6464b..590773d 100644 (file)
@@ -66,5 +66,5 @@ global config.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-config &mdash; npm@2.14.17</p>
+<p id="footer">npm-config &mdash; npm@2.14.18</p>
 
index 678fd56..85a2752 100644 (file)
@@ -63,5 +63,5 @@ versions.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-dedupe &mdash; npm@2.14.17</p>
+<p id="footer">npm-dedupe &mdash; npm@2.14.18</p>
 
index fdae8a3..5c11806 100644 (file)
@@ -38,5 +38,5 @@ something like this:</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-deprecate &mdash; npm@2.14.17</p>
+<p id="footer">npm-deprecate &mdash; npm@2.14.18</p>
 
index 0e92494..c3d6c17 100644 (file)
@@ -85,5 +85,5 @@ begin with a number or the letter <code>v</code>.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-dist-tag &mdash; npm@2.14.17</p>
+<p id="footer">npm-dist-tag &mdash; npm@2.14.18</p>
 
index 5620711..a6e8df6 100644 (file)
@@ -56,5 +56,5 @@ the current folder and use the <code>name</code> property.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-docs &mdash; npm@2.14.17</p>
+<p id="footer">npm-docs &mdash; npm@2.14.18</p>
 
index 3eb387e..1749570 100644 (file)
@@ -49,5 +49,5 @@ or <code>&quot;notepad&quot;</code> on Windows.</li>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-edit &mdash; npm@2.14.17</p>
+<p id="footer">npm-edit &mdash; npm@2.14.18</p>
 
index b4ac864..e8698da 100644 (file)
@@ -49,5 +49,5 @@ Windows</li>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-explore &mdash; npm@2.14.17</p>
+<p id="footer">npm-explore &mdash; npm@2.14.18</p>
 
index 016bd7c..c261935 100644 (file)
@@ -46,5 +46,5 @@ where the terms were found in the documentation.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-help-search &mdash; npm@2.14.17</p>
+<p id="footer">npm-help-search &mdash; npm@2.14.18</p>
 
index 5e7c9e2..0f3046b 100644 (file)
@@ -52,5 +52,5 @@ matches are equivalent to specifying a topic name.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-help &mdash; npm@2.14.17</p>
+<p id="footer">npm-help &mdash; npm@2.14.18</p>
 
index 129f94c..806763f 100644 (file)
@@ -48,5 +48,5 @@ defaults and not prompt you for any options.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-init &mdash; npm@2.14.17</p>
+<p id="footer">npm-init &mdash; npm@2.14.18</p>
 
index 804f03b..19f2dd5 100644 (file)
@@ -42,4 +42,4 @@ takes exactly the same arguments as <code>npm install</code>.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-install-test &mdash; npm@3.7.0</p>
+<p id="footer">npm-install-test &mdash; npm@3.7.2</p>
index 7b2d5a6..ad5db95 100644 (file)
@@ -279,5 +279,5 @@ affects a real use-case, it will be investigated.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-install &mdash; npm@2.14.17</p>
+<p id="footer">npm-install &mdash; npm@2.14.18</p>
 
index 49b169c..f42620e 100644 (file)
@@ -72,5 +72,5 @@ include that scope, e.g.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-link &mdash; npm@2.14.17</p>
+<p id="footer">npm-link &mdash; npm@2.14.18</p>
 
index 1acb680..22809c5 100644 (file)
@@ -55,5 +55,5 @@ that registry at the same time.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-logout &mdash; npm@2.14.17</p>
+<p id="footer">npm-logout &mdash; npm@2.14.18</p>
 
index 233f4ca..dc3bcd3 100644 (file)
@@ -22,7 +22,7 @@ installed, as well as their dependencies, in a tree-structure.</p>
 limit the results to only the paths to the packages named.  Note that
 nested packages will <em>also</em> show the paths to the specified packages.
 For example, running <code>npm ls promzard</code> in npm&#39;s source tree will show:</p>
-<pre><code>npm@2.14.17 /path/to/npm
+<pre><code>npm@2.14.18 /path/to/npm
 └─┬ init-package-json@0.0.4
   └── promzard@0.1.5
 </code></pre><p>It will print out extraneous, missing, and invalid packages.</p>
@@ -97,5 +97,5 @@ project.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-ls &mdash; npm@2.14.17</p>
+<p id="footer">npm-ls &mdash; npm@2.14.18</p>
 
index d49f80c..600986c 100644 (file)
@@ -116,5 +116,5 @@ project.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-outdated &mdash; npm@2.14.17</p>
+<p id="footer">npm-outdated &mdash; npm@2.14.18</p>
 
index 114c856..ab4a640 100644 (file)
@@ -49,5 +49,5 @@ that is not implemented at this time.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-owner &mdash; npm@2.14.17</p>
+<p id="footer">npm-owner &mdash; npm@2.14.18</p>
 
index 745850c..feeeb44 100644 (file)
@@ -41,5 +41,5 @@ overwritten the second time.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-pack &mdash; npm@2.14.17</p>
+<p id="footer">npm-pack &mdash; npm@2.14.18</p>
 
index a190acb..00f8ba9 100644 (file)
@@ -32,4 +32,4 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-ping &mdash; npm@2.14.17</p>
+<p id="footer">npm-ping &mdash; npm@2.14.18</p>
index 63c318c..9f7e7c2 100644 (file)
@@ -38,5 +38,5 @@ to contain a package.json file unless <code>-g</code> is also specified.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-prefix &mdash; npm@2.14.17</p>
+<p id="footer">npm-prefix &mdash; npm@2.14.18</p>
 
index 63f1f8b..72727bf 100644 (file)
@@ -41,5 +41,5 @@ negate <code>NODE_ENV</code> being set to <code>production</code>.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-prune &mdash; npm@2.14.17</p>
+<p id="footer">npm-prune &mdash; npm@2.14.18</p>
 
index 74dcc17..a710af1 100644 (file)
@@ -69,5 +69,5 @@ it is removed with <a href="../cli/npm-unpublish.html">npm-unpublish(1)</a>.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-publish &mdash; npm@2.14.17</p>
+<p id="footer">npm-publish &mdash; npm@2.14.18</p>
 
index 5807f15..18b8cd7 100644 (file)
@@ -38,5 +38,5 @@ the new binary.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-rebuild &mdash; npm@2.14.17</p>
+<p id="footer">npm-rebuild &mdash; npm@2.14.18</p>
 
index d37729d..6bb2696 100644 (file)
@@ -42,5 +42,5 @@ a <code>package.json</code> in the current folder and use the <code>name</code>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-repo &mdash; npm@2.14.17</p>
+<p id="footer">npm-repo &mdash; npm@2.14.18</p>
 
index d5bb06f..8e936e0 100644 (file)
@@ -53,5 +53,5 @@ behavior will be accompanied by an increase in major version number</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-restart &mdash; npm@2.14.17</p>
+<p id="footer">npm-restart &mdash; npm@2.14.18</p>
 
index 32a38c9..672913c 100644 (file)
@@ -39,5 +39,5 @@ on its behalf.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-rm &mdash; npm@2.14.17</p>
+<p id="footer">npm-rm &mdash; npm@2.14.18</p>
 
index c1cf733..dfd6efe 100644 (file)
@@ -35,5 +35,5 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-root &mdash; npm@2.14.17</p>
+<p id="footer">npm-root &mdash; npm@2.14.18</p>
 
index 963045f..e827b78 100644 (file)
@@ -57,5 +57,5 @@ you should write:</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-run-script &mdash; npm@2.14.17</p>
+<p id="footer">npm-run-script &mdash; npm@2.14.18</p>
 
index 0b09478..8e9ed84 100644 (file)
@@ -49,5 +49,5 @@ fall on multiple lines.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-search &mdash; npm@2.14.17</p>
+<p id="footer">npm-search &mdash; npm@2.14.18</p>
 
index e2283e5..09947a0 100644 (file)
@@ -164,5 +164,5 @@ contents rather than versions.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-shrinkwrap &mdash; npm@2.14.17</p>
+<p id="footer">npm-shrinkwrap &mdash; npm@2.14.18</p>
 
index f750c98..3e00cad 100644 (file)
@@ -36,5 +36,5 @@ a vaguely positive way to show that you care.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-star &mdash; npm@2.14.17</p>
+<p id="footer">npm-star &mdash; npm@2.14.18</p>
 
index fcb1fa9..a14fffb 100644 (file)
@@ -37,5 +37,5 @@ you will most certainly enjoy this command.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-stars &mdash; npm@2.14.17</p>
+<p id="footer">npm-stars &mdash; npm@2.14.18</p>
 
index 6ed4cfe..b59eb13 100644 (file)
@@ -39,5 +39,5 @@ more details.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-start &mdash; npm@2.14.17</p>
+<p id="footer">npm-start &mdash; npm@2.14.18</p>
 
index 6f355a6..998d817 100644 (file)
@@ -34,5 +34,5 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-stop &mdash; npm@2.14.17</p>
+<p id="footer">npm-stop &mdash; npm@2.14.18</p>
 
index c4a28e8..6bbbb8a 100644 (file)
@@ -62,5 +62,5 @@ that do not begin with a number or the letter <code>v</code>.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-tag &mdash; npm@2.14.17</p>
+<p id="footer">npm-tag &mdash; npm@2.14.18</p>
 
index d048e0d..7393c31 100644 (file)
@@ -67,4 +67,4 @@ use the <code>npm access</code> command to grant or revoke the appropriate permi
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-team &mdash; npm@2.14.17</p>
+<p id="footer">npm-team &mdash; npm@2.14.18</p>
index 3b6155d..7a3aeb2 100644 (file)
@@ -37,5 +37,5 @@ true.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-test &mdash; npm@2.14.17</p>
+<p id="footer">npm-test &mdash; npm@2.14.18</p>
 
index 7195899..7e738e2 100644 (file)
@@ -57,5 +57,5 @@ npm uninstall dtrace-provider --save-optional
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-uninstall &mdash; npm@2.14.17</p>
+<p id="footer">npm-uninstall &mdash; npm@2.14.18</p>
 
index ef528df..19d030e 100644 (file)
@@ -47,5 +47,5 @@ package again, a new version number must be used.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-unpublish &mdash; npm@2.14.17</p>
+<p id="footer">npm-unpublish &mdash; npm@2.14.18</p>
 
index 052b27a..93ba10c 100644 (file)
@@ -120,5 +120,5 @@ be <em>downgraded</em>.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-update &mdash; npm@2.14.17</p>
+<p id="footer">npm-update &mdash; npm@2.14.18</p>
 
index 230f2f0..d397903 100644 (file)
@@ -95,5 +95,5 @@ and tag up to the server, and deletes the <code>build/temp</code> directory.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-version &mdash; npm@2.14.17</p>
+<p id="footer">npm-version &mdash; npm@2.14.18</p>
 
index efbdcf8..79c3858 100644 (file)
@@ -85,5 +85,5 @@ the field name.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-view &mdash; npm@2.14.17</p>
+<p id="footer">npm-view &mdash; npm@2.14.18</p>
 
index 13bea5f..7c1095e 100644 (file)
@@ -33,5 +33,5 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-whoami &mdash; npm@2.14.17</p>
+<p id="footer">npm-whoami &mdash; npm@2.14.18</p>
 
index 7704316..649645b 100644 (file)
@@ -13,7 +13,7 @@
 <h2 id="synopsis">SYNOPSIS</h2>
 <pre><code>npm &lt;command&gt; [args]
 </code></pre><h2 id="version">VERSION</h2>
-<p>2.14.17</p>
+<p>2.14.18</p>
 <h2 id="description">DESCRIPTION</h2>
 <p>npm is the package manager for the Node JavaScript platform.  It puts
 modules in place so that node can find them, and manages dependency
@@ -110,7 +110,7 @@ easily by doing <code>npm view npm contributors</code>.</p>
 the issues list or ask on the mailing list.</p>
 <ul>
 <li><a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a></li>
-<li><a href="&#109;&#97;&#105;&#x6c;&#116;&#111;&#58;&#x6e;&#112;&#x6d;&#45;&#x40;&#x67;&#111;&#111;&#103;&#x6c;&#x65;&#x67;&#114;&#x6f;&#x75;&#112;&#x73;&#46;&#99;&#x6f;&#109;">&#x6e;&#112;&#x6d;&#45;&#x40;&#x67;&#111;&#111;&#103;&#x6c;&#x65;&#x67;&#114;&#x6f;&#x75;&#112;&#x73;&#46;&#99;&#x6f;&#109;</a></li>
+<li><a href="&#109;&#x61;&#105;&#x6c;&#x74;&#x6f;&#x3a;&#110;&#x70;&#x6d;&#45;&#64;&#x67;&#x6f;&#x6f;&#103;&#108;&#x65;&#103;&#x72;&#x6f;&#117;&#112;&#x73;&#x2e;&#x63;&#111;&#x6d;">&#110;&#x70;&#x6d;&#45;&#64;&#x67;&#x6f;&#x6f;&#103;&#108;&#x65;&#103;&#x72;&#x6f;&#117;&#112;&#x73;&#x2e;&#x63;&#111;&#x6d;</a></li>
 </ul>
 <h2 id="bugs">BUGS</h2>
 <p>When you find issues, please report them:</p>
@@ -118,7 +118,7 @@ the issues list or ask on the mailing list.</p>
 <li>web:
 <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a></li>
 <li>email:
-<a href="&#109;&#97;&#x69;&#108;&#x74;&#111;&#58;&#110;&#x70;&#x6d;&#45;&#x40;&#x67;&#111;&#x6f;&#103;&#108;&#x65;&#103;&#x72;&#111;&#117;&#x70;&#x73;&#x2e;&#99;&#111;&#x6d;">&#110;&#x70;&#x6d;&#45;&#x40;&#x67;&#111;&#x6f;&#103;&#108;&#x65;&#103;&#x72;&#111;&#117;&#x70;&#x73;&#x2e;&#99;&#111;&#x6d;</a></li>
+<a href="&#109;&#97;&#105;&#108;&#x74;&#111;&#58;&#110;&#112;&#109;&#45;&#64;&#x67;&#111;&#x6f;&#x67;&#108;&#x65;&#x67;&#x72;&#111;&#117;&#x70;&#x73;&#46;&#99;&#111;&#x6d;">&#110;&#112;&#109;&#45;&#64;&#x67;&#111;&#x6f;&#x67;&#108;&#x65;&#x67;&#x72;&#111;&#117;&#x70;&#x73;&#46;&#99;&#111;&#x6d;</a></li>
 </ul>
 <p>Be sure to include <em>all</em> of the output from the npm command that didn&#39;t work
 as expected.  The <code>npm-debug.log</code> file is also helpful to provide.</p>
@@ -128,7 +128,7 @@ will no doubt tell you to put the output in a gist or email.</p>
 <p><a href="http://blog.izs.me/">Isaac Z. Schlueter</a> ::
 <a href="https://github.com/isaacs/">isaacs</a> ::
 <a href="http://twitter.com/izs">@izs</a> ::
-<a href="&#x6d;&#x61;&#x69;&#108;&#x74;&#x6f;&#58;&#x69;&#x40;&#105;&#x7a;&#115;&#x2e;&#109;&#101;">&#x69;&#x40;&#105;&#x7a;&#115;&#x2e;&#109;&#101;</a></p>
+<a href="&#x6d;&#x61;&#105;&#108;&#x74;&#111;&#x3a;&#105;&#64;&#x69;&#122;&#x73;&#x2e;&#x6d;&#101;">&#105;&#64;&#x69;&#122;&#x73;&#x2e;&#x6d;&#101;</a></p>
 <h2 id="see-also">SEE ALSO</h2>
 <ul>
 <li><a href="../cli/npm-help.html">npm-help(1)</a></li>
@@ -154,5 +154,5 @@ will no doubt tell you to put the output in a gist or email.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm &mdash; npm@2.14.17</p>
+<p id="footer">npm &mdash; npm@2.14.18</p>
 
index 9ea7c23..d1292d6 100644 (file)
@@ -183,5 +183,5 @@ cannot be found elsewhere.  See <code><a href="../files/package.json.html">packa
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-folders &mdash; npm@2.14.17</p>
+<p id="footer">npm-folders &mdash; npm@2.14.18</p>
 
index 9ea7c23..d1292d6 100644 (file)
@@ -183,5 +183,5 @@ cannot be found elsewhere.  See <code><a href="../files/package.json.html">packa
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-folders &mdash; npm@2.14.17</p>
+<p id="footer">npm-folders &mdash; npm@2.14.18</p>
 
index 733feeb..6b01278 100644 (file)
@@ -567,5 +567,5 @@ ignored.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">package.json &mdash; npm@2.14.17</p>
+<p id="footer">package.json &mdash; npm@2.14.18</p>
 
index 2ef2c3d..ebe83fb 100644 (file)
@@ -83,5 +83,5 @@ manner.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npmrc &mdash; npm@2.14.17</p>
+<p id="footer">npmrc &mdash; npm@2.14.18</p>
 
index 733feeb..6b01278 100644 (file)
@@ -567,5 +567,5 @@ ignored.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">package.json &mdash; npm@2.14.17</p>
+<p id="footer">package.json &mdash; npm@2.14.18</p>
 
index b9c6cee..339c6e8 100644 (file)
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-index &mdash; npm@2.14.17</p>
+<p id="footer">npm-index &mdash; npm@2.14.18</p>
 
index 58fc980..3808874 100644 (file)
@@ -147,5 +147,5 @@ set to anything.&quot;</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-coding-style &mdash; npm@2.14.17</p>
+<p id="footer">npm-coding-style &mdash; npm@2.14.18</p>
 
index a9dab53..00be245 100644 (file)
@@ -799,5 +799,5 @@ exit successfully.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-config &mdash; npm@2.14.17</p>
+<p id="footer">npm-config &mdash; npm@2.14.18</p>
 
index b6ef4af..cb01ee9 100644 (file)
@@ -195,5 +195,5 @@ from a fresh checkout.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-developers &mdash; npm@2.14.17</p>
+<p id="footer">npm-developers &mdash; npm@2.14.18</p>
 
index fddf444..c9b926d 100644 (file)
@@ -13,7 +13,7 @@
 <h2 id="synopsis">SYNOPSIS</h2>
 <ol>
 <li>Get the author email with <code>npm owner ls &lt;pkgname&gt;</code></li>
-<li>Email the author, CC <a href="&#x6d;&#x61;&#x69;&#x6c;&#116;&#x6f;&#x3a;&#115;&#x75;&#x70;&#x70;&#x6f;&#114;&#116;&#64;&#x6e;&#112;&#109;&#x6a;&#x73;&#46;&#x63;&#x6f;&#109;">&#115;&#x75;&#x70;&#x70;&#x6f;&#114;&#116;&#64;&#x6e;&#112;&#109;&#x6a;&#x73;&#46;&#x63;&#x6f;&#109;</a></li>
+<li>Email the author, CC <a href="&#x6d;&#x61;&#x69;&#x6c;&#x74;&#111;&#x3a;&#x73;&#117;&#112;&#112;&#x6f;&#114;&#x74;&#x40;&#x6e;&#x70;&#109;&#x6a;&#115;&#46;&#99;&#111;&#109;">&#x73;&#117;&#112;&#112;&#x6f;&#114;&#x74;&#x40;&#x6e;&#x70;&#109;&#x6a;&#115;&#46;&#99;&#111;&#109;</a></li>
 <li>After a few weeks, if there&#39;s no resolution, we&#39;ll sort it out.</li>
 </ol>
 <p>Don&#39;t squat on package names.  Publish code or move out of the way.</p>
@@ -51,12 +51,12 @@ Joe&#39;s appropriate course of action in each case is the same.</p>
 owner (Bob).</li>
 <li>Joe emails Bob, explaining the situation <strong>as respectfully as
 possible</strong>, and what he would like to do with the module name.  He
-adds the npm support staff <a href="&#109;&#97;&#105;&#x6c;&#x74;&#111;&#58;&#115;&#117;&#112;&#x70;&#x6f;&#x72;&#116;&#x40;&#110;&#112;&#109;&#106;&#115;&#46;&#x63;&#x6f;&#109;">&#115;&#117;&#112;&#x70;&#x6f;&#x72;&#116;&#x40;&#110;&#112;&#109;&#106;&#115;&#46;&#x63;&#x6f;&#109;</a> to the CC list of
+adds the npm support staff <a href="&#x6d;&#97;&#105;&#108;&#116;&#x6f;&#x3a;&#115;&#117;&#112;&#x70;&#111;&#x72;&#x74;&#64;&#x6e;&#112;&#109;&#106;&#115;&#46;&#99;&#111;&#x6d;">&#115;&#117;&#112;&#x70;&#111;&#x72;&#x74;&#64;&#x6e;&#112;&#109;&#106;&#115;&#46;&#99;&#111;&#x6d;</a> to the CC list of
 the email.  Mention in the email that Bob can run <code>npm owner add
 joe foo</code> to add Joe as an owner of the <code>foo</code> package.</li>
 <li>After a reasonable amount of time, if Bob has not responded, or if
 Bob and Joe can&#39;t come to any sort of resolution, email support
-<a href="&#x6d;&#97;&#105;&#x6c;&#116;&#x6f;&#x3a;&#115;&#117;&#x70;&#112;&#x6f;&#114;&#116;&#64;&#110;&#112;&#109;&#x6a;&#x73;&#46;&#x63;&#x6f;&#x6d;">&#115;&#117;&#x70;&#112;&#x6f;&#114;&#116;&#64;&#110;&#112;&#109;&#x6a;&#x73;&#46;&#x63;&#x6f;&#x6d;</a> and we&#39;ll sort it out.  (&quot;Reasonable&quot; is
+<a href="&#109;&#x61;&#x69;&#108;&#116;&#111;&#x3a;&#x73;&#117;&#112;&#x70;&#111;&#114;&#x74;&#64;&#x6e;&#112;&#109;&#106;&#115;&#x2e;&#99;&#x6f;&#x6d;">&#x73;&#117;&#112;&#x70;&#111;&#114;&#x74;&#64;&#x6e;&#112;&#109;&#106;&#115;&#x2e;&#99;&#x6f;&#x6d;</a> and we&#39;ll sort it out.  (&quot;Reasonable&quot; is
 usually at least 4 weeks, but extra time is allowed around common
 holidays.)</li>
 </ol>
@@ -112,5 +112,5 @@ things into it.</li>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-disputes &mdash; npm@2.14.17</p>
+<p id="footer">npm-disputes &mdash; npm@2.14.18</p>
 
diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html
deleted file mode 100644 (file)
index 4dd82dd..0000000
+++ /dev/null
@@ -1,312 +0,0 @@
-<!doctype html>
-<html>
-  <title>npm-faq</title>
-  <meta http-equiv="content-type" value="text/html;utf-8">
-  <link rel="stylesheet" type="text/css" href="../../static/style.css">
-  <link rel="canonical" href="https://www.npmjs.org/doc/misc/npm-faq.html">
-  <script async=true src="../../static/toc.js"></script>
-
-  <body>
-    <div id="wrapper">
-
-<h1><a href="../misc/npm-faq.html">npm-faq</a></h1> <p>Frequently Asked Questions</p>
-<h2 id="where-can-i-find-these-docs-in-html-">Where can I find these docs in HTML?</h2>
-<p><a href="https://docs.npmjs.com/">https://docs.npmjs.com/</a>, or run:</p>
-<pre><code>npm config set viewer browser
-</code></pre><p>to open these documents in your default web browser rather than <code>man</code>.</p>
-<h2 id="it-didn-t-work-">It didn&#39;t work.</h2>
-<p>That&#39;s not really a question.</p>
-<h2 id="why-didn-t-it-work-">Why didn&#39;t it work?</h2>
-<p>I don&#39;t know yet.</p>
-<p>Read the error output, and if you can&#39;t figure out what it means,
-do what it says and post a bug with all the information it asks for.</p>
-<h2 id="where-does-npm-put-stuff-">Where does npm put stuff?</h2>
-<p>See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code></p>
-<p>tl;dr:</p>
-<ul>
-<li>Use the <code>npm root</code> command to see where modules go, and the <code>npm bin</code>
-command to see where executables go</li>
-<li>Global installs are different from local installs.  If you install
-something with the <code>-g</code> flag, then its executables go in <code>npm bin -g</code>
-and its modules go in <code>npm root -g</code>.</li>
-</ul>
-<h2 id="how-do-i-install-something-on-my-computer-in-a-central-location-">How do I install something on my computer in a central location?</h2>
-<p>Install it globally by tacking <code>-g</code> or <code>--global</code> to the command.  (This
-is especially important for command line utilities that need to add
-their bins to the global system <code>PATH</code>.)</p>
-<h2 id="i-installed-something-globally-but-i-can-t-require-it">I installed something globally, but I can&#39;t <code>require()</code> it</h2>
-<p>Install it locally.</p>
-<p>The global install location is a place for command-line utilities
-to put their bins in the system <code>PATH</code>.  It&#39;s not for use with <code>require()</code>.</p>
-<p>If you <code>require()</code> a module in your code, then that means it&#39;s a
-dependency, and a part of your program.  You need to install it locally
-in your program.</p>
-<h2 id="why-can-t-npm-just-put-everything-in-one-place-like-other-package-managers-">Why can&#39;t npm just put everything in one place, like other package managers?</h2>
-<p>Not every change is an improvement, but every improvement is a change.
-This would be like asking git to do network IO for every commit.  It&#39;s
-not going to happen, because it&#39;s a terrible idea that causes more
-problems than it solves.</p>
-<p>It is much harder to avoid dependency conflicts without nesting
-dependencies.  This is fundamental to the way that npm works, and has
-proven to be an extremely successful approach.  See <code><a href="../files/npm-folders.html">npm-folders(5)</a></code> for
-more details.</p>
-<p>If you want a package to be installed in one place, and have all your
-programs reference the same copy of it, then use the <code>npm link</code> command.
-That&#39;s what it&#39;s for.  Install it globally, then link it into each
-program that uses it.</p>
-<h2 id="whatever-i-really-want-the-old-style-everything-global-style-">Whatever, I really want the old style &#39;everything global&#39; style.</h2>
-<p>Write your own package manager.  You could probably even wrap up <code>npm</code>
-in a shell script if you really wanted to.</p>
-<p>npm will not help you do something that is known to be a bad idea.</p>
-<h2 id="should-i-check-my-node_modules-folder-into-git-">Should I check my <code>node_modules</code> folder into git?</h2>
-<p>Usually, no. Allow npm to resolve dependencies for your packages.</p>
-<p>For packages you <strong>deploy</strong>, such as websites and apps,
-you should use npm shrinkwrap to lock down your full dependency tree:</p>
-<p><a href="https://docs.npmjs.com/cli/shrinkwrap">https://docs.npmjs.com/cli/shrinkwrap</a></p>
-<p>If you are paranoid about depending on the npm ecosystem,
-you should run a private npm mirror or a private cache.</p>
-<p>If you want 100% confidence in being able to reproduce the specific bytes
-included in a deployment, you should use an additional mechanism that can
-verify contents rather than versions. For example,
-Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs.</p>
-<h2 id="is-it-npm-or-npm-or-npm-">Is it &#39;npm&#39; or &#39;NPM&#39; or &#39;Npm&#39;?</h2>
-<p>npm should never be capitalized unless it is being displayed in a
-location that is customarily all-caps (such as the title of man pages.)</p>
-<h2 id="if-npm-is-an-acronym-why-is-it-never-capitalized-">If &#39;npm&#39; is an acronym, why is it never capitalized?</h2>
-<p>Contrary to the belief of many, &quot;npm&quot; is not in fact an abbreviation for
-&quot;Node Package Manager&quot;.  It is a recursive bacronymic abbreviation for
-&quot;npm is not an acronym&quot;.  (If it was &quot;ninaa&quot;, then it would be an
-acronym, and thus incorrectly named.)</p>
-<p>&quot;NPM&quot;, however, <em>is</em> an acronym (more precisely, a capitonym) for the
-National Association of Pastoral Musicians.  You can learn more
-about them at <a href="http://npm.org/">http://npm.org/</a>.</p>
-<p>In software, &quot;NPM&quot; is a Non-Parametric Mapping utility written by
-Chris Rorden.  You can analyze pictures of brains with it.  Learn more
-about the (capitalized) NPM program at <a href="http://www.cabiatl.com/mricro/npm/">http://www.cabiatl.com/mricro/npm/</a>.</p>
-<p>The first seed that eventually grew into this flower was a bash utility
-named &quot;pm&quot;, which was a shortened descendent of &quot;pkgmakeinst&quot;, a
-bash function that was used to install various different things on different
-platforms, most often using Yahoo&#39;s <code>yinst</code>.  If <code>npm</code> was ever an
-acronym for anything, it was <code>node pm</code> or maybe <code>new pm</code>.</p>
-<p>So, in all seriousness, the &quot;npm&quot; project is named after its command-line
-utility, which was organically selected to be easily typed by a right-handed
-programmer using a US QWERTY keyboard layout, ending with the
-right-ring-finger in a postition to type the <code>-</code> key for flags and
-other command-line arguments.  That command-line utility is always
-lower-case, though it starts most sentences it is a part of.</p>
-<h2 id="how-do-i-list-installed-packages-">How do I list installed packages?</h2>
-<p><code>npm ls</code></p>
-<h2 id="how-do-i-search-for-packages-">How do I search for packages?</h2>
-<p><code>npm search</code></p>
-<p>Arguments are greps.  <code>npm search jsdom</code> shows jsdom packages.</p>
-<h2 id="how-do-i-update-npm-">How do I update npm?</h2>
-<pre><code>npm install npm -g
-</code></pre><p>You can also update all outdated local packages by doing <code>npm update</code> without
-any arguments, or global packages by doing <code>npm update -g</code>.</p>
-<p>Occasionally, the version of npm will progress such that the current
-version cannot be properly installed with the version that you have
-installed already.  (Consider, if there is ever a bug in the <code>update</code>
-command.)</p>
-<p>In those cases, you can do this:</p>
-<pre><code>curl https://www.npmjs.com/install.sh | sh
-</code></pre><h2 id="what-is-a-package-">What is a <code>package</code>?</h2>
-<p>A package is:</p>
-<ul>
-<li>a) a folder containing a program described by a package.json file</li>
-<li>b) a gzipped tarball containing (a)</li>
-<li>c) a url that resolves to (b)</li>
-<li>d) a <code>&lt;name&gt;@&lt;version&gt;</code> that is published on the registry with (c)</li>
-<li>e) a <code>&lt;name&gt;@&lt;tag&gt;</code> that points to (d)</li>
-<li>f) a <code>&lt;name&gt;</code> that has a &quot;latest&quot; tag satisfying (e)</li>
-<li>g) a <code>git</code> url that, when cloned, results in (a).</li>
-</ul>
-<p>Even if you never publish your package, you can still get a lot of
-benefits of using npm if you just want to write a node program (a), and
-perhaps if you also want to be able to easily install it elsewhere
-after packing it up into a tarball (b).</p>
-<p>Git urls can be of the form:</p>
-<pre><code>git://github.com/user/project.git#commit-ish
-git+ssh://user@hostname:project.git#commit-ish
-git+http://user@hostname/project/blah.git#commit-ish
-git+https://user@hostname/project/blah.git#commit-ish
-</code></pre><p>The <code>commit-ish</code> can be any tag, sha, or branch which can be supplied as
-an argument to <code>git checkout</code>.  The default is <code>master</code>.</p>
-<h2 id="what-is-a-module-">What is a <code>module</code>?</h2>
-<p>A module is anything that can be loaded with <code>require()</code> in a Node.js
-program.  The following things are all examples of things that can be
-loaded as modules:</p>
-<ul>
-<li>A folder with a <code>package.json</code> file containing a <code>main</code> field.</li>
-<li>A folder with an <code>index.js</code> file in it.</li>
-<li>A JavaScript file.</li>
-</ul>
-<p>Most npm packages are modules, because they are libraries that you
-load with <code>require</code>.  However, there&#39;s no requirement that an npm
-package be a module!  Some only contain an executable command-line
-interface, and don&#39;t provide a <code>main</code> field for use in Node programs.</p>
-<p>Almost all npm packages (at least, those that are Node programs)
-<em>contain</em> many modules within them (because every file they load with
-<code>require()</code> is a module).</p>
-<p>In the context of a Node program, the <code>module</code> is also the thing that
-was loaded <em>from</em> a file.  For example, in the following program:</p>
-<pre><code>var req = require(&#39;request&#39;)
-</code></pre><p>we might say that &quot;The variable <code>req</code> refers to the <code>request</code> module&quot;.</p>
-<h2 id="so-why-is-it-the-node_modules-folder-but-package-json-file-why-not-node_packages-or-module-json-">So, why is it the &quot;<code>node_modules</code>&quot; folder, but &quot;<code>package.json</code>&quot; file?  Why not <code>node_packages</code> or <code>module.json</code>?</h2>
-<p>The <code>package.json</code> file defines the package.  (See &quot;What is a
-package?&quot; above.)</p>
-<p>The <code>node_modules</code> folder is the place Node.js looks for modules.
-(See &quot;What is a module?&quot; above.)</p>
-<p>For example, if you create a file at <code>node_modules/foo.js</code> and then
-had a program that did <code>var f = require(&#39;foo.js&#39;)</code> then it would load
-the module.  However, <code>foo.js</code> is not a &quot;package&quot; in this case,
-because it does not have a package.json.</p>
-<p>Alternatively, if you create a package which does not have an
-<code>index.js</code> or a <code>&quot;main&quot;</code> field in the <code>package.json</code> file, then it is
-not a module.  Even if it&#39;s installed in <code>node_modules</code>, it can&#39;t be
-an argument to <code>require()</code>.</p>
-<h2 id="-node_modules-is-the-name-of-my-deity-s-arch-rival-and-a-forbidden-word-in-my-religion-can-i-configure-npm-to-use-a-different-folder-"><code>&quot;node_modules&quot;</code> is the name of my deity&#39;s arch-rival, and a Forbidden Word in my religion.  Can I configure npm to use a different folder?</h2>
-<p>No.  This will never happen.  This question comes up sometimes,
-because it seems silly from the outside that npm couldn&#39;t just be
-configured to put stuff somewhere else, and then npm could load them
-from there.  It&#39;s an arbitrary spelling choice, right?  What&#39;s the big
-deal?</p>
-<p>At the time of this writing, the string <code>&#39;node_modules&#39;</code> appears 151
-times in 53 separate files in npm and node core (excluding tests and
-documentation).</p>
-<p>Some of these references are in node&#39;s built-in module loader.  Since
-npm is not involved <strong>at all</strong> at run-time, node itself would have to
-be configured to know where you&#39;ve decided to stick stuff.  Complexity
-hurdle #1.  Since the Node module system is locked, this cannot be
-changed, and is enough to kill this request.  But I&#39;ll continue, in
-deference to your deity&#39;s delicate feelings regarding spelling.</p>
-<p>Many of the others are in dependencies that npm uses, which are not
-necessarily tightly coupled to npm (in the sense that they do not read
-npm&#39;s configuration files, etc.)  Each of these would have to be
-configured to take the name of the <code>node_modules</code> folder as a
-parameter.  Complexity hurdle #2.</p>
-<p>Furthermore, npm has the ability to &quot;bundle&quot; dependencies by adding
-the dep names to the <code>&quot;bundledDependencies&quot;</code> list in package.json,
-which causes the folder to be included in the package tarball.  What
-if the author of a module bundles its dependencies, and they use a
-different spelling for <code>node_modules</code>?  npm would have to rename the
-folder at publish time, and then be smart enough to unpack it using
-your locally configured name.  Complexity hurdle #3.</p>
-<p>Furthermore, what happens when you <em>change</em> this name?  Fine, it&#39;s
-easy enough the first time, just rename the <code>node_modules</code> folders to
-<code>./blergyblerp/</code> or whatever name you choose.  But what about when you
-change it again?  npm doesn&#39;t currently track any state about past
-configuration settings, so this would be rather difficult to do
-properly.  It would have to track every previous value for this
-config, and always accept any of them, or else yesterday&#39;s install may
-be broken tomorrow.  Complexity hurdle #4.</p>
-<p>Never going to happen.  The folder is named <code>node_modules</code>.  It is
-written indelibly in the Node Way, handed down from the ancient times
-of Node 0.3.</p>
-<h2 id="how-do-i-install-node-with-npm-">How do I install node with npm?</h2>
-<p>You don&#39;t.  Try one of these node version managers:</p>
-<p>Unix:</p>
-<ul>
-<li><a href="http://github.com/isaacs/nave">http://github.com/isaacs/nave</a></li>
-<li><a href="http://github.com/visionmedia/n">http://github.com/visionmedia/n</a></li>
-<li><a href="http://github.com/creationix/nvm">http://github.com/creationix/nvm</a></li>
-</ul>
-<p>Windows:</p>
-<ul>
-<li><a href="http://github.com/marcelklehr/nodist">http://github.com/marcelklehr/nodist</a></li>
-<li><a href="https://github.com/coreybutler/nvm-windows">https://github.com/coreybutler/nvm-windows</a></li>
-<li><a href="https://github.com/hakobera/nvmw">https://github.com/hakobera/nvmw</a></li>
-<li><a href="https://github.com/nanjingboy/nvmw">https://github.com/nanjingboy/nvmw</a></li>
-</ul>
-<h2 id="how-can-i-use-npm-for-development-">How can I use npm for development?</h2>
-<p>See <code><a href="../misc/npm-developers.html">npm-developers(7)</a></code> and <code><a href="../files/package.json.html">package.json(5)</a></code>.</p>
-<p>You&#39;ll most likely want to <code>npm link</code> your development folder.  That&#39;s
-awesomely handy.</p>
-<p>To set up your own private registry, check out <code><a href="../misc/npm-registry.html">npm-registry(7)</a></code>.</p>
-<h2 id="can-i-list-a-url-as-a-dependency-">Can I list a url as a dependency?</h2>
-<p>Yes.  It should be a url to a gzipped tarball containing a single folder
-that has a package.json in its root, or a git url.
-(See &quot;what is a package?&quot; above.)</p>
-<h2 id="how-do-i-symlink-to-a-dev-folder-so-i-don-t-have-to-keep-re-installing-">How do I symlink to a dev folder so I don&#39;t have to keep re-installing?</h2>
-<p>See <code><a href="../cli/npm-link.html">npm-link(1)</a></code></p>
-<h2 id="the-package-registry-website-what-is-that-exactly-">The package registry website.  What is that exactly?</h2>
-<p>See <code><a href="../misc/npm-registry.html">npm-registry(7)</a></code>.</p>
-<h2 id="i-forgot-my-password-and-can-t-publish-how-do-i-reset-it-">I forgot my password, and can&#39;t publish.  How do I reset it?</h2>
-<p>Go to <a href="https://npmjs.com/forgot">https://npmjs.com/forgot</a>.</p>
-<h2 id="i-get-econnrefused-a-lot-what-s-up-">I get ECONNREFUSED a lot.  What&#39;s up?</h2>
-<p>Either the registry is down, or node&#39;s DNS isn&#39;t able to reach out.</p>
-<p>To check if the registry is down, open up
-<a href="https://registry.npmjs.org/">https://registry.npmjs.org/</a> in a web browser.  This will also tell
-you if you are just unable to access the internet for some reason.</p>
-<p>If the registry IS down, let us know by emailing <a href="&#x6d;&#97;&#x69;&#108;&#x74;&#111;&#x3a;&#115;&#x75;&#x70;&#x70;&#x6f;&#x72;&#116;&#x40;&#x6e;&#x70;&#109;&#106;&#115;&#x2e;&#99;&#x6f;&#109;">&#115;&#x75;&#x70;&#x70;&#x6f;&#x72;&#116;&#x40;&#x6e;&#x70;&#109;&#106;&#115;&#x2e;&#99;&#x6f;&#109;</a>
-or posting an issue at <a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a>.  If it&#39;s
-down for the world (and not just on your local network) then we&#39;re
-probably already being pinged about it.</p>
-<p>You can also often get a faster response by visiting the #npm channel
-on Freenode IRC.</p>
-<h2 id="why-no-namespaces-">Why no namespaces?</h2>
-<p>npm has only one global namespace.  If you want to namespace your own packages,
-you may: simply use the <code>-</code> character to separate the names or use scoped
-packages.  npm is a mostly anarchic system.  There is not sufficient need to
-impose namespace rules on everyone.</p>
-<p>As of 2.0, npm supports scoped packages, which allow you to publish a group of
-related modules without worrying about name collisions.</p>
-<p>Every npm user owns the scope associated with their username.  For example, the
-user named <code>npm</code> owns the scope <code>@npm</code>.  Scoped packages are published inside a
-scope by naming them as if they were files under the scope directory, e.g., by
-setting <code>name</code> in <code>package.json</code> to <code>@npm/npm</code>.</p>
-<p>Scoped packages are supported by the public npm registry. The npm client is
-backwards-compatible with un-scoped registries, so it can be used to work with
-scoped and un-scoped registries at the same time.</p>
-<p>Unscoped packages can only depend on other unscoped packages. Scoped packages
-can depend on packages from their own scope, a different scope, or the public
-registry (unscoped).</p>
-<p>For the current documentation of scoped packages, see
-<a href="https://docs.npmjs.com/misc/scope">https://docs.npmjs.com/misc/scope</a></p>
-<p>References:</p>
-<ol>
-<li><p>For the reasoning behind the &quot;one global namespace&quot;, please see  this
-discussion: <a href="https://github.com/npm/npm/issues/798">https://github.com/npm/npm/issues/798</a> (TL;DR: It doesn&#39;t
-actually make things better, and can make them worse.)</p>
-</li>
-<li><p>For the pre-implementation discussion of the scoped package feature, see
-this discussion: <a href="https://github.com/npm/npm/issues/5239">https://github.com/npm/npm/issues/5239</a></p>
-</li>
-</ol>
-<h2 id="who-does-npm-">Who does npm?</h2>
-<p>npm was originally written by Isaac Z. Schlueter, and many others have
-contributed to it, some of them quite substantially.</p>
-<p>The npm open source project, The npm Registry, and <a href="https://www.npmjs.com">the community
-website</a> are maintained and operated by the
-good folks at <a href="http://www.npmjs.com">npm, Inc.</a></p>
-<h2 id="i-have-a-question-or-request-not-addressed-here-where-should-i-put-it-">I have a question or request not addressed here. Where should I put it?</h2>
-<p>Post an issue on the github project:</p>
-<ul>
-<li><a href="https://github.com/npm/npm/issues">https://github.com/npm/npm/issues</a></li>
-</ul>
-<h2 id="why-does-npm-hate-me-">Why does npm hate me?</h2>
-<p>npm is not capable of hatred.  It loves everyone, especially you.</p>
-<h2 id="see-also">SEE ALSO</h2>
-<ul>
-<li><a href="../cli/npm.html">npm(1)</a></li>
-<li><a href="../misc/npm-developers.html">npm-developers(7)</a></li>
-<li><a href="../files/package.json.html">package.json(5)</a></li>
-<li><a href="../cli/npm-config.html">npm-config(1)</a></li>
-<li><a href="../misc/npm-config.html">npm-config(7)</a></li>
-<li><a href="../files/npmrc.html">npmrc(5)</a></li>
-<li><a href="../misc/npm-config.html">npm-config(7)</a></li>
-<li><a href="../files/npm-folders.html">npm-folders(5)</a></li>
-</ul>
-
-</div>
-
-<table border=0 cellspacing=0 cellpadding=0 id=npmlogo>
-<tr><td style="width:180px;height:10px;background:rgb(237,127,127)" colspan=18>&nbsp;</td></tr>
-<tr><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td><td style="width:40px;height:10px;background:#fff" colspan=4>&nbsp;</td><td rowspan=4 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td><td colspan=6 style="width:60px;height:10px;background:#fff">&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=4>&nbsp;</td></tr>
-<tr><td colspan=2 style="width:20px;height:30px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=4 colspan=2>&nbsp;</td><td style="width:10px;height:20px;background:rgb(237,127,127)" rowspan=2>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:20px;height:10px;background:#fff" rowspan=3 colspan=2>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:#fff" rowspan=3>&nbsp;</td><td style="width:10px;height:10px;background:rgb(237,127,127)" rowspan=3>&nbsp;</td></tr>
-<tr><td style="width:10px;height:10px;background:#fff" rowspan=2>&nbsp;</td></tr>
-<tr><td style="width:10px;height:10px;background:#fff">&nbsp;</td></tr>
-<tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
-<tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
-</table>
-<p id="footer">npm-faq &mdash; npm@2.14.12</p>
-
index d17e728..17b15ef 100644 (file)
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-index &mdash; npm@2.14.17</p>
+<p id="footer">npm-index &mdash; npm@2.14.18</p>
 
index 9287bbb..454465e 100644 (file)
@@ -86,4 +86,4 @@
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-orgs &mdash; npm@2.14.17</p>
+<p id="footer">npm-orgs &mdash; npm@2.14.18</p>
index 4210f2c..e9f406c 100644 (file)
@@ -70,5 +70,5 @@ effectively implement the entire CouchDB API anyway.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-registry &mdash; npm@2.14.17</p>
+<p id="footer">npm-registry &mdash; npm@2.14.18</p>
 
index e4eef28..44af5ce 100644 (file)
@@ -91,5 +91,5 @@ that registry instead.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-scope &mdash; npm@2.14.17</p>
+<p id="footer">npm-scope &mdash; npm@2.14.18</p>
 
index 4317994..fde5020 100644 (file)
@@ -207,5 +207,5 @@ scripts is for compilation which must be done on the target architecture.</li>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">npm-scripts &mdash; npm@2.14.17</p>
+<p id="footer">npm-scripts &mdash; npm@2.14.18</p>
 
index 941c678..83b243f 100644 (file)
@@ -57,5 +57,5 @@ modules.  To track those down, you can do the following:</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">removing-npm &mdash; npm@2.14.17</p>
+<p id="footer">removing-npm &mdash; npm@2.14.18</p>
 
index a93fbb5..e57f6dd 100644 (file)
@@ -302,5 +302,5 @@ range, use the <code>satisfies(version, range)</code> function.</p>
 <tr><td style="width:60px;height:10px;background:rgb(237,127,127)" colspan=6>&nbsp;</td><td colspan=10 style="width:10px;height:10px;background:rgb(237,127,127)">&nbsp;</td></tr>
 <tr><td colspan=5 style="width:50px;height:10px;background:#fff">&nbsp;</td><td style="width:40px;height:10px;background:rgb(237,127,127)" colspan=4>&nbsp;</td><td style="width:90px;height:10px;background:#fff" colspan=9>&nbsp;</td></tr>
 </table>
-<p id="footer">semver &mdash; npm@2.14.17</p>
+<p id="footer">semver &mdash; npm@2.14.18</p>
 
index b4a4c63..57489f0 100644 (file)
@@ -23,7 +23,7 @@ For example, running \fBnpm ls promzard\fP in npm's source tree will show:
 .P
 .RS 2
 .nf
-npm@2.14.17 /path/to/npm
+npm@2.14.18 /path/to/npm
 └─┬ init\-package\-json@0\.0\.4
   └── promzard@0\.1\.5
 .fi
index 713ebf7..e7276de 100644 (file)
@@ -10,7 +10,7 @@ npm <command> [args]
 .RE
 .SH VERSION
 .P
-2.14.17
+2.14.18
 .SH DESCRIPTION
 .P
 npm is the package manager for the Node JavaScript platform\.  It puts
index 529f105..7a826a9 100644 (file)
@@ -20,7 +20,7 @@ npm\.load([configObject, ]function (er, npm) {
 .RE
 .SH VERSION
 .P
-2.14.17
+2.14.18
 .SH DESCRIPTION
 .P
 This is the API documentation for npm\.
diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7
deleted file mode 100644 (file)
index ad571b0..0000000
+++ /dev/null
@@ -1,429 +0,0 @@
-.TH "NPM\-FAQ" "7" "November 2015" "" ""
-.SH "NAME"
-\fBnpm-faq\fR \- Frequently Asked Questions
-.SH Where can I find these docs in HTML?
-.P
-https://docs\.npmjs\.com/, or run:
-.P
-.RS 2
-.nf
-npm config set viewer browser
-.fi
-.RE
-.P
-to open these documents in your default web browser rather than \fBman\fP\|\.
-.SH It didn't work\.
-.P
-That's not really a question\.
-.SH Why didn't it work?
-.P
-I don't know yet\.
-.P
-Read the error output, and if you can't figure out what it means,
-do what it says and post a bug with all the information it asks for\.
-.SH Where does npm put stuff?
-.P
-See npm help 5 \fBnpm\-folders\fP
-.P
-tl;dr:
-.RS 0
-.IP \(bu 2
-Use the \fBnpm root\fP command to see where modules go, and the \fBnpm bin\fP
-command to see where executables go
-.IP \(bu 2
-Global installs are different from local installs\.  If you install
-something with the \fB\-g\fP flag, then its executables go in \fBnpm bin \-g\fP
-and its modules go in \fBnpm root \-g\fP\|\.
-
-.RE
-.SH How do I install something on my computer in a central location?
-.P
-Install it globally by tacking \fB\-g\fP or \fB\-\-global\fP to the command\.  (This
-is especially important for command line utilities that need to add
-their bins to the global system \fBPATH\fP\|\.)
-.SH I installed something globally, but I can't \fBrequire()\fP it
-.P
-Install it locally\.
-.P
-The global install location is a place for command\-line utilities
-to put their bins in the system \fBPATH\fP\|\.  It's not for use with \fBrequire()\fP\|\.
-.P
-If you \fBrequire()\fP a module in your code, then that means it's a
-dependency, and a part of your program\.  You need to install it locally
-in your program\.
-.SH Why can't npm just put everything in one place, like other package managers?
-.P
-Not every change is an improvement, but every improvement is a change\.
-This would be like asking git to do network IO for every commit\.  It's
-not going to happen, because it's a terrible idea that causes more
-problems than it solves\.
-.P
-It is much harder to avoid dependency conflicts without nesting
-dependencies\.  This is fundamental to the way that npm works, and has
-proven to be an extremely successful approach\.  See npm help 5 \fBnpm\-folders\fP for
-more details\.
-.P
-If you want a package to be installed in one place, and have all your
-programs reference the same copy of it, then use the \fBnpm link\fP command\.
-That's what it's for\.  Install it globally, then link it into each
-program that uses it\.
-.SH Whatever, I really want the old style 'everything global' style\.
-.P
-Write your own package manager\.  You could probably even wrap up \fBnpm\fP
-in a shell script if you really wanted to\.
-.P
-npm will not help you do something that is known to be a bad idea\.
-.SH Should I check my \fBnode_modules\fP folder into git?
-.P
-Usually, no\. Allow npm to resolve dependencies for your packages\.
-.P
-For packages you \fBdeploy\fR, such as websites and apps,
-you should use npm shrinkwrap to lock down your full dependency tree:
-.P
-https://docs\.npmjs\.com/cli/shrinkwrap
-.P
-If you are paranoid about depending on the npm ecosystem,
-you should run a private npm mirror or a private cache\.
-.P
-If you want 100% confidence in being able to reproduce the specific bytes
-included in a deployment, you should use an additional mechanism that can
-verify contents rather than versions\. For example,
-Amazon machine images, DigitalOcean snapshots, Heroku slugs, or simple tarballs\.
-.SH Is it 'npm' or 'NPM' or 'Npm'?
-.P
-npm should never be capitalized unless it is being displayed in a
-location that is customarily all\-caps (such as the title of man pages\.)
-.SH If 'npm' is an acronym, why is it never capitalized?
-.P
-Contrary to the belief of many, "npm" is not in fact an abbreviation for
-"Node Package Manager"\.  It is a recursive bacronymic abbreviation for
-"npm is not an acronym"\.  (If it was "ninaa", then it would be an
-acronym, and thus incorrectly named\.)
-.P
-"NPM", however, \fIis\fR an acronym (more precisely, a capitonym) for the
-National Association of Pastoral Musicians\.  You can learn more
-about them at http://npm\.org/\|\.
-.P
-In software, "NPM" is a Non\-Parametric Mapping utility written by
-Chris Rorden\.  You can analyze pictures of brains with it\.  Learn more
-about the (capitalized) NPM program at http://www\.cabiatl\.com/mricro/npm/\|\.
-.P
-The first seed that eventually grew into this flower was a bash utility
-named "pm", which was a shortened descendent of "pkgmakeinst", a
-bash function that was used to install various different things on different
-platforms, most often using Yahoo's \fByinst\fP\|\.  If \fBnpm\fP was ever an
-acronym for anything, it was \fBnode pm\fP or maybe \fBnew pm\fP\|\.
-.P
-So, in all seriousness, the "npm" project is named after its command\-line
-utility, which was organically selected to be easily typed by a right\-handed
-programmer using a US QWERTY keyboard layout, ending with the
-right\-ring\-finger in a postition to type the \fB\-\fP key for flags and
-other command\-line arguments\.  That command\-line utility is always
-lower\-case, though it starts most sentences it is a part of\.
-.SH How do I list installed packages?
-.P
-\fBnpm ls\fP
-.SH How do I search for packages?
-.P
-\fBnpm search\fP
-.P
-Arguments are greps\.  \fBnpm search jsdom\fP shows jsdom packages\.
-.SH How do I update npm?
-.P
-.RS 2
-.nf
-npm install npm \-g
-.fi
-.RE
-.P
-You can also update all outdated local packages by doing \fBnpm update\fP without
-any arguments, or global packages by doing \fBnpm update \-g\fP\|\.
-.P
-Occasionally, the version of npm will progress such that the current
-version cannot be properly installed with the version that you have
-installed already\.  (Consider, if there is ever a bug in the \fBupdate\fP
-command\.)
-.P
-In those cases, you can do this:
-.P
-.RS 2
-.nf
-curl https://www\.npmjs\.com/install\.sh | sh
-.fi
-.RE
-.SH What is a \fBpackage\fP?
-.P
-A package is:
-.RS 0
-.IP \(bu 2
-a) a folder containing a program described by a package\.json file
-.IP \(bu 2
-b) a gzipped tarball containing (a)
-.IP \(bu 2
-c) a url that resolves to (b)
-.IP \(bu 2
-d) a \fB<name>@<version>\fP that is published on the registry with (c)
-.IP \(bu 2
-e) a \fB<name>@<tag>\fP that points to (d)
-.IP \(bu 2
-f) a \fB<name>\fP that has a "latest" tag satisfying (e)
-.IP \(bu 2
-g) a \fBgit\fP url that, when cloned, results in (a)\.
-
-.RE
-.P
-Even if you never publish your package, you can still get a lot of
-benefits of using npm if you just want to write a node program (a), and
-perhaps if you also want to be able to easily install it elsewhere
-after packing it up into a tarball (b)\.
-.P
-Git urls can be of the form:
-.P
-.RS 2
-.nf
-git://github\.com/user/project\.git#commit\-ish
-git+ssh://user@hostname:project\.git#commit\-ish
-git+http://user@hostname/project/blah\.git#commit\-ish
-git+https://user@hostname/project/blah\.git#commit\-ish
-.fi
-.RE
-.P
-The \fBcommit\-ish\fP can be any tag, sha, or branch which can be supplied as
-an argument to \fBgit checkout\fP\|\.  The default is \fBmaster\fP\|\.
-.SH What is a \fBmodule\fP?
-.P
-A module is anything that can be loaded with \fBrequire()\fP in a Node\.js
-program\.  The following things are all examples of things that can be
-loaded as modules:
-.RS 0
-.IP \(bu 2
-A folder with a \fBpackage\.json\fP file containing a \fBmain\fP field\.
-.IP \(bu 2
-A folder with an \fBindex\.js\fP file in it\.
-.IP \(bu 2
-A JavaScript file\.
-
-.RE
-.P
-Most npm packages are modules, because they are libraries that you
-load with \fBrequire\fP\|\.  However, there's no requirement that an npm
-package be a module!  Some only contain an executable command\-line
-interface, and don't provide a \fBmain\fP field for use in Node programs\.
-.P
-Almost all npm packages (at least, those that are Node programs)
-\fIcontain\fR many modules within them (because every file they load with
-\fBrequire()\fP is a module)\.
-.P
-In the context of a Node program, the \fBmodule\fP is also the thing that
-was loaded \fIfrom\fR a file\.  For example, in the following program:
-.P
-.RS 2
-.nf
-var req = require('request')
-.fi
-.RE
-.P
-we might say that "The variable \fBreq\fP refers to the \fBrequest\fP module"\.
-.SH So, why is it the "\fBnode_modules\fP" folder, but "\fBpackage\.json\fP" file?  Why not \fBnode_packages\fP or \fBmodule\.json\fP?
-.P
-The \fBpackage\.json\fP file defines the package\.  (See "What is a
-package?" above\.)
-.P
-The \fBnode_modules\fP folder is the place Node\.js looks for modules\.
-(See "What is a module?" above\.)
-.P
-For example, if you create a file at \fBnode_modules/foo\.js\fP and then
-had a program that did \fBvar f = require('foo\.js')\fP then it would load
-the module\.  However, \fBfoo\.js\fP is not a "package" in this case,
-because it does not have a package\.json\.
-.P
-Alternatively, if you create a package which does not have an
-\fBindex\.js\fP or a \fB"main"\fP field in the \fBpackage\.json\fP file, then it is
-not a module\.  Even if it's installed in \fBnode_modules\fP, it can't be
-an argument to \fBrequire()\fP\|\.
-.SH \fB"node_modules"\fP is the name of my deity's arch\-rival, and a Forbidden Word in my religion\.  Can I configure npm to use a different folder?
-.P
-No\.  This will never happen\.  This question comes up sometimes,
-because it seems silly from the outside that npm couldn't just be
-configured to put stuff somewhere else, and then npm could load them
-from there\.  It's an arbitrary spelling choice, right?  What's the big
-deal?
-.P
-At the time of this writing, the string \fB\|'node_modules'\fP appears 151
-times in 53 separate files in npm and node core (excluding tests and
-documentation)\.
-.P
-Some of these references are in node's built\-in module loader\.  Since
-npm is not involved \fBat all\fR at run\-time, node itself would have to
-be configured to know where you've decided to stick stuff\.  Complexity
-hurdle #1\.  Since the Node module system is locked, this cannot be
-changed, and is enough to kill this request\.  But I'll continue, in
-deference to your deity's delicate feelings regarding spelling\.
-.P
-Many of the others are in dependencies that npm uses, which are not
-necessarily tightly coupled to npm (in the sense that they do not read
-npm's configuration files, etc\.)  Each of these would have to be
-configured to take the name of the \fBnode_modules\fP folder as a
-parameter\.  Complexity hurdle #2\.
-.P
-Furthermore, npm has the ability to "bundle" dependencies by adding
-the dep names to the \fB"bundledDependencies"\fP list in package\.json,
-which causes the folder to be included in the package tarball\.  What
-if the author of a module bundles its dependencies, and they use a
-different spelling for \fBnode_modules\fP?  npm would have to rename the
-folder at publish time, and then be smart enough to unpack it using
-your locally configured name\.  Complexity hurdle #3\.
-.P
-Furthermore, what happens when you \fIchange\fR this name?  Fine, it's
-easy enough the first time, just rename the \fBnode_modules\fP folders to
-\fB\|\./blergyblerp/\fP or whatever name you choose\.  But what about when you
-change it again?  npm doesn't currently track any state about past
-configuration settings, so this would be rather difficult to do
-properly\.  It would have to track every previous value for this
-config, and always accept any of them, or else yesterday's install may
-be broken tomorrow\.  Complexity hurdle #4\.
-.P
-Never going to happen\.  The folder is named \fBnode_modules\fP\|\.  It is
-written indelibly in the Node Way, handed down from the ancient times
-of Node 0\.3\.
-.SH How do I install node with npm?
-.P
-You don't\.  Try one of these node version managers:
-.P
-Unix:
-.RS 0
-.IP \(bu 2
-http://github\.com/isaacs/nave
-.IP \(bu 2
-http://github\.com/visionmedia/n
-.IP \(bu 2
-http://github\.com/creationix/nvm
-
-.RE
-.P
-Windows:
-.RS 0
-.IP \(bu 2
-http://github\.com/marcelklehr/nodist
-.IP \(bu 2
-https://github\.com/coreybutler/nvm\-windows
-.IP \(bu 2
-https://github\.com/hakobera/nvmw
-.IP \(bu 2
-https://github\.com/nanjingboy/nvmw
-
-.RE
-.SH How can I use npm for development?
-.P
-See npm help 7 \fBnpm\-developers\fP and npm help 5 \fBpackage\.json\fP\|\.
-.P
-You'll most likely want to \fBnpm link\fP your development folder\.  That's
-awesomely handy\.
-.P
-To set up your own private registry, check out npm help 7 \fBnpm\-registry\fP\|\.
-.SH Can I list a url as a dependency?
-.P
-Yes\.  It should be a url to a gzipped tarball containing a single folder
-that has a package\.json in its root, or a git url\.
-(See "what is a package?" above\.)
-.SH How do I symlink to a dev folder so I don't have to keep re\-installing?
-.P
-See npm help \fBnpm\-link\fP
-.SH The package registry website\.  What is that exactly?
-.P
-See npm help 7 \fBnpm\-registry\fP\|\.
-.SH I forgot my password, and can't publish\.  How do I reset it?
-.P
-Go to https://npmjs\.com/forgot\|\.
-.SH I get ECONNREFUSED a lot\.  What's up?
-.P
-Either the registry is down, or node's DNS isn't able to reach out\.
-.P
-To check if the registry is down, open up
-https://registry\.npmjs\.org/ in a web browser\.  This will also tell
-you if you are just unable to access the internet for some reason\.
-.P
-If the registry IS down, let us know by emailing support@npmjs\.com
-or posting an issue at https://github\.com/npm/npm/issues\|\.  If it's
-down for the world (and not just on your local network) then we're
-probably already being pinged about it\.
-.P
-You can also often get a faster response by visiting the #npm channel
-on Freenode IRC\.
-.SH Why no namespaces?
-.P
-npm has only one global namespace\.  If you want to namespace your own packages,
-you may: simply use the \fB\-\fP character to separate the names or use scoped
-packages\.  npm is a mostly anarchic system\.  There is not sufficient need to
-impose namespace rules on everyone\.
-.P
-As of 2\.0, npm supports scoped packages, which allow you to publish a group of
-related modules without worrying about name collisions\.
-.P
-Every npm user owns the scope associated with their username\.  For example, the
-user named \fBnpm\fP owns the scope \fB@npm\fP\|\.  Scoped packages are published inside a
-scope by naming them as if they were files under the scope directory, e\.g\., by
-setting \fBname\fP in \fBpackage\.json\fP to \fB@npm/npm\fP\|\.
-.P
-Scoped packages are supported by the public npm registry\. The npm client is
-backwards\-compatible with un\-scoped registries, so it can be used to work with
-scoped and un\-scoped registries at the same time\.
-.P
-Unscoped packages can only depend on other unscoped packages\. Scoped packages
-can depend on packages from their own scope, a different scope, or the public
-registry (unscoped)\.
-.P
-For the current documentation of scoped packages, see
-https://docs\.npmjs\.com/misc/scope
-.P
-References:
-.RS 0
-.IP 1. 3
-For the reasoning behind the "one global namespace", please see  this
-discussion: https://github\.com/npm/npm/issues/798 (TL;DR: It doesn't
-actually make things better, and can make them worse\.)
-.IP 2. 3
-For the pre\-implementation discussion of the scoped package feature, see
-this discussion: https://github\.com/npm/npm/issues/5239
-
-.RE
-.SH Who does npm?
-.P
-npm was originally written by Isaac Z\. Schlueter, and many others have
-contributed to it, some of them quite substantially\.
-.P
-The npm open source project, The npm Registry, and the community
-website \fIhttps://www\.npmjs\.com\fR are maintained and operated by the
-good folks at npm, Inc\. \fIhttp://www\.npmjs\.com\fR
-.SH I have a question or request not addressed here\. Where should I put it?
-.P
-Post an issue on the github project:
-.RS 0
-.IP \(bu 2
-https://github\.com/npm/npm/issues
-
-.RE
-.SH Why does npm hate me?
-.P
-npm is not capable of hatred\.  It loves everyone, especially you\.
-.SH SEE ALSO
-.RS 0
-.IP \(bu 2
-npm help npm
-.IP \(bu 2
-npm help 7 developers
-.IP \(bu 2
-npm help 5 package\.json
-.IP \(bu 2
-npm help config
-.IP \(bu 2
-npm help 7 config
-.IP \(bu 2
-npm help 5 npmrc
-.IP \(bu 2
-npm help 7 config
-.IP \(bu 2
-npm help 5 folders
-
-.RE
-
index f4a9fe3..aea8aaf 100644 (file)
@@ -1,4 +1,11 @@
 
+0.3.1 / 2016-01-14
+==================
+
+  * add MIT LICENSE file (#23, @kasicka)
+  * preserve chaining after redundant style-method calls (#19, @drewblaisdell)
+  * package: add "license" field (#16, @BenjaminTsai)
+
 0.3.0 / 2014-05-09
 ==================
 
diff --git a/deps/npm/node_modules/ansi/LICENSE b/deps/npm/node_modules/ansi/LICENSE
new file mode 100644 (file)
index 0000000..2ea4dc5
--- /dev/null
@@ -0,0 +1,24 @@
+(The MIT License)
+
+Copyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>
+
+Permission is hereby granted, free of charge, to any person
+obtaining a copy of this software and associated documentation
+files (the "Software"), to deal in the Software without
+restriction, including without limitation the rights to use,
+copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following
+conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+OTHER DEALINGS IN THE SOFTWARE.
index 52fc8ec..b1714e3 100644 (file)
@@ -238,14 +238,14 @@ Object.keys(styles).forEach(function (style) {
     , r = reset[style]
 
   Cursor.prototype[style] = function () {
-    if (this[name]) return
+    if (this[name]) return this
     this.enabled && this.write(prefix + c + suffix)
     this[name] = true
     return this
   }
 
   Cursor.prototype['reset' + name] = function () {
-    if (!this[name]) return
+    if (!this[name]) return this
     this.enabled && this.write(prefix + r + suffix)
     this[name] = false
     return this
index 706ae63..f65863b 100644 (file)
@@ -1,6 +1,7 @@
 {
   "name": "ansi",
   "description": "Advanced ANSI formatting tool for Node.js",
+  "license": "MIT",
   "keywords": [
     "ansi",
     "formatting",
@@ -11,7 +12,7 @@
     "256",
     "stream"
   ],
-  "version": "0.3.0",
+  "version": "0.3.1",
   "author": {
     "name": "Nathan Rajlich",
     "email": "nathan@tootallnate.net",
     "url": "git://github.com/TooTallNate/ansi.js.git"
   },
   "main": "./lib/ansi.js",
+  "gitHead": "4d0d4af94e0bdaa648bd7262acd3bde4b98d5246",
   "bugs": {
     "url": "https://github.com/TooTallNate/ansi.js/issues"
   },
-  "homepage": "https://github.com/TooTallNate/ansi.js",
-  "_id": "ansi@0.3.0",
-  "_shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0",
+  "homepage": "https://github.com/TooTallNate/ansi.js#readme",
+  "_id": "ansi@0.3.1",
+  "scripts": {},
+  "_shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
   "_from": "ansi@latest",
-  "_npmVersion": "1.4.9",
+  "_npmVersion": "3.3.12",
+  "_nodeVersion": "5.3.0",
   "_npmUser": {
     "name": "tootallnate",
     "email": "nathan@tootallnate.net"
     }
   ],
   "dist": {
-    "shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0",
-    "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz"
+    "shasum": "0c42d4fb17160d5a9af1e484bace1c66922c1b21",
+    "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz",
+  "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.1.tgz",
   "readme": "ERROR: No README data found!"
 }
index 42b2089..334d550 100644 (file)
@@ -145,6 +145,8 @@ module.exports = function (items) {
     column.width = items.map(function (item) {
       return item[columnName];
     }).reduce(function (min, cur) {
+      // if already at maxWidth don't bother testing
+      if (min >= column.maxWidth) return min;
       return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))));
     }, 0);
   });
@@ -181,9 +183,11 @@ module.exports = function (items) {
     var column = columns[columnName];
     column.width = items.map(function (item) {
       return item[columnName].reduce(function (min, cur) {
+        if (min >= column.maxWidth) return min;
         return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))));
       }, 0);
     }).reduce(function (min, cur) {
+      if (min >= column.maxWidth) return min;
       return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur)));
     }, 0);
   });
@@ -217,7 +221,7 @@ function createRows(items, columns, columnNames, paddingChr) {
     });
     // combine matching lines of each rows
 
-    var _loop = function (i) {
+    var _loop = function _loop(i) {
       row[i] = row[i] || [];
       columnNames.forEach(function (columnName) {
         var column = columns[columnName];
@@ -240,12 +244,15 @@ function createRows(items, columns, columnNames, paddingChr) {
  */
 
 function mixin() {
-  if (Object.assign) return Object.assign.apply(Object, arguments);
+  var _Object;
+
+  if (Object.assign) return (_Object = Object).assign.apply(_Object, arguments);
   return ObjectAssign.apply(undefined, arguments);
 }
 
 function ObjectAssign(target, firstSource) {
   "use strict";
+
   if (target === undefined || target === null) throw new TypeError("Cannot convert first argument to object");
 
   var to = Object(target);
index 227b41e..221269b 100644 (file)
@@ -135,6 +135,8 @@ module.exports = function(items, options = {}) {
     column.width = items
     .map(item => item[columnName])
     .reduce((min, cur) => {
+      // if already at maxWidth don't bother testing
+      if (min >= column.maxWidth) return min
       return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))))
     }, 0)
   })
@@ -171,9 +173,11 @@ module.exports = function(items, options = {}) {
     let column = columns[columnName]
     column.width = items.map(item => {
       return item[columnName].reduce((min, cur) => {
+        if (min >= column.maxWidth) return min
         return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur))))
       }, 0)
     }).reduce((min, cur) => {
+      if (min >= column.maxWidth) return min
       return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur)))
     }, 0)
   })
index fc808cc..cc3c87b 100644 (file)
@@ -1,4 +1,4 @@
-Copyright © 2011-2014 Paul Vorbach <paul@vorba.ch>
+Copyright © 2011-2015 Paul Vorbach <paul@vorba.ch>
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of
 this software and associated documentation files (the “Software”), to deal in
index d7231cf..0b6ceca 100644 (file)
@@ -2,16 +2,16 @@
 
 [![build status](https://secure.travis-ci.org/pvorb/node-clone.png)](http://travis-ci.org/pvorb/node-clone)
 
-offers foolproof _deep cloning_ of variables in JavaScript.
+[![info badge](https://nodei.co/npm/clone.png?downloads=true&downloadRank=true&stars=true)](http://npm-stat.com/charts.html?package=clone)
+
+offers foolproof _deep cloning_ of objects, arrays, numbers, strings etc. in JavaScript.
 
 
 ## Installation
 
     npm install clone
 
-or
-
-    ender build clone
+(It also works with browserify, ender or standalone.)
 
 
 ## Example
@@ -105,7 +105,7 @@ github](https://github.com/pvorb/node-clone/issues) or send me an email to
 
 ## License
 
-Copyright © 2011-2014 [Paul Vorbach](http://paul.vorba.ch/) and
+Copyright © 2011-2015 [Paul Vorbach](http://paul.vorba.ch/) and
 [contributors](https://github.com/pvorb/node-clone/graphs/contributors).
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of
index f8fa315..6263759 100644 (file)
@@ -1,34 +1,6 @@
+var clone = (function() {
 'use strict';
 
-function objectToString(o) {
-  return Object.prototype.toString.call(o);
-}
-
-// shim for Node's 'util' package
-// DO NOT REMOVE THIS! It is required for compatibility with EnderJS (http://enderjs.com/).
-var util = {
-  isArray: function (ar) {
-    return Array.isArray(ar) || (typeof ar === 'object' && objectToString(ar) === '[object Array]');
-  },
-  isDate: function (d) {
-    return typeof d === 'object' && objectToString(d) === '[object Date]';
-  },
-  isRegExp: function (re) {
-    return typeof re === 'object' && objectToString(re) === '[object RegExp]';
-  },
-  getRegExpFlags: function (re) {
-    var flags = '';
-    re.global && (flags += 'g');
-    re.ignoreCase && (flags += 'i');
-    re.multiline && (flags += 'm');
-    return flags;
-  }
-};
-
-
-if (typeof module === 'object')
-  module.exports = clone;
-
 /**
  * Clones (copies) an Object using deep copying.
  *
@@ -47,8 +19,14 @@ if (typeof module === 'object')
  * @param `prototype` - sets the prototype to be used when cloning an object.
  *    (optional - defaults to parent prototype).
 */
-
 function clone(parent, circular, depth, prototype) {
+  var filter;
+  if (typeof circular === 'object') {
+    depth = circular.depth;
+    prototype = circular.prototype;
+    filter = circular.filter;
+    circular = circular.circular
+  }
   // maintain two arrays for circular references, where corresponding parents
   // and children have the same index
   var allParents = [];
@@ -77,12 +55,12 @@ function clone(parent, circular, depth, prototype) {
       return parent;
     }
 
-    if (util.isArray(parent)) {
+    if (clone.__isArray(parent)) {
       child = [];
-    } else if (util.isRegExp(parent)) {
-      child = new RegExp(parent.source, util.getRegExpFlags(parent));
+    } else if (clone.__isRegExp(parent)) {
+      child = new RegExp(parent.source, __getRegExpFlags(parent));
       if (parent.lastIndex) child.lastIndex = parent.lastIndex;
-    } else if (util.isDate(parent)) {
+    } else if (clone.__isDate(parent)) {
       child = new Date(parent.getTime());
     } else if (useBuffer && Buffer.isBuffer(parent)) {
       child = new Buffer(parent.length);
@@ -114,7 +92,7 @@ function clone(parent, circular, depth, prototype) {
       if (proto) {
         attrs = Object.getOwnPropertyDescriptor(proto, i);
       }
-      
+
       if (attrs && attrs.set == null) {
         continue;
       }
@@ -134,7 +112,7 @@ function clone(parent, circular, depth, prototype) {
  * USE WITH CAUTION! This may not behave as you wish if you do not know how this
  * works.
  */
-clone.clonePrototype = function(parent) {
+clone.clonePrototype = function clonePrototype(parent) {
   if (parent === null)
     return null;
 
@@ -142,3 +120,41 @@ clone.clonePrototype = function(parent) {
   c.prototype = parent;
   return new c();
 };
+
+// private utility functions
+
+function __objToStr(o) {
+  return Object.prototype.toString.call(o);
+};
+clone.__objToStr = __objToStr;
+
+function __isDate(o) {
+  return typeof o === 'object' && __objToStr(o) === '[object Date]';
+};
+clone.__isDate = __isDate;
+
+function __isArray(o) {
+  return typeof o === 'object' && __objToStr(o) === '[object Array]';
+};
+clone.__isArray = __isArray;
+
+function __isRegExp(o) {
+  return typeof o === 'object' && __objToStr(o) === '[object RegExp]';
+};
+clone.__isRegExp = __isRegExp;
+
+function __getRegExpFlags(re) {
+  var flags = '';
+  if (re.global) flags += 'g';
+  if (re.ignoreCase) flags += 'i';
+  if (re.multiline) flags += 'm';
+  return flags;
+};
+clone.__getRegExpFlags = __getRegExpFlags;
+
+return clone;
+})();
+
+if (typeof module === 'object' && module.exports) {
+  module.exports = clone;
+}
index bc8e878..84d16fb 100644 (file)
@@ -8,7 +8,7 @@
     "function",
     "date"
   ],
-  "version": "0.1.19",
+  "version": "1.0.2",
   "repository": {
     "type": "git",
     "url": "git://github.com/pvorb/node-clone.git"
       "name": "Róbert Oroszi",
       "email": "robert+gh@oroszi.net",
       "url": "https://github.com/oroce"
+    },
+    {
+      "name": "Aurélio A. Heckert",
+      "url": "http://softwarelivre.org/aurium"
+    },
+    {
+      "name": "Guy Ellis",
+      "url": "http://www.guyellisrocks.com/"
     }
   ],
   "license": "MIT",
   "engines": {
-    "node": "*"
+    "node": ">=0.8"
   },
   "dependencies": {},
   "devDependencies": {
-    "underscore": "*",
-    "nodeunit": "*"
+    "nodeunit": "~0.9.0"
   },
   "optionalDependencies": {},
   "scripts": {
     "test": "nodeunit test.js"
   },
-  "gitHead": "bb11a43363a0f69e8ac014cb5376ce215ea1f8fd",
+  "gitHead": "0e8216efc672496b612fd7ab62159117d16ec4a0",
   "homepage": "https://github.com/pvorb/node-clone",
-  "_id": "clone@0.1.19",
-  "_shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85",
-  "_from": "clone@>=0.1.5 <0.2.0",
+  "_id": "clone@1.0.2",
+  "_shasum": "260b7a99ebb1edfe247538175f783243cb19d149",
+  "_from": "clone@>=1.0.2 <2.0.0",
   "_npmVersion": "1.4.14",
   "_npmUser": {
     "name": "pvorb",
     }
   ],
   "dist": {
-    "shasum": "613fb68639b26a494ac53253e15b1a6bd88ada85",
-    "tarball": "http://registry.npmjs.org/clone/-/clone-0.1.19.tgz"
+    "shasum": "260b7a99ebb1edfe247538175f783243cb19d149",
+    "tarball": "http://registry.npmjs.org/clone/-/clone-1.0.2.tgz"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/clone/-/clone-0.1.19.tgz"
+  "_resolved": "https://registry.npmjs.org/clone/-/clone-1.0.2.tgz",
+  "readme": "ERROR: No README data found!"
 }
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test-apart-ctx.html
new file mode 100644 (file)
index 0000000..4d532bb
--- /dev/null
@@ -0,0 +1,22 @@
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Clone Test-Suite (Browser)</title>
+  </head>
+  <body>
+    <script>
+      var data = document.location.search.substr(1).split('&');
+      try {
+        ctx = parent[data[0]];
+        eval(decodeURIComponent(data[1]));
+        window.results = results;
+      } catch(e) {
+        var extra = '';
+        if (e.name == 'SecurityError')
+          extra = 'This test suite needs to be run on an http server.';
+        alert('Apart Context iFrame Error\n' + e + '\n\n' + extra);
+        throw e;
+      }
+    </script>
+  </body>
+</html>
diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html b/deps/npm/node_modules/columnify/node_modules/wcwidth/node_modules/defaults/node_modules/clone/test.html
new file mode 100644 (file)
index 0000000..a955702
--- /dev/null
@@ -0,0 +1,148 @@
+<!doctype html>
+<html>
+  <head>
+    <meta charset="utf-8">
+    <title>Clone Test-Suite (Browser)</title>
+    <script>
+      var module = {};
+      var tests = exports = module.exports = {};
+
+      function require(moduleName) {
+        if (moduleName == './') {
+          return clone;
+        }
+      }
+
+      function log(str) {
+        logList.innerHTML += '<li>' + str + '</li>';
+      }
+    </script>
+    <script src="clone.js"></script>
+    <script src="test.js"></script>
+  </head>
+  <body>
+    <h1 id="nodeunit-header">Clone Test-Suite (Browser)</h1>
+    Tests started: <span id="testsStarted"></span>;
+    Tests finished: <span id="testsFinished"></span>.
+    <ul id="logList"></ul>
+    <script>
+      /* Methods copied from
+       * https://github.com/caolan/nodeunit/blob/master/lib/assert.js
+       */
+      function isUndefinedOrNull(value) {
+        return value === null || value === undefined;
+      }
+
+      function isArguments(object) {
+        return Object.prototype.toString.call(object) == '[object Arguments]';
+      }
+
+      var _keys = function (obj){
+        if (Object.keys) return Object.keys(obj);
+        if (typeof obj != 'object' && typeof obj != 'function') {
+          throw new TypeError('-');
+        }
+        var keys = [];
+        for(var k in obj) if(obj.hasOwnProperty(k)) keys.push(k);
+        return keys;
+      };
+
+      function objEquiv(a, b) {
+        if (isUndefinedOrNull(a) || isUndefinedOrNull(b))
+          return false;
+
+        if (a.prototype !== b.prototype)
+          return false;
+
+        if (isArguments(a)) {
+          if (!isArguments(b)) return false;
+          a = pSlice.call(a);
+          b = pSlice.call(b);
+          return _deepEqual(a, b);
+        }
+
+        try {
+          var ka = _keys(a), kb = _keys(b), key, i;
+        } catch (e) {
+          return false
+        }
+
+        if (ka.length != kb.length)
+          return false;
+
+        ka.sort();
+        kb.sort();
+
+        for (i = ka.length - 1; i >= 0; i--) {
+          if (ka[i] != kb[i]) return false;
+        }
+
+        for (i = ka.length - 1; i >= 0; i--) {
+          key = ka[i];
+          if (!_deepEqual(a[key], b[key] ))
+            return false;
+        }
+
+        return true;
+      }
+      function _deepEqual(actual, expected) {
+        if (actual === expected) {
+          return true;
+        } else if (actual instanceof Date && expected instanceof Date) {
+          return actual.getTime() === expected.getTime();
+        } else if (actual instanceof RegExp && expected instanceof RegExp) {
+          return actual.source === expected.source &&
+              actual.global === expected.global &&
+              actual.ignoreCase === expected.ignoreCase &&
+              actual.multiline === expected.multiline;
+        } else if (typeof actual != 'object' && typeof expected != 'object') {
+          return actual == expected;
+        } else {
+          return objEquiv(actual, expected);
+        }
+      }
+
+      for (var testName in tests) {
+        setTimeout((function (testName) {
+          try {
+            testsStarted.innerHTML = (parseInt(testsStarted.innerHTML) || 0) + 1;
+            function incFinished() {
+              testsFinished.innerHTML = (parseInt(testsFinished.innerHTML) || 0) + 1;
+            }
+
+            tests[testName]({
+              expect: function (num) {
+                this._expect = num
+              },
+              ok: function (val) {
+                if(!val) throw new Error(val + ' is not ok.')
+              },
+              equal: function (a,b) {
+                if (a != b) throw new Error(a + ' is not equal to ' + b)
+              },
+              notEqual: function (a,b) {
+                if (a == b) throw new Error(a + ' is equal to ' + b)
+              },
+              strictEqual: function (a,b) {
+                if (a !== b) throw new Error(a + ' is not strict equal to ' + b)
+              },
+              deepEqual: function (a,b) {
+                if (!_deepEqual(a,b))
+                  throw new Error(JSON.stringify(a) + ' is not deep equal to ' +
+                                  JSON.stringify(b))
+              },
+              done: function () {
+                log(testName + ' <span style="color:blue">is ok</span>.');
+                incFinished();
+              }
+            });
+          } catch(e) {
+            log(testName + ' <span style="color:red">FAIL.</span> <small>'+ e +'</small>');
+            incFinished();
+            console.log(e);
+          }
+        })(testName), 1);
+      }
+    </script>
+  </body>
+</html>
index cb3d166..e8b65b3 100644 (file)
@@ -1,16 +1,50 @@
-if(module.parent === null) {
-  console.log('Run this test file with nodeunit:');
-  console.log('$ nodeunit test.js');
-}
+var clone = require('./');
 
+function inspect(obj) {
+  seen = [];
+  return JSON.stringify(obj, function (key, val) {
+    if (val != null && typeof val == "object") {
+      if (seen.indexOf(val) >= 0) {
+        return '[cyclic]';
+      }
 
-var clone = require('./');
-var util = require('util');
-var _ = require('underscore');
+      seen.push(val);
+    }
 
+    return val;
+  });
+}
+
+// Creates a new VM in node, or an iframe in a browser in order to run the
+// script
+function apartContext(context, script, callback) {
+  var vm = require('vm');
 
+  if (vm) {
+    var ctx = vm.createContext({ ctx: context });
+    callback(vm.runInContext(script, ctx));
+  } else if (document && document.createElement) {
+    var iframe = document.createElement('iframe');
+    iframe.style.display = 'none';
+    document.body.appendChild(iframe);
+
+    var myCtxId = 'tmpCtx' + Math.random();
+
+    window[myCtxId] = context;
+    iframe.src = 'test-apart-ctx.html?' + myCtxId + '&' + encodeURIComponent(script);
+    iframe.onload = function() {
+      try {
+        callback(iframe.contentWindow.results);
+      } catch (e) {
+        throw e;
+      }
+    };
+  } else {
+    console.log('WARNING: cannot create an apart context.');
+  }
+}
 
-exports["clone string"] = function(test) {
+exports["clone string"] = function (test) {
   test.expect(2); // how many tests?
 
   var a = "foo";
@@ -21,9 +55,7 @@ exports["clone string"] = function(test) {
   test.done();
 };
 
-
-
-exports["clone number"] = function(test) {
+exports["clone number"] = function (test) {
   test.expect(5); // how many tests?
 
   var a = 0;
@@ -40,37 +72,30 @@ exports["clone number"] = function(test) {
   test.done();
 };
 
-
-
-exports["clone date"] = function(test) {
+exports["clone date"] = function (test) {
   test.expect(3); // how many tests?
 
   var a = new Date;
   var c = clone(a);
-  test.ok(a instanceof Date);
-  test.ok(c instanceof Date);
-  test.equal(c.getTime(), a.getTime());
+  test.ok(!!a.getUTCDate && !!a.toUTCString);
+  test.ok(!!c.getUTCDate && !!c.toUTCString);
+  test.equal(a.getTime(), c.getTime());
 
   test.done();
 };
 
-
-
-exports["clone object"] = function(test) {
-  test.expect(2); // how many tests?
+exports["clone object"] = function (test) {
+  test.expect(1); // how many tests?
 
   var a = { foo: { bar: "baz" } };
   var b = clone(a);
 
-  test.ok(_(a).isEqual(b), "underscore equal");
   test.deepEqual(b, a);
 
   test.done();
 };
 
-
-
-exports["clone array"] = function(test) {
+exports["clone array"] = function (test) {
   test.expect(2); // how many tests?
 
   var a = [
@@ -79,13 +104,17 @@ exports["clone array"] = function(test) {
   ];
   var b = clone(a);
 
-  test.ok(_(a).isEqual(b), "underscore equal");
+  test.ok(b instanceof Array);
   test.deepEqual(b, a);
 
   test.done();
 };
 
-exports["clone buffer"] = function(test) {
+exports["clone buffer"] = function (test) {
+  if (typeof Buffer == 'undefined') {
+    return test.done();
+  }
+
   test.expect(1);
 
   var a = new Buffer("this is a test buffer");
@@ -96,14 +125,11 @@ exports["clone buffer"] = function(test) {
   test.done();
 };
 
-
-
-exports["clone regexp"] = function(test) {
+exports["clone regexp"] = function (test) {
   test.expect(5);
 
   var a = /abc123/gi;
   var b = clone(a);
-
   test.deepEqual(b, a);
 
   var c = /a/g;
@@ -119,63 +145,54 @@ exports["clone regexp"] = function(test) {
   test.done();
 };
 
-
-exports["clone object containing array"] = function(test) {
-  test.expect(2); // how many tests?
+exports["clone object containing array"] = function (test) {
+  test.expect(1); // how many tests?
 
   var a = {
     arr1: [ { a: '1234', b: '2345' } ],
     arr2: [ { c: '345', d: '456' } ]
   };
+
   var b = clone(a);
 
-  test.ok(_(a).isEqual(b), "underscore equal");
   test.deepEqual(b, a);
 
   test.done();
 };
 
-
-
-exports["clone object with circular reference"] = function(test) {
+exports["clone object with circular reference"] = function (test) {
   test.expect(8); // how many tests?
 
-  var _ = test.ok;
-  var c = [1, "foo", {'hello': 'bar'}, function() {}, false, [2]];
+  var c = [1, "foo", {'hello': 'bar'}, function () {}, false, [2]];
   var b = [c, 2, 3, 4];
+
   var a = {'b': b, 'c': c};
   a.loop = a;
   a.loop2 = a;
   c.loop = c;
   c.aloop = a;
+
   var aCopy = clone(a);
-  _(a != aCopy);
-  _(a.c != aCopy.c);
-  _(aCopy.c == aCopy.b[0]);
-  _(aCopy.c.loop.loop.aloop == aCopy);
-  _(aCopy.c[0] == a.c[0]);
-
-  //console.log(util.inspect(aCopy, true, null) );
-  //console.log("------------------------------------------------------------");
-  //console.log(util.inspect(a, true, null) );
-  _(eq(a, aCopy));
+  test.ok(a != aCopy);
+  test.ok(a.c != aCopy.c);
+  test.ok(aCopy.c == aCopy.b[0]);
+  test.ok(aCopy.c.loop.loop.aloop == aCopy);
+  test.ok(aCopy.c[0] == a.c[0]);
+
+  test.ok(eq(a, aCopy));
   aCopy.c[0] = 2;
-  _(!eq(a, aCopy));
+  test.ok(!eq(a, aCopy));
   aCopy.c = "2";
-  _(!eq(a, aCopy));
-  //console.log("------------------------------------------------------------");
-  //console.log(util.inspect(aCopy, true, null) );
+  test.ok(!eq(a, aCopy));
 
   function eq(x, y) {
-    return util.inspect(x, true, null) === util.inspect(y, true, null);
+    return inspect(x) === inspect(y);
   }
 
   test.done();
 };
 
-
-
-exports['clonePrototype'] = function(test) {
+exports['clone prototype'] = function (test) {
   test.expect(3); // how many tests?
 
   var a = {
@@ -190,34 +207,38 @@ exports['clonePrototype'] = function(test) {
   test.strictEqual(b.y, a.y);
 
   test.done();
-}
+};
 
-exports['cloneWithinNewVMContext'] = function(test) {
-  test.expect(3);
-  var vm = require('vm');
-  var ctx = vm.createContext({ clone: clone });
-  var script = "clone( {array: [1, 2, 3], date: new Date(), regex: /^foo$/ig} );";
-  var results = vm.runInContext(script, ctx);
-  test.ok(results.array instanceof Array);
-  test.ok(results.date instanceof Date);
-  test.ok(results.regex instanceof RegExp);
-  test.done();
-}
+exports['clone within an apart context'] = function (test) {
+  var results = apartContext({ clone: clone },
+      "results = ctx.clone({ a: [1, 2, 3], d: new Date(), r: /^foo$/ig })",
+      function (results) {
+    test.ok(results.a.constructor.toString() === Array.toString());
+    test.ok(results.d.constructor.toString() === Date.toString());
+    test.ok(results.r.constructor.toString() === RegExp.toString());
+    test.done();
+  });
+};
 
-exports['cloneObjectWithNoConstructor'] = function(test) {
+exports['clone object with no constructor'] = function (test) {
   test.expect(3);
+
   var n = null;
+
   var a = { foo: 'bar' };
   a.__proto__ = n;
   test.ok(typeof a === 'object');
   test.ok(typeof a !== null);
+
   var b = clone(a);
   test.ok(a.foo, b.foo);
+
   test.done();
-}
+};
 
 exports['clone object with depth argument'] = function (test) {
   test.expect(6);
+
   var a = {
     foo: {
       bar : {
@@ -225,6 +246,7 @@ exports['clone object with depth argument'] = function (test) {
       }
     }
   };
+
   var b = clone(a, false, 1);
   test.deepEqual(b, a);
   test.notEqual(b, a);
@@ -234,28 +256,35 @@ exports['clone object with depth argument'] = function (test) {
   test.deepEqual(b, a);
   test.notEqual(b.foo, a.foo);
   test.strictEqual(b.foo.bar, a.foo.bar);
+
   test.done();
-}
+};
 
 exports['maintain prototype chain in clones'] = function (test) {
   test.expect(1);
-  function Constructor() {}
-  var a = new Constructor();
+
+  function T() {}
+
+  var a = new T();
   var b = clone(a);
   test.strictEqual(Object.getPrototypeOf(a), Object.getPrototypeOf(b));
+
   test.done();
-}
+};
 
 exports['parent prototype is overriden with prototype provided'] = function (test) {
   test.expect(1);
-  function Constructor() {}
-  var a = new Constructor();
+
+  function T() {}
+
+  var a = new T();
   var b = clone(a, true, Infinity, null);
   test.strictEqual(b.__defineSetter__, undefined);
+
   test.done();
-}
+};
 
-exports['clone object with null children'] = function(test) {
+exports['clone object with null children'] = function (test) {
   test.expect(1);
   var a = {
     foo: {
@@ -265,12 +294,14 @@ exports['clone object with null children'] = function(test) {
       }
     }
   };
+
   var b = clone(a);
+
   test.deepEqual(b, a);
   test.done();
-}
+};
 
-exports['clone instance with getter'] = function(test) {
+exports['clone instance with getter'] = function (test) {
   test.expect(1);
   function Ctor() {};
   Object.defineProperty(Ctor.prototype, 'prop', {
@@ -286,4 +317,56 @@ exports['clone instance with getter'] = function(test) {
 
   test.strictEqual(b.prop, 'value');
   test.done();
-};
\ No newline at end of file
+};
+
+exports['get RegExp flags'] = function (test) {
+  test.strictEqual(clone.__getRegExpFlags(/a/),   ''  );
+  test.strictEqual(clone.__getRegExpFlags(/a/i),  'i' );
+  test.strictEqual(clone.__getRegExpFlags(/a/g),  'g' );
+  test.strictEqual(clone.__getRegExpFlags(/a/gi), 'gi');
+  test.strictEqual(clone.__getRegExpFlags(/a/m),  'm' );
+
+  test.done();
+};
+
+exports["recognize Array object"] = function (test) {
+  var results = apartContext(null, "results = [1, 2, 3]", function(alien) {
+    var local = [4, 5, 6];
+    test.ok(clone.__isArray(alien)); // recognize in other context.
+    test.ok(clone.__isArray(local)); // recognize in local context.
+    test.ok(!clone.__isDate(alien));
+    test.ok(!clone.__isDate(local));
+    test.ok(!clone.__isRegExp(alien));
+    test.ok(!clone.__isRegExp(local));
+    test.done();
+  });
+};
+
+exports["recognize Date object"] = function (test) {
+  var results = apartContext(null, "results = new Date()", function(alien) {
+    var local = new Date();
+
+    test.ok(clone.__isDate(alien)); // recognize in other context.
+    test.ok(clone.__isDate(local)); // recognize in local context.
+    test.ok(!clone.__isArray(alien));
+    test.ok(!clone.__isArray(local));
+    test.ok(!clone.__isRegExp(alien));
+    test.ok(!clone.__isRegExp(local));
+
+    test.done();
+  });
+};
+
+exports["recognize RegExp object"] = function (test) {
+  var results = apartContext(null, "results = /foo/", function(alien) {
+    var local = /bar/;
+
+    test.ok(clone.__isRegExp(alien)); // recognize in other context.
+    test.ok(clone.__isRegExp(local)); // recognize in local context.
+    test.ok(!clone.__isArray(alien));
+    test.ok(!clone.__isArray(local));
+    test.ok(!clone.__isDate(alien));
+    test.ok(!clone.__isDate(local));
+    test.done();
+  });
+};
index fdd074d..8ad5116 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "defaults",
-  "version": "1.0.2",
+  "version": "1.0.3",
   "description": "merge single level defaults over a config object",
   "main": "index.js",
   "scripts": {
   },
   "license": "MIT",
   "dependencies": {
-    "clone": "~0.1.5"
+    "clone": "^1.0.2"
   },
   "devDependencies": {
-    "tap": "~0.4.0"
+    "tap": "^2.0.0"
   },
-  "gitHead": "22c57d1f87a2f03c1f9d21bd39c67db8553a0064",
+  "gitHead": "8831ec32a5f999bfae1a8c9bf32880971ed7c6f2",
   "bugs": {
     "url": "https://github.com/tmpvar/defaults/issues"
   },
-  "homepage": "https://github.com/tmpvar/defaults",
-  "_id": "defaults@1.0.2",
-  "_shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a",
+  "homepage": "https://github.com/tmpvar/defaults#readme",
+  "_id": "defaults@1.0.3",
+  "_shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d",
   "_from": "defaults@>=1.0.0 <2.0.0",
-  "_npmVersion": "1.4.23",
+  "_npmVersion": "2.14.4",
+  "_nodeVersion": "4.1.1",
   "_npmUser": {
     "name": "tmpvar",
     "email": "tmpvar@gmail.com"
   },
+  "dist": {
+    "shasum": "c656051e9817d9ff08ed881477f3fe4019f3ef7d",
+    "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz"
+  },
   "maintainers": [
     {
       "name": "tmpvar",
       "email": "tmpvar@gmail.com"
     }
   ],
-  "dist": {
-    "shasum": "6902e25aa047649a501e19ef9e98f3e8365c109a",
-    "tarball": "http://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz"
-  },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.2.tgz"
+  "_resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 1dc8039..b4c3738 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "columnify",
-  "version": "1.5.2",
+  "version": "1.5.4",
   "description": "Render data in text columns. Supports in-column text-wrap.",
   "main": "columnify.js",
   "scripts": {
@@ -9,15 +9,22 @@
     "bench": "npm test && node bench",
     "prepublish": "make prepublish"
   },
+  "babel": {
+    "presets": [
+      "es2015"
+    ]
+  },
   "author": {
     "name": "Tim Oxley"
   },
   "license": "MIT",
   "devDependencies": {
-    "babel": "^5.8.21",
-    "chalk": "^1.1.0",
-    "tap-spec": "^4.0.2",
-    "tape": "^4.0.3"
+    "babel": "^6.3.26",
+    "babel-cli": "^6.3.17",
+    "babel-preset-es2015": "^6.3.13",
+    "chalk": "^1.1.1",
+    "tap-spec": "^4.1.1",
+    "tape": "^4.4.0"
   },
   "repository": {
     "type": "git",
   "directories": {
     "test": "test"
   },
-  "gitHead": "e7417b78091844ff2f3ba62551a4817c7ae217bd",
-  "_id": "columnify@1.5.2",
-  "_shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a",
-  "_from": "columnify@1.5.2",
-  "_npmVersion": "2.9.0",
-  "_nodeVersion": "2.0.1",
+  "gitHead": "b5373b3d6344bf59e1ab63c912c188c34bce5889",
+  "_id": "columnify@1.5.4",
+  "_shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb",
+  "_from": "columnify@latest",
+  "_npmVersion": "2.14.7",
+  "_nodeVersion": "4.2.3",
   "_npmUser": {
     "name": "timoxley",
     "email": "secoif@gmail.com"
@@ -60,8 +67,8 @@
     }
   ],
   "dist": {
-    "shasum": "6937930d47c22a9bfa20732a7fd619d47eaba65a",
-    "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz"
+    "shasum": "4737ddf1c7b69a8a7c340570782e947eec8e78bb",
+    "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz"
   },
-  "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.2.tgz"
+  "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.5.4.tgz"
 }
index 30682af..df3e6cc 100644 (file)
@@ -108,33 +108,46 @@ function splitIntoLines(str, max) {
  * @return String
  */
 
-function splitLongWords(str, max, truncationChar, result) {
+function splitLongWords(str, max, truncationChar) {
   str = str.trim()
-  result = result || []
-  if (!str) return result.join(' ') || ''
+  var result = []
   var words = str.split(' ')
-  var word = words.shift() || str
-  if (wcwidth(word) > max) {
-    // slice is based on length no wcwidth
-    var i = 0
-    var wwidth = 0
-    var limit = max - wcwidth(truncationChar)
-    while (i < word.length) {
-      var w = wcwidth(word.charAt(i))
-      if(w + wwidth > limit)
-        break
-      wwidth += w
-      ++i
+  var remainder = ''
+
+  var truncationWidth = wcwidth(truncationChar)
+
+  while (remainder || words.length) {
+    if (remainder) {
+      var word = remainder
+      remainder = ''
+    } else {
+      var word = words.shift()
     }
 
-    var remainder = word.slice(i) // get remainder
-    words.unshift(remainder) // save remainder for next loop
+    if (wcwidth(word) > max) {
+      // slice is based on length no wcwidth
+      var i = 0
+      var wwidth = 0
+      var limit = max - truncationWidth
+      while (i < word.length) {
+        var w = wcwidth(word.charAt(i))
+        if (w + wwidth > limit) {
+          break
+        }
+        wwidth += w
+        ++i
+      }
+
+      remainder = word.slice(i) // get remainder
+      // save remainder for next loop
 
-    word = word.slice(0, i) // grab truncated word
-    word += truncationChar // add trailing … or whatever
+      word = word.slice(0, i) // grab truncated word
+      word += truncationChar // add trailing … or whatever
+    }
+    result.push(word)
   }
-  result.push(word)
-  return splitLongWords(words.join(' '), max, truncationChar, result)
+
+  return result.join(' ')
 }
 
 
index 458621a..699311e 100644 (file)
@@ -44,5 +44,6 @@
     }
   ],
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz"
+  "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz",
+  "readme": "ERROR: No README data found!"
 }
index b25913c..ecbf8f6 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "config-chain",
-  "version": "1.1.9",
+  "version": "1.1.10",
   "licenses": [
     {
       "type": "MIT",
   "homepage": "http://github.com/dominictarr/config-chain",
   "repository": {
     "type": "git",
-    "url": "https://github.com/dominictarr/config-chain.git"
+    "url": "git+https://github.com/dominictarr/config-chain.git"
   },
   "dependencies": {
     "proto-list": "~1.2.1",
-    "ini": "1"
+    "ini": "^1.3.4"
   },
   "devDependencies": {
     "tap": "0.3.0"
   "scripts": {
     "test": "tap test/"
   },
-  "gitHead": "832609897082a0a887c59dadb105f4db6de1ab4c",
+  "gitHead": "0b6db3e14b9cdbe31460292bc4caf3983f977816",
   "bugs": {
     "url": "https://github.com/dominictarr/config-chain/issues"
   },
-  "_id": "config-chain@1.1.9",
-  "_shasum": "39ac7d4dca84faad926124c54cff25a53aa8bf6e",
-  "_from": "config-chain@>=1.1.9 <1.2.0",
-  "_npmVersion": "2.11.0",
-  "_nodeVersion": "0.12.4",
+  "_id": "config-chain@1.1.10",
+  "_shasum": "7fc383de0fcc84d711cb465bd176579cad612346",
+  "_from": "config-chain@latest",
+  "_npmVersion": "3.3.12",
+  "_nodeVersion": "5.3.0",
   "_npmUser": {
     "name": "dominictarr",
     "email": "dominic.tarr@gmail.com"
   },
+  "dist": {
+    "shasum": "7fc383de0fcc84d711cb465bd176579cad612346",
+    "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz"
+  },
   "maintainers": [
     {
       "name": "dominictarr",
       "email": "i@izs.me"
     }
   ],
-  "dist": {
-    "shasum": "39ac7d4dca84faad926124c54cff25a53aa8bf6e",
-    "tarball": "http://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz"
-  },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.9.tgz"
+  "_resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.10.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 7834613..bc97bbd 100644 (file)
@@ -38,7 +38,7 @@ test('test saving and loading ini files', function (t) {
         .save('jsonfile')
         .on('save', function () {
           t.equal(fs.readFileSync(f1, 'utf8'),
-                  "bloo = jaus\nfoo = zoo\n")
+                  "bloo=jaus\nfoo=zoo\n")
           t.equal(fs.readFileSync(f2, 'utf8'),
                   "{\"oof\":\"ooz\",\"oolb\":\"suaj\"}")
 
index 9492505..59b50db 100644 (file)
@@ -1,6 +1,8 @@
 var fs = require('graceful-fs')
+var Writable = require('readable-stream').Writable
 var util = require('util')
 var MurmurHash3 = require('imurmurhash')
+var iferr = require('iferr')
 
 function murmurhex () {
   var hash = MurmurHash3('')
@@ -15,82 +17,108 @@ function getTmpname (filename) {
   return filename + '.' + murmurhex(__filename, process.pid, ++invocations)
 }
 
-module.exports = WriteStream
+var setImmediate = global.setImmediate || setTimeout
 
-util.inherits(WriteStream, fs.WriteStream)
-function WriteStream (path, options) {
-  if (!options) options = {}
+module.exports = WriteStreamAtomic
 
-  if (!(this instanceof WriteStream)) {
-    return new WriteStream(path, options)
+// Requirements:
+//   1. Write everything written to the stream to a temp file.
+//   2. If there are no errors:
+//      a. moves the temp file into its final destination
+//      b. emits `finish` & `closed` ONLY after the file is
+//         fully flushed and renamed.
+//   3. If there's an error, removes the temp file.
+
+util.inherits(WriteStreamAtomic, Writable)
+function WriteStreamAtomic (path, options) {
+  if (!(this instanceof WriteStreamAtomic)) {
+    return new WriteStreamAtomic(path, options)
   }
+  Writable.call(this, options)
 
   this.__atomicTarget = path
-  this.__atomicChown = options.chown
-  this.__atomicDidStuff = false
   this.__atomicTmp = getTmpname(path)
 
-  fs.WriteStream.call(this, this.__atomicTmp, options)
-}
+  this.__atomicChown = options && options.chown
+
+  this.__atomicClosed = false
+
+  this.__atomicStream = fs.WriteStream(this.__atomicTmp, options)
 
-function cleanup (er) {
-  fs.unlink(this.__atomicTmp, function () {
-    fs.WriteStream.prototype.emit.call(this, 'error', er)
-  }.bind(this))
+  this.__atomicStream.once('open', handleOpen(this))
+  this.__atomicStream.once('close', handleClose(this))
+  this.__atomicStream.once('error', handleError(this))
 }
 
-function cleanupSync () {
-  try {
-    fs.unlinkSync(this.__atomicTmp)
-  } finally {
-    return
-  }
+// We have to suppress default finish emitting, because ordinarily it
+// would happen as soon as `end` is called on us and all of the
+// data has been written to our target stream. So we suppress
+// finish from being emitted here, and only emit it after our
+// target stream is closed and we've moved everything around.
+WriteStreamAtomic.prototype.emit = function (event) {
+  if (event === 'finish') return this.__atomicStream.end()
+  return Writable.prototype.emit.apply(this, arguments)
 }
 
-// When we *would* emit 'close' or 'finish', instead do our stuff
-WriteStream.prototype.emit = function (ev) {
-  if (ev === 'error') cleanupSync.call(this)
+WriteStreamAtomic.prototype._write = function (buffer, encoding, cb) {
+  var flushed = this.__atomicStream.write(buffer, encoding)
+  if (flushed) return cb()
+  this.__atomicStream.once('drain', cb)
+}
 
-  if (ev !== 'close' && ev !== 'finish') {
-    return fs.WriteStream.prototype.emit.apply(this, arguments)
+function handleOpen (writeStream) {
+  return function (fd) {
+    writeStream.emit('open', fd)
   }
+}
 
-  // We handle emitting finish and close after the rename.
-  if (ev === 'close' || ev === 'finish') {
-    if (!this.__atomicDidStuff) {
-      atomicDoStuff.call(this, function (er) {
-        if (er) cleanup.call(this, er)
-      }.bind(this))
+function handleClose (writeStream) {
+  return function () {
+    if (writeStream.__atomicClosed) return
+    writeStream.__atomicClosed = true
+    if (writeStream.__atomicChown) {
+      var uid = writeStream.__atomicChown.uid
+      var gid = writeStream.__atomicChown.gid
+      return fs.chown(writeStream.__atomicTmp, uid, gid, iferr(cleanup, moveIntoPlace))
+    } else {
+      moveIntoPlace()
     }
   }
-}
-
-function atomicDoStuff (cb) {
-  if (this.__atomicDidStuff) {
-    throw new Error('Already did atomic move-into-place')
+  function cleanup (err) {
+    fs.unlink(writeStream.__atomicTmp, function () {
+      writeStream.emit('error', err)
+      writeStream.emit('close')
+    })
+  }
+  function moveIntoPlace () {
+    fs.rename(writeStream.__atomicTmp, writeStream.__atomicTarget, iferr(cleanup, end))
   }
+  function end () {
+    // We have to use our parent class directly because we suppress `finish`
+    // events fired via our own emit method.
+    Writable.prototype.emit.call(writeStream, 'finish')
 
-  this.__atomicDidStuff = true
-  if (this.__atomicChown) {
-    var uid = this.__atomicChown.uid
-    var gid = this.__atomicChown.gid
-    return fs.chown(this.__atomicTmp, uid, gid, function (er) {
-      if (er) return cb(er)
-      moveIntoPlace.call(this, cb)
-    }.bind(this))
-  } else {
-    moveIntoPlace.call(this, cb)
+    // Delay the close to provide the same temporal separation a physical
+    // file operation would have– that is, the close event is emitted only
+    // after the async close operation completes.
+    setImmediate(function () {
+      writeStream.emit('close')
+    })
   }
 }
 
-function moveIntoPlace (cb) {
-  fs.rename(this.__atomicTmp, this.__atomicTarget, function (er) {
-    cb(er)
-    // emit finish, and then close on the next tick
-    // This makes finish/close consistent across Node versions also.
-    fs.WriteStream.prototype.emit.call(this, 'finish')
-    process.nextTick(function () {
-      fs.WriteStream.prototype.emit.call(this, 'close')
-    }.bind(this))
-  }.bind(this))
+function handleError (writeStream) {
+  return function (er) {
+    cleanupSync()
+    writeStream.emit('error', er)
+    writeStream.__atomicClosed = true
+    writeStream.emit('close')
+  }
+  function cleanupSync () {
+    try {
+      fs.unlinkSync(writeStream.__atomicTmp)
+    } finally {
+      return
+    }
+  }
 }
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/.npmignore
new file mode 100644 (file)
index 0000000..3c3629e
--- /dev/null
@@ -0,0 +1 @@
+node_modules
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/LICENSE
new file mode 100644 (file)
index 0000000..19d5f4b
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) 2014 Nadav Ivgi
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
\ No newline at end of file
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/README.md
new file mode 100644 (file)
index 0000000..0940763
--- /dev/null
@@ -0,0 +1,40 @@
+# iferr
+
+Higher-order functions for easier error handling.
+
+`if (err) return cb(err);` be gone!
+
+## Install
+```bash
+npm install iferr
+```
+
+## Use
+
+### JavaScript example
+```js
+var iferr = require('iferr');
+
+function get_friends_count(id, cb) {
+  User.load_user(id, iferr(cb, function(user) {
+    user.load_friends(iferr(cb, function(friends) {
+      cb(null, friends.length);
+    }));
+  }));
+}
+```
+
+### CoffeeScript example
+```coffee
+iferr = require 'iferr'
+
+get_friends_count = (id, cb) ->
+  User.load_user id, iferr cb, (user) ->
+    user.load_friends iferr cb, (friends) ->
+      cb null, friends.length
+```
+
+(TODO: document tiferr, throwerr and printerr)
+
+## License
+MIT
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.coffee
new file mode 100644 (file)
index 0000000..da6d007
--- /dev/null
@@ -0,0 +1,24 @@
+# Delegates to `succ` on sucecss or to `fail` on error
+# ex: Thing.load 123, iferr cb, (thing) -> ...
+iferr = (fail, succ) -> (err, a...) ->
+  if err? then fail err
+  else succ? a...
+
+# Like iferr, but also catches errors thrown from `succ` and passes to `fail`
+tiferr = (fail, succ) -> iferr fail, (a...) ->
+  try succ a...
+  catch err then fail err
+
+# Delegate to the success function on success, or throw the error otherwise
+# ex: Thing.load 123, throwerr (thing) -> ...
+throwerr = iferr.bind null, (err) -> throw err
+
+# Prints errors when one is passed, or does nothing otherwise
+# ex: thing.save printerr
+printerr = iferr (err) -> console.error err.stack or err
+
+module.exports = exports = iferr
+exports.iferr = iferr
+exports.tiferr = tiferr
+exports.throwerr = throwerr
+exports.printerr = printerr
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/index.js
new file mode 100644 (file)
index 0000000..78fce3d
--- /dev/null
@@ -0,0 +1,49 @@
+// Generated by CoffeeScript 1.7.1
+(function() {
+  var exports, iferr, printerr, throwerr, tiferr,
+    __slice = [].slice;
+
+  iferr = function(fail, succ) {
+    return function() {
+      var a, err;
+      err = arguments[0], a = 2 <= arguments.length ? __slice.call(arguments, 1) : [];
+      if (err != null) {
+        return fail(err);
+      } else {
+        return typeof succ === "function" ? succ.apply(null, a) : void 0;
+      }
+    };
+  };
+
+  tiferr = function(fail, succ) {
+    return iferr(fail, function() {
+      var a, err;
+      a = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
+      try {
+        return succ.apply(null, a);
+      } catch (_error) {
+        err = _error;
+        return fail(err);
+      }
+    });
+  };
+
+  throwerr = iferr.bind(null, function(err) {
+    throw err;
+  });
+
+  printerr = iferr(function(err) {
+    return console.error(err.stack || err);
+  });
+
+  module.exports = exports = iferr;
+
+  exports.iferr = iferr;
+
+  exports.tiferr = tiferr;
+
+  exports.throwerr = throwerr;
+
+  exports.printerr = printerr;
+
+}).call(this);
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/package.json
new file mode 100644 (file)
index 0000000..9017857
--- /dev/null
@@ -0,0 +1,50 @@
+{
+  "name": "iferr",
+  "version": "0.1.5",
+  "description": "Higher-order functions for easier error handling",
+  "main": "index.js",
+  "scripts": {
+    "test": "mocha",
+    "prepublish": "coffee -c index.coffee"
+  },
+  "repository": {
+    "type": "git",
+    "url": "https://github.com/shesek/iferr"
+  },
+  "keywords": [
+    "error",
+    "errors"
+  ],
+  "author": {
+    "name": "Nadav Ivgi"
+  },
+  "license": "MIT",
+  "bugs": {
+    "url": "https://github.com/shesek/iferr/issues"
+  },
+  "homepage": "https://github.com/shesek/iferr",
+  "devDependencies": {
+    "coffee-script": "^1.7.1",
+    "mocha": "^1.18.2"
+  },
+  "_id": "iferr@0.1.5",
+  "dist": {
+    "shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501",
+    "tarball": "http://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz"
+  },
+  "_from": "iferr@>=0.1.5 <0.2.0",
+  "_npmVersion": "1.4.4",
+  "_npmUser": {
+    "name": "nadav",
+    "email": "npm@shesek.info"
+  },
+  "maintainers": [
+    {
+      "name": "nadav",
+      "email": "npm@shesek.info"
+    }
+  ],
+  "directories": {},
+  "_shasum": "c60eed69e6d8fdb6b3104a1fcbca1c192dc5b501",
+  "_resolved": "https://registry.npmjs.org/iferr/-/iferr-0.1.5.tgz"
+}
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/index.coffee
new file mode 100644 (file)
index 0000000..be0bc56
--- /dev/null
@@ -0,0 +1,42 @@
+{ iferr, tiferr, throwerr } = require '../index.coffee'
+{ equal: eq, throws } = require 'assert'
+
+invoke_fail = (cb) -> cb new Error 'callback error'
+invoke_succ = (cb) -> cb null
+throw_error = -> throw new Error 'thrown'
+
+describe 'iferr', ->
+  it 'calls the error callback on errors', (done) ->
+    invoke_fail iferr(
+      (err) ->
+        eq err.message, 'callback error'
+        do done
+      ->
+        done new Error 'shouldn\'t call the success callback'
+    )
+
+  it 'calls the success callback on success', (done) ->
+    invoke_succ iferr(
+      -> done new Error 'shouldn\'t call the error callback'
+      done
+    )
+
+describe 'tiferr', ->
+  it 'catches errors in the success callback', (done) ->
+    invoke_succ tiferr(
+      (err) ->
+        eq err.message, 'thrown'
+        do done
+      throw_error
+    )
+
+describe 'throwerr', ->
+  it 'throws errors passed to the callback', (done)->
+    try invoke_fail throwerr ->
+      done 'shouldn\'t call the success callback'
+    catch err
+      eq err.message, 'callback error'
+      do done
+
+  it 'delegates to the success callback otherwise', (done) ->
+    invoke_succ throwerr done
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts b/deps/npm/node_modules/fs-write-stream-atomic/node_modules/iferr/test/mocha.opts
new file mode 100644 (file)
index 0000000..019defc
--- /dev/null
@@ -0,0 +1,2 @@
+--compilers coffee:coffee-script/register
+--reporter spec
index 1ba3fb5..0fae54c 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "fs-write-stream-atomic",
-  "version": "1.0.5",
+  "version": "1.0.8",
   "description": "Like `fs.createWriteStream(...)`, but atomic.",
   "main": "index.js",
   "directories": {
@@ -8,9 +8,12 @@
   },
   "dependencies": {
     "graceful-fs": "^4.1.2",
-    "imurmurhash": "^0.1.4"
+    "iferr": "^0.1.5",
+    "imurmurhash": "^0.1.4",
+    "readable-stream": "1 || 2"
   },
   "devDependencies": {
+    "rimraf": "^2.4.4",
     "standard": "^5.4.1",
     "tap": "^2.3.1"
   },
     "url": "https://github.com/npm/fs-write-stream-atomic/issues"
   },
   "homepage": "https://github.com/npm/fs-write-stream-atomic",
-  "readme": "# fs-write-stream-atomic\n\nLike `fs.createWriteStream(...)`, but atomic.\n\nWrites to a tmp file and does an atomic `fs.rename` to move it into\nplace when it's done.\n\nFirst rule of debugging: **It's always a race condition.**\n\n## USAGE\n\n```javascript\nvar fsWriteStreamAtomic = require('fs-write-stream-atomic')\n// options are optional.\nvar write = fsWriteStreamAtomic('output.txt', options)\nvar read = fs.createReadStream('input.txt')\nread.pipe(write)\n\n// When the write stream emits a 'finish' or 'close' event,\n// you can be sure that it is moved into place, and contains\n// all the bytes that were written to it, even if something else\n// was writing to `output.txt` at the same time.\n```\n\n### `fsWriteStreamAtomic(filename, [options])`\n\n* `filename` {String} The file we want to write to\n* `options` {Object}\n  * `chown` {Object} User and group to set ownership after write\n    * `uid` {Number}\n    * `gid` {Number}\n  * `encoding` {String} default = 'utf8'\n  * `mode` {Number} default = `0666`\n  * `flags` {String} default = `'w'`\n\n",
-  "readmeFilename": "README.md",
-  "gitHead": "1bc752bf0e0d5b7aaaad7be696dbc0e4ea64258c",
-  "_id": "fs-write-stream-atomic@1.0.5",
-  "_shasum": "862a4dabdffcafabfc16499458e37310c39925f6",
-  "_from": "fs-write-stream-atomic@>=1.0.5 <1.1.0"
+  "gitHead": "b55824ee4de7f1ca23784929d68b1b8f5edbf4a4",
+  "_id": "fs-write-stream-atomic@1.0.8",
+  "_shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b",
+  "_from": "fs-write-stream-atomic@>=1.0.5 <1.1.0",
+  "_npmVersion": "3.5.2",
+  "_nodeVersion": "4.2.2",
+  "_npmUser": {
+    "name": "iarna",
+    "email": "me@re-becca.org"
+  },
+  "dist": {
+    "shasum": "e49aaddf288f87d46ff9e882f216a13abc40778b",
+    "tarball": "http://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "iarna",
+      "email": "me@re-becca.org"
+    },
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    },
+    {
+      "name": "othiym23",
+      "email": "ogd@aoaioxxysz.net"
+    },
+    {
+      "name": "zkat",
+      "email": "kat@sykosomatic.org"
+    }
+  ],
+  "_resolved": "https://registry.npmjs.org/fs-write-stream-atomic/-/fs-write-stream-atomic-1.0.8.tgz"
 }
index 2dae137..d0205e1 100644 (file)
@@ -1,7 +1,14 @@
+var fs = require('graceful-fs')
 var test = require('tap').test
-var writeStream = require('../index.js')
-var fs = require('fs')
 var path = require('path')
+var writeStream = require('../index.js')
+
+var rename = fs.rename
+fs.rename = function (from, to, cb) {
+  setTimeout(function () {
+    rename(from, to, cb)
+  }, 100)
+}
 
 test('basic', function (t) {
   // open 10 write streams to the same file.
@@ -10,40 +17,39 @@ test('basic', function (t) {
   var target = path.resolve(__dirname, 'test.txt')
   var n = 10
 
+  // We run all of our assertions twice:
+  //   once for finish, once for close
+  // There are 6 assertions, two fixed, plus 4 lines in the file.
+  t.plan(n * 2 * 6)
+
   var streams = []
   for (var i = 0; i < n; i++) {
     var s = writeStream(target)
-    s.on('finish', verifier('finish'))
-    s.on('close', verifier('close'))
+    s.on('finish', verifier('finish', i))
+    s.on('close', verifier('close', i))
     streams.push(s)
   }
 
-  var verifierCalled = 0
-  function verifier (ev) {
+  function verifier (ev, num) {
     return function () {
       if (ev === 'close') {
-        t.equal(this.__emittedFinish, true)
+        t.equal(this.__emittedFinish, true, num + '. closed only after finish')
       } else {
         this.__emittedFinish = true
-        t.equal(ev, 'finish')
+        t.equal(ev, 'finish', num + '. finished')
       }
 
       // make sure that one of the atomic streams won.
       var res = fs.readFileSync(target, 'utf8')
       var lines = res.trim().split(/\n/)
-      lines.forEach(function (line) {
+      lines.forEach(function (line, lineno) {
         var first = lines[0].match(/\d+$/)[0]
         var cur = line.match(/\d+$/)[0]
-        t.equal(cur, first)
+        t.equal(cur, first, num + '. line ' + lineno + ' matches')
       })
 
       var resExpr = /^first write \d+\nsecond write \d+\nthird write \d+\nfinal write \d+\n$/
-      t.similar(res, resExpr)
-
-      // should be called once for each close, and each finish
-      if (++verifierCalled === n * 2) {
-        t.end()
-      }
+      t.similar(res, resExpr, num + '. content matches')
     }
   }
 
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js b/deps/npm/node_modules/fs-write-stream-atomic/test/chown.js
new file mode 100644 (file)
index 0000000..1733cf2
--- /dev/null
@@ -0,0 +1,44 @@
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+var test = require('tap').test
+var rimraf = require('rimraf')
+var writeStream = require('../index.js')
+
+var target = path.resolve(__dirname, 'test-chown')
+
+test('chown works', function (t) {
+  t.plan(1)
+  var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}})
+  var hadError = false
+  stream.on('error', function (er) {
+    hadError = true
+    console.log('#', er)
+  })
+  stream.on('close', function () {
+    t.is(hadError, false, 'no errors before close')
+  })
+  stream.end()
+})
+
+test('chown fails', function (t) {
+  t.plan(1)
+  fs.chown = function (file, uid, gid, cb) {
+    cb(new Error('TEST BREAK'))
+  }
+  var stream = writeStream(target, {chown: {uid: process.getuid(), gid: process.getgid()}})
+  var hadError = false
+  stream.on('error', function (er) {
+    hadError = true
+    console.log('#', er)
+  })
+  stream.on('close', function () {
+    t.is(hadError, true, 'error before close')
+  })
+  stream.end()
+})
+
+test('cleanup', function (t) {
+  rimraf.sync(target)
+  t.end()
+})
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js b/deps/npm/node_modules/fs-write-stream-atomic/test/rename-fail.js
new file mode 100644 (file)
index 0000000..7e27f0b
--- /dev/null
@@ -0,0 +1,30 @@
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+var test = require('tap').test
+var rimraf = require('rimraf')
+var writeStream = require('../index.js')
+
+var target = path.resolve(__dirname, 'test-rename')
+
+test('rename fails', function (t) {
+  t.plan(1)
+  fs.rename = function (src, dest, cb) {
+    cb(new Error('TEST BREAK'))
+  }
+  var stream = writeStream(target)
+  var hadError = false
+  stream.on('error', function (er) {
+    hadError = true
+    console.log('#', er)
+  })
+  stream.on('close', function () {
+    t.is(hadError, true, 'error before close')
+  })
+  stream.end()
+})
+
+test('cleanup', function (t) {
+  rimraf.sync(target)
+  t.end()
+})
diff --git a/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js b/deps/npm/node_modules/fs-write-stream-atomic/test/slow-close.js
new file mode 100644 (file)
index 0000000..9840a6e
--- /dev/null
@@ -0,0 +1,40 @@
+'use strict'
+var fs = require('graceful-fs')
+var path = require('path')
+var test = require('tap').test
+var rimraf = require('rimraf')
+var writeStream = require('../index.js')
+
+var target = path.resolve(__dirname, 'test-chown')
+
+test('slow close', function (t) {
+  t.plan(2)
+  // The goal here is to simulate the "file close" step happening so slowly
+  // that the whole close/rename process could finish before the file is
+  // actually closed (and thus buffers truely flushed to the OS). In
+  // previous versions of this module, this would result in the module
+  // emitting finish & close before the file was fully written and in
+  // turn, could break other layers that tried to read the new file.
+  var realEmit = fs.WriteStream.prototype.emit
+  var reallyClosed = false
+  fs.WriteStream.prototype.emit = function (event) {
+    if (event !== 'close') return realEmit.apply(this, arguments)
+    setTimeout(function () {
+      reallyClosed = true
+      realEmit.call(this, 'close')
+    }.bind(this), 200)
+  }
+  var stream = writeStream(target)
+  stream.on('finish', function () {
+    t.is(reallyClosed, true, "didn't finish before target was closed")
+  })
+  stream.on('close', function () {
+    t.is(reallyClosed, true, "didn't close before target was closed")
+  })
+  stream.end()
+})
+
+test('cleanup', function (t) {
+  rimraf.sync(target)
+  t.end()
+})
index be77f99..f146cc5 100644 (file)
@@ -13,12 +13,7 @@ function repeat (times, string) {
 var target = path.resolve(__dirname, repeat(1000, 'test'))
 
 test('name too long', function (t) {
-  // 0.8 streams smh
-  if (process.version.indexOf('v0.8') !== -1) {
-    t.plan(1)
-  } else {
-    t.plan(2)
-  }
+  t.plan(2)
   var stream = writeStream(target)
   var hadError = false
   stream.on('error', function (er) {
index 13a2e86..d920aaa 100644 (file)
@@ -34,3 +34,20 @@ var fs = require('graceful-fs')
 // now go and do stuff with it...
 fs.readFileSync('some-file-or-whatever')
 ```
+
+## Global Patching
+
+If you want to patch the global fs module (or any other fs-like
+module) you can do this:
+
+```javascript
+// Make sure to read the caveat below.
+var realFs = require('fs')
+var gracefulFs = require('graceful-fs')
+gracefulFs.gracefulify(realFs)
+```
+
+This should only ever be done at the top-level application layer, in
+order to delay on EMFILE errors from any fs-using dependencies.  You
+should **not** do this in a library, because it can cause unexpected
+delays in other parts of the program.
index fe3b17c..9bf803e 100644 (file)
@@ -33,6 +33,7 @@ if (process.env.TEST_GRACEFUL_FS_GLOBAL_PATCH) {
 // retry() whenever a close happens *anywhere* in the program.
 // This is essential when multiple graceful-fs instances are
 // in play at the same time.
+module.exports.close =
 fs.close = (function (fs$close) { return function (fd, cb) {
   return fs$close.call(fs, fd, function (err) {
     if (!err)
@@ -43,6 +44,7 @@ fs.close = (function (fs$close) { return function (fd, cb) {
   })
 }})(fs.close)
 
+module.exports.closeSync =
 fs.closeSync = (function (fs$closeSync) { return function (fd) {
   // Note that graceful-fs also retries when fs.closeSync() fails.
   // Looks like a bug to me, although it's probably a harmless one.
index 2a561b4..d519c20 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "graceful-fs",
   "description": "A drop-in replacement for fs, making various improvements.",
-  "version": "4.1.2",
+  "version": "4.1.3",
   "repository": {
     "type": "git",
     "url": "git+https://github.com/isaacs/node-graceful-fs.git"
@@ -36,7 +36,7 @@
   "devDependencies": {
     "mkdirp": "^0.5.0",
     "rimraf": "^2.2.8",
-    "tap": "^1.2.0"
+    "tap": "^5.4.2"
   },
   "files": [
     "fs.js",
     "legacy-streams.js",
     "polyfills.js"
   ],
-  "gitHead": "c286080071b6be9aa9ba108b0bb9b44ff122926d",
+  "gitHead": "694c56f3aed4aee62d6df169be123d3984f61b85",
   "bugs": {
     "url": "https://github.com/isaacs/node-graceful-fs/issues"
   },
   "homepage": "https://github.com/isaacs/node-graceful-fs#readme",
-  "_id": "graceful-fs@4.1.2",
-  "_shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37",
-  "_from": "graceful-fs@>=4.1.2 <4.2.0",
-  "_npmVersion": "3.0.0",
-  "_nodeVersion": "2.2.1",
+  "_id": "graceful-fs@4.1.3",
+  "_shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c",
+  "_from": "graceful-fs@latest",
+  "_npmVersion": "3.7.0",
+  "_nodeVersion": "4.0.0",
   "_npmUser": {
     "name": "isaacs",
-    "email": "isaacs@npmjs.com"
+    "email": "i@izs.me"
   },
   "dist": {
-    "shasum": "fe2239b7574972e67e41f808823f9bfa4a991e37",
-    "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz"
+    "shasum": "92033ce11113c41e2628d61fdfa40bc10dc0155c",
+    "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz"
   },
   "maintainers": [
     {
@@ -68,6 +68,9 @@
       "email": "i@izs.me"
     }
   ],
-  "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.2.tgz",
-  "readme": "ERROR: No README data found!"
+  "_npmOperationalInternal": {
+    "host": "packages-6-west.internal.npmjs.com",
+    "tmp": "tmp/graceful-fs-4.1.3.tgz_1454449326495_0.943017533281818"
+  },
+  "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.3.tgz"
 }
index 2cc79c4..bd64c12 100644 (file)
@@ -41,5 +41,5 @@ Or from the command line:
 $ npm-init
 ```
 
-See [PromZard](https://github.com/isaacs/promzard) for details about
+See [PromZard](https://github.com/npm/promzard) for details about
 what can go in the config file.
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE b/deps/npm/node_modules/init-package-json/node_modules/glob/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/README.md b/deps/npm/node_modules/init-package-json/node_modules/glob/README.md
new file mode 100644 (file)
index 0000000..6960483
--- /dev/null
@@ -0,0 +1,359 @@
+# Glob
+
+Match files using the patterns the shell uses, like stars and stuff.
+
+[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
+
+This is a glob implementation in JavaScript.  It uses the `minimatch`
+library to do its matching.
+
+![](oh-my-glob.gif)
+
+## Usage
+
+```javascript
+var glob = require("glob")
+
+// options is optional
+glob("**/*.js", options, function (er, files) {
+  // files is an array of filenames.
+  // If the `nonull` option is set, and nothing
+  // was found, then files is ["**/*.js"]
+  // er is an error object or null.
+})
+```
+
+## Glob Primer
+
+"Globs" are the patterns you type when you do stuff like `ls *.js` on
+the command line, or put `build/*` in a `.gitignore` file.
+
+Before parsing the path part patterns, braced sections are expanded
+into a set.  Braced sections start with `{` and end with `}`, with any
+number of comma-delimited sections within.  Braced sections may contain
+slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
+
+The following characters have special magic meaning when used in a
+path portion:
+
+* `*` Matches 0 or more characters in a single path portion
+* `?` Matches 1 character
+* `[...]` Matches a range of characters, similar to a RegExp range.
+  If the first character of the range is `!` or `^` then it matches
+  any character not in the range.
+* `!(pattern|pattern|pattern)` Matches anything that does not match
+  any of the patterns provided.
+* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
+  patterns provided.
+* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
+  patterns provided.
+* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
+* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
+  provided
+* `**` If a "globstar" is alone in a path portion, then it matches
+  zero or more directories and subdirectories searching for matches.
+  It does not crawl symlinked directories.
+
+### Dots
+
+If a file or directory path portion has a `.` as the first character,
+then it will not match any glob pattern unless that pattern's
+corresponding path part also has a `.` as its first character.
+
+For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
+However the pattern `a/*/c` would not, because `*` does not start with
+a dot character.
+
+You can make glob treat dots as normal characters by setting
+`dot:true` in the options.
+
+### Basename Matching
+
+If you set `matchBase:true` in the options, and the pattern has no
+slashes in it, then it will seek for any file anywhere in the tree
+with a matching basename.  For example, `*.js` would match
+`test/simple/basic.js`.
+
+### Empty Sets
+
+If no matching files are found, then an empty array is returned.  This
+differs from the shell, where the pattern itself is returned.  For
+example:
+
+    $ echo a*s*d*f
+    a*s*d*f
+
+To get the bash-style behavior, set the `nonull:true` in the options.
+
+### See Also:
+
+* `man sh`
+* `man bash` (Search for "Pattern Matching")
+* `man 3 fnmatch`
+* `man 5 gitignore`
+* [minimatch documentation](https://github.com/isaacs/minimatch)
+
+## glob.hasMagic(pattern, [options])
+
+Returns `true` if there are any special characters in the pattern, and
+`false` otherwise.
+
+Note that the options affect the results.  If `noext:true` is set in
+the options object, then `+(a|b)` will not be considered a magic
+pattern.  If the pattern has a brace expansion, like `a/{b/c,x/y}`
+then that is considered magical, unless `nobrace:true` is set in the
+options.
+
+## glob(pattern, [options], cb)
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* `cb` `{Function}`
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Perform an asynchronous glob search.
+
+## glob.sync(pattern, [options])
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* return: `{Array<String>}` filenames found matching the pattern
+
+Perform a synchronous glob search.
+
+## Class: glob.Glob
+
+Create a Glob object by instantiating the `glob.Glob` class.
+
+```javascript
+var Glob = require("glob").Glob
+var mg = new Glob(pattern, options, cb)
+```
+
+It's an EventEmitter, and starts walking the filesystem to find matches
+immediately.
+
+### new glob.Glob(pattern, [options], [cb])
+
+* `pattern` `{String}` pattern to search for
+* `options` `{Object}`
+* `cb` `{Function}` Called when an error occurs, or matches are found
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Note that if the `sync` flag is set in the options, then matches will
+be immediately available on the `g.found` member.
+
+### Properties
+
+* `minimatch` The minimatch object that the glob uses.
+* `options` The options object passed in.
+* `aborted` Boolean which is set to true when calling `abort()`.  There
+  is no way at this time to continue a glob search after aborting, but
+  you can re-use the statCache to avoid having to duplicate syscalls.
+* `cache` Convenience object.  Each field has the following possible
+  values:
+  * `false` - Path does not exist
+  * `true` - Path exists
+  * `'FILE'` - Path exists, and is not a directory
+  * `'DIR'` - Path exists, and is a directory
+  * `[file, entries, ...]` - Path exists, is a directory, and the
+    array value is the results of `fs.readdir`
+* `statCache` Cache of `fs.stat` results, to prevent statting the same
+  path multiple times.
+* `symlinks` A record of which paths are symbolic links, which is
+  relevant in resolving `**` patterns.
+* `realpathCache` An optional object which is passed to `fs.realpath`
+  to minimize unnecessary syscalls.  It is stored on the instantiated
+  Glob object, and may be re-used.
+
+### Events
+
+* `end` When the matching is finished, this is emitted with all the
+  matches found.  If the `nonull` option is set, and no match was found,
+  then the `matches` list contains the original pattern.  The matches
+  are sorted, unless the `nosort` flag is set.
+* `match` Every time a match is found, this is emitted with the specific
+  thing that matched. It is not deduplicated or resolved to a realpath.
+* `error` Emitted when an unexpected error is encountered, or whenever
+  any fs error occurs if `options.strict` is set.
+* `abort` When `abort()` is called, this event is raised.
+
+### Methods
+
+* `pause` Temporarily stop the search
+* `resume` Resume the search
+* `abort` Stop the search forever
+
+### Options
+
+All the options that can be passed to Minimatch can also be passed to
+Glob to change pattern matching behavior.  Also, some have been added,
+or have glob-specific ramifications.
+
+All options are false by default, unless otherwise noted.
+
+All options are added to the Glob object, as well.
+
+If you are running many `glob` operations, you can pass a Glob object
+as the `options` argument to a subsequent operation to shortcut some
+`stat` and `readdir` calls.  At the very least, you may pass in shared
+`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
+parallel glob operations will be sped up by sharing information about
+the filesystem.
+
+* `cwd` The current working directory in which to search.  Defaults
+  to `process.cwd()`.
+* `root` The place where patterns starting with `/` will be mounted
+  onto.  Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
+  systems, and `C:\` or some such on Windows.)
+* `dot` Include `.dot` files in normal matches and `globstar` matches.
+  Note that an explicit dot in a portion of the pattern will always
+  match dot files.
+* `nomount` By default, a pattern starting with a forward-slash will be
+  "mounted" onto the root setting, so that a valid filesystem path is
+  returned.  Set this flag to disable that behavior.
+* `mark` Add a `/` character to directory matches.  Note that this
+  requires additional stat calls.
+* `nosort` Don't sort the results.
+* `stat` Set to true to stat *all* results.  This reduces performance
+  somewhat, and is completely unnecessary, unless `readdir` is presumed
+  to be an untrustworthy indicator of file existence.
+* `silent` When an unusual error is encountered when attempting to
+  read a directory, a warning will be printed to stderr.  Set the
+  `silent` option to true to suppress these warnings.
+* `strict` When an unusual error is encountered when attempting to
+  read a directory, the process will just continue on in search of
+  other matches.  Set the `strict` option to raise an error in these
+  cases.
+* `cache` See `cache` property above.  Pass in a previously generated
+  cache object to save some fs calls.
+* `statCache` A cache of results of filesystem information, to prevent
+  unnecessary stat calls.  While it should not normally be necessary
+  to set this, you may pass the statCache from one glob() call to the
+  options object of another, if you know that the filesystem will not
+  change between calls.  (See "Race Conditions" below.)
+* `symlinks` A cache of known symbolic links.  You may pass in a
+  previously generated `symlinks` object to save `lstat` calls when
+  resolving `**` matches.
+* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
+* `nounique` In some cases, brace-expanded patterns can result in the
+  same file showing up multiple times in the result set.  By default,
+  this implementation prevents duplicates in the result set.  Set this
+  flag to disable that behavior.
+* `nonull` Set to never return an empty set, instead returning a set
+  containing the pattern itself.  This is the default in glob(3).
+* `debug` Set to enable debug logging in minimatch and glob.
+* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
+* `noglobstar` Do not match `**` against multiple filenames.  (Ie,
+  treat it as a normal `*` instead.)
+* `noext` Do not match `+(a|b)` "extglob" patterns.
+* `nocase` Perform a case-insensitive match.  Note: on
+  case-insensitive filesystems, non-magic patterns will match by
+  default, since `stat` and `readdir` will not raise errors.
+* `matchBase` Perform a basename-only match if the pattern does not
+  contain any slash characters.  That is, `*.js` would be treated as
+  equivalent to `**/*.js`, matching all js files in all directories.
+* `nodir` Do not match directories, only files.  (Note: to match
+  *only* directories, simply put a `/` at the end of the pattern.)
+* `ignore` Add a pattern or an array of glob patterns to exclude matches.
+  Note: `ignore` patterns are *always* in `dot:true` mode, regardless
+  of any other settings.
+* `follow` Follow symlinked directories when expanding `**` patterns.
+  Note that this can result in a lot of duplicate references in the
+  presence of cyclic links.
+* `realpath` Set to true to call `fs.realpath` on all of the results.
+  In the case of a symlink that cannot be resolved, the full absolute
+  path to the matched entry is returned (though it will usually be a
+  broken symlink)
+
+## Comparisons to other fnmatch/glob implementations
+
+While strict compliance with the existing standards is a worthwhile
+goal, some discrepancies exist between node-glob and other
+implementations, and are intentional.
+
+The double-star character `**` is supported by default, unless the
+`noglobstar` flag is set.  This is supported in the manner of bsdglob
+and bash 4.3, where `**` only has special significance if it is the only
+thing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but
+`a/**b` will not.
+
+Note that symlinked directories are not crawled as part of a `**`,
+though their contents may match against subsequent portions of the
+pattern.  This prevents infinite loops and duplicates and the like.
+
+If an escaped pattern has no matches, and the `nonull` flag is set,
+then glob returns the pattern as-provided, rather than
+interpreting the character escapes.  For example,
+`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
+`"*a?"`.  This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
+
+If brace expansion is not disabled, then it is performed before any
+other interpretation of the glob pattern.  Thus, a pattern like
+`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
+**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
+checked for validity.  Since those two are valid, matching proceeds.
+
+### Comments and Negation
+
+Previously, this module let you mark a pattern as a "comment" if it
+started with a `#` character, or a "negated" pattern if it started
+with a `!` character.
+
+These options were deprecated in version 5, and removed in version 6.
+
+To specify things that should not match, use the `ignore` option.
+
+## Windows
+
+**Please only use forward-slashes in glob expressions.**
+
+Though windows uses either `/` or `\` as its path separator, only `/`
+characters are used by this glob implementation.  You must use
+forward-slashes **only** in glob expressions.  Back-slashes will always
+be interpreted as escape characters, not path separators.
+
+Results from absolute patterns such as `/foo/*` are mounted onto the
+root setting using `path.join`.  On windows, this will by default result
+in `/foo/*` matching `C:\foo\bar.txt`.
+
+## Race Conditions
+
+Glob searching, by its very nature, is susceptible to race conditions,
+since it relies on directory walking and such.
+
+As a result, it is possible that a file that exists when glob looks for
+it may have been deleted or modified by the time it returns the result.
+
+As part of its internal implementation, this program caches all stat
+and readdir calls that it makes, in order to cut down on system
+overhead.  However, this also makes it even more susceptible to races,
+especially if the cache or statCache objects are reused between glob
+calls.
+
+Users are thus advised not to use a glob result as a guarantee of
+filesystem state in the face of rapid changes.  For the vast majority
+of operations, this is never a problem.
+
+## Contributing
+
+Any change to behavior (including bugfixes) must come with a test.
+
+Patches that fail tests or reduce performance will be rejected.
+
+```
+# to run tests
+npm test
+
+# to re-generate test fixtures
+npm run test-regen
+
+# to benchmark against bash/zsh
+npm run bench
+
+# to profile javascript
+npm run prof
+```
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/common.js b/deps/npm/node_modules/init-package-json/node_modules/glob/common.js
new file mode 100644 (file)
index 0000000..c9127eb
--- /dev/null
@@ -0,0 +1,226 @@
+exports.alphasort = alphasort
+exports.alphasorti = alphasorti
+exports.setopts = setopts
+exports.ownProp = ownProp
+exports.makeAbs = makeAbs
+exports.finish = finish
+exports.mark = mark
+exports.isIgnored = isIgnored
+exports.childrenIgnored = childrenIgnored
+
+function ownProp (obj, field) {
+  return Object.prototype.hasOwnProperty.call(obj, field)
+}
+
+var path = require("path")
+var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
+var Minimatch = minimatch.Minimatch
+
+function alphasorti (a, b) {
+  return a.toLowerCase().localeCompare(b.toLowerCase())
+}
+
+function alphasort (a, b) {
+  return a.localeCompare(b)
+}
+
+function setupIgnores (self, options) {
+  self.ignore = options.ignore || []
+
+  if (!Array.isArray(self.ignore))
+    self.ignore = [self.ignore]
+
+  if (self.ignore.length) {
+    self.ignore = self.ignore.map(ignoreMap)
+  }
+}
+
+// ignore patterns are always in dot:true mode.
+function ignoreMap (pattern) {
+  var gmatcher = null
+  if (pattern.slice(-3) === '/**') {
+    var gpattern = pattern.replace(/(\/\*\*)+$/, '')
+    gmatcher = new Minimatch(gpattern, { dot: true })
+  }
+
+  return {
+    matcher: new Minimatch(pattern, { dot: true }),
+    gmatcher: gmatcher
+  }
+}
+
+function setopts (self, pattern, options) {
+  if (!options)
+    options = {}
+
+  // base-matching: just use globstar for that.
+  if (options.matchBase && -1 === pattern.indexOf("/")) {
+    if (options.noglobstar) {
+      throw new Error("base matching requires globstar")
+    }
+    pattern = "**/" + pattern
+  }
+
+  self.silent = !!options.silent
+  self.pattern = pattern
+  self.strict = options.strict !== false
+  self.realpath = !!options.realpath
+  self.realpathCache = options.realpathCache || Object.create(null)
+  self.follow = !!options.follow
+  self.dot = !!options.dot
+  self.mark = !!options.mark
+  self.nodir = !!options.nodir
+  if (self.nodir)
+    self.mark = true
+  self.sync = !!options.sync
+  self.nounique = !!options.nounique
+  self.nonull = !!options.nonull
+  self.nosort = !!options.nosort
+  self.nocase = !!options.nocase
+  self.stat = !!options.stat
+  self.noprocess = !!options.noprocess
+
+  self.maxLength = options.maxLength || Infinity
+  self.cache = options.cache || Object.create(null)
+  self.statCache = options.statCache || Object.create(null)
+  self.symlinks = options.symlinks || Object.create(null)
+
+  setupIgnores(self, options)
+
+  self.changedCwd = false
+  var cwd = process.cwd()
+  if (!ownProp(options, "cwd"))
+    self.cwd = cwd
+  else {
+    self.cwd = options.cwd
+    self.changedCwd = path.resolve(options.cwd) !== cwd
+  }
+
+  self.root = options.root || path.resolve(self.cwd, "/")
+  self.root = path.resolve(self.root)
+  if (process.platform === "win32")
+    self.root = self.root.replace(/\\/g, "/")
+
+  self.nomount = !!options.nomount
+
+  // disable comments and negation in Minimatch.
+  // Note that they are not supported in Glob itself anyway.
+  options.nonegate = true
+  options.nocomment = true
+
+  self.minimatch = new Minimatch(pattern, options)
+  self.options = self.minimatch.options
+}
+
+function finish (self) {
+  var nou = self.nounique
+  var all = nou ? [] : Object.create(null)
+
+  for (var i = 0, l = self.matches.length; i < l; i ++) {
+    var matches = self.matches[i]
+    if (!matches || Object.keys(matches).length === 0) {
+      if (self.nonull) {
+        // do like the shell, and spit out the literal glob
+        var literal = self.minimatch.globSet[i]
+        if (nou)
+          all.push(literal)
+        else
+          all[literal] = true
+      }
+    } else {
+      // had matches
+      var m = Object.keys(matches)
+      if (nou)
+        all.push.apply(all, m)
+      else
+        m.forEach(function (m) {
+          all[m] = true
+        })
+    }
+  }
+
+  if (!nou)
+    all = Object.keys(all)
+
+  if (!self.nosort)
+    all = all.sort(self.nocase ? alphasorti : alphasort)
+
+  // at *some* point we statted all of these
+  if (self.mark) {
+    for (var i = 0; i < all.length; i++) {
+      all[i] = self._mark(all[i])
+    }
+    if (self.nodir) {
+      all = all.filter(function (e) {
+        return !(/\/$/.test(e))
+      })
+    }
+  }
+
+  if (self.ignore.length)
+    all = all.filter(function(m) {
+      return !isIgnored(self, m)
+    })
+
+  self.found = all
+}
+
+function mark (self, p) {
+  var abs = makeAbs(self, p)
+  var c = self.cache[abs]
+  var m = p
+  if (c) {
+    var isDir = c === 'DIR' || Array.isArray(c)
+    var slash = p.slice(-1) === '/'
+
+    if (isDir && !slash)
+      m += '/'
+    else if (!isDir && slash)
+      m = m.slice(0, -1)
+
+    if (m !== p) {
+      var mabs = makeAbs(self, m)
+      self.statCache[mabs] = self.statCache[abs]
+      self.cache[mabs] = self.cache[abs]
+    }
+  }
+
+  return m
+}
+
+// lotta situps...
+function makeAbs (self, f) {
+  var abs = f
+  if (f.charAt(0) === '/') {
+    abs = path.join(self.root, f)
+  } else if (isAbsolute(f) || f === '') {
+    abs = f
+  } else if (self.changedCwd) {
+    abs = path.resolve(self.cwd, f)
+  } else {
+    abs = path.resolve(f)
+  }
+  return abs
+}
+
+
+// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
+// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
+function isIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
+
+function childrenIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js b/deps/npm/node_modules/init-package-json/node_modules/glob/glob.js
new file mode 100644 (file)
index 0000000..a62da27
--- /dev/null
@@ -0,0 +1,765 @@
+// Approach:
+//
+// 1. Get the minimatch set
+// 2. For each pattern in the set, PROCESS(pattern, false)
+// 3. Store matches per-set, then uniq them
+//
+// PROCESS(pattern, inGlobStar)
+// Get the first [n] items from pattern that are all strings
+// Join these together.  This is PREFIX.
+//   If there is no more remaining, then stat(PREFIX) and
+//   add to matches if it succeeds.  END.
+//
+// If inGlobStar and PREFIX is symlink and points to dir
+//   set ENTRIES = []
+// else readdir(PREFIX) as ENTRIES
+//   If fail, END
+//
+// with ENTRIES
+//   If pattern[n] is GLOBSTAR
+//     // handle the case where the globstar match is empty
+//     // by pruning it out, and testing the resulting pattern
+//     PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
+//     // handle other cases.
+//     for ENTRY in ENTRIES (not dotfiles)
+//       // attach globstar + tail onto the entry
+//       // Mark that this entry is a globstar match
+//       PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
+//
+//   else // not globstar
+//     for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
+//       Test ENTRY against pattern[n]
+//       If fails, continue
+//       If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
+//
+// Caveat:
+//   Cache all stats and readdirs results to minimize syscall.  Since all
+//   we ever care about is existence and directory-ness, we can just keep
+//   `true` for files, and [children,...] for directories, or `false` for
+//   things that don't exist.
+
+module.exports = glob
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var inherits = require('inherits')
+var EE = require('events').EventEmitter
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var globSync = require('./sync.js')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var inflight = require('inflight')
+var util = require('util')
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+var once = require('once')
+
+function glob (pattern, options, cb) {
+  if (typeof options === 'function') cb = options, options = {}
+  if (!options) options = {}
+
+  if (options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return globSync(pattern, options)
+  }
+
+  return new Glob(pattern, options, cb)
+}
+
+glob.sync = globSync
+var GlobSync = glob.GlobSync = globSync.GlobSync
+
+// old api surface
+glob.glob = glob
+
+function extend (origin, add) {
+  if (add === null || typeof add !== 'object') {
+    return origin
+  }
+
+  var keys = Object.keys(add)
+  var i = keys.length
+  while (i--) {
+    origin[keys[i]] = add[keys[i]]
+  }
+  return origin
+}
+
+glob.hasMagic = function (pattern, options_) {
+  var options = extend({}, options_)
+  options.noprocess = true
+
+  var g = new Glob(pattern, options)
+  var set = g.minimatch.set
+  if (set.length > 1)
+    return true
+
+  for (var j = 0; j < set[0].length; j++) {
+    if (typeof set[0][j] !== 'string')
+      return true
+  }
+
+  return false
+}
+
+glob.Glob = Glob
+inherits(Glob, EE)
+function Glob (pattern, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = null
+  }
+
+  if (options && options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return new GlobSync(pattern, options)
+  }
+
+  if (!(this instanceof Glob))
+    return new Glob(pattern, options, cb)
+
+  setopts(this, pattern, options)
+  this._didRealPath = false
+
+  // process each pattern in the minimatch set
+  var n = this.minimatch.set.length
+
+  // The matches are stored as {<filename>: true,...} so that
+  // duplicates are automagically pruned.
+  // Later, we do an Object.keys() on these.
+  // Keep them as a list so we can fill in when nonull is set.
+  this.matches = new Array(n)
+
+  if (typeof cb === 'function') {
+    cb = once(cb)
+    this.on('error', cb)
+    this.on('end', function (matches) {
+      cb(null, matches)
+    })
+  }
+
+  var self = this
+  var n = this.minimatch.set.length
+  this._processing = 0
+  this.matches = new Array(n)
+
+  this._emitQueue = []
+  this._processQueue = []
+  this.paused = false
+
+  if (this.noprocess)
+    return this
+
+  if (n === 0)
+    return done()
+
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false, done)
+  }
+
+  function done () {
+    --self._processing
+    if (self._processing <= 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._finish = function () {
+  assert(this instanceof Glob)
+  if (this.aborted)
+    return
+
+  if (this.realpath && !this._didRealpath)
+    return this._realpath()
+
+  common.finish(this)
+  this.emit('end', this.found)
+}
+
+Glob.prototype._realpath = function () {
+  if (this._didRealpath)
+    return
+
+  this._didRealpath = true
+
+  var n = this.matches.length
+  if (n === 0)
+    return this._finish()
+
+  var self = this
+  for (var i = 0; i < this.matches.length; i++)
+    this._realpathSet(i, next)
+
+  function next () {
+    if (--n === 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._realpathSet = function (index, cb) {
+  var matchset = this.matches[index]
+  if (!matchset)
+    return cb()
+
+  var found = Object.keys(matchset)
+  var self = this
+  var n = found.length
+
+  if (n === 0)
+    return cb()
+
+  var set = this.matches[index] = Object.create(null)
+  found.forEach(function (p, i) {
+    // If there's a problem with the stat, then it means that
+    // one or more of the links in the realpath couldn't be
+    // resolved.  just return the abs value in that case.
+    p = self._makeAbs(p)
+    fs.realpath(p, self.realpathCache, function (er, real) {
+      if (!er)
+        set[real] = true
+      else if (er.syscall === 'stat')
+        set[p] = true
+      else
+        self.emit('error', er) // srsly wtf right here
+
+      if (--n === 0) {
+        self.matches[index] = set
+        cb()
+      }
+    })
+  })
+}
+
+Glob.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+Glob.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
+
+Glob.prototype.abort = function () {
+  this.aborted = true
+  this.emit('abort')
+}
+
+Glob.prototype.pause = function () {
+  if (!this.paused) {
+    this.paused = true
+    this.emit('pause')
+  }
+}
+
+Glob.prototype.resume = function () {
+  if (this.paused) {
+    this.emit('resume')
+    this.paused = false
+    if (this._emitQueue.length) {
+      var eq = this._emitQueue.slice(0)
+      this._emitQueue.length = 0
+      for (var i = 0; i < eq.length; i ++) {
+        var e = eq[i]
+        this._emitMatch(e[0], e[1])
+      }
+    }
+    if (this._processQueue.length) {
+      var pq = this._processQueue.slice(0)
+      this._processQueue.length = 0
+      for (var i = 0; i < pq.length; i ++) {
+        var p = pq[i]
+        this._processing--
+        this._process(p[0], p[1], p[2], p[3])
+      }
+    }
+  }
+}
+
+Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
+  assert(this instanceof Glob)
+  assert(typeof cb === 'function')
+
+  if (this.aborted)
+    return
+
+  this._processing++
+  if (this.paused) {
+    this._processQueue.push([pattern, index, inGlobStar, cb])
+    return
+  }
+
+  //console.error('PROCESS %d', this._processing, pattern)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // see if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index, cb)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip _processing
+  if (childrenIgnored(this, read))
+    return cb()
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
+}
+
+Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return cb()
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return cb()
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this._emitMatch(index, e)
+    }
+    // This was the last one, and no stats were needed
+    return cb()
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix) {
+      if (prefix !== '/')
+        e = prefix + '/' + e
+      else
+        e = prefix + e
+    }
+    this._process([e].concat(remain), index, inGlobStar, cb)
+  }
+  cb()
+}
+
+Glob.prototype._emitMatch = function (index, e) {
+  if (this.aborted)
+    return
+
+  if (this.matches[index][e])
+    return
+
+  if (isIgnored(this, e))
+    return
+
+  if (this.paused) {
+    this._emitQueue.push([index, e])
+    return
+  }
+
+  var abs = this._makeAbs(e)
+
+  if (this.nodir) {
+    var c = this.cache[abs]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  if (this.mark)
+    e = this._mark(e)
+
+  this.matches[index][e] = true
+
+  var st = this.statCache[abs]
+  if (st)
+    this.emit('stat', e, st)
+
+  this.emit('match', e)
+}
+
+Glob.prototype._readdirInGlobStar = function (abs, cb) {
+  if (this.aborted)
+    return
+
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false, cb)
+
+  var lstatkey = 'lstat\0' + abs
+  var self = this
+  var lstatcb = inflight(lstatkey, lstatcb_)
+
+  if (lstatcb)
+    fs.lstat(abs, lstatcb)
+
+  function lstatcb_ (er, lstat) {
+    if (er)
+      return cb()
+
+    var isSym = lstat.isSymbolicLink()
+    self.symlinks[abs] = isSym
+
+    // If it's not a symlink or a dir, then it's definitely a regular file.
+    // don't bother doing a readdir in that case.
+    if (!isSym && !lstat.isDirectory()) {
+      self.cache[abs] = 'FILE'
+      cb()
+    } else
+      self._readdir(abs, false, cb)
+  }
+}
+
+Glob.prototype._readdir = function (abs, inGlobStar, cb) {
+  if (this.aborted)
+    return
+
+  cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
+  if (!cb)
+    return
+
+  //console.error('RD %j %j', +inGlobStar, abs)
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs, cb)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return cb()
+
+    if (Array.isArray(c))
+      return cb(null, c)
+  }
+
+  var self = this
+  fs.readdir(abs, readdirCb(this, abs, cb))
+}
+
+function readdirCb (self, abs, cb) {
+  return function (er, entries) {
+    if (er)
+      self._readdirError(abs, er, cb)
+    else
+      self._readdirEntries(abs, entries, cb)
+  }
+}
+
+Glob.prototype._readdirEntries = function (abs, entries, cb) {
+  if (this.aborted)
+    return
+
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+  return cb(null, entries)
+}
+
+Glob.prototype._readdirError = function (f, er, cb) {
+  if (this.aborted)
+    return
+
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      this.cache[this._makeAbs(f)] = 'FILE'
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict) {
+        this.emit('error', er)
+        // If the error is handled, then we abort
+        // if not, we threw out of here
+        this.abort()
+      }
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+
+  return cb()
+}
+
+Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+
+Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+  //console.error('pgs2', prefix, remain[0], entries)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return cb()
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false, cb)
+
+  var isSym = this.symlinks[abs]
+  var len = entries.length
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return cb()
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true, cb)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true, cb)
+  }
+
+  cb()
+}
+
+Glob.prototype._processSimple = function (prefix, index, cb) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var self = this
+  this._stat(prefix, function (er, exists) {
+    self._processSimple2(prefix, index, er, exists, cb)
+  })
+}
+Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
+
+  //console.error('ps2', prefix, exists)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return cb()
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this._emitMatch(index, prefix)
+  cb()
+}
+
+// Returns either 'DIR', 'FILE', or false
+Glob.prototype._stat = function (f, cb) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return cb()
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return cb(null, c)
+
+    if (needDir && c === 'FILE')
+      return cb()
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (stat !== undefined) {
+    if (stat === false)
+      return cb(null, stat)
+    else {
+      var type = stat.isDirectory() ? 'DIR' : 'FILE'
+      if (needDir && type === 'FILE')
+        return cb()
+      else
+        return cb(null, type, stat)
+    }
+  }
+
+  var self = this
+  var statcb = inflight('stat\0' + abs, lstatcb_)
+  if (statcb)
+    fs.lstat(abs, statcb)
+
+  function lstatcb_ (er, lstat) {
+    if (lstat && lstat.isSymbolicLink()) {
+      // If it's a symlink, then treat it as the target, unless
+      // the target does not exist, then treat it as a file.
+      return fs.stat(abs, function (er, stat) {
+        if (er)
+          self._stat2(f, abs, null, lstat, cb)
+        else
+          self._stat2(f, abs, er, stat, cb)
+      })
+    } else {
+      self._stat2(f, abs, er, lstat, cb)
+    }
+  }
+}
+
+Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
+  if (er) {
+    this.statCache[abs] = false
+    return cb()
+  }
+
+  var needDir = f.slice(-1) === '/'
+  this.statCache[abs] = stat
+
+  if (abs.slice(-1) === '/' && !stat.isDirectory())
+    return cb(null, false, stat)
+
+  var c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c !== 'DIR')
+    return cb()
+
+  return cb(null, c, stat)
+}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/index.js
new file mode 100644 (file)
index 0000000..19f103f
--- /dev/null
@@ -0,0 +1,20 @@
+'use strict';
+
+function posix(path) {
+       return path.charAt(0) === '/';
+};
+
+function win32(path) {
+       // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+       var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
+       var result = splitDeviceRe.exec(path);
+       var device = result[1] || '';
+       var isUnc = !!device && device.charAt(1) !== ':';
+
+       // UNC paths are always absolute
+       return !!result[2] || isUnc;
+};
+
+module.exports = process.platform === 'win32' ? win32 : posix;
+module.exports.posix = posix;
+module.exports.win32 = win32;
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/package.json
new file mode 100644 (file)
index 0000000..3937263
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "name": "path-is-absolute",
+  "version": "1.0.0",
+  "description": "Node.js 0.12 path.isAbsolute() ponyfill",
+  "license": "MIT",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/path-is-absolute.git"
+  },
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "scripts": {
+    "test": "node test.js"
+  },
+  "files": [
+    "index.js"
+  ],
+  "keywords": [
+    "path",
+    "paths",
+    "file",
+    "dir",
+    "absolute",
+    "isabsolute",
+    "is-absolute",
+    "built-in",
+    "util",
+    "utils",
+    "core",
+    "ponyfill",
+    "polyfill",
+    "shim",
+    "is",
+    "detect",
+    "check"
+  ],
+  "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1",
+  "bugs": {
+    "url": "https://github.com/sindresorhus/path-is-absolute/issues"
+  },
+  "homepage": "https://github.com/sindresorhus/path-is-absolute",
+  "_id": "path-is-absolute@1.0.0",
+  "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+  "_from": "path-is-absolute@>=1.0.0 <2.0.0",
+  "_npmVersion": "2.5.1",
+  "_nodeVersion": "0.12.0",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+    "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz",
+  "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/init-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md
new file mode 100644 (file)
index 0000000..cdf94f4
--- /dev/null
@@ -0,0 +1,51 @@
+# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
+
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill
+
+> Ponyfill: A polyfill that doesn't overwrite the native method
+
+
+## Install
+
+```
+$ npm install --save path-is-absolute
+```
+
+
+## Usage
+
+```js
+var pathIsAbsolute = require('path-is-absolute');
+
+// Linux
+pathIsAbsolute('/home/foo');
+//=> true
+
+// Windows
+pathIsAbsolute('C:/Users/');
+//=> true
+
+// Any OS
+pathIsAbsolute.posix('/home/foo');
+//=> true
+```
+
+
+## API
+
+See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
+
+### pathIsAbsolute(path)
+
+### pathIsAbsolute.posix(path)
+
+The Posix specific version.
+
+### pathIsAbsolute.win32(path)
+
+The Windows specific version.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/package.json b/deps/npm/node_modules/init-package-json/node_modules/glob/package.json
new file mode 100644 (file)
index 0000000..19e926c
--- /dev/null
@@ -0,0 +1,73 @@
+{
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "name": "glob",
+  "description": "a little globber",
+  "version": "6.0.4",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/node-glob.git"
+  },
+  "main": "glob.js",
+  "files": [
+    "glob.js",
+    "sync.js",
+    "common.js"
+  ],
+  "engines": {
+    "node": "*"
+  },
+  "dependencies": {
+    "inflight": "^1.0.4",
+    "inherits": "2",
+    "minimatch": "2 || 3",
+    "once": "^1.3.0",
+    "path-is-absolute": "^1.0.0"
+  },
+  "devDependencies": {
+    "mkdirp": "0",
+    "rimraf": "^2.2.8",
+    "tap": "^5.0.0",
+    "tick": "0.0.6"
+  },
+  "scripts": {
+    "prepublish": "npm run benchclean",
+    "profclean": "rm -f v8.log profile.txt",
+    "test": "tap test/*.js --cov",
+    "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
+    "bench": "bash benchmark.sh",
+    "prof": "bash prof.sh && cat profile.txt",
+    "benchclean": "node benchclean.js"
+  },
+  "license": "ISC",
+  "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6",
+  "bugs": {
+    "url": "https://github.com/isaacs/node-glob/issues"
+  },
+  "homepage": "https://github.com/isaacs/node-glob#readme",
+  "_id": "glob@6.0.4",
+  "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+  "_from": "glob@>=6.0.0 <7.0.0",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "dist": {
+    "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+    "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
+  "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js b/deps/npm/node_modules/init-package-json/node_modules/glob/sync.js
new file mode 100644 (file)
index 0000000..09883d2
--- /dev/null
@@ -0,0 +1,460 @@
+module.exports = globSync
+globSync.GlobSync = GlobSync
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var Glob = require('./glob.js').Glob
+var util = require('util')
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var childrenIgnored = common.childrenIgnored
+
+function globSync (pattern, options) {
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  return new GlobSync(pattern, options).found
+}
+
+function GlobSync (pattern, options) {
+  if (!pattern)
+    throw new Error('must provide pattern')
+
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  if (!(this instanceof GlobSync))
+    return new GlobSync(pattern, options)
+
+  setopts(this, pattern, options)
+
+  if (this.noprocess)
+    return this
+
+  var n = this.minimatch.set.length
+  this.matches = new Array(n)
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false)
+  }
+  this._finish()
+}
+
+GlobSync.prototype._finish = function () {
+  assert(this instanceof GlobSync)
+  if (this.realpath) {
+    var self = this
+    this.matches.forEach(function (matchset, index) {
+      var set = self.matches[index] = Object.create(null)
+      for (var p in matchset) {
+        try {
+          p = self._makeAbs(p)
+          var real = fs.realpathSync(p, self.realpathCache)
+          set[real] = true
+        } catch (er) {
+          if (er.syscall === 'stat')
+            set[self._makeAbs(p)] = true
+          else
+            throw er
+        }
+      }
+    })
+  }
+  common.finish(this)
+}
+
+
+GlobSync.prototype._process = function (pattern, index, inGlobStar) {
+  assert(this instanceof GlobSync)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // See if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip processing
+  if (childrenIgnored(this, read))
+    return
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
+}
+
+
+GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
+  var entries = this._readdir(abs, inGlobStar)
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix.slice(-1) !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this.matches[index][e] = true
+    }
+    // This was the last one, and no stats were needed
+    return
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix)
+      newPattern = [prefix, e]
+    else
+      newPattern = [e]
+    this._process(newPattern.concat(remain), index, inGlobStar)
+  }
+}
+
+
+GlobSync.prototype._emitMatch = function (index, e) {
+  var abs = this._makeAbs(e)
+  if (this.mark)
+    e = this._mark(e)
+
+  if (this.matches[index][e])
+    return
+
+  if (this.nodir) {
+    var c = this.cache[this._makeAbs(e)]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  this.matches[index][e] = true
+  if (this.stat)
+    this._stat(e)
+}
+
+
+GlobSync.prototype._readdirInGlobStar = function (abs) {
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false)
+
+  var entries
+  var lstat
+  var stat
+  try {
+    lstat = fs.lstatSync(abs)
+  } catch (er) {
+    // lstat failed, doesn't exist
+    return null
+  }
+
+  var isSym = lstat.isSymbolicLink()
+  this.symlinks[abs] = isSym
+
+  // If it's not a symlink or a dir, then it's definitely a regular file.
+  // don't bother doing a readdir in that case.
+  if (!isSym && !lstat.isDirectory())
+    this.cache[abs] = 'FILE'
+  else
+    entries = this._readdir(abs, false)
+
+  return entries
+}
+
+GlobSync.prototype._readdir = function (abs, inGlobStar) {
+  var entries
+
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return null
+
+    if (Array.isArray(c))
+      return c
+  }
+
+  try {
+    return this._readdirEntries(abs, fs.readdirSync(abs))
+  } catch (er) {
+    this._readdirError(abs, er)
+    return null
+  }
+}
+
+GlobSync.prototype._readdirEntries = function (abs, entries) {
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+
+  // mark and cache dir-ness
+  return entries
+}
+
+GlobSync.prototype._readdirError = function (f, er) {
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      this.cache[this._makeAbs(f)] = 'FILE'
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict)
+        throw er
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+}
+
+GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
+
+  var entries = this._readdir(abs, inGlobStar)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false)
+
+  var len = entries.length
+  var isSym = this.symlinks[abs]
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true)
+  }
+}
+
+GlobSync.prototype._processSimple = function (prefix, index) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var exists = this._stat(prefix)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this.matches[index][prefix] = true
+}
+
+// Returns either 'DIR', 'FILE', or false
+GlobSync.prototype._stat = function (f) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return false
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return c
+
+    if (needDir && c === 'FILE')
+      return false
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (!stat) {
+    var lstat
+    try {
+      lstat = fs.lstatSync(abs)
+    } catch (er) {
+      return false
+    }
+
+    if (lstat.isSymbolicLink()) {
+      try {
+        stat = fs.statSync(abs)
+      } catch (er) {
+        stat = lstat
+      }
+    } else {
+      stat = lstat
+    }
+  }
+
+  this.statCache[abs] = stat
+
+  var c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c !== 'DIR')
+    return false
+
+  return c
+}
+
+GlobSync.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+GlobSync.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
index 1407e97..4290031 100644 (file)
@@ -8,7 +8,7 @@
   "description": "prompting wizardly",
   "version": "0.3.0",
   "repository": {
-    "url": "git://github.com/isaacs/promzard.git"
+    "url": "git://github.com/isaacs/promzard"
   },
   "dependencies": {
     "read": "1"
@@ -46,6 +46,5 @@
     "tarball": "http://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/promzard/-/promzard-0.3.0.tgz"
 }
index 0cc543e..4be2426 100644 (file)
@@ -1,13 +1,13 @@
 {
   "name": "init-package-json",
-  "version": "1.9.1",
+  "version": "1.9.3",
   "main": "init-package-json.js",
   "scripts": {
     "test": "tap test/*.js"
   },
   "repository": {
     "type": "git",
-    "url": "git://github.com/isaacs/init-package-json.git"
+    "url": "git+https://github.com/npm/init-package-json.git"
   },
   "author": {
     "name": "Isaac Z. Schlueter",
@@ -17,7 +17,7 @@
   "license": "ISC",
   "description": "A node module to get your node module started",
   "dependencies": {
-    "glob": "^5.0.3",
+    "glob": "^6.0.0",
     "npm-package-arg": "^4.0.0",
     "promzard": "^0.3.0",
     "read": "~1.0.1",
     "prompt",
     "start"
   ],
-  "gitHead": "37c38b4e23189eb5645901fa6851f343fddd4b73",
+  "gitHead": "12eb24ff2f75f84a4a27436bc6f6cb765cbd9ee2",
   "bugs": {
-    "url": "https://github.com/isaacs/init-package-json/issues"
+    "url": "https://github.com/npm/init-package-json/issues"
   },
-  "homepage": "https://github.com/isaacs/init-package-json#readme",
-  "_id": "init-package-json@1.9.1",
-  "_shasum": "a28e05b5baeb3363cd473df68d30d3a80523a31c",
-  "_from": "init-package-json@1.9.1",
-  "_npmVersion": "2.14.1",
-  "_nodeVersion": "2.2.2",
+  "homepage": "https://github.com/npm/init-package-json#readme",
+  "_id": "init-package-json@1.9.3",
+  "_shasum": "ca2ff94709b6d9aaad66533c11a0aff645f15c7d",
+  "_from": "init-package-json@1.9.3",
+  "_npmVersion": "3.5.4",
+  "_nodeVersion": "4.2.2",
   "_npmUser": {
-    "name": "zkat",
-    "email": "kat@sykosomatic.org"
+    "name": "iarna",
+    "email": "me@re-becca.org"
   },
   "dist": {
-    "shasum": "a28e05b5baeb3363cd473df68d30d3a80523a31c",
-    "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.9.1.tgz"
+    "shasum": "ca2ff94709b6d9aaad66533c11a0aff645f15c7d",
+    "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-1.9.3.tgz"
   },
   "maintainers": [
     {
@@ -78,5 +78,5 @@
     }
   ],
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.1.tgz"
+  "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-1.9.3.tgz"
 }
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore b/deps/npm/node_modules/npm-registry-client/node_modules/retry/.npmignore
new file mode 100644 (file)
index 0000000..e7726a0
--- /dev/null
@@ -0,0 +1,2 @@
+/node_modules/*
+npm-debug.log
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/License b/deps/npm/node_modules/npm-registry-client/node_modules/retry/License
new file mode 100644 (file)
index 0000000..0b58de3
--- /dev/null
@@ -0,0 +1,21 @@
+Copyright (c) 2011:
+Tim Koschützki (tim@debuggable.com)
+Felix Geisendörfer (felix@debuggable.com)
+
+ Permission is hereby granted, free of charge, to any person obtaining a copy
+ of this software and associated documentation files (the "Software"), to deal
+ in the Software without restriction, including without limitation the rights
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+ copies of the Software, and to permit persons to whom the Software is
+ furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice shall be included in
+ all copies or substantial portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+ THE SOFTWARE.
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile b/deps/npm/node_modules/npm-registry-client/node_modules/retry/Makefile
new file mode 100644 (file)
index 0000000..98e7167
--- /dev/null
@@ -0,0 +1,21 @@
+SHELL := /bin/bash
+
+test:
+       @node test/runner.js
+
+release-major: test
+       npm version major -m "Release %s"
+       git push
+       npm publish
+
+release-minor: test
+       npm version minor -m "Release %s"
+       git push
+       npm publish
+
+release-patch: test
+       npm version patch -m "Release %s"
+       git push
+       npm publish
+
+.PHONY: test
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md b/deps/npm/node_modules/npm-registry-client/node_modules/retry/README.md
new file mode 100644 (file)
index 0000000..09d9c8a
--- /dev/null
@@ -0,0 +1,195 @@
+# retry
+
+Abstraction for exponential and custom retry strategies for failed operations.
+
+## Installation
+
+    npm install retry
+
+## Current Status
+
+This module has been tested and is ready to be used.
+
+## Tutorial
+
+The example below will retry a potentially failing `dns.resolve` operation
+`10` times using an exponential backoff strategy. With the default settings, this
+means the last attempt is made after `17 minutes and 3 seconds`.
+
+``` javascript
+var dns = require('dns');
+var retry = require('retry');
+
+function faultTolerantResolve(address, cb) {
+  var operation = retry.operation();
+
+  operation.attempt(function(currentAttempt) {
+    dns.resolve(address, function(err, addresses) {
+      if (operation.retry(err)) {
+        return;
+      }
+
+      cb(err ? operation.mainError() : null, addresses);
+    });
+  });
+}
+
+faultTolerantResolve('nodejs.org', function(err, addresses) {
+  console.log(err, addresses);
+});
+```
+
+Of course you can also configure the factors that go into the exponential
+backoff. See the API documentation below for all available settings.
+currentAttempt is an int representing the number of attempts so far.
+
+``` javascript
+var operation = retry.operation({
+  retries: 5,
+  factor: 3,
+  minTimeout: 1 * 1000,
+  maxTimeout: 60 * 1000,
+  randomize: true,
+});
+```
+
+## API
+
+### retry.operation([options])
+
+Creates a new `RetryOperation` object. See the `retry.timeouts()` function
+below for available `options`.
+
+### retry.timeouts([options])
+
+Returns an array of timeouts. All time `options` and return values are in
+milliseconds. If `options` is an array, a copy of that array is returned.
+
+`options` is a JS object that can contain any of the following keys:
+
+* `retries`: The maximum amount of times to retry the operation. Default is `10`.
+* `factor`: The exponential factor to use. Default is `2`.
+* `minTimeout`: The number of milliseconds before starting the first retry. Default is `1000`.
+* `maxTimeout`: The maximum number of milliseconds between two retries. Default is `Infinity`.
+* `randomize`: Randomizes the timeouts by multiplying with a factor between `1` to `2`. Default is `false`.
+
+The formula used to calculate the individual timeouts is:
+
+```
+var Math.min(random * minTimeout * Math.pow(factor, attempt), maxTimeout);
+```
+
+Have a look at [this article][article] for a better explanation of approach.
+
+If you want to tune your `factor` / `times` settings to attempt the last retry
+after a certain amount of time, you can use wolfram alpha. For example in order
+to tune for `10` attempts in `5 minutes`, you can use this equation:
+
+![screenshot](https://github.com/tim-kos/node-retry/raw/master/equation.gif)
+
+Explaining the various values from left to right:
+
+* `k = 0 ... 9`:  The `retries` value (10)
+* `1000`: The `minTimeout` value in ms (1000)
+* `x^k`: No need to change this, `x` will be your resulting factor
+* `5 * 60 * 1000`: The desired total amount of time for retrying in ms (5 minutes)
+
+To make this a little easier for you, use wolfram alpha to do the calculations:
+
+<http://www.wolframalpha.com/input/?i=Sum%5B1000*x^k%2C+{k%2C+0%2C+9}%5D+%3D+5+*+60+*+1000>
+
+[article]: http://dthain.blogspot.com/2009/02/exponential-backoff-in-distributed.html
+
+### retry.createTimeout(attempt, opts)
+
+Returns a new `timeout` (integer in milliseconds) based on the given parameters.
+
+`attempt` is an integer representing for which retry the timeout should be calculated. If your retry operation was executed 4 times you had one attempt and 3 retries. If you then want to calculate a new timeout, you should set `attempt` to 4 (attempts are zero-indexed).
+
+`opts` can include `factor`, `minTimeout`, `randomize` (boolean) and `maxTimeout`. They are documented above.
+
+`retry.createTimeout()` is used internally by `retry.timeouts()` and is public for you to be able to create your own timeouts for reinserting an item, see [issue #13](https://github.com/tim-kos/node-retry/issues/13).
+
+### retry.wrap(obj, [options], [methodNames])
+
+Wrap all functions of the `obj` with retry. Optionally you can pass operation options and
+an array of method names which need to be wrapped.
+
+```
+retry.wrap(obj)
+
+retry.wrap(obj, ['method1', 'method2']);
+
+retry.wrap(obj, {retries: 3});
+
+retry.wrap(obj, {retries: 3}, ['method1', 'method2']);
+```
+The `options` object can take any options that the usual call to `retry.operation` can take.
+
+### new RetryOperation(timeouts)
+
+Creates a new `RetryOperation` where `timeouts` is an array where each value is
+a timeout given in milliseconds.
+
+#### retryOperation.errors()
+
+Returns an array of all errors that have been passed to
+`retryOperation.retry()` so far.
+
+#### retryOperation.mainError()
+
+A reference to the error object that occured most frequently. Errors are
+compared using the `error.message` property.
+
+If multiple error messages occured the same amount of time, the last error
+object with that message is returned.
+
+If no errors occured so far, the value is `null`.
+
+#### retryOperation.attempt(fn, timeoutOps)
+
+Defines the function `fn` that is to be retried and executes it for the first
+time right away. The `fn` function can receive an optional `currentAttempt` callback that represents the number of attempts to execute `fn` so far.
+
+Optionally defines `timeoutOps` which is an object having a property `timeout` in miliseconds and a property `cb` callback function.
+Whenever your retry operation takes longer than `timeout` to execute, the timeout callback function `cb` is called.
+
+
+#### retryOperation.try(fn)
+
+This is an alias for `retryOperation.attempt(fn)`. This is deprecated.
+
+#### retryOperation.start(fn)
+
+This is an alias for `retryOperation.attempt(fn)`. This is deprecated.
+
+#### retryOperation.retry(error)
+
+Returns `false` when no `error` value is given, or the maximum amount of retries
+has been reached.
+
+Otherwise it returns `true`, and retries the operation after the timeout for
+the current attempt number.
+
+#### retryOperation.attempts()
+
+Returns an int representing the number of attempts it took to call `fn` before it was successful.
+
+## License
+
+retry is licensed under the MIT license.
+
+
+#Changelog
+
+0.7.0 Some bugfixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13).
+
+0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in miliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called.
+
+0.5.0 Some minor refactorings.
+
+0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it.
+
+0.3.0 Added retryOperation.start() which is an alias for retryOperation.try().
+
+0.2.0 Added attempts() function and parameter to retryOperation.try() representing the number of attempts it took to call fn().
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif b/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif
new file mode 100644 (file)
index 0000000..9710723
Binary files /dev/null and b/deps/npm/node_modules/npm-registry-client/node_modules/retry/equation.gif differ
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/example/dns.js
new file mode 100644 (file)
index 0000000..d6351e9
--- /dev/null
@@ -0,0 +1,31 @@
+var dns = require('dns');
+var retry = require('../lib/retry');
+
+function faultTolerantResolve(address, cb) {
+  var opts = {
+    retries: 2,
+    factor: 2,
+    minTimeout: 1 * 1000,
+    maxTimeout: 2 * 1000,
+    randomize: true
+  };
+  var operation = retry.operation(opts);
+
+  operation.attempt(function(currentAttempt) {
+    dns.resolve(address, function(err, addresses) {
+      if (operation.retry(err)) {
+        return;
+      }
+
+      cb(operation.mainError(), operation.errors(), addresses);
+    });
+  });
+}
+
+faultTolerantResolve('nodejs.org', function(err, errors, addresses) {
+  console.warn('err:');
+  console.log(err);
+
+  console.warn('addresses:');
+  console.log(addresses);
+});
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/index.js
new file mode 100644 (file)
index 0000000..ee62f3a
--- /dev/null
@@ -0,0 +1 @@
+module.exports = require('./lib/retry');
\ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry.js
new file mode 100644 (file)
index 0000000..9468565
--- /dev/null
@@ -0,0 +1,94 @@
+var RetryOperation = require('./retry_operation');
+
+exports.operation = function(options) {
+  var retryForever = false;
+  if (options && options.forever === true) retryForever = true;
+  var timeouts = exports.timeouts(options);
+  return new RetryOperation(timeouts, retryForever);
+};
+
+exports.timeouts = function(options) {
+  if (options instanceof Array) {
+    return [].concat(options);
+  }
+
+  var opts = {
+    retries: 10,
+    factor: 2,
+    minTimeout: 1 * 1000,
+    maxTimeout: Infinity,
+    randomize: false
+  };
+  for (var key in options) {
+    opts[key] = options[key];
+  }
+
+  if (opts.minTimeout > opts.maxTimeout) {
+    throw new Error('minTimeout is greater than maxTimeout');
+  }
+
+  var timeouts = [];
+  for (var i = 0; i < opts.retries; i++) {
+    timeouts.push(this.createTimeout(i, opts));
+  }
+
+  // sort the array numerically ascending
+  timeouts.sort(function(a,b) {
+    return a - b;
+  });
+
+  return timeouts;
+};
+
+exports.createTimeout = function(attempt, opts) {
+  var random = (opts.randomize)
+    ? (Math.random() + 1)
+    : 1;
+
+  var timeout = Math.round(random * opts.minTimeout * Math.pow(opts.factor, attempt));
+  timeout = Math.min(timeout, opts.maxTimeout);
+
+  return timeout;
+};
+
+exports.wrap = function(obj, options, methods) {
+  if (options instanceof Array) {
+    methods = options;
+    options = null;
+  }
+
+  if (!methods) {
+    methods = [];
+    for (var key in obj) {
+      if (typeof obj[key] === 'function') {
+        methods.push(key);
+      }
+    }
+  }
+
+  for (var i = 0; i < methods.length; i++) {
+    var method   = methods[i];
+    var original = obj[method];
+
+    obj[method] = function retryWrapper() {
+      var op       = exports.operation(options);
+      var args     = Array.prototype.slice.call(arguments);
+      var callback = args.pop();
+
+      args.push(function(err) {
+        if (op.retry(err)) {
+          return;
+        }
+        if (err) {
+          arguments[0] = op.mainError();
+        }
+        callback.apply(this, arguments);
+      });
+
+      op.attempt(function() {
+        original.apply(obj, args);
+      });
+    };
+    obj[method].options = options;
+  }
+};
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/lib/retry_operation.js
new file mode 100644 (file)
index 0000000..52b8955
--- /dev/null
@@ -0,0 +1,120 @@
+function RetryOperation(timeouts, retryForever) {
+  this._timeouts = timeouts;
+  this._fn = null;
+  this._errors = [];
+  this._attempts = 1;
+  this._operationTimeout = null;
+  this._operationTimeoutCb = null;
+  this._timeout = null;
+
+  if (!!retryForever) {
+    this._cachedTimeouts = this._timeouts.slice(0);
+  }
+}
+module.exports = RetryOperation;
+
+RetryOperation.prototype.retry = function(err) {
+  if (this._timeout) {
+    clearTimeout(this._timeout);
+  }
+
+  if (!err) {
+    return false;
+  }
+
+  this._errors.push(err);
+
+  var timeout = this._timeouts.shift();
+  if (timeout === undefined) {
+    if (this._cachedTimeouts) {
+      // retry forever, only keep last error
+      this._errors.splice(this._errors.length - 1, this._errors.length);
+      this._timeouts = this._cachedTimeouts.slice(0);
+      timeout = this._timeouts.shift();
+    } else {
+      return false;
+    }
+  }
+
+  var self = this;
+  setTimeout(function() {
+    self._attempts++;
+
+    if (self._operationTimeoutCb) {
+      self._timeout = setTimeout(function() {
+        self._operationTimeoutCb(self._attempts);
+      }, self._operationTimeout);
+    }
+
+    self._fn(self._attempts);
+  }, timeout);
+
+  return true;
+};
+
+RetryOperation.prototype.attempt = function(fn, timeoutOps) {
+  this._fn = fn;
+
+  if (timeoutOps) {
+    if (timeoutOps.timeout) {
+      this._operationTimeout = timeoutOps.timeout;
+    }
+    if (timeoutOps.cb) {
+      this._operationTimeoutCb = timeoutOps.cb;
+    }
+  }
+
+  var self = this;
+  if (this._operationTimeoutCb) {
+    this._timeout = setTimeout(function() {
+      self._operationTimeoutCb();
+    }, self._operationTimeout);
+  }
+
+  this._fn(this._attempts);
+};
+
+RetryOperation.prototype.try = function(fn) {
+  console.log('Using RetryOperation.try() is deprecated');
+  this.attempt(fn);
+};
+
+RetryOperation.prototype.start = function(fn) {
+  console.log('Using RetryOperation.start() is deprecated');
+  this.attempt(fn);
+};
+
+RetryOperation.prototype.start = RetryOperation.prototype.try;
+
+RetryOperation.prototype.errors = function() {
+  return this._errors;
+};
+
+RetryOperation.prototype.attempts = function() {
+  return this._attempts;
+};
+
+RetryOperation.prototype.mainError = function() {
+  if (this._errors.length === 0) {
+    return null;
+  }
+
+  var counts = {};
+  var mainError = null;
+  var mainErrorCount = 0;
+
+  for (var i = 0; i < this._errors.length; i++) {
+    var error = this._errors[i];
+    var message = error.message;
+    var count = (counts[message] || 0) + 1;
+
+    counts[message] = count;
+
+    if (count >= mainErrorCount) {
+      mainError = error;
+      mainErrorCount = count;
+    }
+  }
+
+  return mainError;
+};
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json b/deps/npm/node_modules/npm-registry-client/node_modules/retry/package.json
new file mode 100644 (file)
index 0000000..dea2f3b
--- /dev/null
@@ -0,0 +1,54 @@
+{
+  "author": {
+    "name": "Tim Koschützki",
+    "email": "tim@debuggable.com",
+    "url": "http://debuggable.com/"
+  },
+  "name": "retry",
+  "description": "Abstraction for exponential and custom retry strategies for failed operations.",
+  "license": "MIT",
+  "version": "0.8.0",
+  "homepage": "https://github.com/tim-kos/node-retry",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/tim-kos/node-retry.git"
+  },
+  "directories": {
+    "lib": "./lib"
+  },
+  "main": "index",
+  "engines": {
+    "node": "*"
+  },
+  "dependencies": {},
+  "devDependencies": {
+    "fake": "0.2.0",
+    "far": "0.0.1"
+  },
+  "gitHead": "9446e803d6a41ae08732a4a215ae5bf1ff1ccfdd",
+  "bugs": {
+    "url": "https://github.com/tim-kos/node-retry/issues"
+  },
+  "_id": "retry@0.8.0",
+  "scripts": {},
+  "_shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f",
+  "_from": "retry@>=0.8.0 <0.9.0",
+  "_npmVersion": "2.1.7",
+  "_nodeVersion": "0.10.33",
+  "_npmUser": {
+    "name": "tim-kos",
+    "email": "tim@debuggable.com"
+  },
+  "maintainers": [
+    {
+      "name": "tim-kos",
+      "email": "tim@debuggable.com"
+    }
+  ],
+  "dist": {
+    "shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f",
+    "tarball": "http://registry.npmjs.org/retry/-/retry-0.8.0.tgz"
+  },
+  "_resolved": "https://registry.npmjs.org/retry/-/retry-0.8.0.tgz",
+  "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/common.js
new file mode 100644 (file)
index 0000000..2247206
--- /dev/null
@@ -0,0 +1,10 @@
+var common = module.exports;
+var path = require('path');
+
+var rootDir = path.join(__dirname, '..');
+common.dir = {
+  lib: rootDir + '/lib'
+};
+
+common.assert = require('assert');
+common.fake = require('fake');
\ No newline at end of file
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-operation.js
new file mode 100644 (file)
index 0000000..cecfa3b
--- /dev/null
@@ -0,0 +1,106 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var retry = require(common.dir.lib + '/retry');
+
+(function testErrors() {
+  var operation = retry.operation();
+
+  var error = new Error('some error');
+  var error2 = new Error('some other error');
+  operation._errors.push(error);
+  operation._errors.push(error2);
+
+  assert.deepEqual(operation.errors(), [error, error2]);
+})();
+
+(function testMainErrorReturnsMostFrequentError() {
+  var operation = retry.operation();
+  var error = new Error('some error');
+  var error2 = new Error('some other error');
+
+  operation._errors.push(error);
+  operation._errors.push(error2);
+  operation._errors.push(error);
+
+  assert.strictEqual(operation.mainError(), error);
+})();
+
+(function testMainErrorReturnsLastErrorOnEqualCount() {
+  var operation = retry.operation();
+  var error = new Error('some error');
+  var error2 = new Error('some other error');
+
+  operation._errors.push(error);
+  operation._errors.push(error2);
+
+  assert.strictEqual(operation.mainError(), error2);
+})();
+
+(function testAttempt() {
+  var operation = retry.operation();
+  var fn = new Function();
+
+  var timeoutOpts = {
+    timeout: 1,
+    cb: function() {}
+  };
+  operation.attempt(fn, timeoutOpts);
+
+  assert.strictEqual(fn, operation._fn);
+  assert.strictEqual(timeoutOpts.timeout, operation._operationTimeout);
+  assert.strictEqual(timeoutOpts.cb, operation._operationTimeoutCb);
+})();
+
+(function testRetry() {
+  var times = 3;
+  var error = new Error('some error');
+  var operation = retry.operation([1, 2, 3]);
+  var attempts = 0;
+
+  var finalCallback = fake.callback('finalCallback');
+  fake.expectAnytime(finalCallback);
+
+  var fn = function() {
+    operation.attempt(function(currentAttempt) {
+      attempts++;
+      assert.equal(currentAttempt, attempts);
+      if (operation.retry(error)) {
+        return;
+      }
+
+      assert.strictEqual(attempts, 4);
+      assert.strictEqual(operation.attempts(), attempts);
+      assert.strictEqual(operation.mainError(), error);
+      finalCallback();
+    });
+  };
+
+  fn();
+})();
+
+(function testRetryForever() {
+  var error = new Error('some error');
+  var operation = retry.operation({ retries: 3, forever: true });
+  var attempts = 0;
+
+  var finalCallback = fake.callback('finalCallback');
+  fake.expectAnytime(finalCallback);
+
+  var fn = function() {
+    operation.attempt(function(currentAttempt) {
+      attempts++;
+      assert.equal(currentAttempt, attempts);
+      if (attempts !== 6 && operation.retry(error)) {
+        return;
+      }
+
+      assert.strictEqual(attempts, 6);
+      assert.strictEqual(operation.attempts(), attempts);
+      assert.strictEqual(operation.mainError(), error);
+      finalCallback();
+    });
+  };
+
+  fn();
+})();
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-retry-wrap.js
new file mode 100644 (file)
index 0000000..7ca8bc7
--- /dev/null
@@ -0,0 +1,77 @@
+var common = require('../common');
+var assert = common.assert;
+var fake = common.fake.create();
+var retry = require(common.dir.lib + '/retry');
+
+function getLib() {
+  return {
+    fn1: function() {},
+    fn2: function() {},
+    fn3: function() {}
+  };
+}
+
+(function wrapAll() {
+  var lib = getLib();
+  retry.wrap(lib);
+  assert.equal(lib.fn1.name, 'retryWrapper');
+  assert.equal(lib.fn2.name, 'retryWrapper');
+  assert.equal(lib.fn3.name, 'retryWrapper');
+}());
+
+(function wrapAllPassOptions() {
+  var lib = getLib();
+  retry.wrap(lib, {retries: 2});
+  assert.equal(lib.fn1.name, 'retryWrapper');
+  assert.equal(lib.fn2.name, 'retryWrapper');
+  assert.equal(lib.fn3.name, 'retryWrapper');
+  assert.equal(lib.fn1.options.retries, 2);
+  assert.equal(lib.fn2.options.retries, 2);
+  assert.equal(lib.fn3.options.retries, 2);
+}());
+
+(function wrapDefined() {
+  var lib = getLib();
+  retry.wrap(lib, ['fn2', 'fn3']);
+  assert.notEqual(lib.fn1.name, 'retryWrapper');
+  assert.equal(lib.fn2.name, 'retryWrapper');
+  assert.equal(lib.fn3.name, 'retryWrapper');
+}());
+
+(function wrapDefinedAndPassOptions() {
+  var lib = getLib();
+  retry.wrap(lib, {retries: 2}, ['fn2', 'fn3']);
+  assert.notEqual(lib.fn1.name, 'retryWrapper');
+  assert.equal(lib.fn2.name, 'retryWrapper');
+  assert.equal(lib.fn3.name, 'retryWrapper');
+  assert.equal(lib.fn2.options.retries, 2);
+  assert.equal(lib.fn3.options.retries, 2);
+}());
+
+(function runWrappedWithoutError() {
+  var callbackCalled;
+  var lib = {method: function(a, b, callback) {
+    assert.equal(a, 1);
+    assert.equal(b, 2);
+    assert.equal(typeof callback, 'function');
+    callback();
+  }};
+  retry.wrap(lib);
+  lib.method(1, 2, function() {
+    callbackCalled = true;
+  });
+  assert.ok(callbackCalled);
+}());
+
+(function runWrappedWithError() {
+  var callbackCalled;
+  var lib = {method: function(callback) {
+    callback(new Error('Some error'));
+  }};
+  retry.wrap(lib, {retries: 1});
+  lib.method(function(err) {
+    callbackCalled = true;
+    assert.ok(err instanceof Error);
+  });
+  assert.ok(!callbackCalled);
+}());
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/integration/test-timeouts.js
new file mode 100644 (file)
index 0000000..7206b0f
--- /dev/null
@@ -0,0 +1,69 @@
+var common = require('../common');
+var assert = common.assert;
+var retry = require(common.dir.lib + '/retry');
+
+(function testDefaultValues() {
+  var timeouts = retry.timeouts();
+
+  assert.equal(timeouts.length, 10);
+  assert.equal(timeouts[0], 1000);
+  assert.equal(timeouts[1], 2000);
+  assert.equal(timeouts[2], 4000);
+})();
+
+(function testDefaultValuesWithRandomize() {
+  var minTimeout = 5000;
+  var timeouts = retry.timeouts({
+    minTimeout: minTimeout,
+    randomize: true
+  });
+
+  assert.equal(timeouts.length, 10);
+  assert.ok(timeouts[0] > minTimeout);
+  assert.ok(timeouts[1] > timeouts[0]);
+  assert.ok(timeouts[2] > timeouts[1]);
+})();
+
+(function testPassedTimeoutsAreUsed() {
+  var timeoutsArray = [1000, 2000, 3000];
+  var timeouts = retry.timeouts(timeoutsArray);
+  assert.deepEqual(timeouts, timeoutsArray);
+  assert.notStrictEqual(timeouts, timeoutsArray);
+})();
+
+(function testTimeoutsAreWithinBoundaries() {
+  var minTimeout = 1000;
+  var maxTimeout = 10000;
+  var timeouts = retry.timeouts({
+    minTimeout: minTimeout,
+    maxTimeout: maxTimeout
+  });
+  for (var i = 0; i < timeouts; i++) {
+    assert.ok(timeouts[i] >= minTimeout);
+    assert.ok(timeouts[i] <= maxTimeout);
+  }
+})();
+
+(function testTimeoutsAreIncremental() {
+  var timeouts = retry.timeouts();
+  var lastTimeout = timeouts[0];
+  for (var i = 0; i < timeouts; i++) {
+    assert.ok(timeouts[i] > lastTimeout);
+    lastTimeout = timeouts[i];
+  }
+})();
+
+(function testTimeoutsAreIncrementalForFactorsLessThanOne() {
+  var timeouts = retry.timeouts({
+    retries: 3,
+    factor: 0.5
+  });
+
+  var expected = [250, 500, 1000];
+  assert.deepEqual(expected, timeouts);
+})();
+
+(function testRetries() {
+  var timeouts = retry.timeouts({retries: 2});
+  assert.strictEqual(timeouts.length, 2);
+})();
diff --git a/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js b/deps/npm/node_modules/npm-registry-client/node_modules/retry/test/runner.js
new file mode 100644 (file)
index 0000000..e0ee2f5
--- /dev/null
@@ -0,0 +1,5 @@
+var far = require('far').create();
+
+far.add(__dirname);
+far.include(/\/test-.*\.js$/);
+far.execute();
diff --git a/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE b/deps/npm/node_modules/npmlog/node_modules/are-we-there-yet/LICENSE
new file mode 100644 (file)
index 0000000..af45880
--- /dev/null
@@ -0,0 +1,5 @@
+Copyright (c) 2015, Rebecca Turner
+
+Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
index 52f9f9a..ef2476e 100644 (file)
@@ -128,7 +128,8 @@ Tracker
     events.  Defaults to undefined.
   * **todo** *(optional)* The amount of work todo (a number). Defaults to 0.
 
-Ordinarily these are constructed as a part of a tracker group (via `newItem`) but they c
+Ordinarily these are constructed as a part of a tracker group (via
+`newItem`).
 
 * var completed = tracker.completed()
 
index 22f47ac..9e77119 100644 (file)
@@ -1,21 +1,21 @@
 "use strict"
-var stream = require("readable-stream");
+var stream = require("readable-stream")
 var EventEmitter = require("events").EventEmitter
 var util = require("util")
 var delegate = require("delegates")
 
+function noteChange (trackerGroup) {
+  return function (name) {
+    trackerGroup.emit('change', name || trackerGroup.name);
+  }
+}
+
 var TrackerGroup = exports.TrackerGroup = function (name) {
   EventEmitter.call(this)
   this.name = name
   this.trackGroup = []
-  var self = this
   this.totalWeight = 0
-  var noteChange = this.noteChange = function (name) {
-    self.emit("change", name || this.name)
-  }.bind(this)
-  this.trackGroup.forEach(function(unit) {
-    unit.on("change", noteChange)
-  })
+  this.noteChange = noteChange(this)
 }
 util.inherits(TrackerGroup, EventEmitter)
 
@@ -23,9 +23,10 @@ TrackerGroup.prototype.completed = function () {
   if (this.trackGroup.length==0) return 0
   var valPerWeight = 1 / this.totalWeight
   var completed = 0
-  this.trackGroup.forEach(function(T) {
-    completed += valPerWeight * T.weight *  T.completed()
-  })
+  for (var i = 0, len = this.trackGroup.length; i < len; i++){
+    var group = this.trackGroup[i];
+    completed += valPerWeight * group.weight *  group.completed()
+  }
   return completed
 }
 
@@ -33,6 +34,7 @@ TrackerGroup.prototype.addUnit = function (unit, weight, noChange) {
   unit.weight = weight || 1
   this.totalWeight += unit.weight
   this.trackGroup.push(unit)
+  // Bubble events back up
   unit.on("change", this.noteChange)
   if (! noChange) this.emit("change", this.name)
   return unit
@@ -51,12 +53,12 @@ TrackerGroup.prototype.newStream = function (name, todo, weight) {
 }
 
 TrackerGroup.prototype.finish = function () {
-  if (! this.trackGroup.length) { this.addUnit(new Tracker(), 1, true) }
-  var self = this
-  this.trackGroup.forEach(function(T) {
-    T.removeListener("change", self.noteChange)
-    T.finish()
-  })
+  if (! this.trackGroup.length) this.addUnit(new Tracker(), 1, true)
+  for (var i = 0, len = this.trackGroup.length; i < len; i++) {
+    var group = this.trackGroup[i]
+    group.removeListener("change", this.noteChange)
+    group.finish()
+  }
   this.emit("change", this.name)
 }
 
@@ -85,7 +87,7 @@ var Tracker = exports.Tracker = function (name,todo) {
 util.inherits(Tracker, EventEmitter)
 
 Tracker.prototype.completed = function () {
-  return this.workTodo==0 ? 0 : this.workDone / this.workTodo
+  return this.workTodo === 0 ? 0 : this.workDone / this.workTodo
 }
 
 Tracker.prototype.addWork = function (work) {
@@ -1,6 +1,4 @@
-Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
-DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
+Copyright (c) 2015 TJ Holowaychuk <tj@vision-media.ca>
 
 Permission is hereby granted, free of charge, to any person obtaining
 a copy of this software and associated documentation files (the
index ea3c1da..52014b7 100644 (file)
@@ -1,9 +1,9 @@
 {
   "name": "delegates",
-  "version": "0.1.0",
+  "version": "1.0.0",
   "repository": {
     "type": "git",
-    "url": "git://github.com/visionmedia/node-delegates.git"
+    "url": "git+https://github.com/visionmedia/node-delegates.git"
   },
   "description": "delegate methods and accessors to another property",
   "keywords": [
     "should": "*"
   },
   "license": "MIT",
+  "gitHead": "c4dc07ef1ed51c2b2a63f3585e5ef949ee577a49",
   "bugs": {
     "url": "https://github.com/visionmedia/node-delegates/issues"
   },
-  "homepage": "https://github.com/visionmedia/node-delegates",
-  "_id": "delegates@0.1.0",
-  "_shasum": "b4b57be11a1653517a04b27f0949bdc327dfe390",
-  "_from": "delegates@>=0.1.0 <0.2.0",
-  "_npmVersion": "1.4.9",
+  "homepage": "https://github.com/visionmedia/node-delegates#readme",
+  "_id": "delegates@1.0.0",
+  "scripts": {},
+  "_shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a",
+  "_from": "delegates@>=1.0.0 <2.0.0",
+  "_npmVersion": "3.3.12",
+  "_nodeVersion": "4.2.1",
   "_npmUser": {
-    "name": "dominicbarnes",
-    "email": "dominic@dbarnes.info"
+    "name": "tjholowaychuk",
+    "email": "tj@vision-media.ca"
   },
   "maintainers": [
     {
     }
   ],
   "dist": {
-    "shasum": "b4b57be11a1653517a04b27f0949bdc327dfe390",
-    "tarball": "http://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz"
+    "shasum": "84c6e159b81904fdca59a0ef44cd870d31250f9a",
+    "tarball": "http://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/delegates/-/delegates-0.1.0.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz"
 }
index 7591006..62b542c 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "are-we-there-yet",
-  "version": "1.0.4",
+  "version": "1.0.6",
   "description": "Keep track of the overall completion of many dispirate processes",
   "main": "index.js",
   "scripts": {
   },
   "homepage": "https://github.com/iarna/are-we-there-yet",
   "devDependencies": {
-    "tap": "^0.4.13"
+    "tap": "^5.2.0"
   },
   "dependencies": {
-    "delegates": "^0.1.0",
-    "readable-stream": "^1.1.13"
-  },
-  "gitHead": "7ce414849b81ab83935a935275def01914821bde",
-  "_id": "are-we-there-yet@1.0.4",
-  "_shasum": "527fe389f7bcba90806106b99244eaa07e886f85",
-  "_from": "are-we-there-yet@>=1.0.0 <1.1.0",
-  "_npmVersion": "2.0.0",
+    "delegates": "^1.0.0",
+    "readable-stream": "^2.0.0 || ^1.1.13"
+  },
+  "gitHead": "5f19c8b6f9c5afb8b0b17308cb9d66f7027ae526",
+  "_id": "are-we-there-yet@1.0.6",
+  "_shasum": "a2d28c93102aa6cc96245a26cb954de06ec53f0c",
+  "_from": "are-we-there-yet@>=1.0.6 <1.1.0",
+  "_npmVersion": "3.6.0",
+  "_nodeVersion": "5.4.0",
   "_npmUser": {
     "name": "iarna",
     "email": "me@re-becca.org"
   },
+  "dist": {
+    "shasum": "a2d28c93102aa6cc96245a26cb954de06ec53f0c",
+    "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.6.tgz"
+  },
   "maintainers": [
     {
       "name": "iarna",
       "email": "me@re-becca.org"
     }
   ],
-  "dist": {
-    "shasum": "527fe389f7bcba90806106b99244eaa07e886f85",
-    "tarball": "http://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz"
-  },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.4.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.0.6.tgz"
 }
index e9d3cc3..5a03e59 100644 (file)
@@ -26,9 +26,12 @@ If you have a UTF-16 locale then you won't be detected as unicode capable.
 
 ### Windows
 
-Since at least Windows 7, `cmd` and `powershell` have been unicode capable.
-As such, we report any Windows installation as unicode capable.
-
+Since at least Windows 7, `cmd` and `powershell` have been unicode capable,
+but unfortunately even then it's not guaranteed. In many localizations it
+still uses legacy code pages and there's no facility short of running
+programs or linking C++ that will let us detect this. As such, we
+report any Windows installation as NOT unicode capable, and recommend
+that you encourage your users to override this via config.
 
 ### Unix Like Operating Systems
 
index e0907b5..9bf537b 100644 (file)
@@ -2,9 +2,13 @@
 var os = require("os")
 
 var hasUnicode = module.exports = function () {
-  // Supported Win32 platforms (>XP) support unicode in the console, though
-  // font support isn't fantastic.
-  if (os.type() == "Windows_NT") { return true }
+  // Recent Win32 platforms (>XP) CAN support unicode in the console but
+  // don't have to, and in non-english locales often use traditional local
+  // code pages. There's no way, short of windows system calls or execing
+  // the chcp command line program to figure this out. As such, we default
+  // this to false and encourage your users to override it via config if
+  // appropriate.
+  if (os.type() == "Windows_NT") { return false }
 
   var isUTF8 = /[.]UTF-8/
   if (isUTF8.test(process.env.LC_ALL)
index 6430bb7..a9d9a54 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "has-unicode",
-  "version": "1.0.1",
+  "version": "2.0.0",
   "description": "Try to guess if your terminal supports unicode",
   "main": "index.js",
   "scripts": {
   },
   "homepage": "https://github.com/iarna/has-unicode",
   "devDependencies": {
-    "require-inject": "^1.1.1",
-    "tap": "^0.4.13"
+    "require-inject": "^1.3.0",
+    "tap": "^2.3.1"
   },
-  "gitHead": "d4ad300c67b25c197582e42e936ea928f7935d01",
-  "_id": "has-unicode@1.0.1",
-  "_shasum": "c46fceea053eb8ec789bffbba25fca52dfdcf38e",
-  "_from": "has-unicode@>=1.0.0 <2.0.0",
-  "_npmVersion": "3.3.6",
-  "_nodeVersion": "4.1.1",
+  "gitHead": "fdd5de141a5564bdb5bc991d951209da40f6a598",
+  "_id": "has-unicode@2.0.0",
+  "_shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3",
+  "_from": "has-unicode@>=2.0.0 <3.0.0",
+  "_npmVersion": "2.14.7",
+  "_nodeVersion": "4.2.2",
   "_npmUser": {
     "name": "iarna",
     "email": "me@re-becca.org"
   },
   "dist": {
-    "shasum": "c46fceea053eb8ec789bffbba25fca52dfdcf38e",
-    "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-1.0.1.tgz"
+    "shasum": "a3cd96c307ba41d559c5a2ee408c12a11c4c2ec3",
+    "tarball": "http://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz"
   },
   "maintainers": [
     {
@@ -48,6 +48,5 @@
     }
   ],
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-1.0.1.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.0.tgz"
 }
index 2394c14..cbdfda3 100644 (file)
@@ -7,7 +7,7 @@ test("Windows", function (t) {
   var hasUnicode = requireInject("../index.js", {
     os: { type: function () { return "Windows_NT" } }
   })
-  t.is(hasUnicode(), true, "Windows is assumed to be unicode aware")
+  t.is(hasUnicode(), false, "Windows is assumed NOT to be unicode aware")
 })
 test("Unix Env", function (t) {
   t.plan(3)
index 9cd87e5..b054ca5 100644 (file)
@@ -1,5 +1,5 @@
-Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
+Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
 DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
 
 Permission is hereby granted, free of charge, to any person obtaining
index 456d23d..94491c8 100644 (file)
@@ -1,20 +1,18 @@
-# lodash.pad v3.1.1
+# lodash.pad v3.2.2
 
-The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.pad` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
+The [lodash](https://lodash.com/) method `_.pad` exported as a [Node.js](https://nodejs.org/) module.
 
 ## Installation
 
 Using npm:
-
 ```bash
 $ {sudo -H} npm i -g npm
 $ npm i --save lodash.pad
 ```
 
-In Node.js/io.js:
-
+In Node.js:
 ```js
 var pad = require('lodash.pad');
 ```
 
-See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.1.1-npm-packages/lodash.pad) for more details.
+See the [documentation](https://lodash.com/docs#pad) or [package source](https://github.com/lodash/lodash/blob/3.2.2-npm-packages/lodash.pad) for more details.
index a29ccea..786b6a6 100644 (file)
 /**
- * lodash 3.1.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+ * lodash 3.2.2 (Custom Build) <https://lodash.com/>
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  * Available under MIT license <https://lodash.com/license>
  */
-var baseToString = require('lodash._basetostring'),
-    createPadding = require('lodash._createpadding');
+var repeat = require('lodash.repeat');
 
-/* Native method references for those with the same name as other `lodash` methods. */
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+    MAX_INTEGER = 1.7976931348623157e+308,
+    NAN = 0 / 0;
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]',
+    genTag = '[object GeneratorFunction]',
+    symbolTag = '[object Symbol]';
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Used to compose unicode character classes. */
+var rsAstralRange = '\\ud800-\\udfff',
+    rsComboMarksRange = '\\u0300-\\u036f\\ufe20-\\ufe23',
+    rsComboSymbolsRange = '\\u20d0-\\u20f0',
+    rsVarRange = '\\ufe0e\\ufe0f';
+
+/** Used to compose unicode capture groups. */
+var rsAstral = '[' + rsAstralRange + ']',
+    rsCombo = '[' + rsComboMarksRange + rsComboSymbolsRange + ']',
+    rsFitz = '\\ud83c[\\udffb-\\udfff]',
+    rsModifier = '(?:' + rsCombo + '|' + rsFitz + ')',
+    rsNonAstral = '[^' + rsAstralRange + ']',
+    rsRegional = '(?:\\ud83c[\\udde6-\\uddff]){2}',
+    rsSurrPair = '[\\ud800-\\udbff][\\udc00-\\udfff]',
+    rsZWJ = '\\u200d';
+
+/** Used to compose unicode regexes. */
+var reOptMod = rsModifier + '?',
+    rsOptVar = '[' + rsVarRange + ']?',
+    rsOptJoin = '(?:' + rsZWJ + '(?:' + [rsNonAstral, rsRegional, rsSurrPair].join('|') + ')' + rsOptVar + reOptMod + ')*',
+    rsSeq = rsOptVar + reOptMod + rsOptJoin,
+    rsSymbol = '(?:' + [rsNonAstral + rsCombo + '?', rsCombo, rsRegional, rsSurrPair, rsAstral].join('|') + ')';
+
+/** Used to match [string symbols](https://mathiasbynens.be/notes/javascript-unicode). */
+var reComplexSymbol = RegExp(rsFitz + '(?=' + rsFitz + ')|' + rsSymbol + rsSeq, 'g');
+
+/** Used to detect strings with [zero-width joiners or code points from the astral planes](http://eev.ee/blog/2015/09/12/dark-corners-of-unicode/). */
+var reHasComplexSymbol = RegExp('[' + rsZWJ + rsAstralRange  + rsComboMarksRange + rsComboSymbolsRange + rsVarRange + ']');
+
+/** Used to determine if values are of the language type `Object`. */
+var objectTypes = {
+  'function': true,
+  'object': true
+};
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/** Detect free variable `exports`. */
+var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
+
+/** Detect free variable `module`. */
+var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
+
+/** Detect free variable `self`. */
+var freeSelf = checkGlobal(objectTypes[typeof self] && self);
+
+/** Detect free variable `window`. */
+var freeWindow = checkGlobal(objectTypes[typeof window] && window);
+
+/** Detect `this` as the global object. */
+var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
+
+/**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
+
+/**
+ * Checks if `value` is a global object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {null|Object} Returns `value` if it's a global object, else `null`.
+ */
+function checkGlobal(value) {
+  return (value && value.Object === Object) ? value : null;
+}
+
+/**
+ * Gets the number of symbols in `string`.
+ *
+ * @private
+ * @param {string} string The string to inspect.
+ * @returns {number} Returns the string size.
+ */
+function stringSize(string) {
+  if (!(string && reHasComplexSymbol.test(string))) {
+    return string.length;
+  }
+  var result = reComplexSymbol.lastIndex = 0;
+  while (reComplexSymbol.test(string)) {
+    result++;
+  }
+  return result;
+}
+
+/**
+ * Converts `string` to an array.
+ *
+ * @private
+ * @param {string} string The string to convert.
+ * @returns {Array} Returns the converted array.
+ */
+function stringToArray(string) {
+  return string.match(reComplexSymbol);
+}
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
 var nativeCeil = Math.ceil,
-    nativeFloor = Math.floor,
-    nativeIsFinite = global.isFinite;
+    nativeFloor = Math.floor;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+    symbolToString = Symbol ? symbolProto.toString : undefined;
+
+/**
+ * Creates the padding for `string` based on `length`. The `chars` string
+ * is truncated if the number of characters exceeds `length`.
+ *
+ * @private
+ * @param {string} string The string to create padding for.
+ * @param {number} [length=0] The padding length.
+ * @param {string} [chars=' '] The string used as padding.
+ * @returns {string} Returns the padding for `string`.
+ */
+function createPadding(string, length, chars) {
+  length = toInteger(length);
+
+  var strLength = stringSize(string);
+  if (!length || strLength >= length) {
+    return '';
+  }
+  var padLength = length - strLength;
+  chars = chars === undefined ? ' ' : (chars + '');
+
+  var result = repeat(chars, nativeCeil(padLength / stringSize(chars)));
+  return reHasComplexSymbol.test(chars)
+    ? stringToArray(result).slice(0, padLength).join('')
+    : result.slice(0, padLength);
+}
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+  // The use of `Object#toString` avoids issues with the `typeof` operator
+  // in Safari 8 which returns 'object' for typed array constructors, and
+  // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
+  var tag = isObject(value) ? objectToString.call(value) : '';
+  return tag == funcTag || tag == genTag;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+  var type = typeof value;
+  return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+  return !!value && typeof value == 'object';
+}
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+  return typeof value == 'symbol' ||
+    (isObjectLike(value) && objectToString.call(value) == symbolTag);
+}
+
+/**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3');
+ * // => 3
+ */
+function toInteger(value) {
+  if (!value) {
+    return value === 0 ? value : 0;
+  }
+  value = toNumber(value);
+  if (value === INFINITY || value === -INFINITY) {
+    var sign = (value < 0 ? -1 : 1);
+    return sign * MAX_INTEGER;
+  }
+  var remainder = value % 1;
+  return value === value ? (remainder ? value - remainder : value) : 0;
+}
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3);
+ * // => 3
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3');
+ * // => 3
+ */
+function toNumber(value) {
+  if (isObject(value)) {
+    var other = isFunction(value.valueOf) ? value.valueOf() : value;
+    value = isObject(other) ? (other + '') : other;
+  }
+  if (typeof value != 'string') {
+    return value === 0 ? value : +value;
+  }
+  value = value.replace(reTrim, '');
+  var isBinary = reIsBinary.test(value);
+  return (isBinary || reIsOctal.test(value))
+    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+    : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+  // Exit early for strings to avoid a performance hit in some environments.
+  if (typeof value == 'string') {
+    return value;
+  }
+  if (value == null) {
+    return '';
+  }
+  if (isSymbol(value)) {
+    return Symbol ? symbolToString.call(value) : '';
+  }
+  var result = (value + '');
+  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
 
 /**
  * Pads `string` on the left and right sides if it's shorter than `length`.
@@ -37,19 +412,18 @@ var nativeCeil = Math.ceil,
  * // => 'abc'
  */
 function pad(string, length, chars) {
-  string = baseToString(string);
-  length = +length;
+  string = toString(string);
+  length = toInteger(length);
 
-  var strLength = string.length;
-  if (strLength >= length || !nativeIsFinite(length)) {
+  var strLength = stringSize(string);
+  if (!length || strLength >= length) {
     return string;
   }
   var mid = (length - strLength) / 2,
       leftLength = nativeFloor(mid),
       rightLength = nativeCeil(mid);
 
-  chars = createPadding('', rightLength, chars);
-  return chars.slice(0, leftLength) + string + chars;
+  return createPadding('', leftLength, chars) + string + createPadding('', rightLength, chars);
 }
 
 module.exports = pad;
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/LICENSE
deleted file mode 100644 (file)
index 9cd87e5..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
-DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
-
-Permission is hereby granted, free of charge, to any person obtaining
-a copy of this software and associated documentation files (the
-"Software"), to deal in the Software without restriction, including
-without limitation the rights to use, copy, modify, merge, publish,
-distribute, sublicense, and/or sell copies of the Software, and to
-permit persons to whom the Software is furnished to do so, subject to
-the following conditions:
-
-The above copyright notice and this permission notice shall be
-included in all copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/README.md
deleted file mode 100644 (file)
index f81145e..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# lodash._basetostring v3.0.1
-
-The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `baseToString` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
-
-## Installation
-
-Using npm:
-
-```bash
-$ {sudo -H} npm i -g npm
-$ npm i --save lodash._basetostring
-```
-
-In Node.js/io.js:
-
-```js
-var baseToString = require('lodash._basetostring');
-```
-
-See the [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash._basetostring) for more details.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/index.js
deleted file mode 100644 (file)
index db8ecc9..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-/**
- * lodash 3.0.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-
-/**
- * Converts `value` to a string if it's not one. An empty string is returned
- * for `null` or `undefined` values.
- *
- * @private
- * @param {*} value The value to process.
- * @returns {string} Returns the string.
- */
-function baseToString(value) {
-  return value == null ? '' : (value + '');
-}
-
-module.exports = baseToString;
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._basetostring/package.json
deleted file mode 100644 (file)
index f592f32..0000000
+++ /dev/null
@@ -1,88 +0,0 @@
-{
-  "name": "lodash._basetostring",
-  "version": "3.0.1",
-  "description": "The modern build of lodash’s internal `baseToString` as a module.",
-  "homepage": "https://lodash.com/",
-  "icon": "https://lodash.com/icon.svg",
-  "license": "MIT",
-  "author": {
-    "name": "John-David Dalton",
-    "email": "john.david.dalton@gmail.com",
-    "url": "http://allyoucanleet.com/"
-  },
-  "contributors": [
-    {
-      "name": "John-David Dalton",
-      "email": "john.david.dalton@gmail.com",
-      "url": "http://allyoucanleet.com/"
-    },
-    {
-      "name": "Benjamin Tan",
-      "email": "demoneaux@gmail.com",
-      "url": "https://d10.github.io/"
-    },
-    {
-      "name": "Blaine Bublitz",
-      "email": "blaine@iceddev.com",
-      "url": "http://www.iceddev.com/"
-    },
-    {
-      "name": "Kit Cambridge",
-      "email": "github@kitcambridge.be",
-      "url": "http://kitcambridge.be/"
-    },
-    {
-      "name": "Mathias Bynens",
-      "email": "mathias@qiwi.be",
-      "url": "https://mathiasbynens.be/"
-    }
-  ],
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/lodash/lodash.git"
-  },
-  "scripts": {
-    "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
-  },
-  "bugs": {
-    "url": "https://github.com/lodash/lodash/issues"
-  },
-  "_id": "lodash._basetostring@3.0.1",
-  "_shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
-  "_from": "lodash._basetostring@>=3.0.0 <4.0.0",
-  "_npmVersion": "2.12.0",
-  "_nodeVersion": "0.12.5",
-  "_npmUser": {
-    "name": "jdalton",
-    "email": "john.david.dalton@gmail.com"
-  },
-  "maintainers": [
-    {
-      "name": "jdalton",
-      "email": "john.david.dalton@gmail.com"
-    },
-    {
-      "name": "d10",
-      "email": "demoneaux@gmail.com"
-    },
-    {
-      "name": "kitcambridge",
-      "email": "github@kitcambridge.be"
-    },
-    {
-      "name": "mathias",
-      "email": "mathias@qiwi.be"
-    },
-    {
-      "name": "phated",
-      "email": "blaine@iceddev.com"
-    }
-  ],
-  "dist": {
-    "shasum": "d1861d877f824a52f669832dcaf3ee15566a07d5",
-    "tarball": "http://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz"
-  },
-  "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash._basetostring/-/lodash._basetostring-3.0.1.tgz",
-  "readme": "ERROR: No README data found!"
-}
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/README.md
deleted file mode 100644 (file)
index f9c9411..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# lodash._createpadding v3.6.1
-
-The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) internal `createPadding` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
-
-## Installation
-
-Using npm:
-
-```bash
-$ {sudo -H} npm i -g npm
-$ npm i --save lodash._createpadding
-```
-
-In Node.js/io.js:
-
-```js
-var createPadding = require('lodash._createpadding');
-```
-
-See the [package source](https://github.com/lodash/lodash/blob/3.6.1-npm-packages/lodash._createpadding) for more details.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/index.js
deleted file mode 100644 (file)
index 3541a8a..0000000
+++ /dev/null
@@ -1,37 +0,0 @@
-/**
- * lodash 3.6.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-var repeat = require('lodash.repeat');
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeCeil = Math.ceil,
-    nativeIsFinite = global.isFinite;
-
-/**
- * Creates the padding required for `string` based on the given `length`.
- * The `chars` string is truncated if the number of characters exceeds `length`.
- *
- * @private
- * @param {string} string The string to create padding for.
- * @param {number} [length=0] The padding length.
- * @param {string} [chars=' '] The string used as padding.
- * @returns {string} Returns the pad for `string`.
- */
-function createPadding(string, length, chars) {
-  var strLength = string.length;
-  length = +length;
-
-  if (strLength >= length || !nativeIsFinite(length)) {
-    return '';
-  }
-  var padLength = length - strLength;
-  chars = chars == null ? ' ' : (chars + '');
-  return repeat(chars, nativeCeil(padLength / chars.length)).slice(0, padLength);
-}
-
-module.exports = createPadding;
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/README.md
deleted file mode 100644 (file)
index dec571a..0000000
+++ /dev/null
@@ -1,20 +0,0 @@
-# lodash.repeat v3.0.1
-
-The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
-
-## Installation
-
-Using npm:
-
-```bash
-$ {sudo -H} npm i -g npm
-$ npm i --save lodash.repeat
-```
-
-In Node.js/io.js:
-
-```js
-var repeat = require('lodash.repeat');
-```
-
-See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/node_modules/lodash.repeat/index.js
deleted file mode 100644 (file)
index 367913f..0000000
+++ /dev/null
@@ -1,55 +0,0 @@
-/**
- * lodash 3.0.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
- * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
- * Available under MIT license <https://lodash.com/license>
- */
-var baseToString = require('lodash._basetostring');
-
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeFloor = Math.floor,
-    nativeIsFinite = global.isFinite;
-
-/**
- * Repeats the given string `n` times.
- *
- * @static
- * @memberOf _
- * @category String
- * @param {string} [string=''] The string to repeat.
- * @param {number} [n=0] The number of times to repeat the string.
- * @returns {string} Returns the repeated string.
- * @example
- *
- * _.repeat('*', 3);
- * // => '***'
- *
- * _.repeat('abc', 2);
- * // => 'abcabc'
- *
- * _.repeat('abc', 0);
- * // => ''
- */
-function repeat(string, n) {
-  var result = '';
-  string = baseToString(string);
-  n = +n;
-  if (n < 1 || !string || !nativeIsFinite(n)) {
-    return result;
-  }
-  // Leverage the exponentiation by squaring algorithm for a faster repeat.
-  // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
-  do {
-    if (n % 2) {
-      result += string;
-    }
-    n = nativeFloor(n / 2);
-    string += string;
-  } while (n);
-
-  return result;
-}
-
-module.exports = repeat;
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash._createpadding/package.json
deleted file mode 100644 (file)
index 376b174..0000000
+++ /dev/null
@@ -1,91 +0,0 @@
-{
-  "name": "lodash._createpadding",
-  "version": "3.6.1",
-  "description": "The modern build of lodash’s internal `createPadding` as a module.",
-  "homepage": "https://lodash.com/",
-  "icon": "https://lodash.com/icon.svg",
-  "license": "MIT",
-  "author": {
-    "name": "John-David Dalton",
-    "email": "john.david.dalton@gmail.com",
-    "url": "http://allyoucanleet.com/"
-  },
-  "contributors": [
-    {
-      "name": "John-David Dalton",
-      "email": "john.david.dalton@gmail.com",
-      "url": "http://allyoucanleet.com/"
-    },
-    {
-      "name": "Benjamin Tan",
-      "email": "demoneaux@gmail.com",
-      "url": "https://d10.github.io/"
-    },
-    {
-      "name": "Blaine Bublitz",
-      "email": "blaine@iceddev.com",
-      "url": "http://www.iceddev.com/"
-    },
-    {
-      "name": "Kit Cambridge",
-      "email": "github@kitcambridge.be",
-      "url": "http://kitcambridge.be/"
-    },
-    {
-      "name": "Mathias Bynens",
-      "email": "mathias@qiwi.be",
-      "url": "https://mathiasbynens.be/"
-    }
-  ],
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/lodash/lodash.git"
-  },
-  "scripts": {
-    "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
-  },
-  "dependencies": {
-    "lodash.repeat": "^3.0.0"
-  },
-  "bugs": {
-    "url": "https://github.com/lodash/lodash/issues"
-  },
-  "_id": "lodash._createpadding@3.6.1",
-  "_shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
-  "_from": "lodash._createpadding@>=3.0.0 <4.0.0",
-  "_npmVersion": "2.12.0",
-  "_nodeVersion": "0.12.5",
-  "_npmUser": {
-    "name": "jdalton",
-    "email": "john.david.dalton@gmail.com"
-  },
-  "maintainers": [
-    {
-      "name": "jdalton",
-      "email": "john.david.dalton@gmail.com"
-    },
-    {
-      "name": "d10",
-      "email": "demoneaux@gmail.com"
-    },
-    {
-      "name": "kitcambridge",
-      "email": "github@kitcambridge.be"
-    },
-    {
-      "name": "mathias",
-      "email": "mathias@qiwi.be"
-    },
-    {
-      "name": "phated",
-      "email": "blaine@iceddev.com"
-    }
-  ],
-  "dist": {
-    "shasum": "4907b438595adc54ee8935527a6c424c02c81a87",
-    "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
-  },
-  "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
-  "readme": "ERROR: No README data found!"
-}
@@ -1,5 +1,5 @@
-Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
+Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
 DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
 
 Permission is hereby granted, free of charge, to any person obtaining
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/README.md b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/README.md
new file mode 100644 (file)
index 0000000..a18ab41
--- /dev/null
@@ -0,0 +1,18 @@
+# lodash.repeat v3.1.2
+
+The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module.
+
+## Installation
+
+Using npm:
+```bash
+$ {sudo -H} npm i -g npm
+$ npm i --save lodash.repeat
+```
+
+In Node.js:
+```js
+var repeat = require('lodash.repeat');
+```
+
+See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.repeat) for more details.
diff --git a/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/index.js b/deps/npm/node_modules/npmlog/node_modules/gauge/node_modules/lodash.pad/node_modules/lodash.repeat/index.js
new file mode 100644 (file)
index 0000000..f84e2a7
--- /dev/null
@@ -0,0 +1,348 @@
+/**
+ * lodash 3.1.2 (Custom Build) <https://lodash.com/>
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
+ * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Available under MIT license <https://lodash.com/license>
+ */
+
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+    MAX_SAFE_INTEGER = 9007199254740991,
+    MAX_INTEGER = 1.7976931348623157e+308,
+    NAN = 0 / 0;
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]',
+    genTag = '[object GeneratorFunction]',
+    symbolTag = '[object Symbol]';
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Used to determine if values are of the language type `Object`. */
+var objectTypes = {
+  'function': true,
+  'object': true
+};
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/** Detect free variable `exports`. */
+var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
+
+/** Detect free variable `module`. */
+var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
+
+/** Detect free variable `self`. */
+var freeSelf = checkGlobal(objectTypes[typeof self] && self);
+
+/** Detect free variable `window`. */
+var freeWindow = checkGlobal(objectTypes[typeof window] && window);
+
+/** Detect `this` as the global object. */
+var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
+
+/**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
+
+/**
+ * Checks if `value` is a global object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {null|Object} Returns `value` if it's a global object, else `null`.
+ */
+function checkGlobal(value) {
+  return (value && value.Object === Object) ? value : null;
+}
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+    symbolToString = Symbol ? symbolProto.toString : undefined;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+  // The use of `Object#toString` avoids issues with the `typeof` operator
+  // in Safari 8 which returns 'object' for typed array constructors, and
+  // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
+  var tag = isObject(value) ? objectToString.call(value) : '';
+  return tag == funcTag || tag == genTag;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+  var type = typeof value;
+  return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+  return !!value && typeof value == 'object';
+}
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+  return typeof value == 'symbol' ||
+    (isObjectLike(value) && objectToString.call(value) == symbolTag);
+}
+
+/**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3');
+ * // => 3
+ */
+function toInteger(value) {
+  if (!value) {
+    return value === 0 ? value : 0;
+  }
+  value = toNumber(value);
+  if (value === INFINITY || value === -INFINITY) {
+    var sign = (value < 0 ? -1 : 1);
+    return sign * MAX_INTEGER;
+  }
+  var remainder = value % 1;
+  return value === value ? (remainder ? value - remainder : value) : 0;
+}
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3);
+ * // => 3
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3');
+ * // => 3
+ */
+function toNumber(value) {
+  if (isObject(value)) {
+    var other = isFunction(value.valueOf) ? value.valueOf() : value;
+    value = isObject(other) ? (other + '') : other;
+  }
+  if (typeof value != 'string') {
+    return value === 0 ? value : +value;
+  }
+  value = value.replace(reTrim, '');
+  var isBinary = reIsBinary.test(value);
+  return (isBinary || reIsOctal.test(value))
+    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+    : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+  // Exit early for strings to avoid a performance hit in some environments.
+  if (typeof value == 'string') {
+    return value;
+  }
+  if (value == null) {
+    return '';
+  }
+  if (isSymbol(value)) {
+    return Symbol ? symbolToString.call(value) : '';
+  }
+  var result = (value + '');
+  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
+
+/**
+ * Repeats the given string `n` times.
+ *
+ * @static
+ * @memberOf _
+ * @category String
+ * @param {string} [string=''] The string to repeat.
+ * @param {number} [n=0] The number of times to repeat the string.
+ * @returns {string} Returns the repeated string.
+ * @example
+ *
+ * _.repeat('*', 3);
+ * // => '***'
+ *
+ * _.repeat('abc', 2);
+ * // => 'abcabc'
+ *
+ * _.repeat('abc', 0);
+ * // => ''
+ */
+function repeat(string, n) {
+  string = toString(string);
+  n = toInteger(n);
+
+  var result = '';
+  if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
+    return result;
+  }
+  // Leverage the exponentiation by squaring algorithm for a faster repeat.
+  // See https://en.wikipedia.org/wiki/Exponentiation_by_squaring for more details.
+  do {
+    if (n % 2) {
+      result += string;
+    }
+    n = nativeFloor(n / 2);
+    string += string;
+  } while (n);
+
+  return result;
+}
+
+module.exports = repeat;
@@ -1,15 +1,13 @@
 {
   "name": "lodash.repeat",
-  "version": "3.0.1",
-  "description": "The modern build of lodash’s `_.repeat` as a module.",
+  "version": "3.1.2",
+  "description": "The lodash method `_.repeat` exported as a module.",
   "homepage": "https://lodash.com/",
   "icon": "https://lodash.com/icon.svg",
   "license": "MIT",
   "keywords": [
-    "lodash",
     "lodash-modularized",
-    "stdlib",
-    "util"
+    "repeat"
   ],
   "author": {
     "name": "John-David Dalton",
       "url": "http://allyoucanleet.com/"
     },
     {
-      "name": "Benjamin Tan",
-      "email": "demoneaux@gmail.com",
-      "url": "https://d10.github.io/"
-    },
-    {
       "name": "Blaine Bublitz",
       "email": "blaine@iceddev.com",
-      "url": "http://www.iceddev.com/"
-    },
-    {
-      "name": "Kit Cambridge",
-      "email": "github@kitcambridge.be",
-      "url": "http://kitcambridge.be/"
+      "url": "https://github.com/phated"
     },
     {
       "name": "Mathias Bynens",
   "scripts": {
     "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
   },
-  "dependencies": {
-    "lodash._basetostring": "^3.0.0"
-  },
   "bugs": {
     "url": "https://github.com/lodash/lodash/issues"
   },
-  "_id": "lodash.repeat@3.0.1",
-  "_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
+  "_id": "lodash.repeat@3.1.2",
+  "_shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
   "_from": "lodash.repeat@>=3.0.0 <4.0.0",
-  "_npmVersion": "2.12.0",
-  "_nodeVersion": "0.12.5",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "5.4.0",
   "_npmUser": {
     "name": "jdalton",
     "email": "john.david.dalton@gmail.com"
   },
+  "dist": {
+    "shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
+    "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz"
+  },
   "maintainers": [
     {
       "name": "jdalton",
       "email": "john.david.dalton@gmail.com"
     },
     {
-      "name": "d10",
-      "email": "demoneaux@gmail.com"
-    },
-    {
-      "name": "kitcambridge",
-      "email": "github@kitcambridge.be"
-    },
-    {
       "name": "mathias",
       "email": "mathias@qiwi.be"
     },
       "email": "blaine@iceddev.com"
     }
   ],
-  "dist": {
-    "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
-    "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz"
+  "_npmOperationalInternal": {
+    "host": "packages-6-west.internal.npmjs.com",
+    "tmp": "tmp/lodash.repeat-3.1.2.tgz_1454484666569_0.24294439097866416"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz"
 }
index c18ed47..bda44d6 100644 (file)
@@ -1,15 +1,13 @@
 {
   "name": "lodash.pad",
-  "version": "3.1.1",
-  "description": "The modern build of lodash’s `_.pad` as a module.",
+  "version": "3.2.2",
+  "description": "The lodash method `_.pad` exported as a module.",
   "homepage": "https://lodash.com/",
   "icon": "https://lodash.com/icon.svg",
   "license": "MIT",
   "keywords": [
-    "lodash",
     "lodash-modularized",
-    "stdlib",
-    "util"
+    "pad"
   ],
   "author": {
     "name": "John-David Dalton",
       "url": "http://allyoucanleet.com/"
     },
     {
-      "name": "Benjamin Tan",
-      "email": "demoneaux@gmail.com",
-      "url": "https://d10.github.io/"
-    },
-    {
       "name": "Blaine Bublitz",
       "email": "blaine@iceddev.com",
-      "url": "http://www.iceddev.com/"
-    },
-    {
-      "name": "Kit Cambridge",
-      "email": "github@kitcambridge.be",
-      "url": "http://kitcambridge.be/"
+      "url": "https://github.com/phated"
     },
     {
       "name": "Mathias Bynens",
     "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
   },
   "dependencies": {
-    "lodash._basetostring": "^3.0.0",
-    "lodash._createpadding": "^3.0.0"
+    "lodash.repeat": "^3.0.0"
   },
   "bugs": {
     "url": "https://github.com/lodash/lodash/issues"
   },
-  "_id": "lodash.pad@3.1.1",
-  "_shasum": "2e078ebc33b331d2ba34bf8732af129fd5c04624",
+  "_id": "lodash.pad@3.2.2",
+  "_shasum": "fb7fdded36eb773f839ab6b5291dac03cb65c88a",
   "_from": "lodash.pad@>=3.0.0 <4.0.0",
-  "_npmVersion": "2.12.0",
-  "_nodeVersion": "0.12.5",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "5.4.0",
   "_npmUser": {
     "name": "jdalton",
     "email": "john.david.dalton@gmail.com"
   },
+  "dist": {
+    "shasum": "fb7fdded36eb773f839ab6b5291dac03cb65c88a",
+    "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.2.2.tgz"
+  },
   "maintainers": [
     {
       "name": "jdalton",
       "email": "john.david.dalton@gmail.com"
     },
     {
-      "name": "d10",
-      "email": "demoneaux@gmail.com"
-    },
-    {
-      "name": "kitcambridge",
-      "email": "github@kitcambridge.be"
-    },
-    {
       "name": "mathias",
       "email": "mathias@qiwi.be"
     },
       "email": "blaine@iceddev.com"
     }
   ],
-  "dist": {
-    "shasum": "2e078ebc33b331d2ba34bf8732af129fd5c04624",
-    "tarball": "http://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz"
+  "_npmOperationalInternal": {
+    "host": "packages-9-west.internal.npmjs.com",
+    "tmp": "tmp/lodash.pad-3.2.2.tgz_1454484625805_0.547145590884611"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.1.1.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/lodash.pad/-/lodash.pad-3.2.2.tgz"
 }
index 9cd87e5..b054ca5 100644 (file)
@@ -1,5 +1,5 @@
-Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
+Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
 DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
 
 Permission is hereby granted, free of charge, to any person obtaining
index dec571a..a18ab41 100644 (file)
@@ -1,20 +1,18 @@
-# lodash.repeat v3.0.1
+# lodash.repeat v3.1.2
 
-The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
+The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module.
 
 ## Installation
 
 Using npm:
-
 ```bash
 $ {sudo -H} npm i -g npm
 $ npm i --save lodash.repeat
 ```
 
-In Node.js/io.js:
-
+In Node.js:
 ```js
 var repeat = require('lodash.repeat');
 ```
 
-See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details.
+See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.repeat) for more details.
index 367913f..f84e2a7 100644 (file)
 /**
- * lodash 3.0.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+ * lodash 3.1.2 (Custom Build) <https://lodash.com/>
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  * Available under MIT license <https://lodash.com/license>
  */
-var baseToString = require('lodash._basetostring');
 
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeFloor = Math.floor,
-    nativeIsFinite = global.isFinite;
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+    MAX_SAFE_INTEGER = 9007199254740991,
+    MAX_INTEGER = 1.7976931348623157e+308,
+    NAN = 0 / 0;
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]',
+    genTag = '[object GeneratorFunction]',
+    symbolTag = '[object Symbol]';
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Used to determine if values are of the language type `Object`. */
+var objectTypes = {
+  'function': true,
+  'object': true
+};
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/** Detect free variable `exports`. */
+var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
+
+/** Detect free variable `module`. */
+var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
+
+/** Detect free variable `self`. */
+var freeSelf = checkGlobal(objectTypes[typeof self] && self);
+
+/** Detect free variable `window`. */
+var freeWindow = checkGlobal(objectTypes[typeof window] && window);
+
+/** Detect `this` as the global object. */
+var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
+
+/**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
+
+/**
+ * Checks if `value` is a global object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {null|Object} Returns `value` if it's a global object, else `null`.
+ */
+function checkGlobal(value) {
+  return (value && value.Object === Object) ? value : null;
+}
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+    symbolToString = Symbol ? symbolProto.toString : undefined;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+  // The use of `Object#toString` avoids issues with the `typeof` operator
+  // in Safari 8 which returns 'object' for typed array constructors, and
+  // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
+  var tag = isObject(value) ? objectToString.call(value) : '';
+  return tag == funcTag || tag == genTag;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+  var type = typeof value;
+  return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+  return !!value && typeof value == 'object';
+}
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+  return typeof value == 'symbol' ||
+    (isObjectLike(value) && objectToString.call(value) == symbolTag);
+}
+
+/**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3');
+ * // => 3
+ */
+function toInteger(value) {
+  if (!value) {
+    return value === 0 ? value : 0;
+  }
+  value = toNumber(value);
+  if (value === INFINITY || value === -INFINITY) {
+    var sign = (value < 0 ? -1 : 1);
+    return sign * MAX_INTEGER;
+  }
+  var remainder = value % 1;
+  return value === value ? (remainder ? value - remainder : value) : 0;
+}
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3);
+ * // => 3
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3');
+ * // => 3
+ */
+function toNumber(value) {
+  if (isObject(value)) {
+    var other = isFunction(value.valueOf) ? value.valueOf() : value;
+    value = isObject(other) ? (other + '') : other;
+  }
+  if (typeof value != 'string') {
+    return value === 0 ? value : +value;
+  }
+  value = value.replace(reTrim, '');
+  var isBinary = reIsBinary.test(value);
+  return (isBinary || reIsOctal.test(value))
+    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+    : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+  // Exit early for strings to avoid a performance hit in some environments.
+  if (typeof value == 'string') {
+    return value;
+  }
+  if (value == null) {
+    return '';
+  }
+  if (isSymbol(value)) {
+    return Symbol ? symbolToString.call(value) : '';
+  }
+  var result = (value + '');
+  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
 
 /**
  * Repeats the given string `n` times.
@@ -33,10 +325,11 @@ var nativeFloor = Math.floor,
  * // => ''
  */
 function repeat(string, n) {
+  string = toString(string);
+  n = toInteger(n);
+
   var result = '';
-  string = baseToString(string);
-  n = +n;
-  if (n < 1 || !string || !nativeIsFinite(n)) {
+  if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
     return result;
   }
   // Leverage the exponentiation by squaring algorithm for a faster repeat.
index f941138..0f5f953 100644 (file)
@@ -1,15 +1,13 @@
 {
   "name": "lodash.repeat",
-  "version": "3.0.1",
-  "description": "The modern build of lodash’s `_.repeat` as a module.",
+  "version": "3.1.2",
+  "description": "The lodash method `_.repeat` exported as a module.",
   "homepage": "https://lodash.com/",
   "icon": "https://lodash.com/icon.svg",
   "license": "MIT",
   "keywords": [
-    "lodash",
     "lodash-modularized",
-    "stdlib",
-    "util"
+    "repeat"
   ],
   "author": {
     "name": "John-David Dalton",
       "url": "http://allyoucanleet.com/"
     },
     {
-      "name": "Benjamin Tan",
-      "email": "demoneaux@gmail.com",
-      "url": "https://d10.github.io/"
-    },
-    {
       "name": "Blaine Bublitz",
       "email": "blaine@iceddev.com",
-      "url": "http://www.iceddev.com/"
-    },
-    {
-      "name": "Kit Cambridge",
-      "email": "github@kitcambridge.be",
-      "url": "http://kitcambridge.be/"
+      "url": "https://github.com/phated"
     },
     {
       "name": "Mathias Bynens",
   "scripts": {
     "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
   },
-  "dependencies": {
-    "lodash._basetostring": "^3.0.0"
-  },
   "bugs": {
     "url": "https://github.com/lodash/lodash/issues"
   },
-  "_id": "lodash.repeat@3.0.1",
-  "_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
+  "_id": "lodash.repeat@3.1.2",
+  "_shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
   "_from": "lodash.repeat@>=3.0.0 <4.0.0",
-  "_npmVersion": "2.12.0",
-  "_nodeVersion": "0.12.5",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "5.4.0",
   "_npmUser": {
     "name": "jdalton",
     "email": "john.david.dalton@gmail.com"
   },
+  "dist": {
+    "shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
+    "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz"
+  },
   "maintainers": [
     {
       "name": "jdalton",
       "email": "john.david.dalton@gmail.com"
     },
     {
-      "name": "d10",
-      "email": "demoneaux@gmail.com"
-    },
-    {
-      "name": "kitcambridge",
-      "email": "github@kitcambridge.be"
-    },
-    {
       "name": "mathias",
       "email": "mathias@qiwi.be"
     },
       "email": "blaine@iceddev.com"
     }
   ],
-  "dist": {
-    "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
-    "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz"
+  "_npmOperationalInternal": {
+    "host": "packages-6-west.internal.npmjs.com",
+    "tmp": "tmp/lodash.repeat-3.1.2.tgz_1454484666569_0.24294439097866416"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz",
+  "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz",
   "readme": "ERROR: No README data found!"
 }
index 376b174..8b820a8 100644 (file)
@@ -86,6 +86,5 @@
     "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
 }
index 55b0c25..b8e25f6 100644 (file)
@@ -93,6 +93,5 @@
     "tarball": "http://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/lodash.padleft/-/lodash.padleft-3.1.1.tgz"
 }
index 9cd87e5..b054ca5 100644 (file)
@@ -1,5 +1,5 @@
-Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
-Based on Underscore.js, copyright 2009-2015 Jeremy Ashkenas,
+Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
+Based on Underscore.js, copyright 2009-2016 Jeremy Ashkenas,
 DocumentCloud and Investigative Reporters & Editors <http://underscorejs.org/>
 
 Permission is hereby granted, free of charge, to any person obtaining
index dec571a..a18ab41 100644 (file)
@@ -1,20 +1,18 @@
-# lodash.repeat v3.0.1
+# lodash.repeat v3.1.2
 
-The [modern build](https://github.com/lodash/lodash/wiki/Build-Differences) of [lodash’s](https://lodash.com/) `_.repeat` exported as a [Node.js](http://nodejs.org/)/[io.js](https://iojs.org/) module.
+The [lodash](https://lodash.com/) method `_.repeat` exported as a [Node.js](https://nodejs.org/) module.
 
 ## Installation
 
 Using npm:
-
 ```bash
 $ {sudo -H} npm i -g npm
 $ npm i --save lodash.repeat
 ```
 
-In Node.js/io.js:
-
+In Node.js:
 ```js
 var repeat = require('lodash.repeat');
 ```
 
-See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.0.1-npm-packages/lodash.repeat) for more details.
+See the [documentation](https://lodash.com/docs#repeat) or [package source](https://github.com/lodash/lodash/blob/3.1.2-npm-packages/lodash.repeat) for more details.
index 367913f..f84e2a7 100644 (file)
 /**
- * lodash 3.0.1 (Custom Build) <https://lodash.com/>
- * Build: `lodash modern modularize exports="npm" -o ./`
- * Copyright 2012-2015 The Dojo Foundation <http://dojofoundation.org/>
+ * lodash 3.1.2 (Custom Build) <https://lodash.com/>
+ * Build: `lodash modularize exports="npm" -o ./`
+ * Copyright 2012-2016 The Dojo Foundation <http://dojofoundation.org/>
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
- * Copyright 2009-2015 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
+ * Copyright 2009-2016 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
  * Available under MIT license <https://lodash.com/license>
  */
-var baseToString = require('lodash._basetostring');
 
-/* Native method references for those with the same name as other `lodash` methods. */
-var nativeFloor = Math.floor,
-    nativeIsFinite = global.isFinite;
+/** Used as references for various `Number` constants. */
+var INFINITY = 1 / 0,
+    MAX_SAFE_INTEGER = 9007199254740991,
+    MAX_INTEGER = 1.7976931348623157e+308,
+    NAN = 0 / 0;
+
+/** `Object#toString` result references. */
+var funcTag = '[object Function]',
+    genTag = '[object GeneratorFunction]',
+    symbolTag = '[object Symbol]';
+
+/** Used to match leading and trailing whitespace. */
+var reTrim = /^\s+|\s+$/g;
+
+/** Used to detect bad signed hexadecimal string values. */
+var reIsBadHex = /^[-+]0x[0-9a-f]+$/i;
+
+/** Used to detect binary string values. */
+var reIsBinary = /^0b[01]+$/i;
+
+/** Used to detect octal string values. */
+var reIsOctal = /^0o[0-7]+$/i;
+
+/** Used to determine if values are of the language type `Object`. */
+var objectTypes = {
+  'function': true,
+  'object': true
+};
+
+/** Built-in method references without a dependency on `root`. */
+var freeParseInt = parseInt;
+
+/** Detect free variable `exports`. */
+var freeExports = (objectTypes[typeof exports] && exports && !exports.nodeType) ? exports : null;
+
+/** Detect free variable `module`. */
+var freeModule = (objectTypes[typeof module] && module && !module.nodeType) ? module : null;
+
+/** Detect free variable `global` from Node.js. */
+var freeGlobal = checkGlobal(freeExports && freeModule && typeof global == 'object' && global);
+
+/** Detect free variable `self`. */
+var freeSelf = checkGlobal(objectTypes[typeof self] && self);
+
+/** Detect free variable `window`. */
+var freeWindow = checkGlobal(objectTypes[typeof window] && window);
+
+/** Detect `this` as the global object. */
+var thisGlobal = checkGlobal(objectTypes[typeof this] && this);
+
+/**
+ * Used as a reference to the global object.
+ *
+ * The `this` value is used if it's the global object to avoid Greasemonkey's
+ * restricted `window` object, otherwise the `window` object is used.
+ */
+var root = freeGlobal || ((freeWindow !== (thisGlobal && thisGlobal.window)) && freeWindow) || freeSelf || thisGlobal || Function('return this')();
+
+/**
+ * Checks if `value` is a global object.
+ *
+ * @private
+ * @param {*} value The value to check.
+ * @returns {null|Object} Returns `value` if it's a global object, else `null`.
+ */
+function checkGlobal(value) {
+  return (value && value.Object === Object) ? value : null;
+}
+
+/** Used for built-in method references. */
+var objectProto = Object.prototype;
+
+/**
+ * Used to resolve the [`toStringTag`](http://ecma-international.org/ecma-262/6.0/#sec-object.prototype.tostring)
+ * of values.
+ */
+var objectToString = objectProto.toString;
+
+/** Built-in value references. */
+var Symbol = root.Symbol;
+
+/* Built-in method references for those with the same name as other `lodash` methods. */
+var nativeFloor = Math.floor;
+
+/** Used to convert symbols to primitives and strings. */
+var symbolProto = Symbol ? Symbol.prototype : undefined,
+    symbolToString = Symbol ? symbolProto.toString : undefined;
+
+/**
+ * Checks if `value` is classified as a `Function` object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isFunction(_);
+ * // => true
+ *
+ * _.isFunction(/abc/);
+ * // => false
+ */
+function isFunction(value) {
+  // The use of `Object#toString` avoids issues with the `typeof` operator
+  // in Safari 8 which returns 'object' for typed array constructors, and
+  // PhantomJS 1.9 which returns 'function' for `NodeList` instances.
+  var tag = isObject(value) ? objectToString.call(value) : '';
+  return tag == funcTag || tag == genTag;
+}
+
+/**
+ * Checks if `value` is the [language type](https://es5.github.io/#x8) of `Object`.
+ * (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is an object, else `false`.
+ * @example
+ *
+ * _.isObject({});
+ * // => true
+ *
+ * _.isObject([1, 2, 3]);
+ * // => true
+ *
+ * _.isObject(_.noop);
+ * // => true
+ *
+ * _.isObject(null);
+ * // => false
+ */
+function isObject(value) {
+  var type = typeof value;
+  return !!value && (type == 'object' || type == 'function');
+}
+
+/**
+ * Checks if `value` is object-like. A value is object-like if it's not `null`
+ * and has a `typeof` result of "object".
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is object-like, else `false`.
+ * @example
+ *
+ * _.isObjectLike({});
+ * // => true
+ *
+ * _.isObjectLike([1, 2, 3]);
+ * // => true
+ *
+ * _.isObjectLike(_.noop);
+ * // => false
+ *
+ * _.isObjectLike(null);
+ * // => false
+ */
+function isObjectLike(value) {
+  return !!value && typeof value == 'object';
+}
+
+/**
+ * Checks if `value` is classified as a `Symbol` primitive or object.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to check.
+ * @returns {boolean} Returns `true` if `value` is correctly classified, else `false`.
+ * @example
+ *
+ * _.isSymbol(Symbol.iterator);
+ * // => true
+ *
+ * _.isSymbol('abc');
+ * // => false
+ */
+function isSymbol(value) {
+  return typeof value == 'symbol' ||
+    (isObjectLike(value) && objectToString.call(value) == symbolTag);
+}
+
+/**
+ * Converts `value` to an integer.
+ *
+ * **Note:** This function is loosely based on [`ToInteger`](http://www.ecma-international.org/ecma-262/6.0/#sec-tointeger).
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to convert.
+ * @returns {number} Returns the converted integer.
+ * @example
+ *
+ * _.toInteger(3);
+ * // => 3
+ *
+ * _.toInteger(Number.MIN_VALUE);
+ * // => 0
+ *
+ * _.toInteger(Infinity);
+ * // => 1.7976931348623157e+308
+ *
+ * _.toInteger('3');
+ * // => 3
+ */
+function toInteger(value) {
+  if (!value) {
+    return value === 0 ? value : 0;
+  }
+  value = toNumber(value);
+  if (value === INFINITY || value === -INFINITY) {
+    var sign = (value < 0 ? -1 : 1);
+    return sign * MAX_INTEGER;
+  }
+  var remainder = value % 1;
+  return value === value ? (remainder ? value - remainder : value) : 0;
+}
+
+/**
+ * Converts `value` to a number.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {number} Returns the number.
+ * @example
+ *
+ * _.toNumber(3);
+ * // => 3
+ *
+ * _.toNumber(Number.MIN_VALUE);
+ * // => 5e-324
+ *
+ * _.toNumber(Infinity);
+ * // => Infinity
+ *
+ * _.toNumber('3');
+ * // => 3
+ */
+function toNumber(value) {
+  if (isObject(value)) {
+    var other = isFunction(value.valueOf) ? value.valueOf() : value;
+    value = isObject(other) ? (other + '') : other;
+  }
+  if (typeof value != 'string') {
+    return value === 0 ? value : +value;
+  }
+  value = value.replace(reTrim, '');
+  var isBinary = reIsBinary.test(value);
+  return (isBinary || reIsOctal.test(value))
+    ? freeParseInt(value.slice(2), isBinary ? 2 : 8)
+    : (reIsBadHex.test(value) ? NAN : +value);
+}
+
+/**
+ * Converts `value` to a string if it's not one. An empty string is returned
+ * for `null` and `undefined` values. The sign of `-0` is preserved.
+ *
+ * @static
+ * @memberOf _
+ * @category Lang
+ * @param {*} value The value to process.
+ * @returns {string} Returns the string.
+ * @example
+ *
+ * _.toString(null);
+ * // => ''
+ *
+ * _.toString(-0);
+ * // => '-0'
+ *
+ * _.toString([1, 2, 3]);
+ * // => '1,2,3'
+ */
+function toString(value) {
+  // Exit early for strings to avoid a performance hit in some environments.
+  if (typeof value == 'string') {
+    return value;
+  }
+  if (value == null) {
+    return '';
+  }
+  if (isSymbol(value)) {
+    return Symbol ? symbolToString.call(value) : '';
+  }
+  var result = (value + '');
+  return (result == '0' && (1 / value) == -INFINITY) ? '-0' : result;
+}
 
 /**
  * Repeats the given string `n` times.
@@ -33,10 +325,11 @@ var nativeFloor = Math.floor,
  * // => ''
  */
 function repeat(string, n) {
+  string = toString(string);
+  n = toInteger(n);
+
   var result = '';
-  string = baseToString(string);
-  n = +n;
-  if (n < 1 || !string || !nativeIsFinite(n)) {
+  if (!string || n < 1 || n > MAX_SAFE_INTEGER) {
     return result;
   }
   // Leverage the exponentiation by squaring algorithm for a faster repeat.
index f941138..0f5f953 100644 (file)
@@ -1,15 +1,13 @@
 {
   "name": "lodash.repeat",
-  "version": "3.0.1",
-  "description": "The modern build of lodash’s `_.repeat` as a module.",
+  "version": "3.1.2",
+  "description": "The lodash method `_.repeat` exported as a module.",
   "homepage": "https://lodash.com/",
   "icon": "https://lodash.com/icon.svg",
   "license": "MIT",
   "keywords": [
-    "lodash",
     "lodash-modularized",
-    "stdlib",
-    "util"
+    "repeat"
   ],
   "author": {
     "name": "John-David Dalton",
       "url": "http://allyoucanleet.com/"
     },
     {
-      "name": "Benjamin Tan",
-      "email": "demoneaux@gmail.com",
-      "url": "https://d10.github.io/"
-    },
-    {
       "name": "Blaine Bublitz",
       "email": "blaine@iceddev.com",
-      "url": "http://www.iceddev.com/"
-    },
-    {
-      "name": "Kit Cambridge",
-      "email": "github@kitcambridge.be",
-      "url": "http://kitcambridge.be/"
+      "url": "https://github.com/phated"
     },
     {
       "name": "Mathias Bynens",
   "scripts": {
     "test": "echo \"See https://travis-ci.org/lodash/lodash-cli for testing details.\""
   },
-  "dependencies": {
-    "lodash._basetostring": "^3.0.0"
-  },
   "bugs": {
     "url": "https://github.com/lodash/lodash/issues"
   },
-  "_id": "lodash.repeat@3.0.1",
-  "_shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
+  "_id": "lodash.repeat@3.1.2",
+  "_shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
   "_from": "lodash.repeat@>=3.0.0 <4.0.0",
-  "_npmVersion": "2.12.0",
-  "_nodeVersion": "0.12.5",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "5.4.0",
   "_npmUser": {
     "name": "jdalton",
     "email": "john.david.dalton@gmail.com"
   },
+  "dist": {
+    "shasum": "b5f35daab458353a7db5e45d439a1becfff4678d",
+    "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz"
+  },
   "maintainers": [
     {
       "name": "jdalton",
       "email": "john.david.dalton@gmail.com"
     },
     {
-      "name": "d10",
-      "email": "demoneaux@gmail.com"
-    },
-    {
-      "name": "kitcambridge",
-      "email": "github@kitcambridge.be"
-    },
-    {
       "name": "mathias",
       "email": "mathias@qiwi.be"
     },
       "email": "blaine@iceddev.com"
     }
   ],
-  "dist": {
-    "shasum": "f4b98dc7ef67256ce61e7874e1865edb208e0edf",
-    "tarball": "http://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz"
+  "_npmOperationalInternal": {
+    "host": "packages-6-west.internal.npmjs.com",
+    "tmp": "tmp/lodash.repeat-3.1.2.tgz_1454484666569_0.24294439097866416"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.0.1.tgz",
+  "_resolved": "https://registry.npmjs.org/lodash.repeat/-/lodash.repeat-3.1.2.tgz",
   "readme": "ERROR: No README data found!"
 }
index 376b174..8b820a8 100644 (file)
@@ -86,6 +86,5 @@
     "tarball": "http://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/lodash._createpadding/-/lodash._createpadding-3.6.1.tgz"
 }
index 2a40f94..b8ab0fb 100644 (file)
@@ -93,6 +93,5 @@
     "tarball": "http://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz"
   },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/lodash.padright/-/lodash.padright-3.1.1.tgz"
 }
index d16cc33..b4a64f9 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "gauge",
-  "version": "1.2.2",
+  "version": "1.2.5",
   "description": "A terminal based horizontal guage",
   "main": "progress-bar.js",
   "scripts": {
@@ -26,7 +26,7 @@
   "homepage": "https://github.com/iarna/gauge",
   "dependencies": {
     "ansi": "^0.3.0",
-    "has-unicode": "^1.0.0",
+    "has-unicode": "^2.0.0",
     "lodash.pad": "^3.0.0",
     "lodash.padleft": "^3.0.0",
     "lodash.padright": "^3.0.0"
   "devDependencies": {
     "tap": "^0.4.13"
   },
-  "gitHead": "9f7eeeeed3b74a70f30b721d570435f6ffbc0168",
-  "_id": "gauge@1.2.2",
-  "_shasum": "05b6730a19a8fcad3c340a142f0945222a3f815b",
-  "_from": "gauge@>=1.2.0 <1.3.0",
-  "_npmVersion": "3.1.0",
-  "_nodeVersion": "0.10.38",
+  "gitHead": "bd0bb377d121e17d343bba156dd92fe6a8b21581",
+  "_id": "gauge@1.2.5",
+  "_shasum": "b80f107dd1f7d3c5a85f5aa74f9e0124caac9da7",
+  "_from": "gauge@>=1.2.5 <1.3.0",
+  "_npmVersion": "3.6.0",
+  "_nodeVersion": "5.4.0",
   "_npmUser": {
     "name": "iarna",
     "email": "me@re-becca.org"
   },
   "dist": {
-    "shasum": "05b6730a19a8fcad3c340a142f0945222a3f815b",
-    "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.2.tgz"
+    "shasum": "b80f107dd1f7d3c5a85f5aa74f9e0124caac9da7",
+    "tarball": "http://registry.npmjs.org/gauge/-/gauge-1.2.5.tgz"
   },
   "maintainers": [
     {
@@ -55,6 +55,5 @@
     }
   ],
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.2.tgz",
-  "readme": "ERROR: No README data found!"
+  "_resolved": "https://registry.npmjs.org/gauge/-/gauge-1.2.5.tgz"
 }
index 16bdadc..00b3a77 100644 (file)
@@ -36,7 +36,7 @@ var ProgressBar = module.exports = function (options, cursor) {
     {type: "completionbar"},
     {type: "endgroup"}
   ]
-  this.updatefreq = options.maxUpdateFrequency || 50
+  this.updatefreq = options.maxUpdateFrequency == null ? 50 : options.maxUpdateFrequency
   this.lastName = ""
   this.lastCompleted = 0
   this.spun = 0
@@ -132,13 +132,12 @@ ProgressBar.prototype.show = function(name, completed) {
   if (!isTTY()) return
   if (this.disabled) return
   if (! this.spun && ! completed) return
-  if (this.tryAgain) {
-    clearTimeout(this.tryAgain)
-    this.tryAgain = null
-  }
+  if (this.tryAgain) return
   var self = this
+
   if (this.showing && new Date() - this.last < this.updatefreq) {
     this.tryAgain = setTimeout(function () {
+      self.tryAgain = null
       if (self.disabled) return
       if (! self.spun && ! completed) return
       drawBar()
index 3993926..5d3e7e7 100644 (file)
@@ -4,7 +4,7 @@ var ProgressBar = require("../progress-bar.js")
 
 var cursor = []
 var C
-var bar = new ProgressBar({theme: ProgressBar.ascii}, C = {
+var bar = new ProgressBar({theme: ProgressBar.ascii, maxUpdateFrequency: 0}, C = {
   show: function () {
     cursor.push(["show"])
     return C
index 40c1bc4..2b0c4c9 100644 (file)
@@ -6,7 +6,7 @@
   },
   "name": "npmlog",
   "description": "logger for npm",
-  "version": "2.0.0",
+  "version": "2.0.2",
   "repository": {
     "type": "git",
     "url": "git+https://github.com/npm/npmlog.git"
     "test": "tap test/*.js"
   },
   "dependencies": {
-    "ansi": "~0.3.0",
-    "are-we-there-yet": "~1.0.0",
-    "gauge": "~1.2.0"
+    "ansi": "~0.3.1",
+    "are-we-there-yet": "~1.0.6",
+    "gauge": "~1.2.5"
   },
   "devDependencies": {
-    "tap": "~2.2.0"
+    "tap": "~5.1.2"
   },
   "license": "ISC",
-  "readme": "# npmlog\n\nThe logger util that npm uses.\n\nThis logger is very basic.  It does the logging for npm.  It supports\ncustom levels and colored output.\n\nBy default, logs are written to stderr.  If you want to send log messages\nto outputs other than streams, then you can change the `log.stream`\nmember, or you can just listen to the events that it emits, and do\nwhatever you want with them.\n\n# Basic Usage\n\n```\nvar log = require('npmlog')\n\n// additional stuff ---------------------------+\n// message ----------+                         |\n// prefix ----+      |                         |\n// level -+   |      |                         |\n//        v   v      v                         v\n    log.info('fyi', 'I have a kitty cat: %j', myKittyCat)\n```\n\n## log.level\n\n* {String}\n\nThe level to display logs at.  Any logs at or above this level will be\ndisplayed.  The special level `silent` will prevent anything from being\ndisplayed ever.\n\n## log.record\n\n* {Array}\n\nAn array of all the log messages that have been entered.\n\n## log.maxRecordSize\n\n* {Number}\n\nThe maximum number of records to keep.  If log.record gets bigger than\n10% over this value, then it is sliced down to 90% of this value.\n\nThe reason for the 10% window is so that it doesn't have to resize a\nlarge array on every log entry.\n\n## log.prefixStyle\n\n* {Object}\n\nA style object that specifies how prefixes are styled.  (See below)\n\n## log.headingStyle\n\n* {Object}\n\nA style object that specifies how the heading is styled.  (See below)\n\n## log.heading\n\n* {String} Default: \"\"\n\nIf set, a heading that is printed at the start of every line.\n\n## log.stream\n\n* {Stream} Default: `process.stderr`\n\nThe stream where output is written.\n\n## log.enableColor()\n\nForce colors to be used on all messages, regardless of the output\nstream.\n\n## log.disableColor()\n\nDisable colors on all messages.\n\n## log.enableProgress()\n\nEnable the display of log activity spinner and progress bar\n\n## log.disableProgress()\n\nDisable the display of a progress bar\n\n## log.enableUnicode()\n\nForce the unicode theme to be used for the progress bar.\n\n## log.disableUnicode()\n\nDisable the use of unicode in the progress bar.\n\n## log.setGaugeTemplate(template)\n\nOverrides the default gauge template.\n\n## log.pause()\n\nStop emitting messages to the stream, but do not drop them.\n\n## log.resume()\n\nEmit all buffered messages that were written while paused.\n\n## log.log(level, prefix, message, ...)\n\n* `level` {String} The level to emit the message at\n* `prefix` {String} A string prefix.  Set to \"\" to skip.\n* `message...` Arguments to `util.format`\n\nEmit a log message at the specified level.\n\n## log\\[level](prefix, message, ...)\n\nFor example,\n\n* log.silly(prefix, message, ...)\n* log.verbose(prefix, message, ...)\n* log.info(prefix, message, ...)\n* log.http(prefix, message, ...)\n* log.warn(prefix, message, ...)\n* log.error(prefix, message, ...)\n\nLike `log.log(level, prefix, message, ...)`.  In this way, each level is\ngiven a shorthand, so you can do `log.info(prefix, message)`.\n\n## log.addLevel(level, n, style, disp)\n\n* `level` {String} Level indicator\n* `n` {Number} The numeric level\n* `style` {Object} Object with fg, bg, inverse, etc.\n* `disp` {String} Optional replacement for `level` in the output.\n\nSets up a new level with a shorthand function and so forth.\n\nNote that if the number is `Infinity`, then setting the level to that\nwill cause all log messages to be suppressed.  If the number is\n`-Infinity`, then the only way to show it is to enable all log messages.\n\n## log.newItem(name, todo, weight)\n\n* `name` {String} Optional; progress item name.\n* `todo` {Number} Optional; total amount of work to be done. Default 0.\n* `weight` {Number} Optional; the weight of this item relative to others. Default 1.\n\nThis adds a new `are-we-there-yet` item tracker to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `Tracker` object.\n\n## log.newStream(name, todo, weight)\n\nThis adds a new `are-we-there-yet` stream tracker to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `TrackerStream` object.\n\n## log.newGroup(name, weight)\n\nThis adds a new `are-we-there-yet` tracker group to the progress tracker. The\nobject returned has the `log[level]` methods but is otherwise an\n`are-we-there-yet` `TrackerGroup` object.\n\n# Events\n\nEvents are all emitted with the message object.\n\n* `log` Emitted for all messages\n* `log.<level>` Emitted for all messages with the `<level>` level.\n* `<prefix>` Messages with prefixes also emit their prefix as an event.\n\n# Style Objects\n\nStyle objects can have the following fields:\n\n* `fg` {String} Color for the foreground text\n* `bg` {String} Color for the background\n* `bold`, `inverse`, `underline` {Boolean} Set the associated property\n* `bell` {Boolean} Make a noise (This is pretty annoying, probably.)\n\n# Message Objects\n\nEvery log event is emitted with a message object, and the `log.record`\nlist contains all of them that have been created.  They have the\nfollowing fields:\n\n* `id` {Number}\n* `level` {String}\n* `prefix` {String}\n* `message` {String} Result of `util.format()`\n* `messageRaw` {Array} Arguments to `util.format()`\n",
-  "readmeFilename": "README.md",
-  "gitHead": "6eaa3f8eec672bb7b56a4df9b55dbfff3b9c6a71",
+  "gitHead": "79dc582bf1ce4d2010454d89738a0a4dbd113be9",
   "bugs": {
     "url": "https://github.com/npm/npmlog/issues"
   },
   "homepage": "https://github.com/npm/npmlog#readme",
-  "_id": "npmlog@2.0.0",
-  "_shasum": "4076c200a3dda51133e6f3cf052130105f78bbdf",
-  "_from": "npmlog@>=2.0.0 <2.1.0"
+  "_id": "npmlog@2.0.2",
+  "_shasum": "d0470238b9697b7c3c4d16bdea65a00b12a464ab",
+  "_from": "npmlog@2.0.2",
+  "_npmVersion": "3.6.0",
+  "_nodeVersion": "5.4.0",
+  "_npmUser": {
+    "name": "iarna",
+    "email": "me@re-becca.org"
+  },
+  "dist": {
+    "shasum": "d0470238b9697b7c3c4d16bdea65a00b12a464ab",
+    "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-2.0.2.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "iarna",
+      "email": "me@re-becca.org"
+    },
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    },
+    {
+      "name": "othiym23",
+      "email": "ogd@aoaioxxysz.net"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-2.0.2.tgz"
 }
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE b/deps/npm/node_modules/read-package-json/node_modules/glob/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/README.md b/deps/npm/node_modules/read-package-json/node_modules/glob/README.md
new file mode 100644 (file)
index 0000000..6960483
--- /dev/null
@@ -0,0 +1,359 @@
+# Glob
+
+Match files using the patterns the shell uses, like stars and stuff.
+
+[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
+
+This is a glob implementation in JavaScript.  It uses the `minimatch`
+library to do its matching.
+
+![](oh-my-glob.gif)
+
+## Usage
+
+```javascript
+var glob = require("glob")
+
+// options is optional
+glob("**/*.js", options, function (er, files) {
+  // files is an array of filenames.
+  // If the `nonull` option is set, and nothing
+  // was found, then files is ["**/*.js"]
+  // er is an error object or null.
+})
+```
+
+## Glob Primer
+
+"Globs" are the patterns you type when you do stuff like `ls *.js` on
+the command line, or put `build/*` in a `.gitignore` file.
+
+Before parsing the path part patterns, braced sections are expanded
+into a set.  Braced sections start with `{` and end with `}`, with any
+number of comma-delimited sections within.  Braced sections may contain
+slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
+
+The following characters have special magic meaning when used in a
+path portion:
+
+* `*` Matches 0 or more characters in a single path portion
+* `?` Matches 1 character
+* `[...]` Matches a range of characters, similar to a RegExp range.
+  If the first character of the range is `!` or `^` then it matches
+  any character not in the range.
+* `!(pattern|pattern|pattern)` Matches anything that does not match
+  any of the patterns provided.
+* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
+  patterns provided.
+* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
+  patterns provided.
+* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
+* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
+  provided
+* `**` If a "globstar" is alone in a path portion, then it matches
+  zero or more directories and subdirectories searching for matches.
+  It does not crawl symlinked directories.
+
+### Dots
+
+If a file or directory path portion has a `.` as the first character,
+then it will not match any glob pattern unless that pattern's
+corresponding path part also has a `.` as its first character.
+
+For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
+However the pattern `a/*/c` would not, because `*` does not start with
+a dot character.
+
+You can make glob treat dots as normal characters by setting
+`dot:true` in the options.
+
+### Basename Matching
+
+If you set `matchBase:true` in the options, and the pattern has no
+slashes in it, then it will seek for any file anywhere in the tree
+with a matching basename.  For example, `*.js` would match
+`test/simple/basic.js`.
+
+### Empty Sets
+
+If no matching files are found, then an empty array is returned.  This
+differs from the shell, where the pattern itself is returned.  For
+example:
+
+    $ echo a*s*d*f
+    a*s*d*f
+
+To get the bash-style behavior, set the `nonull:true` in the options.
+
+### See Also:
+
+* `man sh`
+* `man bash` (Search for "Pattern Matching")
+* `man 3 fnmatch`
+* `man 5 gitignore`
+* [minimatch documentation](https://github.com/isaacs/minimatch)
+
+## glob.hasMagic(pattern, [options])
+
+Returns `true` if there are any special characters in the pattern, and
+`false` otherwise.
+
+Note that the options affect the results.  If `noext:true` is set in
+the options object, then `+(a|b)` will not be considered a magic
+pattern.  If the pattern has a brace expansion, like `a/{b/c,x/y}`
+then that is considered magical, unless `nobrace:true` is set in the
+options.
+
+## glob(pattern, [options], cb)
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* `cb` `{Function}`
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Perform an asynchronous glob search.
+
+## glob.sync(pattern, [options])
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* return: `{Array<String>}` filenames found matching the pattern
+
+Perform a synchronous glob search.
+
+## Class: glob.Glob
+
+Create a Glob object by instantiating the `glob.Glob` class.
+
+```javascript
+var Glob = require("glob").Glob
+var mg = new Glob(pattern, options, cb)
+```
+
+It's an EventEmitter, and starts walking the filesystem to find matches
+immediately.
+
+### new glob.Glob(pattern, [options], [cb])
+
+* `pattern` `{String}` pattern to search for
+* `options` `{Object}`
+* `cb` `{Function}` Called when an error occurs, or matches are found
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Note that if the `sync` flag is set in the options, then matches will
+be immediately available on the `g.found` member.
+
+### Properties
+
+* `minimatch` The minimatch object that the glob uses.
+* `options` The options object passed in.
+* `aborted` Boolean which is set to true when calling `abort()`.  There
+  is no way at this time to continue a glob search after aborting, but
+  you can re-use the statCache to avoid having to duplicate syscalls.
+* `cache` Convenience object.  Each field has the following possible
+  values:
+  * `false` - Path does not exist
+  * `true` - Path exists
+  * `'FILE'` - Path exists, and is not a directory
+  * `'DIR'` - Path exists, and is a directory
+  * `[file, entries, ...]` - Path exists, is a directory, and the
+    array value is the results of `fs.readdir`
+* `statCache` Cache of `fs.stat` results, to prevent statting the same
+  path multiple times.
+* `symlinks` A record of which paths are symbolic links, which is
+  relevant in resolving `**` patterns.
+* `realpathCache` An optional object which is passed to `fs.realpath`
+  to minimize unnecessary syscalls.  It is stored on the instantiated
+  Glob object, and may be re-used.
+
+### Events
+
+* `end` When the matching is finished, this is emitted with all the
+  matches found.  If the `nonull` option is set, and no match was found,
+  then the `matches` list contains the original pattern.  The matches
+  are sorted, unless the `nosort` flag is set.
+* `match` Every time a match is found, this is emitted with the specific
+  thing that matched. It is not deduplicated or resolved to a realpath.
+* `error` Emitted when an unexpected error is encountered, or whenever
+  any fs error occurs if `options.strict` is set.
+* `abort` When `abort()` is called, this event is raised.
+
+### Methods
+
+* `pause` Temporarily stop the search
+* `resume` Resume the search
+* `abort` Stop the search forever
+
+### Options
+
+All the options that can be passed to Minimatch can also be passed to
+Glob to change pattern matching behavior.  Also, some have been added,
+or have glob-specific ramifications.
+
+All options are false by default, unless otherwise noted.
+
+All options are added to the Glob object, as well.
+
+If you are running many `glob` operations, you can pass a Glob object
+as the `options` argument to a subsequent operation to shortcut some
+`stat` and `readdir` calls.  At the very least, you may pass in shared
+`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
+parallel glob operations will be sped up by sharing information about
+the filesystem.
+
+* `cwd` The current working directory in which to search.  Defaults
+  to `process.cwd()`.
+* `root` The place where patterns starting with `/` will be mounted
+  onto.  Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
+  systems, and `C:\` or some such on Windows.)
+* `dot` Include `.dot` files in normal matches and `globstar` matches.
+  Note that an explicit dot in a portion of the pattern will always
+  match dot files.
+* `nomount` By default, a pattern starting with a forward-slash will be
+  "mounted" onto the root setting, so that a valid filesystem path is
+  returned.  Set this flag to disable that behavior.
+* `mark` Add a `/` character to directory matches.  Note that this
+  requires additional stat calls.
+* `nosort` Don't sort the results.
+* `stat` Set to true to stat *all* results.  This reduces performance
+  somewhat, and is completely unnecessary, unless `readdir` is presumed
+  to be an untrustworthy indicator of file existence.
+* `silent` When an unusual error is encountered when attempting to
+  read a directory, a warning will be printed to stderr.  Set the
+  `silent` option to true to suppress these warnings.
+* `strict` When an unusual error is encountered when attempting to
+  read a directory, the process will just continue on in search of
+  other matches.  Set the `strict` option to raise an error in these
+  cases.
+* `cache` See `cache` property above.  Pass in a previously generated
+  cache object to save some fs calls.
+* `statCache` A cache of results of filesystem information, to prevent
+  unnecessary stat calls.  While it should not normally be necessary
+  to set this, you may pass the statCache from one glob() call to the
+  options object of another, if you know that the filesystem will not
+  change between calls.  (See "Race Conditions" below.)
+* `symlinks` A cache of known symbolic links.  You may pass in a
+  previously generated `symlinks` object to save `lstat` calls when
+  resolving `**` matches.
+* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
+* `nounique` In some cases, brace-expanded patterns can result in the
+  same file showing up multiple times in the result set.  By default,
+  this implementation prevents duplicates in the result set.  Set this
+  flag to disable that behavior.
+* `nonull` Set to never return an empty set, instead returning a set
+  containing the pattern itself.  This is the default in glob(3).
+* `debug` Set to enable debug logging in minimatch and glob.
+* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
+* `noglobstar` Do not match `**` against multiple filenames.  (Ie,
+  treat it as a normal `*` instead.)
+* `noext` Do not match `+(a|b)` "extglob" patterns.
+* `nocase` Perform a case-insensitive match.  Note: on
+  case-insensitive filesystems, non-magic patterns will match by
+  default, since `stat` and `readdir` will not raise errors.
+* `matchBase` Perform a basename-only match if the pattern does not
+  contain any slash characters.  That is, `*.js` would be treated as
+  equivalent to `**/*.js`, matching all js files in all directories.
+* `nodir` Do not match directories, only files.  (Note: to match
+  *only* directories, simply put a `/` at the end of the pattern.)
+* `ignore` Add a pattern or an array of glob patterns to exclude matches.
+  Note: `ignore` patterns are *always* in `dot:true` mode, regardless
+  of any other settings.
+* `follow` Follow symlinked directories when expanding `**` patterns.
+  Note that this can result in a lot of duplicate references in the
+  presence of cyclic links.
+* `realpath` Set to true to call `fs.realpath` on all of the results.
+  In the case of a symlink that cannot be resolved, the full absolute
+  path to the matched entry is returned (though it will usually be a
+  broken symlink)
+
+## Comparisons to other fnmatch/glob implementations
+
+While strict compliance with the existing standards is a worthwhile
+goal, some discrepancies exist between node-glob and other
+implementations, and are intentional.
+
+The double-star character `**` is supported by default, unless the
+`noglobstar` flag is set.  This is supported in the manner of bsdglob
+and bash 4.3, where `**` only has special significance if it is the only
+thing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but
+`a/**b` will not.
+
+Note that symlinked directories are not crawled as part of a `**`,
+though their contents may match against subsequent portions of the
+pattern.  This prevents infinite loops and duplicates and the like.
+
+If an escaped pattern has no matches, and the `nonull` flag is set,
+then glob returns the pattern as-provided, rather than
+interpreting the character escapes.  For example,
+`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
+`"*a?"`.  This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
+
+If brace expansion is not disabled, then it is performed before any
+other interpretation of the glob pattern.  Thus, a pattern like
+`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
+**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
+checked for validity.  Since those two are valid, matching proceeds.
+
+### Comments and Negation
+
+Previously, this module let you mark a pattern as a "comment" if it
+started with a `#` character, or a "negated" pattern if it started
+with a `!` character.
+
+These options were deprecated in version 5, and removed in version 6.
+
+To specify things that should not match, use the `ignore` option.
+
+## Windows
+
+**Please only use forward-slashes in glob expressions.**
+
+Though windows uses either `/` or `\` as its path separator, only `/`
+characters are used by this glob implementation.  You must use
+forward-slashes **only** in glob expressions.  Back-slashes will always
+be interpreted as escape characters, not path separators.
+
+Results from absolute patterns such as `/foo/*` are mounted onto the
+root setting using `path.join`.  On windows, this will by default result
+in `/foo/*` matching `C:\foo\bar.txt`.
+
+## Race Conditions
+
+Glob searching, by its very nature, is susceptible to race conditions,
+since it relies on directory walking and such.
+
+As a result, it is possible that a file that exists when glob looks for
+it may have been deleted or modified by the time it returns the result.
+
+As part of its internal implementation, this program caches all stat
+and readdir calls that it makes, in order to cut down on system
+overhead.  However, this also makes it even more susceptible to races,
+especially if the cache or statCache objects are reused between glob
+calls.
+
+Users are thus advised not to use a glob result as a guarantee of
+filesystem state in the face of rapid changes.  For the vast majority
+of operations, this is never a problem.
+
+## Contributing
+
+Any change to behavior (including bugfixes) must come with a test.
+
+Patches that fail tests or reduce performance will be rejected.
+
+```
+# to run tests
+npm test
+
+# to re-generate test fixtures
+npm run test-regen
+
+# to benchmark against bash/zsh
+npm run bench
+
+# to profile javascript
+npm run prof
+```
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/common.js b/deps/npm/node_modules/read-package-json/node_modules/glob/common.js
new file mode 100644 (file)
index 0000000..c9127eb
--- /dev/null
@@ -0,0 +1,226 @@
+exports.alphasort = alphasort
+exports.alphasorti = alphasorti
+exports.setopts = setopts
+exports.ownProp = ownProp
+exports.makeAbs = makeAbs
+exports.finish = finish
+exports.mark = mark
+exports.isIgnored = isIgnored
+exports.childrenIgnored = childrenIgnored
+
+function ownProp (obj, field) {
+  return Object.prototype.hasOwnProperty.call(obj, field)
+}
+
+var path = require("path")
+var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
+var Minimatch = minimatch.Minimatch
+
+function alphasorti (a, b) {
+  return a.toLowerCase().localeCompare(b.toLowerCase())
+}
+
+function alphasort (a, b) {
+  return a.localeCompare(b)
+}
+
+function setupIgnores (self, options) {
+  self.ignore = options.ignore || []
+
+  if (!Array.isArray(self.ignore))
+    self.ignore = [self.ignore]
+
+  if (self.ignore.length) {
+    self.ignore = self.ignore.map(ignoreMap)
+  }
+}
+
+// ignore patterns are always in dot:true mode.
+function ignoreMap (pattern) {
+  var gmatcher = null
+  if (pattern.slice(-3) === '/**') {
+    var gpattern = pattern.replace(/(\/\*\*)+$/, '')
+    gmatcher = new Minimatch(gpattern, { dot: true })
+  }
+
+  return {
+    matcher: new Minimatch(pattern, { dot: true }),
+    gmatcher: gmatcher
+  }
+}
+
+function setopts (self, pattern, options) {
+  if (!options)
+    options = {}
+
+  // base-matching: just use globstar for that.
+  if (options.matchBase && -1 === pattern.indexOf("/")) {
+    if (options.noglobstar) {
+      throw new Error("base matching requires globstar")
+    }
+    pattern = "**/" + pattern
+  }
+
+  self.silent = !!options.silent
+  self.pattern = pattern
+  self.strict = options.strict !== false
+  self.realpath = !!options.realpath
+  self.realpathCache = options.realpathCache || Object.create(null)
+  self.follow = !!options.follow
+  self.dot = !!options.dot
+  self.mark = !!options.mark
+  self.nodir = !!options.nodir
+  if (self.nodir)
+    self.mark = true
+  self.sync = !!options.sync
+  self.nounique = !!options.nounique
+  self.nonull = !!options.nonull
+  self.nosort = !!options.nosort
+  self.nocase = !!options.nocase
+  self.stat = !!options.stat
+  self.noprocess = !!options.noprocess
+
+  self.maxLength = options.maxLength || Infinity
+  self.cache = options.cache || Object.create(null)
+  self.statCache = options.statCache || Object.create(null)
+  self.symlinks = options.symlinks || Object.create(null)
+
+  setupIgnores(self, options)
+
+  self.changedCwd = false
+  var cwd = process.cwd()
+  if (!ownProp(options, "cwd"))
+    self.cwd = cwd
+  else {
+    self.cwd = options.cwd
+    self.changedCwd = path.resolve(options.cwd) !== cwd
+  }
+
+  self.root = options.root || path.resolve(self.cwd, "/")
+  self.root = path.resolve(self.root)
+  if (process.platform === "win32")
+    self.root = self.root.replace(/\\/g, "/")
+
+  self.nomount = !!options.nomount
+
+  // disable comments and negation in Minimatch.
+  // Note that they are not supported in Glob itself anyway.
+  options.nonegate = true
+  options.nocomment = true
+
+  self.minimatch = new Minimatch(pattern, options)
+  self.options = self.minimatch.options
+}
+
+function finish (self) {
+  var nou = self.nounique
+  var all = nou ? [] : Object.create(null)
+
+  for (var i = 0, l = self.matches.length; i < l; i ++) {
+    var matches = self.matches[i]
+    if (!matches || Object.keys(matches).length === 0) {
+      if (self.nonull) {
+        // do like the shell, and spit out the literal glob
+        var literal = self.minimatch.globSet[i]
+        if (nou)
+          all.push(literal)
+        else
+          all[literal] = true
+      }
+    } else {
+      // had matches
+      var m = Object.keys(matches)
+      if (nou)
+        all.push.apply(all, m)
+      else
+        m.forEach(function (m) {
+          all[m] = true
+        })
+    }
+  }
+
+  if (!nou)
+    all = Object.keys(all)
+
+  if (!self.nosort)
+    all = all.sort(self.nocase ? alphasorti : alphasort)
+
+  // at *some* point we statted all of these
+  if (self.mark) {
+    for (var i = 0; i < all.length; i++) {
+      all[i] = self._mark(all[i])
+    }
+    if (self.nodir) {
+      all = all.filter(function (e) {
+        return !(/\/$/.test(e))
+      })
+    }
+  }
+
+  if (self.ignore.length)
+    all = all.filter(function(m) {
+      return !isIgnored(self, m)
+    })
+
+  self.found = all
+}
+
+function mark (self, p) {
+  var abs = makeAbs(self, p)
+  var c = self.cache[abs]
+  var m = p
+  if (c) {
+    var isDir = c === 'DIR' || Array.isArray(c)
+    var slash = p.slice(-1) === '/'
+
+    if (isDir && !slash)
+      m += '/'
+    else if (!isDir && slash)
+      m = m.slice(0, -1)
+
+    if (m !== p) {
+      var mabs = makeAbs(self, m)
+      self.statCache[mabs] = self.statCache[abs]
+      self.cache[mabs] = self.cache[abs]
+    }
+  }
+
+  return m
+}
+
+// lotta situps...
+function makeAbs (self, f) {
+  var abs = f
+  if (f.charAt(0) === '/') {
+    abs = path.join(self.root, f)
+  } else if (isAbsolute(f) || f === '') {
+    abs = f
+  } else if (self.changedCwd) {
+    abs = path.resolve(self.cwd, f)
+  } else {
+    abs = path.resolve(f)
+  }
+  return abs
+}
+
+
+// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
+// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
+function isIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
+
+function childrenIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js b/deps/npm/node_modules/read-package-json/node_modules/glob/glob.js
new file mode 100644 (file)
index 0000000..a62da27
--- /dev/null
@@ -0,0 +1,765 @@
+// Approach:
+//
+// 1. Get the minimatch set
+// 2. For each pattern in the set, PROCESS(pattern, false)
+// 3. Store matches per-set, then uniq them
+//
+// PROCESS(pattern, inGlobStar)
+// Get the first [n] items from pattern that are all strings
+// Join these together.  This is PREFIX.
+//   If there is no more remaining, then stat(PREFIX) and
+//   add to matches if it succeeds.  END.
+//
+// If inGlobStar and PREFIX is symlink and points to dir
+//   set ENTRIES = []
+// else readdir(PREFIX) as ENTRIES
+//   If fail, END
+//
+// with ENTRIES
+//   If pattern[n] is GLOBSTAR
+//     // handle the case where the globstar match is empty
+//     // by pruning it out, and testing the resulting pattern
+//     PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
+//     // handle other cases.
+//     for ENTRY in ENTRIES (not dotfiles)
+//       // attach globstar + tail onto the entry
+//       // Mark that this entry is a globstar match
+//       PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
+//
+//   else // not globstar
+//     for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
+//       Test ENTRY against pattern[n]
+//       If fails, continue
+//       If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
+//
+// Caveat:
+//   Cache all stats and readdirs results to minimize syscall.  Since all
+//   we ever care about is existence and directory-ness, we can just keep
+//   `true` for files, and [children,...] for directories, or `false` for
+//   things that don't exist.
+
+module.exports = glob
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var inherits = require('inherits')
+var EE = require('events').EventEmitter
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var globSync = require('./sync.js')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var inflight = require('inflight')
+var util = require('util')
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+var once = require('once')
+
+function glob (pattern, options, cb) {
+  if (typeof options === 'function') cb = options, options = {}
+  if (!options) options = {}
+
+  if (options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return globSync(pattern, options)
+  }
+
+  return new Glob(pattern, options, cb)
+}
+
+glob.sync = globSync
+var GlobSync = glob.GlobSync = globSync.GlobSync
+
+// old api surface
+glob.glob = glob
+
+function extend (origin, add) {
+  if (add === null || typeof add !== 'object') {
+    return origin
+  }
+
+  var keys = Object.keys(add)
+  var i = keys.length
+  while (i--) {
+    origin[keys[i]] = add[keys[i]]
+  }
+  return origin
+}
+
+glob.hasMagic = function (pattern, options_) {
+  var options = extend({}, options_)
+  options.noprocess = true
+
+  var g = new Glob(pattern, options)
+  var set = g.minimatch.set
+  if (set.length > 1)
+    return true
+
+  for (var j = 0; j < set[0].length; j++) {
+    if (typeof set[0][j] !== 'string')
+      return true
+  }
+
+  return false
+}
+
+glob.Glob = Glob
+inherits(Glob, EE)
+function Glob (pattern, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = null
+  }
+
+  if (options && options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return new GlobSync(pattern, options)
+  }
+
+  if (!(this instanceof Glob))
+    return new Glob(pattern, options, cb)
+
+  setopts(this, pattern, options)
+  this._didRealPath = false
+
+  // process each pattern in the minimatch set
+  var n = this.minimatch.set.length
+
+  // The matches are stored as {<filename>: true,...} so that
+  // duplicates are automagically pruned.
+  // Later, we do an Object.keys() on these.
+  // Keep them as a list so we can fill in when nonull is set.
+  this.matches = new Array(n)
+
+  if (typeof cb === 'function') {
+    cb = once(cb)
+    this.on('error', cb)
+    this.on('end', function (matches) {
+      cb(null, matches)
+    })
+  }
+
+  var self = this
+  var n = this.minimatch.set.length
+  this._processing = 0
+  this.matches = new Array(n)
+
+  this._emitQueue = []
+  this._processQueue = []
+  this.paused = false
+
+  if (this.noprocess)
+    return this
+
+  if (n === 0)
+    return done()
+
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false, done)
+  }
+
+  function done () {
+    --self._processing
+    if (self._processing <= 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._finish = function () {
+  assert(this instanceof Glob)
+  if (this.aborted)
+    return
+
+  if (this.realpath && !this._didRealpath)
+    return this._realpath()
+
+  common.finish(this)
+  this.emit('end', this.found)
+}
+
+Glob.prototype._realpath = function () {
+  if (this._didRealpath)
+    return
+
+  this._didRealpath = true
+
+  var n = this.matches.length
+  if (n === 0)
+    return this._finish()
+
+  var self = this
+  for (var i = 0; i < this.matches.length; i++)
+    this._realpathSet(i, next)
+
+  function next () {
+    if (--n === 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._realpathSet = function (index, cb) {
+  var matchset = this.matches[index]
+  if (!matchset)
+    return cb()
+
+  var found = Object.keys(matchset)
+  var self = this
+  var n = found.length
+
+  if (n === 0)
+    return cb()
+
+  var set = this.matches[index] = Object.create(null)
+  found.forEach(function (p, i) {
+    // If there's a problem with the stat, then it means that
+    // one or more of the links in the realpath couldn't be
+    // resolved.  just return the abs value in that case.
+    p = self._makeAbs(p)
+    fs.realpath(p, self.realpathCache, function (er, real) {
+      if (!er)
+        set[real] = true
+      else if (er.syscall === 'stat')
+        set[p] = true
+      else
+        self.emit('error', er) // srsly wtf right here
+
+      if (--n === 0) {
+        self.matches[index] = set
+        cb()
+      }
+    })
+  })
+}
+
+Glob.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+Glob.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
+
+Glob.prototype.abort = function () {
+  this.aborted = true
+  this.emit('abort')
+}
+
+Glob.prototype.pause = function () {
+  if (!this.paused) {
+    this.paused = true
+    this.emit('pause')
+  }
+}
+
+Glob.prototype.resume = function () {
+  if (this.paused) {
+    this.emit('resume')
+    this.paused = false
+    if (this._emitQueue.length) {
+      var eq = this._emitQueue.slice(0)
+      this._emitQueue.length = 0
+      for (var i = 0; i < eq.length; i ++) {
+        var e = eq[i]
+        this._emitMatch(e[0], e[1])
+      }
+    }
+    if (this._processQueue.length) {
+      var pq = this._processQueue.slice(0)
+      this._processQueue.length = 0
+      for (var i = 0; i < pq.length; i ++) {
+        var p = pq[i]
+        this._processing--
+        this._process(p[0], p[1], p[2], p[3])
+      }
+    }
+  }
+}
+
+Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
+  assert(this instanceof Glob)
+  assert(typeof cb === 'function')
+
+  if (this.aborted)
+    return
+
+  this._processing++
+  if (this.paused) {
+    this._processQueue.push([pattern, index, inGlobStar, cb])
+    return
+  }
+
+  //console.error('PROCESS %d', this._processing, pattern)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // see if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index, cb)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip _processing
+  if (childrenIgnored(this, read))
+    return cb()
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
+}
+
+Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return cb()
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return cb()
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this._emitMatch(index, e)
+    }
+    // This was the last one, and no stats were needed
+    return cb()
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix) {
+      if (prefix !== '/')
+        e = prefix + '/' + e
+      else
+        e = prefix + e
+    }
+    this._process([e].concat(remain), index, inGlobStar, cb)
+  }
+  cb()
+}
+
+Glob.prototype._emitMatch = function (index, e) {
+  if (this.aborted)
+    return
+
+  if (this.matches[index][e])
+    return
+
+  if (isIgnored(this, e))
+    return
+
+  if (this.paused) {
+    this._emitQueue.push([index, e])
+    return
+  }
+
+  var abs = this._makeAbs(e)
+
+  if (this.nodir) {
+    var c = this.cache[abs]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  if (this.mark)
+    e = this._mark(e)
+
+  this.matches[index][e] = true
+
+  var st = this.statCache[abs]
+  if (st)
+    this.emit('stat', e, st)
+
+  this.emit('match', e)
+}
+
+Glob.prototype._readdirInGlobStar = function (abs, cb) {
+  if (this.aborted)
+    return
+
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false, cb)
+
+  var lstatkey = 'lstat\0' + abs
+  var self = this
+  var lstatcb = inflight(lstatkey, lstatcb_)
+
+  if (lstatcb)
+    fs.lstat(abs, lstatcb)
+
+  function lstatcb_ (er, lstat) {
+    if (er)
+      return cb()
+
+    var isSym = lstat.isSymbolicLink()
+    self.symlinks[abs] = isSym
+
+    // If it's not a symlink or a dir, then it's definitely a regular file.
+    // don't bother doing a readdir in that case.
+    if (!isSym && !lstat.isDirectory()) {
+      self.cache[abs] = 'FILE'
+      cb()
+    } else
+      self._readdir(abs, false, cb)
+  }
+}
+
+Glob.prototype._readdir = function (abs, inGlobStar, cb) {
+  if (this.aborted)
+    return
+
+  cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
+  if (!cb)
+    return
+
+  //console.error('RD %j %j', +inGlobStar, abs)
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs, cb)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return cb()
+
+    if (Array.isArray(c))
+      return cb(null, c)
+  }
+
+  var self = this
+  fs.readdir(abs, readdirCb(this, abs, cb))
+}
+
+function readdirCb (self, abs, cb) {
+  return function (er, entries) {
+    if (er)
+      self._readdirError(abs, er, cb)
+    else
+      self._readdirEntries(abs, entries, cb)
+  }
+}
+
+Glob.prototype._readdirEntries = function (abs, entries, cb) {
+  if (this.aborted)
+    return
+
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+  return cb(null, entries)
+}
+
+Glob.prototype._readdirError = function (f, er, cb) {
+  if (this.aborted)
+    return
+
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      this.cache[this._makeAbs(f)] = 'FILE'
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict) {
+        this.emit('error', er)
+        // If the error is handled, then we abort
+        // if not, we threw out of here
+        this.abort()
+      }
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+
+  return cb()
+}
+
+Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+
+Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+  //console.error('pgs2', prefix, remain[0], entries)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return cb()
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false, cb)
+
+  var isSym = this.symlinks[abs]
+  var len = entries.length
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return cb()
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true, cb)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true, cb)
+  }
+
+  cb()
+}
+
+Glob.prototype._processSimple = function (prefix, index, cb) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var self = this
+  this._stat(prefix, function (er, exists) {
+    self._processSimple2(prefix, index, er, exists, cb)
+  })
+}
+Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
+
+  //console.error('ps2', prefix, exists)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return cb()
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this._emitMatch(index, prefix)
+  cb()
+}
+
+// Returns either 'DIR', 'FILE', or false
+Glob.prototype._stat = function (f, cb) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return cb()
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return cb(null, c)
+
+    if (needDir && c === 'FILE')
+      return cb()
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (stat !== undefined) {
+    if (stat === false)
+      return cb(null, stat)
+    else {
+      var type = stat.isDirectory() ? 'DIR' : 'FILE'
+      if (needDir && type === 'FILE')
+        return cb()
+      else
+        return cb(null, type, stat)
+    }
+  }
+
+  var self = this
+  var statcb = inflight('stat\0' + abs, lstatcb_)
+  if (statcb)
+    fs.lstat(abs, statcb)
+
+  function lstatcb_ (er, lstat) {
+    if (lstat && lstat.isSymbolicLink()) {
+      // If it's a symlink, then treat it as the target, unless
+      // the target does not exist, then treat it as a file.
+      return fs.stat(abs, function (er, stat) {
+        if (er)
+          self._stat2(f, abs, null, lstat, cb)
+        else
+          self._stat2(f, abs, er, stat, cb)
+      })
+    } else {
+      self._stat2(f, abs, er, lstat, cb)
+    }
+  }
+}
+
+Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
+  if (er) {
+    this.statCache[abs] = false
+    return cb()
+  }
+
+  var needDir = f.slice(-1) === '/'
+  this.statCache[abs] = stat
+
+  if (abs.slice(-1) === '/' && !stat.isDirectory())
+    return cb(null, false, stat)
+
+  var c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c !== 'DIR')
+    return cb()
+
+  return cb(null, c, stat)
+}
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/index.js
new file mode 100644 (file)
index 0000000..19f103f
--- /dev/null
@@ -0,0 +1,20 @@
+'use strict';
+
+function posix(path) {
+       return path.charAt(0) === '/';
+};
+
+function win32(path) {
+       // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+       var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
+       var result = splitDeviceRe.exec(path);
+       var device = result[1] || '';
+       var isUnc = !!device && device.charAt(1) !== ':';
+
+       // UNC paths are always absolute
+       return !!result[2] || isUnc;
+};
+
+module.exports = process.platform === 'win32' ? win32 : posix;
+module.exports.posix = posix;
+module.exports.win32 = win32;
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/package.json
new file mode 100644 (file)
index 0000000..3937263
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "name": "path-is-absolute",
+  "version": "1.0.0",
+  "description": "Node.js 0.12 path.isAbsolute() ponyfill",
+  "license": "MIT",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/path-is-absolute.git"
+  },
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "scripts": {
+    "test": "node test.js"
+  },
+  "files": [
+    "index.js"
+  ],
+  "keywords": [
+    "path",
+    "paths",
+    "file",
+    "dir",
+    "absolute",
+    "isabsolute",
+    "is-absolute",
+    "built-in",
+    "util",
+    "utils",
+    "core",
+    "ponyfill",
+    "polyfill",
+    "shim",
+    "is",
+    "detect",
+    "check"
+  ],
+  "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1",
+  "bugs": {
+    "url": "https://github.com/sindresorhus/path-is-absolute/issues"
+  },
+  "homepage": "https://github.com/sindresorhus/path-is-absolute",
+  "_id": "path-is-absolute@1.0.0",
+  "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+  "_from": "path-is-absolute@>=1.0.0 <2.0.0",
+  "_npmVersion": "2.5.1",
+  "_nodeVersion": "0.12.0",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+    "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz",
+  "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/read-package-json/node_modules/glob/node_modules/path-is-absolute/readme.md
new file mode 100644 (file)
index 0000000..cdf94f4
--- /dev/null
@@ -0,0 +1,51 @@
+# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
+
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill
+
+> Ponyfill: A polyfill that doesn't overwrite the native method
+
+
+## Install
+
+```
+$ npm install --save path-is-absolute
+```
+
+
+## Usage
+
+```js
+var pathIsAbsolute = require('path-is-absolute');
+
+// Linux
+pathIsAbsolute('/home/foo');
+//=> true
+
+// Windows
+pathIsAbsolute('C:/Users/');
+//=> true
+
+// Any OS
+pathIsAbsolute.posix('/home/foo');
+//=> true
+```
+
+
+## API
+
+See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
+
+### pathIsAbsolute(path)
+
+### pathIsAbsolute.posix(path)
+
+The Posix specific version.
+
+### pathIsAbsolute.win32(path)
+
+The Windows specific version.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/package.json b/deps/npm/node_modules/read-package-json/node_modules/glob/package.json
new file mode 100644 (file)
index 0000000..19e926c
--- /dev/null
@@ -0,0 +1,73 @@
+{
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "name": "glob",
+  "description": "a little globber",
+  "version": "6.0.4",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/node-glob.git"
+  },
+  "main": "glob.js",
+  "files": [
+    "glob.js",
+    "sync.js",
+    "common.js"
+  ],
+  "engines": {
+    "node": "*"
+  },
+  "dependencies": {
+    "inflight": "^1.0.4",
+    "inherits": "2",
+    "minimatch": "2 || 3",
+    "once": "^1.3.0",
+    "path-is-absolute": "^1.0.0"
+  },
+  "devDependencies": {
+    "mkdirp": "0",
+    "rimraf": "^2.2.8",
+    "tap": "^5.0.0",
+    "tick": "0.0.6"
+  },
+  "scripts": {
+    "prepublish": "npm run benchclean",
+    "profclean": "rm -f v8.log profile.txt",
+    "test": "tap test/*.js --cov",
+    "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
+    "bench": "bash benchmark.sh",
+    "prof": "bash prof.sh && cat profile.txt",
+    "benchclean": "node benchclean.js"
+  },
+  "license": "ISC",
+  "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6",
+  "bugs": {
+    "url": "https://github.com/isaacs/node-glob/issues"
+  },
+  "homepage": "https://github.com/isaacs/node-glob#readme",
+  "_id": "glob@6.0.4",
+  "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+  "_from": "glob@>=6.0.0 <7.0.0",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "dist": {
+    "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+    "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
+  "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js b/deps/npm/node_modules/read-package-json/node_modules/glob/sync.js
new file mode 100644 (file)
index 0000000..09883d2
--- /dev/null
@@ -0,0 +1,460 @@
+module.exports = globSync
+globSync.GlobSync = GlobSync
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var Glob = require('./glob.js').Glob
+var util = require('util')
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var childrenIgnored = common.childrenIgnored
+
+function globSync (pattern, options) {
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  return new GlobSync(pattern, options).found
+}
+
+function GlobSync (pattern, options) {
+  if (!pattern)
+    throw new Error('must provide pattern')
+
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  if (!(this instanceof GlobSync))
+    return new GlobSync(pattern, options)
+
+  setopts(this, pattern, options)
+
+  if (this.noprocess)
+    return this
+
+  var n = this.minimatch.set.length
+  this.matches = new Array(n)
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false)
+  }
+  this._finish()
+}
+
+GlobSync.prototype._finish = function () {
+  assert(this instanceof GlobSync)
+  if (this.realpath) {
+    var self = this
+    this.matches.forEach(function (matchset, index) {
+      var set = self.matches[index] = Object.create(null)
+      for (var p in matchset) {
+        try {
+          p = self._makeAbs(p)
+          var real = fs.realpathSync(p, self.realpathCache)
+          set[real] = true
+        } catch (er) {
+          if (er.syscall === 'stat')
+            set[self._makeAbs(p)] = true
+          else
+            throw er
+        }
+      }
+    })
+  }
+  common.finish(this)
+}
+
+
+GlobSync.prototype._process = function (pattern, index, inGlobStar) {
+  assert(this instanceof GlobSync)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // See if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip processing
+  if (childrenIgnored(this, read))
+    return
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
+}
+
+
+GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
+  var entries = this._readdir(abs, inGlobStar)
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix.slice(-1) !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this.matches[index][e] = true
+    }
+    // This was the last one, and no stats were needed
+    return
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix)
+      newPattern = [prefix, e]
+    else
+      newPattern = [e]
+    this._process(newPattern.concat(remain), index, inGlobStar)
+  }
+}
+
+
+GlobSync.prototype._emitMatch = function (index, e) {
+  var abs = this._makeAbs(e)
+  if (this.mark)
+    e = this._mark(e)
+
+  if (this.matches[index][e])
+    return
+
+  if (this.nodir) {
+    var c = this.cache[this._makeAbs(e)]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  this.matches[index][e] = true
+  if (this.stat)
+    this._stat(e)
+}
+
+
+GlobSync.prototype._readdirInGlobStar = function (abs) {
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false)
+
+  var entries
+  var lstat
+  var stat
+  try {
+    lstat = fs.lstatSync(abs)
+  } catch (er) {
+    // lstat failed, doesn't exist
+    return null
+  }
+
+  var isSym = lstat.isSymbolicLink()
+  this.symlinks[abs] = isSym
+
+  // If it's not a symlink or a dir, then it's definitely a regular file.
+  // don't bother doing a readdir in that case.
+  if (!isSym && !lstat.isDirectory())
+    this.cache[abs] = 'FILE'
+  else
+    entries = this._readdir(abs, false)
+
+  return entries
+}
+
+GlobSync.prototype._readdir = function (abs, inGlobStar) {
+  var entries
+
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return null
+
+    if (Array.isArray(c))
+      return c
+  }
+
+  try {
+    return this._readdirEntries(abs, fs.readdirSync(abs))
+  } catch (er) {
+    this._readdirError(abs, er)
+    return null
+  }
+}
+
+GlobSync.prototype._readdirEntries = function (abs, entries) {
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+
+  // mark and cache dir-ness
+  return entries
+}
+
+GlobSync.prototype._readdirError = function (f, er) {
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      this.cache[this._makeAbs(f)] = 'FILE'
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict)
+        throw er
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+}
+
+GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
+
+  var entries = this._readdir(abs, inGlobStar)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false)
+
+  var len = entries.length
+  var isSym = this.symlinks[abs]
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true)
+  }
+}
+
+GlobSync.prototype._processSimple = function (prefix, index) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var exists = this._stat(prefix)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this.matches[index][prefix] = true
+}
+
+// Returns either 'DIR', 'FILE', or false
+GlobSync.prototype._stat = function (f) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return false
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return c
+
+    if (needDir && c === 'FILE')
+      return false
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (!stat) {
+    var lstat
+    try {
+      lstat = fs.lstatSync(abs)
+    } catch (er) {
+      return false
+    }
+
+    if (lstat.isSymbolicLink()) {
+      try {
+        stat = fs.statSync(abs)
+      } catch (er) {
+        stat = lstat
+      }
+    } else {
+      stat = lstat
+    }
+  }
+
+  this.statCache[abs] = stat
+
+  var c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c !== 'DIR')
+    return false
+
+  return c
+}
+
+GlobSync.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+GlobSync.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
index 5c8a150..a607dd0 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "read-package-json",
-  "version": "2.0.2",
+  "version": "2.0.3",
   "author": {
     "name": "Isaac Z. Schlueter",
     "email": "i@izs.me",
@@ -16,7 +16,7 @@
     "test": "standard && tap test/*.js"
   },
   "dependencies": {
-    "glob": "^5.0.3",
+    "glob": "^6.0.0",
     "json-parse-helpfulerror": "^1.0.2",
     "normalize-package-data": "^2.0.0",
     "graceful-fs": "^4.1.2"
     "graceful-fs": "^4.1.2"
   },
   "license": "ISC",
-  "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\n// readJson(filename, [logFunction=noop], [strict=false], cb)\nreadJson('/path/to/package.json', console.error, false, 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, [logFn = noop], [strict = false], cb)\n\n* `file` {String} The path to the package.json file\n* `logFn` {Function} Function to handle logging.  Defaults to a noop.\n* `strict` {Boolean} True to enforce SemVer 2.0 version strings, and\n  other strict requirements.\n* `cb` {Function} Gets called with `(er, data)`, as is The Node Way.\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### `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 `<name> : <filename>` 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",
-  "readmeFilename": "README.md",
-  "gitHead": "0c51e0a836de1a6eaa0d4ce1a8692162598d1276",
+  "gitHead": "336a212716bb830781d7e71580adaeda377b69d9",
   "bugs": {
     "url": "https://github.com/npm/read-package-json/issues"
   },
   "homepage": "https://github.com/npm/read-package-json#readme",
-  "_id": "read-package-json@2.0.2",
-  "_shasum": "fba055da32caef82e8eff08fc0cac78fc1d027cd",
-  "_from": "read-package-json@>=2.0.2 <2.1.0"
+  "_id": "read-package-json@2.0.3",
+  "_shasum": "f8cec1627053b54f384b353224545e607554c5d2",
+  "_from": "read-package-json@2.0.3",
+  "_npmVersion": "3.5.4",
+  "_nodeVersion": "4.2.2",
+  "_npmUser": {
+    "name": "iarna",
+    "email": "me@re-becca.org"
+  },
+  "dist": {
+    "shasum": "f8cec1627053b54f384b353224545e607554c5d2",
+    "tarball": "http://registry.npmjs.org/read-package-json/-/read-package-json-2.0.3.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "iarna",
+      "email": "me@re-becca.org"
+    },
+    {
+      "name": "isaacs",
+      "email": "isaacs@npmjs.com"
+    },
+    {
+      "name": "othiym23",
+      "email": "ogd@aoaioxxysz.net"
+    },
+    {
+      "name": "zkat",
+      "email": "kat@sykosomatic.org"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/read-package-json/-/read-package-json-2.0.3.tgz"
 }
diff --git a/deps/npm/node_modules/read-package-json/zunda b/deps/npm/node_modules/read-package-json/zunda
new file mode 100644 (file)
index 0000000..8a80494
--- /dev/null
@@ -0,0 +1 @@
+{"_id":"zunda","_rev":"2-d344ae8ca038029c6651c8fd579d3b39","name":"zunda","description":"Zunda for Node.js","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"zunda","version":"0.0.1","author":{"name":"inken"},"description":"Zunda for Node.js","main":"zunda.js","dependencies":{"execsync":"*"},"repository":{"type":"git","url":"https://github.com/inkenkun/node-zunda.git"},"keywords":["zunda"],"homepage":"http://x1.inkenkun.com/","license":"MIT","bugs":{"url":"https://github.com/inkenkun/node-zunda/issues"},"_id":"zunda@0.0.1","dist":{"shasum":"c54fe03aa53efbcf52fcd5c7da4180d3f37871c9","tarball":"http://registry.npmjs.org/zunda/-/zunda-0.0.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"inken","email":"inkenkun@gmail.com"},"maintainers":[{"name":"inken","email":"inkenkun@gmail.com"}],"directories":{}}},"readme":"# ZundaJS\r\n\r\nZundaの結果をパースする Node.js 用モジュールです。\r\n\r\n## Installation\r\n\r\n``` shell\r\n$ npm install zunda\r\n```\r\n\r\n\r\n## Usage\r\n\r\n### Asynchronous\r\n\r\n```javascript\r\n\tvar Zunda = new require('zunda')\r\n\t  , zunda = new Zunda()\r\n\t;\r\n\tzunda.parse('次郎は大阪に行ったが、太郎は東京には行かず地元に残ろうとした', function(err, result) {\r\n\t\tif (err) throw err;\r\n\t\tconsole.log(result);\r\n\t});\r\n```\r\n\r\n### Synchronous\r\n\r\n```javascript\r\n\tvar Zunda = new require('zunda')\r\n\t  , zunda = new Zunda()\r\n\t;\r\n\tvar result =  zunda.parseSync('次郎は大阪に行ったが、太郎は東京には行かず地元に残ろうとした');\r\n\tconsole.log(result);\r\n```\r\n\r\n## Result\r\n\r\n\r\n\t [ \r\n\t   { event: [ '#EVENT0', '4', 'wr:筆者', '非未来', '0', '叙述', '成立', '0', '0' ],\r\n         words: '次郎は大阪に行ったが、',\r\n    \t wakachi: '次郎 は 大阪 に 行っ た が 、' },\r\n       { event: [ '#EVENT1', '13', 'wr:筆者', '未来', '0', '叙述', '不成立', '0', '0' ],\r\n         words: '太郎は東京には行かず',\r\n         wakachi: '太郎 は 東京 に は 行か ず' },\r\n       { event: [ '#EVENT2', '17', 'wr:筆者', '未来', '0', '意志', '高確率', 'ポジティブ', '0' ],\r\n         words: '地元に残ろうとした',\r\n         wakachi: '地元 に 残ろ う と し た' },\r\n       { event: [ '#EVENT3', '20', 'wr:筆者', '非未来', '0', '叙述', '成立', '0', '0' ],\r\n         words: '残ろうとした',\r\n         wakachi: '残ろ う と し た' } \r\n     ]\r\n\r\n\r\n\r\n## Reference\r\n\r\nhicomiさんの mecab-async https://www.npmjs.org/package/mecab-async を参考にさせていただきました。\r\nzunda https://code.google.com/p/zunda/\r\n","maintainers":[{"name":"inken","email":"inkenkun@gmail.com"}],"time":{"modified":"2014-06-23T01:53:45.429Z","created":"2014-06-23T01:53:45.429Z","0.0.1":"2014-06-23T01:53:45.429Z"},"homepage":"http://x1.inkenkun.com/","keywords":["zunda"],"repository":{"type":"git","url":"https://github.com/inkenkun/node-zunda.git"},"author":{"name":"inken"},"bugs":{"url":"https://github.com/inkenkun/node-zunda/issues"},"license":"MIT","readmeFilename":"README.md","_attachments":{}}
\ No newline at end of file
diff --git a/deps/npm/node_modules/request/.eslintrc b/deps/npm/node_modules/request/.eslintrc
deleted file mode 100644 (file)
index 6ebc536..0000000
+++ /dev/null
@@ -1,45 +0,0 @@
-{
-  "env": {
-    "node": true
-  },
-  "rules": {
-    // 2-space indentation
-    "indent": [2, 2, {"SwitchCase": 1}],
-    // Disallow semi-colons, unless needed to disambiguate statement
-    "semi": [2, "never"],
-    // Require strings to use single quotes
-    "quotes": [2, "single"],
-    // Require curly braces for all control statements
-    "curly": 2,
-    // Disallow using variables and functions before they've been defined
-    "no-use-before-define": 2,
-    // Allow any case for variable naming
-    "camelcase": 0,
-    // Disallow unused variables, except as function arguments
-    "no-unused-vars": [2, {"args":"none"}],
-    // Allow leading underscores for method names
-    // REASON: we use underscores to denote private methods
-    "no-underscore-dangle": 0,
-    // Allow multi spaces around operators since they are
-    // used for alignment.  This is not consistent in the
-    // code.
-    "no-multi-spaces": 0,
-    // Style rule is: most objects use { beforeColon: false, afterColon: true }, unless aligning which uses:
-    //
-    // {
-    //   beforeColon : true,
-    //   afterColon  : true
-    // }
-    //
-    // eslint can't handle this, so the check is disabled.
-    "key-spacing": 0,
-    // Allow shadowing vars in outer scope (needs discussion)
-    "no-shadow": 0,
-    // Use if () { }
-    //       ^ space
-    "space-after-keywords": [2, "always"],
-    // Use if () { }
-    //          ^ space
-    "space-before-blocks": [2, "always"]
-  }
-}
index 7dc85ea..86386a9 100644 (file)
@@ -1,5 +1,20 @@
 ## Change Log
 
+### v2.68.0 (2016/01/27)
+- [#2036](https://github.com/request/request/pull/2036) Add AWS Signature Version 4 (@simov, @mirkods)
+- [#2022](https://github.com/request/request/pull/2022) Convert numeric multipart bodies to string (@simov, @feross)
+- [#2024](https://github.com/request/request/pull/2024) Update har-validator dependency for nsp advisory #76 (@TylerDixon)
+- [#2016](https://github.com/request/request/pull/2016) Update qs to version 6.0.2 🚀 (@greenkeeperio-bot)
+- [#2007](https://github.com/request/request/pull/2007) Use the `extend` module instead of util._extend (@simov)
+- [#2003](https://github.com/request/request/pull/2003) Update browserify to version 13.0.0 🚀 (@greenkeeperio-bot)
+- [#1989](https://github.com/request/request/pull/1989) Update buffer-equal to version 1.0.0 🚀 (@greenkeeperio-bot)
+- [#1956](https://github.com/request/request/pull/1956) Check form-data content-length value before setting up the header (@jongyoonlee)
+- [#1958](https://github.com/request/request/pull/1958) Use IncomingMessage.destroy method (@simov)
+- [#1952](https://github.com/request/request/pull/1952) Adds example for Tor proxy (@prometheansacrifice)
+- [#1943](https://github.com/request/request/pull/1943) Update eslint to version 1.10.3 🚀 (@simov, @greenkeeperio-bot)
+- [#1924](https://github.com/request/request/pull/1924) Update eslint to version 1.10.1 🚀 (@greenkeeperio-bot)
+- [#1915](https://github.com/request/request/pull/1915) Remove content-length and transfer-encoding headers from defaultProxyHeaderWhiteList (@yaxia)
+
 ### v2.67.0 (2015/11/19)
 - [#1913](https://github.com/request/request/pull/1913) Update http-signature to version 1.1.0 🚀 (@greenkeeperio-bot)
 
 - [#521](https://github.com/request/request/pull/521) Improving test-localAddress.js (@noway421)
 - [#529](https://github.com/request/request/pull/529) dependencies versions bump (@jodaka)
 
-### v2.17.0 (2013/04/22)
+### v2.18.0 (2013/04/22)
 - [#523](https://github.com/request/request/pull/523) Updating dependencies (@noway421)
 - [#520](https://github.com/request/request/pull/520) Fixing test-tunnel.js (@noway421)
 - [#519](https://github.com/request/request/pull/519) Update internal path state on post-creation QS changes (@jblebrun)
index 77e30df..6ee45b2 100644 (file)
@@ -754,7 +754,7 @@ The first argument can be either a `url` or an `options` object. The only requir
 - `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional).  See documentation above.
 - `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above.
 - `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).
-- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services)
+- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services). If you want to use AWS sign version 4 use the parameter `sign_version` with value `4` otherwise the default is version 2. **Note:** you need to `npm install aws4` first.
 - `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.
 
 ---
index ceb1cd1..3059574 100644 (file)
@@ -3,7 +3,7 @@
 var fs = require('fs')
 var qs = require('querystring')
 var validate = require('har-validator')
-var util = require('util')
+var extend = require('extend')
 
 function Har (request) {
   this.request = request
@@ -118,7 +118,8 @@ Har.prototype.options = function (options) {
     return options
   }
 
-  var har = util._extend({}, options.har)
+  var har = {}
+  extend(har, options.har)
 
   // only process the first entry
   if (har.log && har.log.entries) {
index 0361858..c128172 100644 (file)
@@ -68,6 +68,9 @@ Multipart.prototype.build = function (parts, chunked) {
   var body = chunked ? new CombinedStream() : []
 
   function add (part) {
+    if (typeof part === 'number') {
+      part = part.toString()
+    }
     return chunked ? body.append(part) : body.push(new Buffer(part))
   }
 
index 918aec6..bf96a8f 100644 (file)
@@ -12,7 +12,6 @@ var defaultProxyHeaderWhiteList = [
   'cache-control',
   'content-encoding',
   'content-language',
-  'content-length',
   'content-location',
   'content-md5',
   'content-range',
@@ -24,7 +23,6 @@ var defaultProxyHeaderWhiteList = [
   'pragma',
   'referer',
   'te',
-  'transfer-encoding',
   'user-agent',
   'via'
 ]
index c90bace..0fe40d0 100644 (file)
   "engines": {
     "node": "*"
   },
-  "readme": "aws-sign\n========\n\nAWS signing. Originally pulled from LearnBoost/knox, maintained as vendor in request, now a standalone module.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "8554bdb41268fa295eb1ee300f4adaa9f7f07fec",
   "bugs": {
     "url": "https://github.com/mikeal/aws-sign/issues"
   },
   "homepage": "https://github.com/mikeal/aws-sign#readme",
   "_id": "aws-sign2@0.6.0",
+  "scripts": {},
   "_shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f",
+  "_from": "aws-sign2@>=0.6.0 <0.7.0",
+  "_npmVersion": "2.14.4",
+  "_nodeVersion": "4.1.2",
+  "_npmUser": {
+    "name": "mikeal",
+    "email": "mikeal.rogers@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "mikeal",
+      "email": "mikeal.rogers@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "14342dd38dbcc94d0e5b87d763cd63612c0e794f",
+    "tarball": "http://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.6.0.tgz",
-  "_from": "aws-sign2@>=0.6.0 <0.7.0"
+  "readme": "ERROR: No README data found!"
 }
diff --git a/deps/npm/node_modules/request/node_modules/aws4/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/.npmignore
new file mode 100644 (file)
index 0000000..ccafa6b
--- /dev/null
@@ -0,0 +1,3 @@
+test
+coverage
+examples
diff --git a/deps/npm/node_modules/request/node_modules/aws4/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/.travis.yml
new file mode 100644 (file)
index 0000000..61d0634
--- /dev/null
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+  - "0.10"
+  - "0.12"
+  - "4.2"
diff --git a/deps/npm/node_modules/request/node_modules/aws4/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/LICENSE
new file mode 100644 (file)
index 0000000..4f321e5
--- /dev/null
@@ -0,0 +1,19 @@
+Copyright 2013 Michael Hart (michael.hart.au@gmail.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy of
+this software and associated documentation files (the "Software"), to deal in
+the Software without restriction, including without limitation the rights to
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
+of the Software, and to permit persons to whom the Software is furnished to do
+so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
diff --git a/deps/npm/node_modules/request/node_modules/aws4/README.md b/deps/npm/node_modules/request/node_modules/aws4/README.md
new file mode 100644 (file)
index 0000000..068a07a
--- /dev/null
@@ -0,0 +1,509 @@
+aws4
+----
+
+[![Build Status](https://secure.travis-ci.org/mhart/aws4.png?branch=master)](http://travis-ci.org/mhart/aws4)
+
+A small utility to sign vanilla node.js http(s) request options using Amazon's
+[AWS Signature Version 4](http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html).
+
+This signature is supported by nearly all Amazon services, including
+[S3](http://docs.aws.amazon.com/AmazonS3/latest/API/),
+[EC2](http://docs.aws.amazon.com/AWSEC2/latest/APIReference/),
+[DynamoDB](http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/API.html),
+[Kinesis](http://docs.aws.amazon.com/kinesis/latest/APIReference/),
+[Lambda](http://docs.aws.amazon.com/lambda/latest/dg/API_Reference.html),
+[SQS](http://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/),
+[SNS](http://docs.aws.amazon.com/sns/latest/api/),
+[IAM](http://docs.aws.amazon.com/IAM/latest/APIReference/),
+[STS](http://docs.aws.amazon.com/STS/latest/APIReference/),
+[RDS](http://docs.aws.amazon.com/AmazonRDS/latest/APIReference/),
+[CloudWatch](http://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/),
+[CloudWatch Logs](http://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/),
+[CodeDeploy](http://docs.aws.amazon.com/codedeploy/latest/APIReference/),
+[CloudFront](http://docs.aws.amazon.com/AmazonCloudFront/latest/APIReference/),
+[CloudTrail](http://docs.aws.amazon.com/awscloudtrail/latest/APIReference/),
+[ElastiCache](http://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/),
+[EMR](http://docs.aws.amazon.com/ElasticMapReduce/latest/API/),
+[Glacier](http://docs.aws.amazon.com/amazonglacier/latest/dev/amazon-glacier-api.html),
+[CloudSearch](http://docs.aws.amazon.com/cloudsearch/latest/developerguide/APIReq.html),
+[Elastic Load Balancing](http://docs.aws.amazon.com/ElasticLoadBalancing/latest/APIReference/),
+[Elastic Transcoder](http://docs.aws.amazon.com/elastictranscoder/latest/developerguide/api-reference.html),
+[CloudFormation](http://docs.aws.amazon.com/AWSCloudFormation/latest/APIReference/),
+[Elastic Beanstalk](http://docs.aws.amazon.com/elasticbeanstalk/latest/api/),
+[Storage Gateway](http://docs.aws.amazon.com/storagegateway/latest/userguide/AWSStorageGatewayAPI.html),
+[Data Pipeline](http://docs.aws.amazon.com/datapipeline/latest/APIReference/),
+[Direct Connect](http://docs.aws.amazon.com/directconnect/latest/APIReference/),
+[Redshift](http://docs.aws.amazon.com/redshift/latest/APIReference/),
+[OpsWorks](http://docs.aws.amazon.com/opsworks/latest/APIReference/),
+[SES](http://docs.aws.amazon.com/ses/latest/APIReference/),
+[SWF](http://docs.aws.amazon.com/amazonswf/latest/apireference/),
+[AutoScaling](http://docs.aws.amazon.com/AutoScaling/latest/APIReference/),
+[Mobile Analytics](http://docs.aws.amazon.com/mobileanalytics/latest/ug/server-reference.html),
+[Cognito Identity](http://docs.aws.amazon.com/cognitoidentity/latest/APIReference/),
+[Cognito Sync](http://docs.aws.amazon.com/cognitosync/latest/APIReference/),
+[Container Service](http://docs.aws.amazon.com/AmazonECS/latest/APIReference/),
+[AppStream](http://docs.aws.amazon.com/appstream/latest/developerguide/appstream-api-rest.html),
+[Key Management Service](http://docs.aws.amazon.com/kms/latest/APIReference/),
+[Config](http://docs.aws.amazon.com/config/latest/APIReference/),
+[CloudHSM](http://docs.aws.amazon.com/cloudhsm/latest/dg/api-ref.html),
+[Route53](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rest.html) and
+[Route53 Domains](http://docs.aws.amazon.com/Route53/latest/APIReference/requests-rpc.html).
+
+Indeed, the only AWS services that *don't* support v4 as of 2014-12-30 are
+[Import/Export](http://docs.aws.amazon.com/AWSImportExport/latest/DG/api-reference.html) and
+[SimpleDB](http://docs.aws.amazon.com/AmazonSimpleDB/latest/DeveloperGuide/SDB_API.html)
+(they only support [AWS Signature Version 2](https://github.com/mhart/aws2)).
+
+It also provides defaults for a number of core AWS headers and
+request parameters, making it very easy to query AWS services, or
+build out a fully-featured AWS library.
+
+Example
+-------
+
+```javascript
+var http  = require('http'),
+    https = require('https'),
+    aws4  = require('aws4')
+
+// given an options object you could pass to http.request
+var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'}
+
+// alternatively (as aws4 can infer the host):
+opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'}
+
+// alternatively (as us-east-1 is default):
+opts = {service: 'sqs', path: '/?Action=ListQueues'}
+
+aws4.sign(opts) // assumes AWS credentials are available in process.env
+
+console.log(opts)
+/*
+{
+  host: 'sqs.us-east-1.amazonaws.com',
+  path: '/?Action=ListQueues',
+  headers: {
+    Host: 'sqs.us-east-1.amazonaws.com',
+    'X-Amz-Date': '20121226T061030Z',
+    Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...'
+  }
+}
+*/
+
+// we can now use this to query AWS using the standard node.js http API
+http.request(opts, function(res) { res.pipe(process.stdout) }).end()
+/*
+<?xml version="1.0"?>
+<ListQueuesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
+...
+*/
+```
+
+More options
+------------
+
+```javascript
+// you can also pass AWS credentials in explicitly (otherwise taken from process.env)
+aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''})
+
+// can also add the signature to query strings
+aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true})
+
+// create a utility function to pipe to stdout (with https this time)
+function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') }
+
+// aws4 can infer the HTTP method if a body is passed in
+// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8'
+request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'}))
+/*
+<ListGroupsResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
+...
+*/
+
+// can specify any custom option or header as per usual
+request(aws4.sign({
+  service: 'dynamodb',
+  region: 'ap-southeast-2',
+  method: 'POST',
+  path: '/',
+  headers: {
+    'Content-Type': 'application/x-amz-json-1.0',
+    'X-Amz-Target': 'DynamoDB_20120810.ListTables'
+  },
+  body: '{}'
+}))
+/*
+{"TableNames":[]}
+...
+*/
+
+// works with all other services that support Signature Version 4
+
+request(aws4.sign({service: 's3', path: '/', signQuery: true}))
+/*
+<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+...
+*/
+
+request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'}))
+/*
+<DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2014-06-15/">
+...
+*/
+
+request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'}))
+/*
+<ListTopicsResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
+...
+*/
+
+request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'}))
+/*
+<GetSessionTokenResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
+...
+*/
+
+request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'}))
+/*
+<ListDomainNamesResponse xmlns="http://cloudsearch.amazonaws.com/doc/2013-01-01/">
+...
+*/
+
+request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'}))
+/*
+<ListIdentitiesResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
+...
+*/
+
+request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'}))
+/*
+<DescribeAutoScalingInstancesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/">
+...
+*/
+
+request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'}))
+/*
+<DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
+...
+*/
+
+request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'}))
+/*
+<ListStacksResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
+...
+*/
+
+request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'}))
+/*
+<ListAvailableSolutionStacksResponse xmlns="http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
+...
+*/
+
+request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'}))
+/*
+<DescribeDBInstancesResponse xmlns="http://rds.amazonaws.com/doc/2012-09-17/">
+...
+*/
+
+request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'}))
+/*
+<ListMetricsResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">
+...
+*/
+
+request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'}))
+/*
+<DescribeClustersResponse xmlns="http://redshift.amazonaws.com/doc/2012-12-01/">
+...
+*/
+
+request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'}))
+/*
+<DistributionList xmlns="http://cloudfront.amazonaws.com/doc/2014-05-31/">
+...
+*/
+
+request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'}))
+/*
+<DescribeCacheClustersResponse xmlns="http://elasticache.amazonaws.com/doc/2014-07-15/">
+...
+*/
+
+request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'}))
+/*
+<DescribeJobFlowsResponse xmlns="http://elasticmapreduce.amazonaws.com/doc/2009-03-31">
+...
+*/
+
+request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'}))
+/*
+<ListHostedZonesResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
+...
+*/
+
+request(aws4.sign({service: 'appstream', path: '/applications'}))
+/*
+{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/...
+...
+*/
+
+request(aws4.sign({service: 'cognito-sync', path: '/identitypools'}))
+/*
+{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null}
+...
+*/
+
+request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'}))
+/*
+{"NextPageToken":null,"Pipelines":[]}
+...
+*/
+
+request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'}))
+/*
+{"Functions":[],"NextMarker":null}
+...
+*/
+
+request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'}))
+/*
+<ListClustersResponse xmlns="http://ecs.amazonaws.com/doc/2014-11-13/">
+...
+*/
+
+request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}}))
+/*
+{"Marker":null,"VaultList":[]}
+...
+*/
+
+request(aws4.sign({service: 'storagegateway', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'StorageGateway_20120630.ListGateways'
+}}))
+/*
+{"Gateways":[]}
+...
+*/
+
+request(aws4.sign({service: 'datapipeline', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'DataPipeline.ListPipelines'
+}}))
+/*
+{"hasMoreResults":false,"pipelineIdList":[]}
+...
+*/
+
+request(aws4.sign({service: 'opsworks', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks'
+}}))
+/*
+{"Stacks":[]}
+...
+*/
+
+request(aws4.sign({service: 'route53domains', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
+}}))
+/*
+{"Domains":[]}
+...
+*/
+
+request(aws4.sign({service: 'kinesis', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'Kinesis_20131202.ListStreams'
+}}))
+/*
+{"HasMoreStreams":false,"StreamNames":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudtrail', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
+}}))
+/*
+{"trailList":[]}
+...
+*/
+
+request(aws4.sign({service: 'logs', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'Logs_20140328.DescribeLogGroups'
+}}))
+/*
+{"logGroups":[]}
+...
+*/
+
+request(aws4.sign({service: 'codedeploy', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'CodeDeploy_20141006.ListApplications'
+}}))
+/*
+{"applications":[]}
+...
+*/
+
+request(aws4.sign({service: 'directconnect', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'OvertureService.DescribeConnections'
+}}))
+/*
+{"connections":[]}
+...
+*/
+
+request(aws4.sign({service: 'kms', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'TrentService.ListKeys'
+}}))
+/*
+{"Keys":[],"Truncated":false}
+...
+*/
+
+request(aws4.sign({service: 'config', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels'
+}}))
+/*
+{"DeliveryChannels":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudhsm', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones'
+}}))
+/*
+{"AZList":["us-east-1a","us-east-1b","us-east-1c"]}
+...
+*/
+
+request(aws4.sign({
+  service: 'swf',
+  body: '{"registrationStatus":"REGISTERED"}',
+  headers: {
+    'Content-Type': 'application/x-amz-json-1.0',
+    'X-Amz-Target': 'SimpleWorkflowService.ListDomains'
+  }
+}))
+/*
+{"domainInfos":[]}
+...
+*/
+
+request(aws4.sign({
+  service: 'cognito-identity',
+  body: '{"MaxResults": 1}',
+  headers: {
+    'Content-Type': 'application/x-amz-json-1.1',
+    'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools'
+  }
+}))
+/*
+{"IdentityPools":[]}
+...
+*/
+
+request(aws4.sign({
+  service: 'mobileanalytics',
+  path: '/2014-06-05/events',
+  body: JSON.stringify({events:[{
+    eventType: 'a',
+    timestamp: new Date().toISOString(),
+    session: {},
+  }]}),
+  headers: {
+    'Content-Type': 'application/json',
+    'X-Amz-Client-Context': JSON.stringify({
+      client: {client_id: 'a', app_title: 'a'},
+      custom: {},
+      env: {platform: 'a'},
+      services: {},
+    }),
+  }
+}))
+/*
+(HTTP 202, empty response)
+*/
+```
+
+API
+---
+
+### aws4.sign(requestOptions, [credentials])
+
+This calculates and populates the `Authorization` header of
+`requestOptions`, and any other necessary AWS headers and/or request
+options. Returns `requestOptions` as a convenience for chaining.
+
+`requestOptions` is an object holding the same options that the node.js
+[http.request](http://nodejs.org/docs/latest/api/http.html#http_http_request_options_callback)
+function takes.
+
+The following properties of `requestOptions` are used in the signing or
+populated if they don't already exist:
+
+- `hostname` or `host` (will be determined from `service` and `region` if not given)
+- `method` (will use `'GET'` if not given or `'POST'` if there is a `body`)
+- `path` (will use `'/'` if not given)
+- `body` (will use `''` if not given)
+- `service` (will be calculated from `hostname` or `host` if not given)
+- `region` (will be calculated from `hostname` or `host` or use `'us-east-1'` if not given)
+- `headers['Host']` (will use `hostname` or `host` or be calculated if not given)
+- `headers['Content-Type']` (will use `'application/x-www-form-urlencoded; charset=utf-8'`
+  if not given and there is a `body`)
+- `headers['Date']` (used to calculate the signature date if given, otherwise `new Date` is used)
+
+Your AWS credentials (which can be found in your
+[AWS console](https://portal.aws.amazon.com/gp/aws/securityCredentials))
+can be specified in one of two ways:
+
+- As the second argument, like this:
+
+```javascript
+aws4.sign(requestOptions, {
+  secretAccessKey: "<your-secret-access-key>",
+  accessKeyId: "<your-access-key-id>",
+  sessionToken: "<your-session-token>"
+})
+```
+
+- From `process.env`, such as this:
+
+```
+export AWS_SECRET_ACCESS_KEY="<your-secret-access-key>"
+export AWS_ACCESS_KEY_ID="<your-access-key-id>"
+export AWS_SESSION_TOKEN="<your-session-token>"
+```
+
+(will also use `AWS_ACCESS_KEY` and `AWS_SECRET_KEY` if available)
+
+The `sessionToken` property and `AWS_SESSION_TOKEN` environment variable are optional for signing
+with [IAM STS temporary credentials](http://docs.aws.amazon.com/STS/latest/UsingSTS/using-temp-creds.html).
+
+Installation
+------------
+
+With [npm](http://npmjs.org/) do:
+
+```
+npm install aws4
+```
+
+Thanks
+------
+
+Thanks to [@jed](https://github.com/jed) for his
+[dynamo-client](https://github.com/jed/dynamo-client) lib where I first
+committed and subsequently extracted this code.
+
+Also thanks to the
+[official node.js AWS SDK](https://github.com/aws/aws-sdk-js) for giving
+me a start on implementing the v4 signature.
diff --git a/deps/npm/node_modules/request/node_modules/aws4/aws4.js b/deps/npm/node_modules/request/node_modules/aws4/aws4.js
new file mode 100644 (file)
index 0000000..3ef54a4
--- /dev/null
@@ -0,0 +1,313 @@
+var aws4 = exports,
+    url = require('url'),
+    querystring = require('querystring'),
+    crypto = require('crypto'),
+    lru = require('lru-cache'),
+    credentialsCache = lru(1000)
+
+// http://docs.amazonwebservices.com/general/latest/gr/signature-version-4.html
+
+function hmac(key, string, encoding) {
+  return crypto.createHmac('sha256', key).update(string, 'utf8').digest(encoding)
+}
+
+function hash(string, encoding) {
+  return crypto.createHash('sha256').update(string, 'utf8').digest(encoding)
+}
+
+// This function assumes the string has already been percent encoded
+function encodeRfc3986(urlEncodedString) {
+  return urlEncodedString.replace(/[!'()*]/g, function(c) {
+    return '%' + c.charCodeAt(0).toString(16).toUpperCase()
+  })
+}
+
+// request: { path | body, [host], [method], [headers], [service], [region] }
+// credentials: { accessKeyId, secretAccessKey, [sessionToken] }
+function RequestSigner(request, credentials) {
+
+  if (typeof request === 'string') request = url.parse(request)
+
+  var headers = request.headers = (request.headers || {}),
+      hostParts = this.matchHost(request.hostname || request.host || headers.Host || headers.host)
+
+  this.request = request
+  this.credentials = credentials || this.defaultCredentials()
+
+  this.service = request.service || hostParts[0] || ''
+  this.region = request.region || hostParts[1] || 'us-east-1'
+
+  // SES uses a different domain from the service name
+  if (this.service === 'email') this.service = 'ses'
+
+  if (!request.method && request.body)
+    request.method = 'POST'
+
+  if (!headers.Host && !headers.host)
+    headers.Host = request.hostname || request.host || this.createHost()
+  if (!request.hostname && !request.host)
+    request.hostname = headers.Host || headers.host
+}
+
+RequestSigner.prototype.matchHost = function(host) {
+  var match = (host || '').match(/([^\.]+)\.(?:([^\.]*)\.)?amazonaws\.com$/)
+  var hostParts = (match || []).slice(1, 3)
+
+  // ES's hostParts are sometimes the other way round, if the value that is expected
+  // to be region equals ‘es’ switch them back
+  // e.g. search-cluster-name-aaaa00aaaa0aaa0aaaaaaa0aaa.us-east-1.es.amazonaws.com
+  if (hostParts[1] === 'es')
+    hostParts = hostParts.reverse()
+
+  return hostParts
+}
+
+// http://docs.aws.amazon.com/general/latest/gr/rande.html
+RequestSigner.prototype.isSingleRegion = function() {
+  // Special case for S3 and SimpleDB in us-east-1
+  if (['s3', 'sdb'].indexOf(this.service) >= 0 && this.region === 'us-east-1') return true
+
+  return ['cloudfront', 'ls', 'route53', 'iam', 'importexport', 'sts']
+    .indexOf(this.service) >= 0
+}
+
+RequestSigner.prototype.createHost = function() {
+  var region = this.isSingleRegion() ? '' :
+        (this.service === 's3' && this.region !== 'us-east-1' ? '-' : '.') + this.region,
+      service = this.service === 'ses' ? 'email' : this.service
+  return service + region + '.amazonaws.com'
+}
+
+RequestSigner.prototype.prepareRequest = function() {
+  this.parsePath()
+
+  var request = this.request, headers = request.headers, query
+
+  if (request.signQuery) {
+
+    this.parsedPath.query = query = this.parsedPath.query || {}
+
+    if (this.credentials.sessionToken)
+      query['X-Amz-Security-Token'] = this.credentials.sessionToken
+
+    if (this.service === 's3' && !query['X-Amz-Expires'])
+      query['X-Amz-Expires'] = 86400
+
+    if (query['X-Amz-Date'])
+      this.datetime = query['X-Amz-Date']
+    else
+      query['X-Amz-Date'] = this.getDateTime()
+
+    query['X-Amz-Algorithm'] = 'AWS4-HMAC-SHA256'
+    query['X-Amz-Credential'] = this.credentials.accessKeyId + '/' + this.credentialString()
+    query['X-Amz-SignedHeaders'] = this.signedHeaders()
+
+  } else {
+
+    if (!request.doNotModifyHeaders) {
+      if (request.body && !headers['Content-Type'] && !headers['content-type'])
+        headers['Content-Type'] = 'application/x-www-form-urlencoded; charset=utf-8'
+
+      if (request.body && !headers['Content-Length'] && !headers['content-length'])
+        headers['Content-Length'] = Buffer.byteLength(request.body)
+
+      if (this.credentials.sessionToken)
+        headers['X-Amz-Security-Token'] = this.credentials.sessionToken
+
+      if (this.service === 's3')
+        headers['X-Amz-Content-Sha256'] = hash(this.request.body || '', 'hex')
+
+      if (headers['X-Amz-Date'])
+        this.datetime = headers['X-Amz-Date']
+      else
+        headers['X-Amz-Date'] = this.getDateTime()
+    }
+
+    delete headers.Authorization
+    delete headers.authorization
+  }
+}
+
+RequestSigner.prototype.sign = function() {
+  if (!this.parsedPath) this.prepareRequest()
+
+  if (this.request.signQuery) {
+    this.parsedPath.query['X-Amz-Signature'] = this.signature()
+  } else {
+    this.request.headers.Authorization = this.authHeader()
+  }
+
+  this.request.path = this.formatPath()
+
+  return this.request
+}
+
+RequestSigner.prototype.getDateTime = function() {
+  if (!this.datetime) {
+    var headers = this.request.headers,
+      date = new Date(headers.Date || headers.date || new Date)
+
+    this.datetime = date.toISOString().replace(/[:\-]|\.\d{3}/g, '')
+  }
+  return this.datetime
+}
+
+RequestSigner.prototype.getDate = function() {
+  return this.getDateTime().substr(0, 8)
+}
+
+RequestSigner.prototype.authHeader = function() {
+  return [
+    'AWS4-HMAC-SHA256 Credential=' + this.credentials.accessKeyId + '/' + this.credentialString(),
+    'SignedHeaders=' + this.signedHeaders(),
+    'Signature=' + this.signature(),
+  ].join(', ')
+}
+
+RequestSigner.prototype.signature = function() {
+  var date = this.getDate(),
+      cacheKey = [this.credentials.secretAccessKey, date, this.region, this.service].join(),
+      kDate, kRegion, kService, kCredentials = credentialsCache.get(cacheKey)
+  if (!kCredentials) {
+    kDate = hmac('AWS4' + this.credentials.secretAccessKey, date)
+    kRegion = hmac(kDate, this.region)
+    kService = hmac(kRegion, this.service)
+    kCredentials = hmac(kService, 'aws4_request')
+    credentialsCache.set(cacheKey, kCredentials)
+  }
+  return hmac(kCredentials, this.stringToSign(), 'hex')
+}
+
+RequestSigner.prototype.stringToSign = function() {
+  return [
+    'AWS4-HMAC-SHA256',
+    this.getDateTime(),
+    this.credentialString(),
+    hash(this.canonicalString(), 'hex'),
+  ].join('\n')
+}
+
+RequestSigner.prototype.canonicalString = function() {
+  if (!this.parsedPath) this.prepareRequest()
+
+  var pathStr = this.parsedPath.path,
+      query = this.parsedPath.query,
+      queryStr = '',
+      normalizePath = this.service !== 's3',
+      decodePath = this.service === 's3' || this.request.doNotEncodePath,
+      decodeSlashesInPath = this.service === 's3',
+      firstValOnly = this.service === 's3',
+      bodyHash = this.service === 's3' && this.request.signQuery ?
+        'UNSIGNED-PAYLOAD' : hash(this.request.body || '', 'hex')
+
+  if (query) {
+    queryStr = encodeRfc3986(querystring.stringify(Object.keys(query).sort().reduce(function(obj, key) {
+      if (!key) return obj
+      obj[key] = !Array.isArray(query[key]) ? query[key] :
+        (firstValOnly ? query[key][0] : query[key].slice().sort())
+      return obj
+    }, {})))
+  }
+  if (pathStr !== '/') {
+    if (normalizePath) pathStr = pathStr.replace(/\/{2,}/g, '/')
+    if (pathStr[0] === '/') pathStr = pathStr.slice(1)
+    pathStr = '/' + pathStr.split('/').reduce(function(path, piece) {
+      if (normalizePath && piece === '..') {
+        path.pop()
+      } else if (!normalizePath || piece !== '.') {
+        if (decodePath) piece = querystring.unescape(piece)
+        path.push(encodeRfc3986(querystring.escape(piece)))
+      }
+      return path
+    }, []).join('/')
+    if (decodeSlashesInPath) pathStr = pathStr.replace(/%2F/g, '/')
+  }
+
+  return [
+    this.request.method || 'GET',
+    pathStr,
+    queryStr,
+    this.canonicalHeaders() + '\n',
+    this.signedHeaders(),
+    bodyHash,
+  ].join('\n')
+}
+
+RequestSigner.prototype.canonicalHeaders = function() {
+  var headers = this.request.headers
+  function trimAll(header) {
+    return header.toString().trim().replace(/\s+/g, ' ')
+  }
+  return Object.keys(headers)
+    .sort(function(a, b) { return a.toLowerCase() < b.toLowerCase() ? -1 : 1 })
+    .map(function(key) { return key.toLowerCase() + ':' + trimAll(headers[key]) })
+    .join('\n')
+}
+
+RequestSigner.prototype.signedHeaders = function() {
+  return Object.keys(this.request.headers)
+    .map(function(key) { return key.toLowerCase() })
+    .sort()
+    .join(';')
+}
+
+RequestSigner.prototype.credentialString = function() {
+  return [
+    this.getDate(),
+    this.region,
+    this.service,
+    'aws4_request',
+  ].join('/')
+}
+
+RequestSigner.prototype.defaultCredentials = function() {
+  var env = process.env
+  return {
+    accessKeyId: env.AWS_ACCESS_KEY_ID || env.AWS_ACCESS_KEY,
+    secretAccessKey: env.AWS_SECRET_ACCESS_KEY || env.AWS_SECRET_KEY,
+    sessionToken: env.AWS_SESSION_TOKEN,
+  }
+}
+
+RequestSigner.prototype.parsePath = function() {
+  var path = this.request.path || '/',
+      queryIx = path.indexOf('?'),
+      query = null
+
+  if (queryIx >= 0) {
+    query = querystring.parse(path.slice(queryIx + 1))
+    path = path.slice(0, queryIx)
+  }
+
+  // S3 doesn't always encode characters > 127 correctly and
+  // all services don't encode characters > 255 correctly
+  // So if there are non-reserved chars (and it's not already all % encoded), just encode them all
+  if (/[^0-9A-Za-z!'()*\-._~%/]/.test(path)) {
+    path = path.split('/').map(function(piece) {
+      return querystring.escape(querystring.unescape(piece))
+    }).join('/')
+  }
+
+  this.parsedPath = {
+    path: path,
+    query: query,
+  }
+}
+
+RequestSigner.prototype.formatPath = function() {
+  var path = this.parsedPath.path,
+      query = this.parsedPath.query
+
+  if (!query) return path
+
+  // Services don't support empty query string keys
+  if (query[''] != null) delete query['']
+
+  return path + '?' + encodeRfc3986(querystring.stringify(query))
+}
+
+aws4.RequestSigner = RequestSigner
+
+aws4.sign = function(request, credentials) {
+  return new RequestSigner(request, credentials).sign()
+}
diff --git a/deps/npm/node_modules/request/node_modules/aws4/example.js b/deps/npm/node_modules/request/node_modules/aws4/example.js
new file mode 100644 (file)
index 0000000..5d07540
--- /dev/null
@@ -0,0 +1,371 @@
+var http  = require('http'),
+    https = require('https'),
+    aws4  = require('aws4')
+
+// given an options object you could pass to http.request
+var opts = {host: 'sqs.us-east-1.amazonaws.com', path: '/?Action=ListQueues'}
+
+// alternatively (as aws4 can infer the host):
+opts = {service: 'sqs', region: 'us-east-1', path: '/?Action=ListQueues'}
+
+// alternatively (as us-east-1 is default):
+opts = {service: 'sqs', path: '/?Action=ListQueues'}
+
+aws4.sign(opts) // assumes AWS credentials are available in process.env
+
+console.log(opts)
+/*
+{
+  host: 'sqs.us-east-1.amazonaws.com',
+  path: '/?Action=ListQueues',
+  headers: {
+    Host: 'sqs.us-east-1.amazonaws.com',
+    'X-Amz-Date': '20121226T061030Z',
+    Authorization: 'AWS4-HMAC-SHA256 Credential=ABCDEF/20121226/us-east-1/sqs/aws4_request, ...'
+  }
+}
+*/
+
+// we can now use this to query AWS using the standard node.js http API
+http.request(opts, function(res) { res.pipe(process.stdout) }).end()
+/*
+<?xml version="1.0"?>
+<ListQueuesResponse xmlns="http://queue.amazonaws.com/doc/2012-11-05/">
+...
+*/
+
+// you can also pass AWS credentials in explicitly (otherwise taken from process.env)
+aws4.sign(opts, {accessKeyId: '', secretAccessKey: ''})
+
+// can also add the signature to query strings
+aws4.sign({service: 's3', path: '/my-bucket?X-Amz-Expires=12345', signQuery: true})
+
+// create a utility function to pipe to stdout (with https this time)
+function request(o) { https.request(o, function(res) { res.pipe(process.stdout) }).end(o.body || '') }
+
+// aws4 can infer the HTTP method if a body is passed in
+// method will be POST and Content-Type: 'application/x-www-form-urlencoded; charset=utf-8'
+request(aws4.sign({service: 'iam', body: 'Action=ListGroups&Version=2010-05-08'}))
+/*
+<ListGroupsResponse xmlns="https://iam.amazonaws.com/doc/2010-05-08/">
+...
+*/
+
+// can specify any custom option or header as per usual
+request(aws4.sign({
+  service: 'dynamodb',
+  region: 'ap-southeast-2',
+  method: 'POST',
+  path: '/',
+  headers: {
+    'Content-Type': 'application/x-amz-json-1.0',
+    'X-Amz-Target': 'DynamoDB_20120810.ListTables'
+  },
+  body: '{}'
+}))
+/*
+{"TableNames":[]}
+...
+*/
+
+// works with all other services that support Signature Version 4
+
+request(aws4.sign({service: 's3', path: '/', signQuery: true}))
+/*
+<ListAllMyBucketsResult xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
+...
+*/
+
+request(aws4.sign({service: 'ec2', path: '/?Action=DescribeRegions&Version=2014-06-15'}))
+/*
+<DescribeRegionsResponse xmlns="http://ec2.amazonaws.com/doc/2014-06-15/">
+...
+*/
+
+request(aws4.sign({service: 'sns', path: '/?Action=ListTopics&Version=2010-03-31'}))
+/*
+<ListTopicsResponse xmlns="http://sns.amazonaws.com/doc/2010-03-31/">
+...
+*/
+
+request(aws4.sign({service: 'sts', path: '/?Action=GetSessionToken&Version=2011-06-15'}))
+/*
+<GetSessionTokenResponse xmlns="https://sts.amazonaws.com/doc/2011-06-15/">
+...
+*/
+
+request(aws4.sign({service: 'cloudsearch', path: '/?Action=ListDomainNames&Version=2013-01-01'}))
+/*
+<ListDomainNamesResponse xmlns="http://cloudsearch.amazonaws.com/doc/2013-01-01/">
+...
+*/
+
+request(aws4.sign({service: 'ses', path: '/?Action=ListIdentities&Version=2010-12-01'}))
+/*
+<ListIdentitiesResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
+...
+*/
+
+request(aws4.sign({service: 'autoscaling', path: '/?Action=DescribeAutoScalingInstances&Version=2011-01-01'}))
+/*
+<DescribeAutoScalingInstancesResponse xmlns="http://autoscaling.amazonaws.com/doc/2011-01-01/">
+...
+*/
+
+request(aws4.sign({service: 'elasticloadbalancing', path: '/?Action=DescribeLoadBalancers&Version=2012-06-01'}))
+/*
+<DescribeLoadBalancersResponse xmlns="http://elasticloadbalancing.amazonaws.com/doc/2012-06-01/">
+...
+*/
+
+request(aws4.sign({service: 'cloudformation', path: '/?Action=ListStacks&Version=2010-05-15'}))
+/*
+<ListStacksResponse xmlns="http://cloudformation.amazonaws.com/doc/2010-05-15/">
+...
+*/
+
+request(aws4.sign({service: 'elasticbeanstalk', path: '/?Action=ListAvailableSolutionStacks&Version=2010-12-01'}))
+/*
+<ListAvailableSolutionStacksResponse xmlns="http://elasticbeanstalk.amazonaws.com/docs/2010-12-01/">
+...
+*/
+
+request(aws4.sign({service: 'rds', path: '/?Action=DescribeDBInstances&Version=2012-09-17'}))
+/*
+<DescribeDBInstancesResponse xmlns="http://rds.amazonaws.com/doc/2012-09-17/">
+...
+*/
+
+request(aws4.sign({service: 'monitoring', path: '/?Action=ListMetrics&Version=2010-08-01'}))
+/*
+<ListMetricsResponse xmlns="http://monitoring.amazonaws.com/doc/2010-08-01/">
+...
+*/
+
+request(aws4.sign({service: 'redshift', path: '/?Action=DescribeClusters&Version=2012-12-01'}))
+/*
+<DescribeClustersResponse xmlns="http://redshift.amazonaws.com/doc/2012-12-01/">
+...
+*/
+
+request(aws4.sign({service: 'cloudfront', path: '/2014-05-31/distribution'}))
+/*
+<DistributionList xmlns="http://cloudfront.amazonaws.com/doc/2014-05-31/">
+...
+*/
+
+request(aws4.sign({service: 'elasticache', path: '/?Action=DescribeCacheClusters&Version=2014-07-15'}))
+/*
+<DescribeCacheClustersResponse xmlns="http://elasticache.amazonaws.com/doc/2014-07-15/">
+...
+*/
+
+request(aws4.sign({service: 'elasticmapreduce', path: '/?Action=DescribeJobFlows&Version=2009-03-31'}))
+/*
+<DescribeJobFlowsResponse xmlns="http://elasticmapreduce.amazonaws.com/doc/2009-03-31">
+...
+*/
+
+request(aws4.sign({service: 'route53', path: '/2013-04-01/hostedzone'}))
+/*
+<ListHostedZonesResponse xmlns="https://route53.amazonaws.com/doc/2013-04-01/">
+...
+*/
+
+request(aws4.sign({service: 'appstream', path: '/applications'}))
+/*
+{"_links":{"curie":[{"href":"http://docs.aws.amazon.com/appstream/latest/...
+...
+*/
+
+request(aws4.sign({service: 'cognito-sync', path: '/identitypools'}))
+/*
+{"Count":0,"IdentityPoolUsages":[],"MaxResults":16,"NextToken":null}
+...
+*/
+
+request(aws4.sign({service: 'elastictranscoder', path: '/2012-09-25/pipelines'}))
+/*
+{"NextPageToken":null,"Pipelines":[]}
+...
+*/
+
+request(aws4.sign({service: 'lambda', path: '/2014-11-13/functions/'}))
+/*
+{"Functions":[],"NextMarker":null}
+...
+*/
+
+request(aws4.sign({service: 'ecs', path: '/?Action=ListClusters&Version=2014-11-13'}))
+/*
+<ListClustersResponse xmlns="http://ecs.amazonaws.com/doc/2014-11-13/">
+...
+*/
+
+request(aws4.sign({service: 'glacier', path: '/-/vaults', headers: {'X-Amz-Glacier-Version': '2012-06-01'}}))
+/*
+{"Marker":null,"VaultList":[]}
+...
+*/
+
+request(aws4.sign({service: 'storagegateway', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'StorageGateway_20120630.ListGateways'
+}}))
+/*
+{"Gateways":[]}
+...
+*/
+
+request(aws4.sign({service: 'datapipeline', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'DataPipeline.ListPipelines'
+}}))
+/*
+{"hasMoreResults":false,"pipelineIdList":[]}
+...
+*/
+
+request(aws4.sign({service: 'opsworks', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'OpsWorks_20130218.DescribeStacks'
+}}))
+/*
+{"Stacks":[]}
+...
+*/
+
+request(aws4.sign({service: 'route53domains', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'Route53Domains_v20140515.ListDomains'
+}}))
+/*
+{"Domains":[]}
+...
+*/
+
+request(aws4.sign({service: 'kinesis', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'Kinesis_20131202.ListStreams'
+}}))
+/*
+{"HasMoreStreams":false,"StreamNames":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudtrail', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'CloudTrail_20131101.DescribeTrails'
+}}))
+/*
+{"trailList":[]}
+...
+*/
+
+request(aws4.sign({service: 'logs', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'Logs_20140328.DescribeLogGroups'
+}}))
+/*
+{"logGroups":[]}
+...
+*/
+
+request(aws4.sign({service: 'codedeploy', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'CodeDeploy_20141006.ListApplications'
+}}))
+/*
+{"applications":[]}
+...
+*/
+
+request(aws4.sign({service: 'directconnect', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'OvertureService.DescribeConnections'
+}}))
+/*
+{"connections":[]}
+...
+*/
+
+request(aws4.sign({service: 'kms', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'TrentService.ListKeys'
+}}))
+/*
+{"Keys":[],"Truncated":false}
+...
+*/
+
+request(aws4.sign({service: 'config', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'StarlingDoveService.DescribeDeliveryChannels'
+}}))
+/*
+{"DeliveryChannels":[]}
+...
+*/
+
+request(aws4.sign({service: 'cloudhsm', body: '{}', headers: {
+  'Content-Type': 'application/x-amz-json-1.1',
+  'X-Amz-Target': 'CloudHsmFrontendService.ListAvailableZones'
+}}))
+/*
+{"AZList":["us-east-1a","us-east-1b","us-east-1c"]}
+...
+*/
+
+request(aws4.sign({
+  service: 'swf',
+  body: '{"registrationStatus":"REGISTERED"}',
+  headers: {
+    'Content-Type': 'application/x-amz-json-1.0',
+    'X-Amz-Target': 'SimpleWorkflowService.ListDomains'
+  }
+}))
+/*
+{"domainInfos":[]}
+...
+*/
+
+request(aws4.sign({
+  service: 'cognito-identity',
+  body: '{"MaxResults": 1}',
+  headers: {
+    'Content-Type': 'application/x-amz-json-1.1',
+    'X-Amz-Target': 'AWSCognitoIdentityService.ListIdentityPools'
+  }
+}))
+/*
+{"IdentityPools":[]}
+...
+*/
+
+request(aws4.sign({
+  service: 'mobileanalytics',
+  path: '/2014-06-05/events',
+  body: JSON.stringify({events:[{
+    eventType: 'a',
+    timestamp: new Date().toISOString(),
+    session: {},
+  }]}),
+  headers: {
+    'Content-Type': 'application/json',
+    'X-Amz-Client-Context': JSON.stringify({
+      client: {client_id: 'a', app_title: 'a'},
+      custom: {},
+      env: {platform: 'a'},
+      services: {},
+    }),
+  }
+}))
+/*
+(HTTP 202, empty response)
+*/
+
+// Still not updated to v4...
+
+//request(aws4.sign({service: 'importexport', path: '/?Action=ListJobs&Version=2010-06-01'}))
+
+//request(aws4.sign({service: 'sdb', path: '/?Action=ListDomains&Version=2009-04-15'}))
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.npmignore
new file mode 100644 (file)
index 0000000..07e6e47
--- /dev/null
@@ -0,0 +1 @@
+/node_modules
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/.travis.yml
new file mode 100644 (file)
index 0000000..4af02b3
--- /dev/null
@@ -0,0 +1,8 @@
+language: node_js
+node_js:
+  - '0.8'
+  - '0.10'
+  - '0.12'
+  - 'iojs'
+before_install:
+  - npm install -g npm@latest
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS
new file mode 100644 (file)
index 0000000..4a0bc50
--- /dev/null
@@ -0,0 +1,14 @@
+# Authors, sorted by whether or not they are me
+Isaac Z. Schlueter <i@izs.me>
+Brian Cottingham <spiffytech@gmail.com>
+Carlos Brito Lage <carlos@carloslage.net>
+Jesse Dailey <jesse.dailey@gmail.com>
+Kevin O'Hara <kevinohara80@gmail.com>
+Marco Rogers <marco.rogers@gmail.com>
+Mark Cavage <mcavage@gmail.com>
+Marko Mikulicic <marko.mikulicic@isti.cnr.it>
+Nathan Rajlich <nathan@tootallnate.net>
+Satheesh Natesan <snateshan@myspace-inc.com>
+Trent Mick <trentm@gmail.com>
+ashleybrener <ashley@starlogik.com>
+n4kz <n4kz@n4kz.com>
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/README.md
new file mode 100644 (file)
index 0000000..c06814e
--- /dev/null
@@ -0,0 +1,137 @@
+# lru cache
+
+A cache object that deletes the least-recently-used items.
+
+## Usage:
+
+```javascript
+var LRU = require("lru-cache")
+  , options = { max: 500
+              , length: function (n) { return n * 2 }
+              , dispose: function (key, n) { n.close() }
+              , maxAge: 1000 * 60 * 60 }
+  , cache = LRU(options)
+  , otherCache = LRU(50) // sets just the max size
+
+cache.set("key", "value")
+cache.get("key") // "value"
+
+cache.reset()    // empty the cache
+```
+
+If you put more stuff in it, then items will fall out.
+
+If you try to put an oversized thing in it, then it'll fall out right
+away.
+
+## Keys should always be Strings or Numbers
+
+Note: this module will print warnings to `console.error` if you use a
+key that is not a String or Number.  Because items are stored in an
+object, which coerces keys to a string, it won't go well for you if
+you try to use a key that is not a unique string, it'll cause surprise
+collisions.  For example:
+
+```JavaScript
+// Bad Example!  Dont' do this!
+var cache = LRU()
+var a = {}
+var b = {}
+cache.set(a, 'this is a')
+cache.set(b, 'this is b')
+console.log(cache.get(a)) // prints: 'this is b'
+```
+
+## Options
+
+* `max` The maximum size of the cache, checked by applying the length
+  function to all values in the cache.  Not setting this is kind of
+  silly, since that's the whole purpose of this lib, but it defaults
+  to `Infinity`.
+* `maxAge` Maximum age in ms.  Items are not pro-actively pruned out
+  as they age, but if you try to get an item that is too old, it'll
+  drop it and return undefined instead of giving it to you.
+* `length` Function that is used to calculate the length of stored
+  items.  If you're storing strings or buffers, then you probably want
+  to do something like `function(n){return n.length}`.  The default is
+  `function(n){return 1}`, which is fine if you want to store `max`
+  like-sized things.
+* `dispose` Function that is called on items when they are dropped
+  from the cache.  This can be handy if you want to close file
+  descriptors or do other cleanup tasks when items are no longer
+  accessible.  Called with `key, value`.  It's called *before*
+  actually removing the item from the internal cache, so if you want
+  to immediately put it back in, you'll have to do that in a
+  `nextTick` or `setTimeout` callback or it won't do anything.
+* `stale` By default, if you set a `maxAge`, it'll only actually pull
+  stale items out of the cache when you `get(key)`.  (That is, it's
+  not pre-emptively doing a `setTimeout` or anything.)  If you set
+  `stale:true`, it'll return the stale value before deleting it.  If
+  you don't set this, then it'll return `undefined` when you try to
+  get a stale entry, as if it had already been deleted.
+
+## API
+
+* `set(key, value, maxAge)`
+* `get(key) => value`
+
+    Both of these will update the "recently used"-ness of the key.
+    They do what you think. `max` is optional and overrides the
+    cache `max` option if provided.
+
+* `peek(key)`
+
+    Returns the key value (or `undefined` if not found) without
+    updating the "recently used"-ness of the key.
+
+    (If you find yourself using this a lot, you *might* be using the
+    wrong sort of data structure, but there are some use cases where
+    it's handy.)
+
+* `del(key)`
+
+    Deletes a key out of the cache.
+
+* `reset()`
+
+    Clear the cache entirely, throwing away all values.
+
+* `has(key)`
+
+    Check if a key is in the cache, without updating the recent-ness
+    or deleting it for being stale.
+
+* `forEach(function(value,key,cache), [thisp])`
+
+    Just like `Array.prototype.forEach`.  Iterates over all the keys
+    in the cache, in order of recent-ness.  (Ie, more recently used
+    items are iterated over first.)
+
+* `keys()`
+
+    Return an array of the keys in the cache.
+
+* `values()`
+
+    Return an array of the values in the cache.
+
+* `length()`
+
+    Return total length of objects in cache taking into account
+    `length` options function.
+
+* `itemCount`
+
+    Return total quantity of objects currently in cache. Note, that
+    `stale` (see options) items are returned as part of this item
+    count.
+
+* `dump()`
+
+    Return an array of the cache entries ready for serialization and usage
+    with 'destinationCache.load(arr)`.
+
+* `load(cacheEntriesArray)`
+
+    Loads another cache entries array, obtained with `sourceCache.dump()`,
+    into the cache. The destination cache is reset before loading new entries
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js
new file mode 100644 (file)
index 0000000..2bbe653
--- /dev/null
@@ -0,0 +1,334 @@
+;(function () { // closure for web browsers
+
+if (typeof module === 'object' && module.exports) {
+  module.exports = LRUCache
+} else {
+  // just set the global for non-node platforms.
+  this.LRUCache = LRUCache
+}
+
+function hOP (obj, key) {
+  return Object.prototype.hasOwnProperty.call(obj, key)
+}
+
+function naiveLength () { return 1 }
+
+var didTypeWarning = false
+function typeCheckKey(key) {
+  if (!didTypeWarning && typeof key !== 'string' && typeof key !== 'number') {
+    didTypeWarning = true
+    console.error(new TypeError("LRU: key must be a string or number. Almost certainly a bug! " + typeof key).stack)
+  }
+}
+
+function LRUCache (options) {
+  if (!(this instanceof LRUCache))
+    return new LRUCache(options)
+
+  if (typeof options === 'number')
+    options = { max: options }
+
+  if (!options)
+    options = {}
+
+  this._max = options.max
+  // Kind of weird to have a default max of Infinity, but oh well.
+  if (!this._max || !(typeof this._max === "number") || this._max <= 0 )
+    this._max = Infinity
+
+  this._lengthCalculator = options.length || naiveLength
+  if (typeof this._lengthCalculator !== "function")
+    this._lengthCalculator = naiveLength
+
+  this._allowStale = options.stale || false
+  this._maxAge = options.maxAge || null
+  this._dispose = options.dispose
+  this.reset()
+}
+
+// resize the cache when the max changes.
+Object.defineProperty(LRUCache.prototype, "max",
+  { set : function (mL) {
+      if (!mL || !(typeof mL === "number") || mL <= 0 ) mL = Infinity
+      this._max = mL
+      if (this._length > this._max) trim(this)
+    }
+  , get : function () { return this._max }
+  , enumerable : true
+  })
+
+// resize the cache when the lengthCalculator changes.
+Object.defineProperty(LRUCache.prototype, "lengthCalculator",
+  { set : function (lC) {
+      if (typeof lC !== "function") {
+        this._lengthCalculator = naiveLength
+        this._length = this._itemCount
+        for (var key in this._cache) {
+          this._cache[key].length = 1
+        }
+      } else {
+        this._lengthCalculator = lC
+        this._length = 0
+        for (var key in this._cache) {
+          this._cache[key].length = this._lengthCalculator(this._cache[key].value)
+          this._length += this._cache[key].length
+        }
+      }
+
+      if (this._length > this._max) trim(this)
+    }
+  , get : function () { return this._lengthCalculator }
+  , enumerable : true
+  })
+
+Object.defineProperty(LRUCache.prototype, "length",
+  { get : function () { return this._length }
+  , enumerable : true
+  })
+
+
+Object.defineProperty(LRUCache.prototype, "itemCount",
+  { get : function () { return this._itemCount }
+  , enumerable : true
+  })
+
+LRUCache.prototype.forEach = function (fn, thisp) {
+  thisp = thisp || this
+  var i = 0
+  var itemCount = this._itemCount
+
+  for (var k = this._mru - 1; k >= 0 && i < itemCount; k--) if (this._lruList[k]) {
+    i++
+    var hit = this._lruList[k]
+    if (isStale(this, hit)) {
+      del(this, hit)
+      if (!this._allowStale) hit = undefined
+    }
+    if (hit) {
+      fn.call(thisp, hit.value, hit.key, this)
+    }
+  }
+}
+
+LRUCache.prototype.keys = function () {
+  var keys = new Array(this._itemCount)
+  var i = 0
+  for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+    var hit = this._lruList[k]
+    keys[i++] = hit.key
+  }
+  return keys
+}
+
+LRUCache.prototype.values = function () {
+  var values = new Array(this._itemCount)
+  var i = 0
+  for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+    var hit = this._lruList[k]
+    values[i++] = hit.value
+  }
+  return values
+}
+
+LRUCache.prototype.reset = function () {
+  if (this._dispose && this._cache) {
+    for (var k in this._cache) {
+      this._dispose(k, this._cache[k].value)
+    }
+  }
+
+  this._cache = Object.create(null) // hash of items by key
+  this._lruList = Object.create(null) // list of items in order of use recency
+  this._mru = 0 // most recently used
+  this._lru = 0 // least recently used
+  this._length = 0 // number of items in the list
+  this._itemCount = 0
+}
+
+LRUCache.prototype.dump = function () {
+  var arr = []
+  var i = 0
+
+  for (var k = this._mru - 1; k >= 0 && i < this._itemCount; k--) if (this._lruList[k]) {
+    var hit = this._lruList[k]
+    if (!isStale(this, hit)) {
+      //Do not store staled hits
+      ++i
+      arr.push({
+        k: hit.key,
+        v: hit.value,
+        e: hit.now + (hit.maxAge || 0)
+      });
+    }
+  }
+  //arr has the most read first
+  return arr
+}
+
+LRUCache.prototype.dumpLru = function () {
+  return this._lruList
+}
+
+LRUCache.prototype.set = function (key, value, maxAge) {
+  maxAge = maxAge || this._maxAge
+  typeCheckKey(key)
+
+  var now = maxAge ? Date.now() : 0
+  var len = this._lengthCalculator(value)
+
+  if (hOP(this._cache, key)) {
+    if (len > this._max) {
+      del(this, this._cache[key])
+      return false
+    }
+    // dispose of the old one before overwriting
+    if (this._dispose)
+      this._dispose(key, this._cache[key].value)
+
+    this._cache[key].now = now
+    this._cache[key].maxAge = maxAge
+    this._cache[key].value = value
+    this._length += (len - this._cache[key].length)
+    this._cache[key].length = len
+    this.get(key)
+
+    if (this._length > this._max)
+      trim(this)
+
+    return true
+  }
+
+  var hit = new Entry(key, value, this._mru++, len, now, maxAge)
+
+  // oversized objects fall out of cache automatically.
+  if (hit.length > this._max) {
+    if (this._dispose) this._dispose(key, value)
+    return false
+  }
+
+  this._length += hit.length
+  this._lruList[hit.lu] = this._cache[key] = hit
+  this._itemCount ++
+
+  if (this._length > this._max)
+    trim(this)
+
+  return true
+}
+
+LRUCache.prototype.has = function (key) {
+  typeCheckKey(key)
+  if (!hOP(this._cache, key)) return false
+  var hit = this._cache[key]
+  if (isStale(this, hit)) {
+    return false
+  }
+  return true
+}
+
+LRUCache.prototype.get = function (key) {
+  typeCheckKey(key)
+  return get(this, key, true)
+}
+
+LRUCache.prototype.peek = function (key) {
+  typeCheckKey(key)
+  return get(this, key, false)
+}
+
+LRUCache.prototype.pop = function () {
+  var hit = this._lruList[this._lru]
+  del(this, hit)
+  return hit || null
+}
+
+LRUCache.prototype.del = function (key) {
+  typeCheckKey(key)
+  del(this, this._cache[key])
+}
+
+LRUCache.prototype.load = function (arr) {
+  //reset the cache
+  this.reset();
+
+  var now = Date.now()
+  //A previous serialized cache has the most recent items first
+  for (var l = arr.length - 1; l >= 0; l-- ) {
+    var hit = arr[l]
+    typeCheckKey(hit.k)
+    var expiresAt = hit.e || 0
+    if (expiresAt === 0) {
+      //the item was created without expiration in a non aged cache
+      this.set(hit.k, hit.v)
+    } else {
+      var maxAge = expiresAt - now
+      //dont add already expired items
+      if (maxAge > 0) this.set(hit.k, hit.v, maxAge)
+    }
+  }
+}
+
+function get (self, key, doUse) {
+  typeCheckKey(key)
+  var hit = self._cache[key]
+  if (hit) {
+    if (isStale(self, hit)) {
+      del(self, hit)
+      if (!self._allowStale) hit = undefined
+    } else {
+      if (doUse) use(self, hit)
+    }
+    if (hit) hit = hit.value
+  }
+  return hit
+}
+
+function isStale(self, hit) {
+  if (!hit || (!hit.maxAge && !self._maxAge)) return false
+  var stale = false;
+  var diff = Date.now() - hit.now
+  if (hit.maxAge) {
+    stale = diff > hit.maxAge
+  } else {
+    stale = self._maxAge && (diff > self._maxAge)
+  }
+  return stale;
+}
+
+function use (self, hit) {
+  shiftLU(self, hit)
+  hit.lu = self._mru ++
+  self._lruList[hit.lu] = hit
+}
+
+function trim (self) {
+  while (self._lru < self._mru && self._length > self._max)
+    del(self, self._lruList[self._lru])
+}
+
+function shiftLU (self, hit) {
+  delete self._lruList[ hit.lu ]
+  while (self._lru < self._mru && !self._lruList[self._lru]) self._lru ++
+}
+
+function del (self, hit) {
+  if (hit) {
+    if (self._dispose) self._dispose(hit.key, hit.value)
+    self._length -= hit.length
+    self._itemCount --
+    delete self._cache[ hit.key ]
+    shiftLU(self, hit)
+  }
+}
+
+// classy, since V8 prefers predictable objects.
+function Entry (key, value, lu, length, now, maxAge) {
+  this.key = key
+  this.value = value
+  this.lu = lu
+  this.length = length
+  this.now = now
+  if (maxAge) this.maxAge = maxAge
+}
+
+})()
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/package.json
new file mode 100644 (file)
index 0000000..576b8dd
--- /dev/null
@@ -0,0 +1,58 @@
+{
+  "name": "lru-cache",
+  "description": "A cache object that deletes the least-recently-used items.",
+  "version": "2.7.3",
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me"
+  },
+  "keywords": [
+    "mru",
+    "lru",
+    "cache"
+  ],
+  "scripts": {
+    "test": "tap test --gc"
+  },
+  "main": "lib/lru-cache.js",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/node-lru-cache.git"
+  },
+  "devDependencies": {
+    "tap": "^1.2.0",
+    "weak": ""
+  },
+  "license": "ISC",
+  "gitHead": "292048199f6d28b77fbe584279a1898e25e4c714",
+  "bugs": {
+    "url": "https://github.com/isaacs/node-lru-cache/issues"
+  },
+  "homepage": "https://github.com/isaacs/node-lru-cache#readme",
+  "_id": "lru-cache@2.7.3",
+  "_shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
+  "_from": "lru-cache@>=2.6.5 <3.0.0",
+  "_npmVersion": "3.3.2",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "dist": {
+    "shasum": "6d4524e8b955f95d4f5b58851ce21dd72fb4e952",
+    "tarball": "http://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "isaacs@npmjs.com"
+    },
+    {
+      "name": "othiym23",
+      "email": "ogd@aoaioxxysz.net"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-2.7.3.tgz",
+  "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/basic.js
new file mode 100644 (file)
index 0000000..b47225f
--- /dev/null
@@ -0,0 +1,396 @@
+var test = require("tap").test
+  , LRU = require("../")
+
+test("basic", function (t) {
+  var cache = new LRU({max: 10})
+  cache.set("key", "value")
+  t.equal(cache.get("key"), "value")
+  t.equal(cache.get("nada"), undefined)
+  t.equal(cache.length, 1)
+  t.equal(cache.max, 10)
+  t.end()
+})
+
+test("least recently set", function (t) {
+  var cache = new LRU(2)
+  cache.set("a", "A")
+  cache.set("b", "B")
+  cache.set("c", "C")
+  t.equal(cache.get("c"), "C")
+  t.equal(cache.get("b"), "B")
+  t.equal(cache.get("a"), undefined)
+  t.end()
+})
+
+test("lru recently gotten", function (t) {
+  var cache = new LRU(2)
+  cache.set("a", "A")
+  cache.set("b", "B")
+  cache.get("a")
+  cache.set("c", "C")
+  t.equal(cache.get("c"), "C")
+  t.equal(cache.get("b"), undefined)
+  t.equal(cache.get("a"), "A")
+  t.end()
+})
+
+test("del", function (t) {
+  var cache = new LRU(2)
+  cache.set("a", "A")
+  cache.del("a")
+  t.equal(cache.get("a"), undefined)
+  t.end()
+})
+
+test("max", function (t) {
+  var cache = new LRU(3)
+
+  // test changing the max, verify that the LRU items get dropped.
+  cache.max = 100
+  for (var i = 0; i < 100; i ++) cache.set(i, i)
+  t.equal(cache.length, 100)
+  for (var i = 0; i < 100; i ++) {
+    t.equal(cache.get(i), i)
+  }
+  cache.max = 3
+  t.equal(cache.length, 3)
+  for (var i = 0; i < 97; i ++) {
+    t.equal(cache.get(i), undefined)
+  }
+  for (var i = 98; i < 100; i ++) {
+    t.equal(cache.get(i), i)
+  }
+
+  // now remove the max restriction, and try again.
+  cache.max = "hello"
+  for (var i = 0; i < 100; i ++) cache.set(i, i)
+  t.equal(cache.length, 100)
+  for (var i = 0; i < 100; i ++) {
+    t.equal(cache.get(i), i)
+  }
+  // should trigger an immediate resize
+  cache.max = 3
+  t.equal(cache.length, 3)
+  for (var i = 0; i < 97; i ++) {
+    t.equal(cache.get(i), undefined)
+  }
+  for (var i = 98; i < 100; i ++) {
+    t.equal(cache.get(i), i)
+  }
+  t.end()
+})
+
+test("reset", function (t) {
+  var cache = new LRU(10)
+  cache.set("a", "A")
+  cache.set("b", "B")
+  cache.reset()
+  t.equal(cache.length, 0)
+  t.equal(cache.max, 10)
+  t.equal(cache.get("a"), undefined)
+  t.equal(cache.get("b"), undefined)
+  t.end()
+})
+
+
+test("basic with weighed length", function (t) {
+  var cache = new LRU({
+    max: 100,
+    length: function (item) { return item.size }
+  })
+  cache.set("key", {val: "value", size: 50})
+  t.equal(cache.get("key").val, "value")
+  t.equal(cache.get("nada"), undefined)
+  t.equal(cache.lengthCalculator(cache.get("key")), 50)
+  t.equal(cache.length, 50)
+  t.equal(cache.max, 100)
+  t.end()
+})
+
+
+test("weighed length item too large", function (t) {
+  var cache = new LRU({
+    max: 10,
+    length: function (item) { return item.size }
+  })
+  t.equal(cache.max, 10)
+
+  // should fall out immediately
+  cache.set("key", {val: "value", size: 50})
+
+  t.equal(cache.length, 0)
+  t.equal(cache.get("key"), undefined)
+  t.end()
+})
+
+test("least recently set with weighed length", function (t) {
+  var cache = new LRU({
+    max:8,
+    length: function (item) { return item.length }
+  })
+  cache.set("a", "A")
+  cache.set("b", "BB")
+  cache.set("c", "CCC")
+  cache.set("d", "DDDD")
+  t.equal(cache.get("d"), "DDDD")
+  t.equal(cache.get("c"), "CCC")
+  t.equal(cache.get("b"), undefined)
+  t.equal(cache.get("a"), undefined)
+  t.end()
+})
+
+test("lru recently gotten with weighed length", function (t) {
+  var cache = new LRU({
+    max: 8,
+    length: function (item) { return item.length }
+  })
+  cache.set("a", "A")
+  cache.set("b", "BB")
+  cache.set("c", "CCC")
+  cache.get("a")
+  cache.get("b")
+  cache.set("d", "DDDD")
+  t.equal(cache.get("c"), undefined)
+  t.equal(cache.get("d"), "DDDD")
+  t.equal(cache.get("b"), "BB")
+  t.equal(cache.get("a"), "A")
+  t.end()
+})
+
+test("lru recently updated with weighed length", function (t) {
+  var cache = new LRU({
+    max: 8,
+    length: function (item) { return item.length }
+  })
+  cache.set("a", "A")
+  cache.set("b", "BB")
+  cache.set("c", "CCC")
+  t.equal(cache.length, 6) //CCC BB A
+  cache.set("a", "+A")
+  t.equal(cache.length, 7) //+A CCC BB
+  cache.set("b", "++BB")
+  t.equal(cache.length, 6) //++BB +A
+  t.equal(cache.get("c"), undefined)
+
+  cache.set("c", "oversized")
+  t.equal(cache.length, 6) //++BB +A
+  t.equal(cache.get("c"), undefined)
+
+  cache.set("a", "oversized")
+  t.equal(cache.length, 4) //++BB
+  t.equal(cache.get("a"), undefined)
+  t.equal(cache.get("b"), "++BB")
+  t.end()
+})
+
+test("set returns proper booleans", function(t) {
+  var cache = new LRU({
+    max: 5,
+    length: function (item) { return item.length }
+  })
+
+  t.equal(cache.set("a", "A"), true)
+
+  // should return false for max exceeded
+  t.equal(cache.set("b", "donuts"), false)
+
+  t.equal(cache.set("b", "B"), true)
+  t.equal(cache.set("c", "CCCC"), true)
+  t.end()
+})
+
+test("drop the old items", function(t) {
+  var cache = new LRU({
+    max: 5,
+    maxAge: 50
+  })
+
+  cache.set("a", "A")
+
+  setTimeout(function () {
+    cache.set("b", "b")
+    t.equal(cache.get("a"), "A")
+  }, 25)
+
+  setTimeout(function () {
+    cache.set("c", "C")
+    // timed out
+    t.notOk(cache.get("a"))
+  }, 60 + 25)
+
+  setTimeout(function () {
+    t.notOk(cache.get("b"))
+    t.equal(cache.get("c"), "C")
+  }, 90)
+
+  setTimeout(function () {
+    t.notOk(cache.get("c"))
+    t.end()
+  }, 155)
+})
+
+test("individual item can have it's own maxAge", function(t) {
+  var cache = new LRU({
+    max: 5,
+    maxAge: 50
+  })
+
+  cache.set("a", "A", 20)
+  setTimeout(function () {
+    t.notOk(cache.get("a"))
+    t.end()
+  }, 25)
+})
+
+test("individual item can have it's own maxAge > cache's", function(t) {
+  var cache = new LRU({
+    max: 5,
+    maxAge: 20
+  })
+
+  cache.set("a", "A", 50)
+  setTimeout(function () {
+    t.equal(cache.get("a"), "A")
+    t.end()
+  }, 25)
+})
+
+test("disposal function", function(t) {
+  var disposed = false
+  var cache = new LRU({
+    max: 1,
+    dispose: function (k, n) {
+      disposed = n
+    }
+  })
+
+  cache.set(1, 1)
+  cache.set(2, 2)
+  t.equal(disposed, 1)
+  cache.set(3, 3)
+  t.equal(disposed, 2)
+  cache.reset()
+  t.equal(disposed, 3)
+  t.end()
+})
+
+test("disposal function on too big of item", function(t) {
+  var disposed = false
+  var cache = new LRU({
+    max: 1,
+    length: function (k) {
+      return k.length
+    },
+    dispose: function (k, n) {
+      disposed = n
+    }
+  })
+  var obj = [ 1, 2 ]
+
+  t.equal(disposed, false)
+  cache.set("obj", obj)
+  t.equal(disposed, obj)
+  t.end()
+})
+
+test("has()", function(t) {
+  var cache = new LRU({
+    max: 1,
+    maxAge: 10
+  })
+
+  cache.set('foo', 'bar')
+  t.equal(cache.has('foo'), true)
+  cache.set('blu', 'baz')
+  t.equal(cache.has('foo'), false)
+  t.equal(cache.has('blu'), true)
+  setTimeout(function() {
+    t.equal(cache.has('blu'), false)
+    t.end()
+  }, 15)
+})
+
+test("stale", function(t) {
+  var cache = new LRU({
+    maxAge: 10,
+    stale: true
+  })
+
+  cache.set('foo', 'bar')
+  t.equal(cache.get('foo'), 'bar')
+  t.equal(cache.has('foo'), true)
+  setTimeout(function() {
+    t.equal(cache.has('foo'), false)
+    t.equal(cache.get('foo'), 'bar')
+    t.equal(cache.get('foo'), undefined)
+    t.end()
+  }, 15)
+})
+
+test("lru update via set", function(t) {
+  var cache = LRU({ max: 2 });
+
+  cache.set('foo', 1);
+  cache.set('bar', 2);
+  cache.del('bar');
+  cache.set('baz', 3);
+  cache.set('qux', 4);
+
+  t.equal(cache.get('foo'), undefined)
+  t.equal(cache.get('bar'), undefined)
+  t.equal(cache.get('baz'), 3)
+  t.equal(cache.get('qux'), 4)
+  t.end()
+})
+
+test("least recently set w/ peek", function (t) {
+  var cache = new LRU(2)
+  cache.set("a", "A")
+  cache.set("b", "B")
+  t.equal(cache.peek("a"), "A")
+  cache.set("c", "C")
+  t.equal(cache.get("c"), "C")
+  t.equal(cache.get("b"), "B")
+  t.equal(cache.get("a"), undefined)
+  t.end()
+})
+
+test("pop the least used item", function (t) {
+  var cache = new LRU(3)
+  , last
+
+  cache.set("a", "A")
+  cache.set("b", "B")
+  cache.set("c", "C")
+
+  t.equal(cache.length, 3)
+  t.equal(cache.max, 3)
+
+  // Ensure we pop a, c, b
+  cache.get("b", "B")
+
+  last = cache.pop()
+  t.equal(last.key, "a")
+  t.equal(last.value, "A")
+  t.equal(cache.length, 2)
+  t.equal(cache.max, 3)
+
+  last = cache.pop()
+  t.equal(last.key, "c")
+  t.equal(last.value, "C")
+  t.equal(cache.length, 1)
+  t.equal(cache.max, 3)
+
+  last = cache.pop()
+  t.equal(last.key, "b")
+  t.equal(last.value, "B")
+  t.equal(cache.length, 0)
+  t.equal(cache.max, 3)
+
+  last = cache.pop()
+  t.equal(last, null)
+  t.equal(cache.length, 0)
+  t.equal(cache.max, 3)
+
+  t.end()
+})
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/foreach.js
new file mode 100644 (file)
index 0000000..4190417
--- /dev/null
@@ -0,0 +1,120 @@
+var test = require('tap').test
+var LRU = require('../')
+
+test('forEach', function (t) {
+  var l = new LRU(5)
+  for (var i = 0; i < 10; i ++) {
+    l.set(i.toString(), i.toString(2))
+  }
+
+  var i = 9
+  l.forEach(function (val, key, cache) {
+    t.equal(cache, l)
+    t.equal(key, i.toString())
+    t.equal(val, i.toString(2))
+    i -= 1
+  })
+
+  // get in order of most recently used
+  l.get(6)
+  l.get(8)
+
+  var order = [ 8, 6, 9, 7, 5 ]
+  var i = 0
+
+  l.forEach(function (val, key, cache) {
+    var j = order[i ++]
+    t.equal(cache, l)
+    t.equal(key, j.toString())
+    t.equal(val, j.toString(2))
+  })
+  t.equal(i, order.length);
+
+  t.end()
+})
+
+test('keys() and values()', function (t) {
+  var l = new LRU(5)
+  for (var i = 0; i < 10; i ++) {
+    l.set(i.toString(), i.toString(2))
+  }
+
+  t.similar(l.keys(), ['9', '8', '7', '6', '5'])
+  t.similar(l.values(), ['1001', '1000', '111', '110', '101'])
+
+  // get in order of most recently used
+  l.get(6)
+  l.get(8)
+
+  t.similar(l.keys(), ['8', '6', '9', '7', '5'])
+  t.similar(l.values(), ['1000', '110', '1001', '111', '101'])
+
+  t.end()
+})
+
+test('all entries are iterated over', function(t) {
+  var l = new LRU(5)
+  for (var i = 0; i < 10; i ++) {
+    l.set(i.toString(), i.toString(2))
+  }
+
+  var i = 0
+  l.forEach(function (val, key, cache) {
+    if (i > 0) {
+      cache.del(key)
+    }
+    i += 1
+  })
+
+  t.equal(i, 5)
+  t.equal(l.keys().length, 1)
+
+  t.end()
+})
+
+test('all stale entries are removed', function(t) {
+  var l = new LRU({ max: 5, maxAge: -5, stale: true })
+  for (var i = 0; i < 10; i ++) {
+    l.set(i.toString(), i.toString(2))
+  }
+
+  var i = 0
+  l.forEach(function () {
+    i += 1
+  })
+
+  t.equal(i, 5)
+  t.equal(l.keys().length, 0)
+
+  t.end()
+})
+
+test('expires', function (t) {
+  var l = new LRU({
+    max: 10,
+    maxAge: 50
+  })
+  for (var i = 0; i < 10; i++) {
+    l.set(i.toString(), i.toString(2), ((i % 2) ? 25 : undefined))
+  }
+
+  var i = 0
+  var order = [ 8, 6, 4, 2, 0 ]
+  setTimeout(function () {
+    l.forEach(function (val, key, cache) {
+      var j = order[i++]
+      t.equal(cache, l)
+      t.equal(key, j.toString())
+      t.equal(val, j.toString(2))
+    })
+    t.equal(i, order.length);
+
+    setTimeout(function () {
+      var count = 0;
+      l.forEach(function (val, key, cache) { count++; })
+      t.equal(0, count);
+      t.end()
+    }, 25)
+
+  }, 26)
+})
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js
new file mode 100644 (file)
index 0000000..b5912f6
--- /dev/null
@@ -0,0 +1,51 @@
+#!/usr/bin/env node --expose_gc
+
+
+var weak = require('weak');
+var test = require('tap').test
+var LRU = require('../')
+var l = new LRU({ max: 10 })
+var refs = 0
+function X() {
+  refs ++
+  weak(this, deref)
+}
+
+function deref() {
+  refs --
+}
+
+test('no leaks', function (t) {
+  // fill up the cache
+  for (var i = 0; i < 100; i++) {
+    l.set(i, new X);
+    // throw some gets in there, too.
+    if (i % 2 === 0)
+      l.get(i / 2)
+  }
+
+  gc()
+
+  var start = process.memoryUsage()
+
+  // capture the memory
+  var startRefs = refs
+
+  // do it again, but more
+  for (var i = 0; i < 10000; i++) {
+    l.set(i, new X);
+    // throw some gets in there, too.
+    if (i % 2 === 0)
+      l.get(i / 2)
+  }
+
+  gc()
+
+  var end = process.memoryUsage()
+  t.equal(refs, startRefs, 'no leaky refs')
+
+  console.error('start: %j\n' +
+                'end:   %j', start, end);
+  t.pass();
+  t.end();
+})
diff --git a/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js b/deps/npm/node_modules/request/node_modules/aws4/node_modules/lru-cache/test/serialize.js
new file mode 100644 (file)
index 0000000..5fe5dc3
--- /dev/null
@@ -0,0 +1,215 @@
+var test = require('tap').test
+var LRU = require('../')
+
+test('dump', function (t) {
+  var cache = new LRU()
+
+  t.equal(cache.dump().length, 0, "nothing in dump for empty cache")
+
+  cache.set("a", "A")
+  cache.set("b", "B")
+  t.deepEqual(cache.dump(), [
+    { k: "b", v: "B", e: 0 },
+    { k: "a", v: "A", e: 0 }
+  ])
+
+  cache.set("a", "A");
+  t.deepEqual(cache.dump(), [
+    { k: "a", v: "A", e: 0 },
+    { k: "b", v: "B", e: 0 }
+  ])
+
+  cache.get("b");
+  t.deepEqual(cache.dump(), [
+    { k: "b", v: "B", e: 0 },
+    { k: "a", v: "A", e: 0 }
+  ])
+
+  cache.del("a");
+  t.deepEqual(cache.dump(), [
+    { k: "b", v: "B",  e: 0 }
+  ])
+
+  t.end()
+})
+
+test("do not dump stale items", function(t) {
+  var cache = new LRU({
+    max: 5,
+    maxAge: 50
+  })
+
+  //expires at 50
+  cache.set("a", "A")
+
+  setTimeout(function () {
+    //expires at 75
+    cache.set("b", "B")
+    var s = cache.dump()
+    t.equal(s.length, 2)
+    t.equal(s[0].k, "b")
+    t.equal(s[1].k, "a")
+  }, 25)
+
+  setTimeout(function () {
+    //expires at 110
+    cache.set("c", "C")
+    var s = cache.dump()
+    t.equal(s.length, 2)
+    t.equal(s[0].k, "c")
+    t.equal(s[1].k, "b")
+  }, 60)
+
+  setTimeout(function () {
+    //expires at 130
+    cache.set("d", "D", 40)
+    var s = cache.dump()
+    t.equal(s.length, 2)
+    t.equal(s[0].k, "d")
+    t.equal(s[1].k, "c")
+  }, 90)
+
+  setTimeout(function () {
+    var s = cache.dump()
+    t.equal(s.length, 1)
+    t.equal(s[0].k, "d")
+  }, 120)
+
+  setTimeout(function () {
+    var s = cache.dump()
+    t.deepEqual(s, [])
+    t.end()
+  }, 155)
+})
+
+test("load basic cache", function(t) {
+  var cache = new LRU(),
+      copy = new LRU()
+
+  cache.set("a", "A")
+  cache.set("b", "B")
+
+  copy.load(cache.dump())
+  t.deepEquals(cache.dump(), copy.dump())
+
+  t.end()
+})
+
+
+test("load staled cache", function(t) {
+  var cache = new LRU({maxAge: 50}),
+      copy = new LRU({maxAge: 50}),
+      arr
+
+  //expires at 50
+  cache.set("a", "A")
+  setTimeout(function () {
+    //expires at 80
+    cache.set("b", "B")
+    arr = cache.dump()
+    t.equal(arr.length, 2)
+  }, 30)
+
+  setTimeout(function () {
+    copy.load(arr)
+    t.equal(copy.get("a"), undefined)
+    t.equal(copy.get("b"), "B")
+  }, 60)
+
+  setTimeout(function () {
+    t.equal(copy.get("b"), undefined)
+    t.end()
+  }, 90)
+})
+
+test("load to other size cache", function(t) {
+  var cache = new LRU({max: 2}),
+      copy = new LRU({max: 1})
+
+  cache.set("a", "A")
+  cache.set("b", "B")
+
+  copy.load(cache.dump())
+  t.equal(copy.get("a"), undefined)
+  t.equal(copy.get("b"), "B")
+
+  //update the last read from original cache
+  cache.get("a")
+  copy.load(cache.dump())
+  t.equal(copy.get("a"), "A")
+  t.equal(copy.get("b"), undefined)
+
+  t.end()
+})
+
+
+test("load to other age cache", function(t) {
+  var cache = new LRU({maxAge: 50}),
+      aged = new LRU({maxAge: 100}),
+      simple = new LRU(),
+      arr,
+      expired
+
+  //created at 0
+  //a would be valid till 0 + 50
+  cache.set("a", "A")
+  setTimeout(function () {
+    //created at 20
+    //b would be valid till 20 + 50
+    cache.set("b", "B")
+    //b would be valid till 20 + 70
+    cache.set("c", "C", 70)
+    arr = cache.dump()
+    t.equal(arr.length, 3)
+  }, 20)
+
+  setTimeout(function () {
+    t.equal(cache.get("a"), undefined)
+    t.equal(cache.get("b"), "B")
+    t.equal(cache.get("c"), "C")
+
+    aged.load(arr)
+    t.equal(aged.get("a"), undefined)
+    t.equal(aged.get("b"), "B")
+    t.equal(aged.get("c"), "C")
+
+    simple.load(arr)
+    t.equal(simple.get("a"), undefined)
+    t.equal(simple.get("b"), "B")
+    t.equal(simple.get("c"), "C")
+  }, 60)
+
+  setTimeout(function () {
+    t.equal(cache.get("a"), undefined)
+    t.equal(cache.get("b"), undefined)
+    t.equal(cache.get("c"), "C")
+
+    aged.load(arr)
+    t.equal(aged.get("a"), undefined)
+    t.equal(aged.get("b"), undefined)
+    t.equal(aged.get("c"), "C")
+
+    simple.load(arr)
+    t.equal(simple.get("a"), undefined)
+    t.equal(simple.get("b"), undefined)
+    t.equal(simple.get("c"), "C")
+  }, 80)
+
+  setTimeout(function () {
+    t.equal(cache.get("a"), undefined)
+    t.equal(cache.get("b"), undefined)
+    t.equal(cache.get("c"), undefined)
+
+    aged.load(arr)
+    t.equal(aged.get("a"), undefined)
+    t.equal(aged.get("b"), undefined)
+    t.equal(aged.get("c"), undefined)
+
+    simple.load(arr)
+    t.equal(simple.get("a"), undefined)
+    t.equal(simple.get("b"), undefined)
+    t.equal(simple.get("c"), undefined)
+    t.end()
+  }, 100)
+
+})
diff --git a/deps/npm/node_modules/request/node_modules/aws4/package.json b/deps/npm/node_modules/request/node_modules/aws4/package.json
new file mode 100644 (file)
index 0000000..38f9c00
--- /dev/null
@@ -0,0 +1,104 @@
+{
+  "name": "aws4",
+  "version": "1.2.1",
+  "description": "Signs and prepares requests using AWS Signature Version 4",
+  "author": {
+    "name": "Michael Hart",
+    "email": "michael.hart.au@gmail.com",
+    "url": "http://github.com/mhart"
+  },
+  "main": "aws4.js",
+  "keywords": [
+    "amazon",
+    "aws",
+    "signature",
+    "s3",
+    "ec2",
+    "autoscaling",
+    "cloudformation",
+    "elasticloadbalancing",
+    "elb",
+    "elasticbeanstalk",
+    "cloudsearch",
+    "dynamodb",
+    "kinesis",
+    "lambda",
+    "glacier",
+    "sqs",
+    "sns",
+    "iam",
+    "sts",
+    "ses",
+    "swf",
+    "storagegateway",
+    "datapipeline",
+    "directconnect",
+    "redshift",
+    "opsworks",
+    "rds",
+    "monitoring",
+    "cloudtrail",
+    "cloudfront",
+    "codedeploy",
+    "elasticache",
+    "elasticmapreduce",
+    "elastictranscoder",
+    "emr",
+    "cloudwatch",
+    "mobileanalytics",
+    "cognitoidentity",
+    "cognitosync",
+    "cognito",
+    "containerservice",
+    "ecs",
+    "appstream",
+    "keymanagementservice",
+    "kms",
+    "config",
+    "cloudhsm",
+    "route53",
+    "route53domains",
+    "logs"
+  ],
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/mhart/aws4.git"
+  },
+  "license": "MIT",
+  "dependencies": {
+    "lru-cache": "^2.6.5"
+  },
+  "devDependencies": {
+    "mocha": "^2.2.5",
+    "should": "^7.0.1"
+  },
+  "scripts": {
+    "test": "mocha ./test/fast.js ./test/slow.js -b -t 100s -R list"
+  },
+  "gitHead": "3d8a3a06a8415bd5255b4f60eb91576952e97f5c",
+  "bugs": {
+    "url": "https://github.com/mhart/aws4/issues"
+  },
+  "homepage": "https://github.com/mhart/aws4#readme",
+  "_id": "aws4@1.2.1",
+  "_shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac",
+  "_from": "aws4@>=1.2.1 <2.0.0",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "4.2.4",
+  "_npmUser": {
+    "name": "hichaelmart",
+    "email": "michael.hart.au@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "hichaelmart",
+      "email": "michael.hart.au@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "52b5659a4d32583d405f65e1124ac436d07fe5ac",
+    "tarball": "http://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/aws4/-/aws4-1.2.1.tgz"
+}
diff --git a/deps/npm/node_modules/request/node_modules/bl/.jshintrc b/deps/npm/node_modules/request/node_modules/bl/.jshintrc
deleted file mode 100644 (file)
index c8ef3ca..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-{
-    "predef": [ ]
-  , "bitwise": false
-  , "camelcase": false
-  , "curly": false
-  , "eqeqeq": false
-  , "forin": false
-  , "immed": false
-  , "latedef": false
-  , "noarg": true
-  , "noempty": true
-  , "nonew": true
-  , "plusplus": false
-  , "quotmark": true
-  , "regexp": false
-  , "undef": true
-  , "unused": true
-  , "strict": false
-  , "trailing": true
-  , "maxlen": 120
-  , "asi": true
-  , "boss": true
-  , "debug": true
-  , "eqnull": true
-  , "esnext": true
-  , "evil": true
-  , "expr": true
-  , "funcscope": false
-  , "globalstrict": false
-  , "iterator": false
-  , "lastsemic": true
-  , "laxbreak": true
-  , "laxcomma": true
-  , "loopfunc": true
-  , "multistr": false
-  , "onecase": false
-  , "proto": false
-  , "regexdash": false
-  , "scripturl": true
-  , "smarttabs": false
-  , "shadow": false
-  , "sub": true
-  , "supernew": false
-  , "validthis": true
-  , "browser": true
-  , "couch": false
-  , "devel": false
-  , "dojo": false
-  , "mootools": false
-  , "node": true
-  , "nonstandard": true
-  , "prototypejs": false
-  , "rhino": false
-  , "worker": true
-  , "wsh": false
-  , "nomen": false
-  , "onevar": false
-  , "passfail": false
-}
\ No newline at end of file
index 81c0814..5cb0480 100644 (file)
@@ -1,14 +1,13 @@
+sudo: false
 language: node_js
-before_install:
-  - curl --location http://git.io/1OcIZA | bash -s
 node_js:
-  - 0.8
-  - 0.10
-  - 0.11
+  - '0.10'
+  - '0.12'
+  - '4'
+  - '5'
 branches:
   only:
     - master
 notifications:
   email:
     - rod@vagg.org
-script: npm test
index 7a2f997..b979ba8 100644 (file)
@@ -52,6 +52,11 @@ BufferList.prototype.append = function (buf) {
   var isBuffer = Buffer.isBuffer(buf) ||
                  buf instanceof BufferList
 
+  // coerce number arguments to strings, since Buffer(number) does
+  // uninitialized memory allocation
+  if (typeof buf == 'number')
+    buf = buf.toString()
+
   this._bufs.push(isBuffer ? buf : new Buffer(buf))
   this.length += buf.length
   return this
index bf544f9..3988c0c 100644 (file)
@@ -3,8 +3,7 @@
     Stability: 2 - Stable
 
 A stream is an abstract interface implemented by various objects in
-Node.js.  For example a [request to an HTTP
-server](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_http_incomingmessage) is a stream, as is
+Node.js.  For example a [request to an HTTP server][] is a stream, as is
 [stdout][]. Streams are readable, writable, or both. All streams are
 instances of [EventEmitter][]
 
@@ -93,6 +92,17 @@ server.listen(1337);
 // error: Unexpected token o
 ```
 
+### Class: stream.Duplex
+
+Duplex streams are streams that implement both the [Readable][] and
+[Writable][] interfaces.  See above for usage.
+
+Examples of Duplex streams include:
+
+* [tcp sockets][]
+* [zlib streams][]
+* [crypto streams][]
+
 ### Class: stream.Readable
 
 <!--type=class-->
@@ -136,61 +146,22 @@ destinations drain and ask for more data.
 
 Examples of readable streams include:
 
-* [http responses, on the client](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_http_incomingmessage)
-* [http requests, on the server](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_http_incomingmessage)
-* [fs read streams](https://iojs.org/dist/v5.0.0/doc/api/fs.html#fs_class_fs_readstream)
+* [http responses, on the client][]
+* [http requests, on the server][]
+* [fs read streams][]
 * [zlib streams][]
 * [crypto streams][]
 * [tcp sockets][]
 * [child process stdout and stderr][]
 * [process.stdin][]
 
-#### Event: 'readable'
-
-When a chunk of data can be read from the stream, it will emit a
-`'readable'` event.
-
-In some cases, listening for a `'readable'` event will cause some data
-to be read into the internal buffer from the underlying system, if it
-hadn't already.
-
-```javascript
-var readable = getReadableStreamSomehow();
-readable.on('readable', function() {
-  // there is some data to read now
-});
-```
-
-Once the internal buffer is drained, a `readable` event will fire
-again when more data is available.
-
-The `readable` event is not emitted in the "flowing" mode with the
-sole exception of the last one, on end-of-stream.
-
-The 'readable' event indicates that the stream has new information:
-either new data is available or the end of the stream has been reached.
-In the former case, `.read()` will return that data. In the latter case,
-`.read()` will return null. For instance, in the following example, `foo.txt`
-is an empty file:
-
-```javascript
-var fs = require('fs');
-var rr = fs.createReadStream('foo.txt');
-rr.on('readable', function() {
-  console.log('readable:', rr.read());
-});
-rr.on('end', function() {
-  console.log('end');
-});
-```
+#### Event: 'close'
 
-The output of running this script is:
+Emitted when the stream and any of its underlying resources (a file
+descriptor, for example) have been closed. The event indicates that
+no more events will be emitted, and no further computation will occur.
 
-```
-bash-3.2$ node test.js
-readable: null
-end
-```
+Not all streams will emit the 'close' event.
 
 #### Event: 'data'
 
@@ -228,101 +199,75 @@ readable.on('end', function() {
 });
 ```
 
-#### Event: 'close'
-
-Emitted when the stream and any of its underlying resources (a file
-descriptor, for example) have been closed. The event indicates that
-no more events will be emitted, and no further computation will occur.
-
-Not all streams will emit the 'close' event.
-
 #### Event: 'error'
 
 * {Error Object}
 
 Emitted if there was an error receiving data.
 
-#### readable.read([size])
-
-* `size` {Number} Optional argument to specify how much data to read.
-* Return {String | Buffer | null}
-
-The `read()` method pulls some data out of the internal buffer and
-returns it.  If there is no data available, then it will return
-`null`.
-
-If you pass in a `size` argument, then it will return that many
-bytes.  If `size` bytes are not available, then it will return `null`,
-unless we've ended, in which case it will return the data remaining
-in the buffer.
+#### Event: 'readable'
 
-If you do not specify a `size` argument, then it will return all the
-data in the internal buffer.
+When a chunk of data can be read from the stream, it will emit a
+`'readable'` event.
 
-This method should only be called in paused mode.  In flowing mode,
-this method is called automatically until the internal buffer is
-drained.
+In some cases, listening for a `'readable'` event will cause some data
+to be read into the internal buffer from the underlying system, if it
+hadn't already.
 
 ```javascript
 var readable = getReadableStreamSomehow();
 readable.on('readable', function() {
-  var chunk;
-  while (null !== (chunk = readable.read())) {
-    console.log('got %d bytes of data', chunk.length);
-  }
+  // there is some data to read now
 });
 ```
 
-If this method returns a data chunk, then it will also trigger the
-emission of a [`'data'` event][].
-
-Note that calling `readable.read([size])` after the `end` event has been
-triggered will return `null`. No runtime error will be raised.
-
-#### readable.setEncoding(encoding)
-
-* `encoding` {String} The encoding to use.
-* Return: `this`
+Once the internal buffer is drained, a `readable` event will fire
+again when more data is available.
 
-Call this function to cause the stream to return strings of the
-specified encoding instead of Buffer objects.  For example, if you do
-`readable.setEncoding('utf8')`, then the output data will be
-interpreted as UTF-8 data, and returned as strings.  If you do
-`readable.setEncoding('hex')`, then the data will be encoded in
-hexadecimal string format.
+The `readable` event is not emitted in the "flowing" mode with the
+sole exception of the last one, on end-of-stream.
 
-This properly handles multi-byte characters that would otherwise be
-potentially mangled if you simply pulled the Buffers directly and
-called `buf.toString(encoding)` on them.  If you want to read the data
-as strings, always use this method.
+The 'readable' event indicates that the stream has new information:
+either new data is available or the end of the stream has been reached.
+In the former case, `.read()` will return that data. In the latter case,
+`.read()` will return null. For instance, in the following example, `foo.txt`
+is an empty file:
 
 ```javascript
-var readable = getReadableStreamSomehow();
-readable.setEncoding('utf8');
-readable.on('data', function(chunk) {
-  assert.equal(typeof chunk, 'string');
-  console.log('got %d characters of string data', chunk.length);
+var fs = require('fs');
+var rr = fs.createReadStream('foo.txt');
+rr.on('readable', function() {
+  console.log('readable:', rr.read());
+});
+rr.on('end', function() {
+  console.log('end');
 });
 ```
 
-#### readable.resume()
+The output of running this script is:
 
-* Return: `this`
+```
+bash-3.2$ node test.js
+readable: null
+end
+```
 
-This method will cause the readable stream to resume emitting `data`
-events.
+#### readable.isPaused()
 
-This method will switch the stream into flowing mode.  If you do *not*
-want to consume the data from a stream, but you *do* want to get to
-its `end` event, you can call [`readable.resume()`][] to open the flow of
-data.
+* Return: `Boolean`
+
+This method returns whether or not the `readable` has been **explicitly**
+paused by client code (using `readable.pause()` without a corresponding
+`readable.resume()`).
 
 ```javascript
-var readable = getReadableStreamSomehow();
-readable.resume();
-readable.on('end', function() {
-  console.log('got to the end, but did not read anything');
-});
+var readable = new stream.Readable
+
+readable.isPaused() // === false
+readable.pause()
+readable.isPaused() // === true
+readable.resume()
+readable.isPaused() // === false
 ```
 
 #### readable.pause()
@@ -346,24 +291,6 @@ readable.on('data', function(chunk) {
 });
 ```
 
-#### readable.isPaused()
-
-* Return: `Boolean`
-
-This method returns whether or not the `readable` has been **explicitly**
-paused by client code (using `readable.pause()` without a corresponding
-`readable.resume()`).
-
-```javascript
-var readable = new stream.Readable
-
-readable.isPaused() // === false
-readable.pause()
-readable.isPaused() // === true
-readable.resume()
-readable.isPaused() // === false
-```
-
 #### readable.pipe(destination[, options])
 
 * `destination` {[Writable][] Stream} The destination for writing data
@@ -416,54 +343,137 @@ reader.on('end', function() {
 Note that `process.stderr` and `process.stdout` are never closed until
 the process exits, regardless of the specified options.
 
-#### readable.unpipe([destination])
+#### readable.read([size])
 
-* `destination` {[Writable][] Stream} Optional specific stream to unpipe
+* `size` {Number} Optional argument to specify how much data to read.
+* Return {String | Buffer | null}
 
-This method will remove the hooks set up for a previous `pipe()` call.
+The `read()` method pulls some data out of the internal buffer and
+returns it.  If there is no data available, then it will return
+`null`.
 
-If the destination is not specified, then all pipes are removed.
+If you pass in a `size` argument, then it will return that many
+bytes.  If `size` bytes are not available, then it will return `null`,
+unless we've ended, in which case it will return the data remaining
+in the buffer.
 
-If the destination is specified, but no pipe is set up for it, then
-this is a no-op.
+If you do not specify a `size` argument, then it will return all the
+data in the internal buffer.
+
+This method should only be called in paused mode.  In flowing mode,
+this method is called automatically until the internal buffer is
+drained.
 
 ```javascript
 var readable = getReadableStreamSomehow();
-var writable = fs.createWriteStream('file.txt');
-// All the data from readable goes into 'file.txt',
-// but only for the first second
-readable.pipe(writable);
-setTimeout(function() {
-  console.log('stop writing to file.txt');
-  readable.unpipe(writable);
-  console.log('manually close the file stream');
-  writable.end();
-}, 1000);
+readable.on('readable', function() {
+  var chunk;
+  while (null !== (chunk = readable.read())) {
+    console.log('got %d bytes of data', chunk.length);
+  }
+});
 ```
 
-#### readable.unshift(chunk)
+If this method returns a data chunk, then it will also trigger the
+emission of a [`'data'` event][].
 
-* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue
+Note that calling `readable.read([size])` after the `end` event has been
+triggered will return `null`. No runtime error will be raised.
 
-This is useful in certain cases where a stream is being consumed by a
-parser, which needs to "un-consume" some data that it has
-optimistically pulled out of the source, so that the stream can be
-passed on to some other party.
+#### readable.resume()
 
-Note that `stream.unshift(chunk)` cannot be called after the `end` event
-has been triggered; a runtime error will be raised.
+* Return: `this`
 
-If you find that you must often call `stream.unshift(chunk)` in your
-programs, consider implementing a [Transform][] stream instead.  (See API
-for Stream Implementors, below.)
+This method will cause the readable stream to resume emitting `data`
+events.
+
+This method will switch the stream into flowing mode.  If you do *not*
+want to consume the data from a stream, but you *do* want to get to
+its `end` event, you can call [`readable.resume()`][] to open the flow of
+data.
 
 ```javascript
-// Pull off a header delimited by \n\n
-// use unshift() if we get too much
-// Call the callback with (error, header, stream)
-var StringDecoder = require('string_decoder').StringDecoder;
-function parseHeader(stream, callback) {
-  stream.on('error', callback);
+var readable = getReadableStreamSomehow();
+readable.resume();
+readable.on('end', function() {
+  console.log('got to the end, but did not read anything');
+});
+```
+
+#### readable.setEncoding(encoding)
+
+* `encoding` {String} The encoding to use.
+* Return: `this`
+
+Call this function to cause the stream to return strings of the
+specified encoding instead of Buffer objects.  For example, if you do
+`readable.setEncoding('utf8')`, then the output data will be
+interpreted as UTF-8 data, and returned as strings.  If you do
+`readable.setEncoding('hex')`, then the data will be encoded in
+hexadecimal string format.
+
+This properly handles multi-byte characters that would otherwise be
+potentially mangled if you simply pulled the Buffers directly and
+called `buf.toString(encoding)` on them.  If you want to read the data
+as strings, always use this method.
+
+```javascript
+var readable = getReadableStreamSomehow();
+readable.setEncoding('utf8');
+readable.on('data', function(chunk) {
+  assert.equal(typeof chunk, 'string');
+  console.log('got %d characters of string data', chunk.length);
+});
+```
+
+#### readable.unpipe([destination])
+
+* `destination` {[Writable][] Stream} Optional specific stream to unpipe
+
+This method will remove the hooks set up for a previous `pipe()` call.
+
+If the destination is not specified, then all pipes are removed.
+
+If the destination is specified, but no pipe is set up for it, then
+this is a no-op.
+
+```javascript
+var readable = getReadableStreamSomehow();
+var writable = fs.createWriteStream('file.txt');
+// All the data from readable goes into 'file.txt',
+// but only for the first second
+readable.pipe(writable);
+setTimeout(function() {
+  console.log('stop writing to file.txt');
+  readable.unpipe(writable);
+  console.log('manually close the file stream');
+  writable.end();
+}, 1000);
+```
+
+#### readable.unshift(chunk)
+
+* `chunk` {Buffer | String} Chunk of data to unshift onto the read queue
+
+This is useful in certain cases where a stream is being consumed by a
+parser, which needs to "un-consume" some data that it has
+optimistically pulled out of the source, so that the stream can be
+passed on to some other party.
+
+Note that `stream.unshift(chunk)` cannot be called after the `end` event
+has been triggered; a runtime error will be raised.
+
+If you find that you must often call `stream.unshift(chunk)` in your
+programs, consider implementing a [Transform][] stream instead.  (See API
+for Stream Implementors, below.)
+
+```javascript
+// Pull off a header delimited by \n\n
+// use unshift() if we get too much
+// Call the callback with (error, header, stream)
+var StringDecoder = require('string_decoder').StringDecoder;
+function parseHeader(stream, callback) {
+  stream.on('error', callback);
   stream.on('readable', onReadable);
   var decoder = new StringDecoder('utf8');
   var header = '';
@@ -528,6 +538,16 @@ myReader.on('readable', function() {
 });
 ```
 
+### Class: stream.Transform
+
+Transform streams are [Duplex][] streams where the output is in some way
+computed from the input.  They implement both the [Readable][] and
+[Writable][] interfaces.  See above for usage.
+
+Examples of Transform streams include:
+
+* [zlib streams][]
+* [crypto streams][]
 
 ### Class: stream.Writable
 
@@ -538,34 +558,15 @@ that you are writing data *to*.
 
 Examples of writable streams include:
 
-* [http requests, on the client](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_class_http_clientrequest)
-* [http responses, on the server](https://iojs.org/dist/v5.0.0/doc/api/http.html#http_class_http_serverresponse)
-* [fs write streams](https://iojs.org/dist/v5.0.0/doc/api/fs.html#fs_class_fs_writestream)
+* [http requests, on the client][]
+* [http responses, on the server][]
+* [fs write streams][]
 * [zlib streams][]
 * [crypto streams][]
 * [tcp sockets][]
-* [child process stdin](https://iojs.org/dist/v5.0.0/doc/api/child_process.html#child_process_child_stdin)
+* [child process stdin][]
 * [process.stdout][], [process.stderr][]
 
-#### writable.write(chunk[, encoding][, callback])
-
-* `chunk` {String | Buffer} The data to write
-* `encoding` {String} The encoding, if `chunk` is a String
-* `callback` {Function} Callback for when this chunk of data is flushed
-* Returns: {Boolean} True if the data was handled completely.
-
-This method writes some data to the underlying system, and calls the
-supplied callback once the data has been fully handled.
-
-The return value indicates if you should continue writing right now.
-If the data had to be buffered internally, then it will return
-`false`.  Otherwise, it will return `true`.
-
-This return value is strictly advisory.  You MAY continue to write,
-even if it returns `false`.  However, writes will be buffered in
-memory, so it is best not to do this excessively.  Instead, wait for
-the `drain` event before writing more data.
-
 #### Event: 'drain'
 
 If a [`writable.write(chunk)`][] call returns false, then the `drain`
@@ -600,40 +601,11 @@ function writeOneMillionTimes(writer, data, encoding, callback) {
 }
 ```
 
-#### writable.cork()
-
-Forces buffering of all writes.
-
-Buffered data will be flushed either at `.uncork()` or at `.end()` call.
-
-#### writable.uncork()
-
-Flush all data, buffered since `.cork()` call.
-
-#### writable.setDefaultEncoding(encoding)
-
-* `encoding` {String} The new default encoding
-
-Sets the default encoding for a writable stream.
-
-#### writable.end([chunk][, encoding][, callback])
-
-* `chunk` {String | Buffer} Optional data to write
-* `encoding` {String} The encoding, if `chunk` is a String
-* `callback` {Function} Optional callback for when the stream is finished
-
-Call this method when no more data will be written to the stream.  If
-supplied, the callback is attached as a listener on the `finish` event.
+#### Event: 'error'
 
-Calling [`write()`][] after calling [`end()`][] will raise an error.
+* {Error object}
 
-```javascript
-// write 'hello, ' and then end with 'world!'
-var file = fs.createWriteStream('example.txt');
-file.write('hello, ');
-file.end('world!');
-// writing more now is not allowed!
-```
+Emitted if there was an error when writing or piping data.
 
 #### Event: 'finish'
 
@@ -686,34 +658,59 @@ reader.pipe(writer);
 reader.unpipe(writer);
 ```
 
-#### Event: 'error'
+#### writable.cork()
 
-* {Error object}
+Forces buffering of all writes.
 
-Emitted if there was an error when writing or piping data.
+Buffered data will be flushed either at `.uncork()` or at `.end()` call.
 
-### Class: stream.Duplex
+#### writable.end([chunk][, encoding][, callback])
 
-Duplex streams are streams that implement both the [Readable][] and
-[Writable][] interfaces.  See above for usage.
+* `chunk` {String | Buffer} Optional data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Optional callback for when the stream is finished
 
-Examples of Duplex streams include:
+Call this method when no more data will be written to the stream.  If
+supplied, the callback is attached as a listener on the `finish` event.
 
-* [tcp sockets][]
-* [zlib streams][]
-* [crypto streams][]
+Calling [`write()`][] after calling [`end()`][] will raise an error.
 
+```javascript
+// write 'hello, ' and then end with 'world!'
+var file = fs.createWriteStream('example.txt');
+file.write('hello, ');
+file.end('world!');
+// writing more now is not allowed!
+```
 
-### Class: stream.Transform
+#### writable.setDefaultEncoding(encoding)
 
-Transform streams are [Duplex][] streams where the output is in some way
-computed from the input.  They implement both the [Readable][] and
-[Writable][] interfaces.  See above for usage.
+* `encoding` {String} The new default encoding
 
-Examples of Transform streams include:
+Sets the default encoding for a writable stream.
 
-* [zlib streams][]
-* [crypto streams][]
+#### writable.uncork()
+
+Flush all data, buffered since `.cork()` call.
+
+#### writable.write(chunk[, encoding][, callback])
+
+* `chunk` {String | Buffer} The data to write
+* `encoding` {String} The encoding, if `chunk` is a String
+* `callback` {Function} Callback for when this chunk of data is flushed
+* Returns: {Boolean} True if the data was handled completely.
+
+This method writes some data to the underlying system, and calls the
+supplied callback once the data has been fully handled.
+
+The return value indicates if you should continue writing right now.
+If the data had to be buffered internally, then it will return
+`false`.  Otherwise, it will return `true`.
+
+This return value is strictly advisory.  You MAY continue to write,
+even if it returns `false`.  However, writes will be buffered in
+memory, so it is best not to do this excessively.  Instead, wait for
+the `drain` event before writing more data.
 
 
 ## API for Stream Implementors
@@ -796,6 +793,49 @@ methods described in [API for Stream Consumers][] above.  Otherwise, you
 can potentially cause adverse side effects in programs that consume
 your streaming interfaces.
 
+### Class: stream.Duplex
+
+<!--type=class-->
+
+A "duplex" stream is one that is both Readable and Writable, such as a
+TCP socket connection.
+
+Note that `stream.Duplex` is an abstract class designed to be extended
+with an underlying implementation of the `_read(size)` and
+[`_write(chunk, encoding, callback)`][] methods as you would with a
+Readable or Writable stream class.
+
+Since JavaScript doesn't have multiple prototypal inheritance, this
+class prototypally inherits from Readable, and then parasitically from
+Writable.  It is thus up to the user to implement both the lowlevel
+`_read(n)` method as well as the lowlevel
+[`_write(chunk, encoding, callback)`][] method on extension duplex classes.
+
+#### new stream.Duplex(options)
+
+* `options` {Object} Passed to both Writable and Readable
+  constructors. Also has the following fields:
+  * `allowHalfOpen` {Boolean} Default=true.  If set to `false`, then
+    the stream will automatically end the readable side when the
+    writable side ends and vice versa.
+  * `readableObjectMode` {Boolean} Default=false. Sets `objectMode`
+    for readable side of the stream. Has no effect if `objectMode`
+    is `true`.
+  * `writableObjectMode` {Boolean} Default=false. Sets `objectMode`
+    for writable side of the stream. Has no effect if `objectMode`
+    is `true`.
+
+In classes that extend the Duplex class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+### Class: stream.PassThrough
+
+This is a trivial implementation of a [Transform][] stream that simply
+passes the input bytes across to the output.  Its purpose is mainly
+for examples and testing, but there are occasionally use cases where
+it can come in handy as a building block for novel sorts of streams.
+
 ### Class: stream.Readable
 
 <!--type=class-->
@@ -807,15 +847,115 @@ Please see above under [API for Stream Consumers][] for how to consume
 streams in your programs.  What follows is an explanation of how to
 implement Readable streams in your programs.
 
-#### Example: A Counting Stream
-
-<!--type=example-->
-
-This is a basic example of a Readable stream.  It emits the numerals
-from 1 to 1,000,000 in ascending order, and then ends.
+#### new stream.Readable([options])
 
-```javascript
-var Readable = require('stream').Readable;
+* `options` {Object}
+  * `highWaterMark` {Number} The maximum number of bytes to store in
+    the internal buffer before ceasing to read from the underlying
+    resource.  Default=16kb, or 16 for `objectMode` streams
+  * `encoding` {String} If specified, then buffers will be decoded to
+    strings using the specified encoding.  Default=null
+  * `objectMode` {Boolean} Whether this stream should behave
+    as a stream of objects. Meaning that stream.read(n) returns
+    a single value instead of a Buffer of size n.  Default=false
+
+In classes that extend the Readable class, make sure to call the
+Readable constructor so that the buffering settings can be properly
+initialized.
+
+#### readable.\_read(size)
+
+* `size` {Number} Number of bytes to read asynchronously
+
+Note: **Implement this method, but do NOT call it directly.**
+
+This method is prefixed with an underscore because it is internal to the
+class that defines it and should only be called by the internal Readable
+class methods. All Readable stream implementations must provide a _read
+method to fetch data from the underlying resource.
+
+When _read is called, if data is available from the resource, `_read` should
+start pushing that data into the read queue by calling `this.push(dataChunk)`.
+`_read` should continue reading from the resource and pushing data until push
+returns false, at which point it should stop reading from the resource. Only
+when _read is called again after it has stopped should it start reading
+more data from the resource and pushing that data onto the queue.
+
+Note: once the `_read()` method is called, it will not be called again until
+the `push` method is called.
+
+The `size` argument is advisory.  Implementations where a "read" is a
+single call that returns data can use this to know how much data to
+fetch.  Implementations where that is not relevant, such as TCP or
+TLS, may ignore this argument, and simply provide data whenever it
+becomes available.  There is no need, for example to "wait" until
+`size` bytes are available before calling [`stream.push(chunk)`][].
+
+#### readable.push(chunk[, encoding])
+
+* `chunk` {Buffer | null | String} Chunk of data to push into the read queue
+* `encoding` {String} Encoding of String chunks.  Must be a valid
+  Buffer encoding, such as `'utf8'` or `'ascii'`
+* return {Boolean} Whether or not more pushes should be performed
+
+Note: **This method should be called by Readable implementors, NOT
+by consumers of Readable streams.**
+
+If a value other than null is passed, The `push()` method adds a chunk of data
+into the queue for subsequent stream processors to consume. If `null` is
+passed, it signals the end of the stream (EOF), after which no more data
+can be written.
+
+The data added with `push` can be pulled out by calling the `read()` method
+when the `'readable'`event fires.
+
+This API is designed to be as flexible as possible.  For example,
+you may be wrapping a lower-level source which has some sort of
+pause/resume mechanism, and a data callback.  In those cases, you
+could wrap the low-level source object by doing something like this:
+
+```javascript
+// source is an object with readStop() and readStart() methods,
+// and an `ondata` member that gets called when it has data, and
+// an `onend` member that gets called when the data is over.
+
+util.inherits(SourceWrapper, Readable);
+
+function SourceWrapper(options) {
+  Readable.call(this, options);
+
+  this._source = getLowlevelSourceObject();
+  var self = this;
+
+  // Every time there's data, we push it into the internal buffer.
+  this._source.ondata = function(chunk) {
+    // if push() returns false, then we need to stop reading from source
+    if (!self.push(chunk))
+      self._source.readStop();
+  };
+
+  // When the source ends, we push the EOF-signaling `null` chunk
+  this._source.onend = function() {
+    self.push(null);
+  };
+}
+
+// _read will be called when the stream wants to pull more data in
+// the advisory size argument is ignored in this case.
+SourceWrapper.prototype._read = function(size) {
+  this._source.readStart();
+};
+```
+
+#### Example: A Counting Stream
+
+<!--type=example-->
+
+This is a basic example of a Readable stream.  It emits the numerals
+from 1 to 1,000,000 in ascending order, and then ends.
+
+```javascript
+var Readable = require('stream').Readable;
 var util = require('util');
 util.inherits(Counter, Readable);
 
@@ -951,220 +1091,6 @@ SimpleProtocol.prototype._read = function(n) {
 // with the parsed header data.
 ```
 
-
-#### new stream.Readable([options])
-
-* `options` {Object}
-  * `highWaterMark` {Number} The maximum number of bytes to store in
-    the internal buffer before ceasing to read from the underlying
-    resource.  Default=16kb, or 16 for `objectMode` streams
-  * `encoding` {String} If specified, then buffers will be decoded to
-    strings using the specified encoding.  Default=null
-  * `objectMode` {Boolean} Whether this stream should behave
-    as a stream of objects. Meaning that stream.read(n) returns
-    a single value instead of a Buffer of size n.  Default=false
-
-In classes that extend the Readable class, make sure to call the
-Readable constructor so that the buffering settings can be properly
-initialized.
-
-#### readable.\_read(size)
-
-* `size` {Number} Number of bytes to read asynchronously
-
-Note: **Implement this method, but do NOT call it directly.**
-
-This method is prefixed with an underscore because it is internal to the
-class that defines it and should only be called by the internal Readable
-class methods. All Readable stream implementations must provide a _read
-method to fetch data from the underlying resource.
-
-When _read is called, if data is available from the resource, `_read` should
-start pushing that data into the read queue by calling `this.push(dataChunk)`.
-`_read` should continue reading from the resource and pushing data until push
-returns false, at which point it should stop reading from the resource. Only
-when _read is called again after it has stopped should it start reading
-more data from the resource and pushing that data onto the queue.
-
-Note: once the `_read()` method is called, it will not be called again until
-the `push` method is called.
-
-The `size` argument is advisory.  Implementations where a "read" is a
-single call that returns data can use this to know how much data to
-fetch.  Implementations where that is not relevant, such as TCP or
-TLS, may ignore this argument, and simply provide data whenever it
-becomes available.  There is no need, for example to "wait" until
-`size` bytes are available before calling [`stream.push(chunk)`][].
-
-#### readable.push(chunk[, encoding])
-
-* `chunk` {Buffer | null | String} Chunk of data to push into the read queue
-* `encoding` {String} Encoding of String chunks.  Must be a valid
-  Buffer encoding, such as `'utf8'` or `'ascii'`
-* return {Boolean} Whether or not more pushes should be performed
-
-Note: **This method should be called by Readable implementors, NOT
-by consumers of Readable streams.**
-
-If a value other than null is passed, The `push()` method adds a chunk of data
-into the queue for subsequent stream processors to consume. If `null` is
-passed, it signals the end of the stream (EOF), after which no more data
-can be written.
-
-The data added with `push` can be pulled out by calling the `read()` method
-when the `'readable'`event fires.
-
-This API is designed to be as flexible as possible.  For example,
-you may be wrapping a lower-level source which has some sort of
-pause/resume mechanism, and a data callback.  In those cases, you
-could wrap the low-level source object by doing something like this:
-
-```javascript
-// source is an object with readStop() and readStart() methods,
-// and an `ondata` member that gets called when it has data, and
-// an `onend` member that gets called when the data is over.
-
-util.inherits(SourceWrapper, Readable);
-
-function SourceWrapper(options) {
-  Readable.call(this, options);
-
-  this._source = getLowlevelSourceObject();
-  var self = this;
-
-  // Every time there's data, we push it into the internal buffer.
-  this._source.ondata = function(chunk) {
-    // if push() returns false, then we need to stop reading from source
-    if (!self.push(chunk))
-      self._source.readStop();
-  };
-
-  // When the source ends, we push the EOF-signaling `null` chunk
-  this._source.onend = function() {
-    self.push(null);
-  };
-}
-
-// _read will be called when the stream wants to pull more data in
-// the advisory size argument is ignored in this case.
-SourceWrapper.prototype._read = function(size) {
-  this._source.readStart();
-};
-```
-
-
-### Class: stream.Writable
-
-<!--type=class-->
-
-`stream.Writable` is an abstract class designed to be extended with an
-underlying implementation of the [`_write(chunk, encoding, callback)`][] method.
-
-Please see above under [API for Stream Consumers][] for how to consume
-writable streams in your programs.  What follows is an explanation of
-how to implement Writable streams in your programs.
-
-#### new stream.Writable([options])
-
-* `options` {Object}
-  * `highWaterMark` {Number} Buffer level when [`write()`][] starts
-    returning false. Default=16kb, or 16 for `objectMode` streams
-  * `decodeStrings` {Boolean} Whether or not to decode strings into
-    Buffers before passing them to [`_write()`][].  Default=true
-  * `objectMode` {Boolean} Whether or not the `write(anyObj)` is
-    a valid operation. If set you can write arbitrary data instead
-    of only `Buffer` / `String` data.  Default=false
-
-In classes that extend the Writable class, make sure to call the
-constructor so that the buffering settings can be properly
-initialized.
-
-#### writable.\_write(chunk, encoding, callback)
-
-* `chunk` {Buffer | String} The chunk to be written. Will **always**
-  be a buffer unless the `decodeStrings` option was set to `false`.
-* `encoding` {String} If the chunk is a string, then this is the
-  encoding type. If chunk is a buffer, then this is the special
-  value - 'buffer', ignore it in this case.
-* `callback` {Function} Call this function (optionally with an error
-  argument) when you are done processing the supplied chunk.
-
-All Writable stream implementations must provide a [`_write()`][]
-method to send data to the underlying resource.
-
-Note: **This function MUST NOT be called directly.**  It should be
-implemented by child classes, and called by the internal Writable
-class methods only.
-
-Call the callback using the standard `callback(error)` pattern to
-signal that the write completed successfully or with an error.
-
-If the `decodeStrings` flag is set in the constructor options, then
-`chunk` may be a string rather than a Buffer, and `encoding` will
-indicate the sort of string that it is.  This is to support
-implementations that have an optimized handling for certain string
-data encodings.  If you do not explicitly set the `decodeStrings`
-option to `false`, then you can safely ignore the `encoding` argument,
-and assume that `chunk` will always be a Buffer.
-
-This method is prefixed with an underscore because it is internal to
-the class that defines it, and should not be called directly by user
-programs.  However, you **are** expected to override this method in
-your own extension classes.
-
-#### writable.\_writev(chunks, callback)
-
-* `chunks` {Array} The chunks to be written.  Each chunk has following
-  format: `{ chunk: ..., encoding: ... }`.
-* `callback` {Function} Call this function (optionally with an error
-  argument) when you are done processing the supplied chunks.
-
-Note: **This function MUST NOT be called directly.**  It may be
-implemented by child classes, and called by the internal Writable
-class methods only.
-
-This function is completely optional to implement. In most cases it is
-unnecessary.  If implemented, it will be called with all the chunks
-that are buffered in the write queue.
-
-
-### Class: stream.Duplex
-
-<!--type=class-->
-
-A "duplex" stream is one that is both Readable and Writable, such as a
-TCP socket connection.
-
-Note that `stream.Duplex` is an abstract class designed to be extended
-with an underlying implementation of the `_read(size)` and
-[`_write(chunk, encoding, callback)`][] methods as you would with a
-Readable or Writable stream class.
-
-Since JavaScript doesn't have multiple prototypal inheritance, this
-class prototypally inherits from Readable, and then parasitically from
-Writable.  It is thus up to the user to implement both the lowlevel
-`_read(n)` method as well as the lowlevel
-[`_write(chunk, encoding, callback)`][] method on extension duplex classes.
-
-#### new stream.Duplex(options)
-
-* `options` {Object} Passed to both Writable and Readable
-  constructors. Also has the following fields:
-  * `allowHalfOpen` {Boolean} Default=true.  If set to `false`, then
-    the stream will automatically end the readable side when the
-    writable side ends and vice versa.
-  * `readableObjectMode` {Boolean} Default=false. Sets `objectMode`
-    for readable side of the stream. Has no effect if `objectMode`
-    is `true`.
-  * `writableObjectMode` {Boolean} Default=false. Sets `objectMode`
-    for writable side of the stream. Has no effect if `objectMode`
-    is `true`.
-
-In classes that extend the Duplex class, make sure to call the
-constructor so that the buffering settings can be properly
-initialized.
-
-
 ### Class: stream.Transform
 
 A "transform" stream is a duplex stream where the output is causally
@@ -1183,12 +1109,47 @@ also implement the `_flush()` method.  (See below.)
 
 #### new stream.Transform([options])
 
-* `options` {Object} Passed to both Writable and Readable
-  constructors.
+* `options` {Object} Passed to both Writable and Readable
+  constructors.
+
+In classes that extend the Transform class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+#### Events: 'finish' and 'end'
+
+The [`finish`][] and [`end`][] events are from the parent Writable
+and Readable classes respectively. The `finish` event is fired after
+`.end()` is called and all chunks have been processed by `_transform`,
+`end` is fired after all data has been output which is after the callback
+in `_flush` has been called.
+
+#### transform.\_flush(callback)
+
+* `callback` {Function} Call this function (optionally with an error
+  argument) when you are done flushing any remaining data.
+
+Note: **This function MUST NOT be called directly.**  It MAY be implemented
+by child classes, and if so, will be called by the internal Transform
+class methods only.
+
+In some cases, your transform operation may need to emit a bit more
+data at the end of the stream.  For example, a `Zlib` compression
+stream will store up some internal state so that it can optimally
+compress the output.  At the end, however, it needs to do the best it
+can with what is left, so that the data will be complete.
+
+In those cases, you can implement a `_flush` method, which will be
+called at the very end, after all the written data is consumed, but
+before emitting `end` to signal the end of the readable side.  Just
+like with `_transform`, call `transform.push(chunk)` zero or more
+times, as appropriate, and call `callback` when the flush operation is
+complete.
 
-In classes that extend the Transform class, make sure to call the
-constructor so that the buffering settings can be properly
-initialized.
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs.  However, you **are** expected to override this method in
+your own extension classes.
 
 #### transform.\_transform(chunk, encoding, callback)
 
@@ -1238,41 +1199,6 @@ the class that defines it, and should not be called directly by user
 programs.  However, you **are** expected to override this method in
 your own extension classes.
 
-#### transform.\_flush(callback)
-
-* `callback` {Function} Call this function (optionally with an error
-  argument) when you are done flushing any remaining data.
-
-Note: **This function MUST NOT be called directly.**  It MAY be implemented
-by child classes, and if so, will be called by the internal Transform
-class methods only.
-
-In some cases, your transform operation may need to emit a bit more
-data at the end of the stream.  For example, a `Zlib` compression
-stream will store up some internal state so that it can optimally
-compress the output.  At the end, however, it needs to do the best it
-can with what is left, so that the data will be complete.
-
-In those cases, you can implement a `_flush` method, which will be
-called at the very end, after all the written data is consumed, but
-before emitting `end` to signal the end of the readable side.  Just
-like with `_transform`, call `transform.push(chunk)` zero or more
-times, as appropriate, and call `callback` when the flush operation is
-complete.
-
-This method is prefixed with an underscore because it is internal to
-the class that defines it, and should not be called directly by user
-programs.  However, you **are** expected to override this method in
-your own extension classes.
-
-#### Events: 'finish' and 'end'
-
-The [`finish`][] and [`end`][] events are from the parent Writable
-and Readable classes respectively. The `finish` event is fired after
-`.end()` is called and all chunks have been processed by `_transform`,
-`end` is fired after all data has been output which is after the callback
-in `_flush` has been called.
-
 #### Example: `SimpleProtocol` parser v2
 
 The example above of a simple protocol parser can be implemented
@@ -1351,13 +1277,79 @@ SimpleProtocol.prototype._transform = function(chunk, encoding, done) {
 // with the parsed header data.
 ```
 
+### Class: stream.Writable
 
-### Class: stream.PassThrough
+<!--type=class-->
 
-This is a trivial implementation of a [Transform][] stream that simply
-passes the input bytes across to the output.  Its purpose is mainly
-for examples and testing, but there are occasionally use cases where
-it can come in handy as a building block for novel sorts of streams.
+`stream.Writable` is an abstract class designed to be extended with an
+underlying implementation of the [`_write(chunk, encoding, callback)`][] method.
+
+Please see above under [API for Stream Consumers][] for how to consume
+writable streams in your programs.  What follows is an explanation of
+how to implement Writable streams in your programs.
+
+#### new stream.Writable([options])
+
+* `options` {Object}
+  * `highWaterMark` {Number} Buffer level when [`write()`][] starts
+    returning false. Default=16kb, or 16 for `objectMode` streams
+  * `decodeStrings` {Boolean} Whether or not to decode strings into
+    Buffers before passing them to [`_write()`][].  Default=true
+  * `objectMode` {Boolean} Whether or not the `write(anyObj)` is
+    a valid operation. If set you can write arbitrary data instead
+    of only `Buffer` / `String` data.  Default=false
+
+In classes that extend the Writable class, make sure to call the
+constructor so that the buffering settings can be properly
+initialized.
+
+#### writable.\_write(chunk, encoding, callback)
+
+* `chunk` {Buffer | String} The chunk to be written. Will **always**
+  be a buffer unless the `decodeStrings` option was set to `false`.
+* `encoding` {String} If the chunk is a string, then this is the
+  encoding type. If chunk is a buffer, then this is the special
+  value - 'buffer', ignore it in this case.
+* `callback` {Function} Call this function (optionally with an error
+  argument) when you are done processing the supplied chunk.
+
+All Writable stream implementations must provide a [`_write()`][]
+method to send data to the underlying resource.
+
+Note: **This function MUST NOT be called directly.**  It should be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+Call the callback using the standard `callback(error)` pattern to
+signal that the write completed successfully or with an error.
+
+If the `decodeStrings` flag is set in the constructor options, then
+`chunk` may be a string rather than a Buffer, and `encoding` will
+indicate the sort of string that it is.  This is to support
+implementations that have an optimized handling for certain string
+data encodings.  If you do not explicitly set the `decodeStrings`
+option to `false`, then you can safely ignore the `encoding` argument,
+and assume that `chunk` will always be a Buffer.
+
+This method is prefixed with an underscore because it is internal to
+the class that defines it, and should not be called directly by user
+programs.  However, you **are** expected to override this method in
+your own extension classes.
+
+#### writable.\_writev(chunks, callback)
+
+* `chunks` {Array} The chunks to be written.  Each chunk has following
+  format: `{ chunk: ..., encoding: ... }`.
+* `callback` {Function} Call this function (optionally with an error
+  argument) when you are done processing the supplied chunks.
+
+Note: **This function MUST NOT be called directly.**  It may be
+implemented by child classes, and called by the internal Writable
+class methods only.
+
+This function is completely optional to implement. In most cases it is
+unnecessary.  If implemented, it will be called with all the chunks
+that are buffered in the write queue.
 
 
 ## Simplified Constructor API
@@ -1370,51 +1362,52 @@ This can be done by passing the appropriate methods as constructor options:
 
 Examples:
 
-### Readable
+### Duplex
 ```javascript
-var readable = new stream.Readable({
+var duplex = new stream.Duplex({
   read: function(n) {
     // sets this._read under the hood
-  }
-});
-```
 
-### Writable
-```javascript
-var writable = new stream.Writable({
+    // push data onto the read queue, passing null
+    // will signal the end of the stream (EOF)
+    this.push(chunk);
+  },
   write: function(chunk, encoding, next) {
     // sets this._write under the hood
+
+    // An optional error can be passed as the first argument
+    next()
   }
 });
 
 // or
 
-var writable = new stream.Writable({
+var duplex = new stream.Duplex({
+  read: function(n) {
+    // sets this._read under the hood
+
+    // push data onto the read queue, passing null
+    // will signal the end of the stream (EOF)
+    this.push(chunk);
+  },
   writev: function(chunks, next) {
     // sets this._writev under the hood
+
+    // An optional error can be passed as the first argument
+    next()
   }
 });
 ```
 
-### Duplex
+### Readable
 ```javascript
-var duplex = new stream.Duplex({
+var readable = new stream.Readable({
   read: function(n) {
     // sets this._read under the hood
-  },
-  write: function(chunk, encoding, next) {
-    // sets this._write under the hood
-  }
-});
-
-// or
 
-var duplex = new stream.Duplex({
-  read: function(n) {
-    // sets this._read under the hood
-  },
-  writev: function(chunks, next) {
-    // sets this._writev under the hood
+    // push data onto the read queue, passing null
+    // will signal the end of the stream (EOF)
+    this.push(chunk);
   }
 });
 ```
@@ -1424,9 +1417,43 @@ var duplex = new stream.Duplex({
 var transform = new stream.Transform({
   transform: function(chunk, encoding, next) {
     // sets this._transform under the hood
+
+    // generate output as many times as needed
+    // this.push(chunk);
+
+    // call when the current chunk is consumed
+    next();
   },
   flush: function(done) {
     // sets this._flush under the hood
+
+    // generate output as many times as needed
+    // this.push(chunk);
+
+    done();
+  }
+});
+```
+
+### Writable
+```javascript
+var writable = new stream.Writable({
+  write: function(chunk, encoding, next) {
+    // sets this._write under the hood
+
+    // An optional error can be passed as the first argument
+    next()
+  }
+});
+
+// or
+
+var writable = new stream.Writable({
+  writev: function(chunks, next) {
+    // sets this._writev under the hood
+
+    // An optional error can be passed as the first argument
+    next()
   }
 });
 ```
@@ -1458,40 +1485,6 @@ The purpose of streams, especially with the `pipe()` method, is to
 limit the buffering of data to acceptable levels, so that sources and
 destinations of varying speed will not overwhelm the available memory.
 
-### `stream.read(0)`
-
-There are some cases where you want to trigger a refresh of the
-underlying readable stream mechanisms, without actually consuming any
-data.  In that case, you can call `stream.read(0)`, which will always
-return null.
-
-If the internal read buffer is below the `highWaterMark`, and the
-stream is not currently reading, then calling `read(0)` will trigger
-a low-level `_read` call.
-
-There is almost never a need to do this. However, you will see some
-cases in Node.js's internals where this is done, particularly in the
-Readable stream class internals.
-
-### `stream.push('')`
-
-Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an
-interesting side effect.  Because it *is* a call to
-[`stream.push()`][], it will end the `reading` process.  However, it
-does *not* add any data to the readable buffer, so there's nothing for
-a user to consume.
-
-Very rarely, there are cases where you have no data to provide now,
-but the consumer of your stream (or, perhaps, another bit of your own
-code) will know when to check again, by calling `stream.read(0)`.  In
-those cases, you *may* call `stream.push('')`.
-
-So far, the only use case for this functionality is in the
-[tls.CryptoStream][] class, which is deprecated in Node.js/io.js v1.0.  If you
-find that you have to use `stream.push('')`, please consider another
-approach, because it almost certainly indicates that something is
-horribly wrong.
-
 ### Compatibility with Older Node.js Versions
 
 <!--type=misc-->
@@ -1649,25 +1642,66 @@ JSONParseStream.prototype._flush = function(cb) {
 };
 ```
 
+### `stream.read(0)`
+
+There are some cases where you want to trigger a refresh of the
+underlying readable stream mechanisms, without actually consuming any
+data.  In that case, you can call `stream.read(0)`, which will always
+return null.
+
+If the internal read buffer is below the `highWaterMark`, and the
+stream is not currently reading, then calling `read(0)` will trigger
+a low-level `_read` call.
+
+There is almost never a need to do this. However, you will see some
+cases in Node.js's internals where this is done, particularly in the
+Readable stream class internals.
+
+### `stream.push('')`
+
+Pushing a zero-byte string or Buffer (when not in [Object mode][]) has an
+interesting side effect.  Because it *is* a call to
+[`stream.push()`][], it will end the `reading` process.  However, it
+does *not* add any data to the readable buffer, so there's nothing for
+a user to consume.
+
+Very rarely, there are cases where you have no data to provide now,
+but the consumer of your stream (or, perhaps, another bit of your own
+code) will know when to check again, by calling `stream.read(0)`.  In
+those cases, you *may* call `stream.push('')`.
+
+So far, the only use case for this functionality is in the
+[tls.CryptoStream][] class, which is deprecated in Node.js/io.js v1.0.  If you
+find that you have to use `stream.push('')`, please consider another
+approach, because it almost certainly indicates that something is
+horribly wrong.
 
-[EventEmitter]: https://iojs.org/dist/v5.0.0/doc/api/events.html#events_class_events_eventemitter
+[request to an HTTP server]: https://nodejs.org/docs/v5.1.0/api/http.html#http_http_incomingmessage
+[EventEmitter]: https://nodejs.org/docs/v5.1.0/api/events.html#events_class_events_eventemitter
 [Object mode]: #stream_object_mode
 [`stream.push(chunk)`]: #stream_readable_push_chunk_encoding
 [`stream.push(null)`]: #stream_readable_push_chunk_encoding
 [`stream.push()`]: #stream_readable_push_chunk_encoding
 [`unpipe()`]: #stream_readable_unpipe_destination
 [unpiped]: #stream_readable_unpipe_destination
-[tcp sockets]: https://iojs.org/dist/v5.0.0/doc/api/net.html#net_class_net_socket
+[tcp sockets]: https://nodejs.org/docs/v5.1.0/api/net.html#net_class_net_socket
+[http responses, on the client]: https://nodejs.org/docs/v5.1.0/api/http.html#http_http_incomingmessage
+[http requests, on the server]: https://nodejs.org/docs/v5.1.0/api/http.html#http_http_incomingmessage
+[http requests, on the client]: https://nodejs.org/docs/v5.1.0/api/http.html#http_class_http_clientrequest
+[http responses, on the server]: https://nodejs.org/docs/v5.1.0/api/http.html#http_class_http_serverresponse
+[fs read streams]: https://nodejs.org/docs/v5.1.0/api/fs.html#fs_class_fs_readstream
+[fs write streams]: https://nodejs.org/docs/v5.1.0/api/fs.html#fs_class_fs_writestream
 [zlib streams]: zlib.html
 [zlib]: zlib.html
 [crypto streams]: crypto.html
 [crypto]: crypto.html
-[tls.CryptoStream]: https://iojs.org/dist/v5.0.0/doc/api/tls.html#tls_class_cryptostream
-[process.stdin]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stdin
-[stdout]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stdout
-[process.stdout]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stdout
-[process.stderr]: https://iojs.org/dist/v5.0.0/doc/api/process.html#process_process_stderr
-[child process stdout and stderr]: https://iojs.org/dist/v5.0.0/doc/api/child_process.html#child_process_child_stdout
+[tls.CryptoStream]: https://nodejs.org/docs/v5.1.0/api/tls.html#tls_class_cryptostream
+[process.stdin]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stdin
+[stdout]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stdout
+[process.stdout]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stdout
+[process.stderr]: https://nodejs.org/docs/v5.1.0/api/process.html#process_process_stderr
+[child process stdout and stderr]: https://nodejs.org/docs/v5.1.0/api/child_process.html#child_process_child_stdout
+[child process stdin]: https://nodejs.org/docs/v5.1.0/api/child_process.html#child_process_child_stdin
 [API for Stream Consumers]: #stream_api_for_stream_consumers
 [API for Stream Implementors]: #stream_api_for_stream_implementors
 [Readable]: #stream_class_stream_readable
@@ -1686,7 +1720,7 @@ JSONParseStream.prototype._flush = function(cb) {
 [`_write(chunk, encoding, callback)`]: #stream_writable_write_chunk_encoding_callback_1
 [`_write()`]: #stream_writable_write_chunk_encoding_callback_1
 [_write]: #stream_writable_write_chunk_encoding_callback_1
-[`util.inherits`]: https://iojs.org/dist/v5.0.0/doc/api/util.html#util_util_inherits_constructor_superconstructor
+[`util.inherits`]: https://nodejs.org/docs/v5.1.0/api/util.html#util_util_inherits_constructor_superconstructor
 [`end()`]: #stream_writable_end_chunk_encoding_callback
 [`'data'` event]: #stream_event_data
 [`resume()`]: #stream_readable_resume
index 90068ea..50852ae 100644 (file)
@@ -61,8 +61,9 @@ var StringDecoder;
 
 util.inherits(Readable, Stream);
 
+var Duplex;
 function ReadableState(options, stream) {
-  var Duplex = require('./_stream_duplex');
+  Duplex = Duplex || require('./_stream_duplex');
 
   options = options || {};
 
@@ -128,8 +129,9 @@ function ReadableState(options, stream) {
   }
 }
 
+var Duplex;
 function Readable(options) {
-  var Duplex = require('./_stream_duplex');
+  Duplex = Duplex || require('./_stream_duplex');
 
   if (!(this instanceof Readable))
     return new Readable(options);
index 23a2ba2..1fa5eb6 100644 (file)
@@ -55,8 +55,9 @@ function WriteReq(chunk, encoding, cb) {
   this.next = null;
 }
 
+var Duplex;
 function WritableState(options, stream) {
-  var Duplex = require('./_stream_duplex');
+  Duplex = Duplex || require('./_stream_duplex');
 
   options = options || {};
 
@@ -164,8 +165,9 @@ Object.defineProperty(WritableState.prototype, 'buffer', {
 }catch(_){}}());
 
 
+var Duplex;
 function Writable(options) {
-  var Duplex = require('./_stream_duplex');
+  Duplex = Duplex || require('./_stream_duplex');
 
   // Writable ctor is applied to Duplexes, though they're not
   // instanceof Writable, they're instanceof Readable.
index 83e519e..ddd227e 100644 (file)
   "devDependencies": {
     "tap": "^2.3.0"
   },
-  "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "a177da234df5638b363ddc15fa324619a38577c8",
   "homepage": "https://github.com/isaacs/core-util-is#readme",
   "_id": "core-util-is@1.0.2",
   "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
+  "_from": "core-util-is@>=1.0.0 <1.1.0",
+  "_npmVersion": "3.3.2",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "dist": {
+    "shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
+    "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
-  "_from": "core-util-is@>=1.0.0 <1.1.0"
+  "readme": "ERROR: No README data found!"
 }
index 4019a28..0ccf225 100644 (file)
@@ -22,7 +22,7 @@
   "gitHead": "e85787b05a8c3c1adb714f332d822e9162699c78",
   "_id": "process-nextick-args@1.0.6",
   "_shasum": "0f96b001cea90b12592ce566edb97ec11e69bd05",
-  "_from": "process-nextick-args@>=1.0.0 <1.1.0",
+  "_from": "process-nextick-args@>=1.0.6 <1.1.0",
   "_npmVersion": "2.14.4",
   "_nodeVersion": "4.1.1",
   "_npmUser": {
index ee70702..0364d54 100644 (file)
     "browserify"
   ],
   "license": "MIT",
-  "readme": "**string_decoder.js** (`require('string_decoder')`) from Node.js core\n\nCopyright Joyent, Inc. and other Node contributors. See LICENCE file for details.\n\nVersion numbers match the versions found in Node core, e.g. 0.10.24 matches Node 0.10.24, likewise 0.11.10 matches Node 0.11.10. **Prefer the stable version over the unstable.**\n\nThe *build/* directory contains a build script that will scrape the source from the [joyent/node](https://github.com/joyent/node) repo given a specific Node version.",
-  "readmeFilename": "README.md",
+  "gitHead": "d46d4fd87cf1d06e031c23f1ba170ca7d4ade9a0",
   "bugs": {
     "url": "https://github.com/rvagg/string_decoder/issues"
   },
   "_id": "string_decoder@0.10.31",
   "_shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
+  "_from": "string_decoder@>=0.10.0 <0.11.0",
+  "_npmVersion": "1.4.23",
+  "_npmUser": {
+    "name": "rvagg",
+    "email": "rod@vagg.org"
+  },
+  "maintainers": [
+    {
+      "name": "substack",
+      "email": "mail@substack.net"
+    },
+    {
+      "name": "rvagg",
+      "email": "rod@vagg.org"
+    }
+  ],
+  "dist": {
+    "shasum": "62e203bc41766c6c28c9fc84301dab1c5310fa94",
+    "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz",
-  "_from": "string_decoder@>=0.10.0 <0.11.0"
+  "readme": "ERROR: No README data found!"
 }
index f68d8bb..ae0c70f 100644 (file)
     "url": "https://github.com/TooTallNate/util-deprecate/issues"
   },
   "homepage": "https://github.com/TooTallNate/util-deprecate",
-  "readme": "util-deprecate\n==============\n### The Node.js `util.deprecate()` function with browser support\n\nIn Node.js, this module simply re-exports the `util.deprecate()` function.\n\nIn the web browser (i.e. via browserify), a browser-specific implementation\nof the `util.deprecate()` function is used.\n\n\n## API\n\nA `deprecate()` function is the only thing exposed by this module.\n\n``` javascript\n// setup:\nexports.foo = deprecate(foo, 'foo() is deprecated, use bar() instead');\n\n\n// users see:\nfoo();\n// foo() is deprecated, use bar() instead\nfoo();\nfoo();\n```\n\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2014 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person\nobtaining a copy of this software and associated documentation\nfiles (the \"Software\"), to deal in the Software without\nrestriction, including without limitation the rights to use,\ncopy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the\nSoftware is furnished to do so, subject to the following\nconditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES\nOF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND\nNONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT\nHOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,\nWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING\nFROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\nOTHER DEALINGS IN THE SOFTWARE.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "475fb6857cd23fafff20c1be846c1350abf8e6d4",
   "_id": "util-deprecate@1.0.2",
   "_shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
+  "_from": "util-deprecate@>=1.0.1 <1.1.0",
+  "_npmVersion": "2.14.4",
+  "_nodeVersion": "4.1.2",
+  "_npmUser": {
+    "name": "tootallnate",
+    "email": "nathan@tootallnate.net"
+  },
+  "maintainers": [
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    }
+  ],
+  "dist": {
+    "shasum": "450d4dc9fa70de732762fbd2d4a28981419a0ccf",
+    "tarball": "http://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz",
-  "_from": "util-deprecate@>=1.0.1 <1.1.0"
+  "readme": "ERROR: No README data found!"
 }
index c0698ef..d6a064e 100644 (file)
@@ -1,13 +1,13 @@
 {
   "name": "readable-stream",
-  "version": "2.0.4",
+  "version": "2.0.5",
   "description": "Streams3, a user-land copy of the stream library from iojs v2.x",
   "main": "readable.js",
   "dependencies": {
     "core-util-is": "~1.0.0",
     "inherits": "~2.0.1",
     "isarray": "0.0.1",
-    "process-nextick-args": "~1.0.0",
+    "process-nextick-args": "~1.0.6",
     "string_decoder": "~0.10.x",
     "util-deprecate": "~1.0.1"
   },
     "util": false
   },
   "license": "MIT",
-  "readme": "# readable-stream\n\n***Node-core streams for userland*** [![Build Status](https://travis-ci.org/nodejs/readable-stream.svg?branch=master)](https://travis-ci.org/nodejs/readable-stream)\n\n\n[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true&downloadRank=true)](https://nodei.co/npm/readable-stream/)\n[![NPM](https://nodei.co/npm-dl/readable-stream.png?&months=6&height=3)](https://nodei.co/npm/readable-stream/)\n\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/readable-stream.svg)](https://saucelabs.com/u/readable-stream)\n\n```bash\nnpm install --save readable-stream\n```\n\n***Node-core streams for userland***\n\nThis package is a mirror of the Streams2 and Streams3 implementations in\nNode-core, including [documentation](doc/stream.markdown).\n\nIf you want to guarantee a stable streams base, regardless of what version of\nNode you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *\"stream\"* module in Node-core, for background see [this blogpost](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).\n\nAs of version 2.0.0 **readable-stream** uses semantic versioning.  \n\n# Streams WG Team Members\n\n* **Chris Dickinson** ([@chrisdickinson](https://github.com/chrisdickinson)) &lt;christopher.s.dickinson@gmail.com&gt;\n  - Release GPG key: 9554F04D7259F04124DE6B476D5A82AC7E37093B\n* **Calvin Metcalf** ([@calvinmetcalf](https://github.com/calvinmetcalf)) &lt;calvin.metcalf@gmail.com&gt;\n  - Release GPG key: F3EF5F62A87FC27A22E643F714CE4FF5015AA242\n* **Rod Vagg** ([@rvagg](https://github.com/rvagg)) &lt;rod@vagg.org&gt;\n  - Release GPG key: DD8F2338BAE7501E3DD5AC78C273792F7D83545D\n* **Sam Newman** ([@sonewman](https://github.com/sonewman)) &lt;newmansam@outlook.com&gt;\n* **Mathias Buus** ([@mafintosh](https://github.com/mafintosh)) &lt;mathiasbuus@gmail.com&gt;\n* **Domenic Denicola** ([@domenic](https://github.com/domenic)) &lt;d@domenic.me&gt;\n",
-  "readmeFilename": "README.md",
+  "gitHead": "a4f23d8e451267684a8160679ce16e16149fe72b",
   "bugs": {
     "url": "https://github.com/nodejs/readable-stream/issues"
   },
   "homepage": "https://github.com/nodejs/readable-stream#readme",
-  "_id": "readable-stream@2.0.4",
-  "_shasum": "2523ef27ffa339d7ba9da8603f2d0599d06edbd8",
-  "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.4.tgz",
-  "_from": "readable-stream@>=2.0.0 <2.1.0"
+  "_id": "readable-stream@2.0.5",
+  "_shasum": "a2426f8dcd4551c77a33f96edf2886a23c829669",
+  "_from": "readable-stream@>=2.0.5 <2.1.0",
+  "_npmVersion": "3.3.12",
+  "_nodeVersion": "5.1.1",
+  "_npmUser": {
+    "name": "cwmma",
+    "email": "calvin.metcalf@gmail.com"
+  },
+  "dist": {
+    "shasum": "a2426f8dcd4551c77a33f96edf2886a23c829669",
+    "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "isaacs@npmjs.com"
+    },
+    {
+      "name": "tootallnate",
+      "email": "nathan@tootallnate.net"
+    },
+    {
+      "name": "rvagg",
+      "email": "rod@vagg.org"
+    },
+    {
+      "name": "cwmma",
+      "email": "calvin.metcalf@gmail.com"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.0.5.tgz",
+  "readme": "ERROR: No README data found!"
 }
index b5dcf4a..469ebc8 100644 (file)
@@ -1,11 +1,10 @@
 {
   "name": "bl",
-  "version": "1.0.0",
+  "version": "1.0.2",
   "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
   "main": "bl.js",
   "scripts": {
-    "test": "node test/test.js | faucet",
-    "test-local": "brtapsauce-local test/basic-test.js"
+    "test": "node test/test.js | faucet"
   },
   "repository": {
     "type": "git",
   ],
   "license": "MIT",
   "dependencies": {
-    "readable-stream": "~2.0.0"
+    "readable-stream": "~2.0.5"
   },
   "devDependencies": {
     "tape": "~2.12.3",
     "hash_file": "~0.1.1",
-    "faucet": "~0.0.1",
-    "brtapsauce": "~0.3.0"
+    "faucet": "~0.0.1"
   },
-  "readme": "# bl *(BufferList)*\n\n[![Build Status](https://travis-ci.org/rvagg/bl.svg?branch=master)](https://travis-ci.org/rvagg/bl)\n\n**A Node.js Buffer list collector, reader and streamer thingy.**\n\n[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/)\n[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/)\n\n**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!\n\nThe original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.\n\n```js\nconst BufferList = require('bl')\n\nvar bl = new BufferList()\nbl.append(new Buffer('abcd'))\nbl.append(new Buffer('efg'))\nbl.append('hi')                     // bl will also accept & convert Strings\nbl.append(new Buffer('j'))\nbl.append(new Buffer([ 0x3, 0x4 ]))\n\nconsole.log(bl.length) // 12\n\nconsole.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'\nconsole.log(bl.slice(3, 10).toString('ascii')) // 'defghij'\nconsole.log(bl.slice(3, 6).toString('ascii'))  // 'def'\nconsole.log(bl.slice(3, 8).toString('ascii'))  // 'defgh'\nconsole.log(bl.slice(5, 10).toString('ascii')) // 'fghij'\n\n// or just use toString!\nconsole.log(bl.toString())               // 'abcdefghij\\u0003\\u0004'\nconsole.log(bl.toString('ascii', 3, 8))  // 'defgh'\nconsole.log(bl.toString('ascii', 5, 10)) // 'fghij'\n\n// other standard Buffer readables\nconsole.log(bl.readUInt16BE(10)) // 0x0304\nconsole.log(bl.readUInt16LE(10)) // 0x0403\n```\n\nGive it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:\n\n```js\nconst bl = require('bl')\n    , fs = require('fs')\n\nfs.createReadStream('README.md')\n  .pipe(bl(function (err, data) { // note 'new' isn't strictly required\n    // `data` is a complete Buffer object containing the full data\n    console.log(data.toString())\n  }))\n```\n\nNote that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.\n\nOr to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):\n```js\nconst hyperquest = require('hyperquest')\n    , bl         = require('bl')\n    , url        = 'https://raw.github.com/rvagg/bl/master/README.md'\n\nhyperquest(url).pipe(bl(function (err, data) {\n  console.log(data.toString())\n}))\n```\n\nOr, use it as a readable stream to recompose a list of Buffers to an output source:\n\n```js\nconst BufferList = require('bl')\n    , fs         = require('fs')\n\nvar bl = new BufferList()\nbl.append(new Buffer('abcd'))\nbl.append(new Buffer('efg'))\nbl.append(new Buffer('hi'))\nbl.append(new Buffer('j'))\n\nbl.pipe(fs.createWriteStream('gibberish.txt'))\n```\n\n## API\n\n  * <a href=\"#ctor\"><code><b>new BufferList([ callback ])</b></code></a>\n  * <a href=\"#length\"><code>bl.<b>length</b></code></a>\n  * <a href=\"#append\"><code>bl.<b>append(buffer)</b></code></a>\n  * <a href=\"#get\"><code>bl.<b>get(index)</b></code></a>\n  * <a href=\"#slice\"><code>bl.<b>slice([ start[, end ] ])</b></code></a>\n  * <a href=\"#copy\"><code>bl.<b>copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])</b></code></a>\n  * <a href=\"#duplicate\"><code>bl.<b>duplicate()</b></code></a>\n  * <a href=\"#consume\"><code>bl.<b>consume(bytes)</b></code></a>\n  * <a href=\"#toString\"><code>bl.<b>toString([encoding, [ start, [ end ]]])</b></code></a>\n  * <a href=\"#readXX\"><code>bl.<b>readDoubleBE()</b></code>, <code>bl.<b>readDoubleLE()</b></code>, <code>bl.<b>readFloatBE()</b></code>, <code>bl.<b>readFloatLE()</b></code>, <code>bl.<b>readInt32BE()</b></code>, <code>bl.<b>readInt32LE()</b></code>, <code>bl.<b>readUInt32BE()</b></code>, <code>bl.<b>readUInt32LE()</b></code>, <code>bl.<b>readInt16BE()</b></code>, <code>bl.<b>readInt16LE()</b></code>, <code>bl.<b>readUInt16BE()</b></code>, <code>bl.<b>readUInt16LE()</b></code>, <code>bl.<b>readInt8()</b></code>, <code>bl.<b>readUInt8()</b></code></a>\n  * <a href=\"#streams\">Streams</a>\n\n--------------------------------------------------------\n<a name=\"ctor\"></a>\n### new BufferList([ callback | buffer | buffer array ])\nThe constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.\n\nNormally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.\n\n`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:\n\n```js\nvar bl = require('bl')\nvar myinstance = bl()\n\n// equivilant to:\n\nvar BufferList = require('bl')\nvar myinstance = new BufferList()\n```\n\n--------------------------------------------------------\n<a name=\"length\"></a>\n### bl.length\nGet the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.\n\n--------------------------------------------------------\n<a name=\"append\"></a>\n### bl.append(buffer)\n`append(buffer)` adds an additional buffer or BufferList to the internal list.\n\n--------------------------------------------------------\n<a name=\"get\"></a>\n### bl.get(index)\n`get()` will return the byte at the specified index.\n\n--------------------------------------------------------\n<a name=\"slice\"></a>\n### bl.slice([ start, [ end ] ])\n`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.\n\nIf the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.\n\n--------------------------------------------------------\n<a name=\"copy\"></a>\n### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])\n`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.\n\n--------------------------------------------------------\n<a name=\"duplicate\"></a>\n### bl.duplicate()\n`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:\n\n```js\nvar bl = new BufferList()\n\nbl.append('hello')\nbl.append(' world')\nbl.append('\\n')\n\nbl.duplicate().pipe(process.stdout, { end: false })\n\nconsole.log(bl.toString())\n```\n\n--------------------------------------------------------\n<a name=\"consume\"></a>\n### bl.consume(bytes)\n`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers&mdash;initial offsets will be calculated accordingly in order to give you a consistent view of the data.\n\n--------------------------------------------------------\n<a name=\"toString\"></a>\n### bl.toString([encoding, [ start, [ end ]]])\n`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.\n\n--------------------------------------------------------\n<a name=\"readXX\"></a>\n### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()\n\nAll of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.\n\nSee the <b><code>[Buffer](http://nodejs.org/docs/latest/api/buffer.html)</code></b> documentation for how these work.\n\n--------------------------------------------------------\n<a name=\"streams\"></a>\n### Streams\n**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance.\n\n--------------------------------------------------------\n\n## Contributors\n\n**bl** is brought to you by the following hackers:\n\n * [Rod Vagg](https://github.com/rvagg)\n * [Matteo Collina](https://github.com/mcollina)\n * [Jarett Cruger](https://github.com/jcrugzz)\n\n=======\n\n<a name=\"license\"></a>\n## License &amp; copyright\n\nCopyright (c) 2013-2014 bl contributors (listed above).\n\nbl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "9f1e7ce410e28d68c0a6f678b93b4cc2273e585f",
   "bugs": {
     "url": "https://github.com/rvagg/bl/issues"
   },
-  "_id": "bl@1.0.0",
-  "_shasum": "ada9a8a89a6d7ac60862f7dec7db207873e0c3f5",
-  "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.0.tgz",
-  "_from": "bl@>=1.0.0 <1.1.0"
+  "_id": "bl@1.0.2",
+  "_shasum": "8c66490d825ba84d560de1f62196a29555b3a0c4",
+  "_from": "bl@>=1.0.0 <1.1.0",
+  "_npmVersion": "3.6.0",
+  "_nodeVersion": "5.5.0",
+  "_npmUser": {
+    "name": "rvagg",
+    "email": "rod@vagg.org"
+  },
+  "maintainers": [
+    {
+      "name": "rvagg",
+      "email": "rod@vagg.org"
+    }
+  ],
+  "dist": {
+    "shasum": "8c66490d825ba84d560de1f62196a29555b3a0c4",
+    "tarball": "http://registry.npmjs.org/bl/-/bl-1.0.2.tgz"
+  },
+  "_npmOperationalInternal": {
+    "host": "packages-6-west.internal.npmjs.com",
+    "tmp": "tmp/bl-1.0.2.tgz_1454532811740_0.7871121023781598"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/bl/-/bl-1.0.2.tgz"
 }
diff --git a/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js b/deps/npm/node_modules/request/node_modules/bl/test/basic-test.js
deleted file mode 100644 (file)
index 75116a3..0000000
+++ /dev/null
@@ -1,541 +0,0 @@
-var tape       = require('tape')
-  , crypto     = require('crypto')
-  , fs         = require('fs')
-  , hash       = require('hash_file')
-  , BufferList = require('../')
-
-  , encodings  =
-      ('hex utf8 utf-8 ascii binary base64'
-          + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
-
-tape('single bytes from single buffer', function (t) {
-  var bl = new BufferList()
-  bl.append(new Buffer('abcd'))
-
-  t.equal(bl.length, 4)
-
-  t.equal(bl.get(0), 97)
-  t.equal(bl.get(1), 98)
-  t.equal(bl.get(2), 99)
-  t.equal(bl.get(3), 100)
-
-  t.end()
-})
-
-tape('single bytes from multiple buffers', function (t) {
-  var bl = new BufferList()
-  bl.append(new Buffer('abcd'))
-  bl.append(new Buffer('efg'))
-  bl.append(new Buffer('hi'))
-  bl.append(new Buffer('j'))
-
-  t.equal(bl.length, 10)
-
-  t.equal(bl.get(0), 97)
-  t.equal(bl.get(1), 98)
-  t.equal(bl.get(2), 99)
-  t.equal(bl.get(3), 100)
-  t.equal(bl.get(4), 101)
-  t.equal(bl.get(5), 102)
-  t.equal(bl.get(6), 103)
-  t.equal(bl.get(7), 104)
-  t.equal(bl.get(8), 105)
-  t.equal(bl.get(9), 106)
-  t.end()
-})
-
-tape('multi bytes from single buffer', function (t) {
-  var bl = new BufferList()
-  bl.append(new Buffer('abcd'))
-
-  t.equal(bl.length, 4)
-
-  t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
-  t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
-  t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
-
-  t.end()
-})
-
-tape('multiple bytes from multiple buffers', function (t) {
-  var bl = new BufferList()
-
-  bl.append(new Buffer('abcd'))
-  bl.append(new Buffer('efg'))
-  bl.append(new Buffer('hi'))
-  bl.append(new Buffer('j'))
-
-  t.equal(bl.length, 10)
-
-  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
-  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
-  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
-  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
-  t.end()
-})
-
-tape('multiple bytes from multiple buffer lists', function (t) {
-  var bl = new BufferList()
-
-  bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')]))
-  bl.append(new BufferList([new Buffer('hi'), new Buffer('j')]))
-
-  t.equal(bl.length, 10)
-
-  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
-  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
-  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
-  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
-
-  t.end()
-})
-
-tape('consuming from multiple buffers', function (t) {
-  var bl = new BufferList()
-
-  bl.append(new Buffer('abcd'))
-  bl.append(new Buffer('efg'))
-  bl.append(new Buffer('hi'))
-  bl.append(new Buffer('j'))
-
-  t.equal(bl.length, 10)
-
-  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
-
-  bl.consume(3)
-  t.equal(bl.length, 7)
-  t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
-
-  bl.consume(2)
-  t.equal(bl.length, 5)
-  t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
-
-  bl.consume(1)
-  t.equal(bl.length, 4)
-  t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
-
-  bl.consume(1)
-  t.equal(bl.length, 3)
-  t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
-
-  bl.consume(2)
-  t.equal(bl.length, 1)
-  t.equal(bl.slice(0, 1).toString('ascii'), 'j')
-
-  t.end()
-})
-
-tape('test readUInt8 / readInt8', function (t) {
-  var buf1 = new Buffer(1)
-    , buf2 = new Buffer(3)
-    , buf3 = new Buffer(3)
-    , bl  = new BufferList()
-
-  buf2[1] = 0x3
-  buf2[2] = 0x4
-  buf3[0] = 0x23
-  buf3[1] = 0x42
-
-  bl.append(buf1)
-  bl.append(buf2)
-  bl.append(buf3)
-
-  t.equal(bl.readUInt8(2), 0x3)
-  t.equal(bl.readInt8(2), 0x3)
-  t.equal(bl.readUInt8(3), 0x4)
-  t.equal(bl.readInt8(3), 0x4)
-  t.equal(bl.readUInt8(4), 0x23)
-  t.equal(bl.readInt8(4), 0x23)
-  t.equal(bl.readUInt8(5), 0x42)
-  t.equal(bl.readInt8(5), 0x42)
-  t.end()
-})
-
-tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
-  var buf1 = new Buffer(1)
-    , buf2 = new Buffer(3)
-    , buf3 = new Buffer(3)
-    , bl   = new BufferList()
-
-  buf2[1] = 0x3
-  buf2[2] = 0x4
-  buf3[0] = 0x23
-  buf3[1] = 0x42
-
-  bl.append(buf1)
-  bl.append(buf2)
-  bl.append(buf3)
-
-  t.equal(bl.readUInt16BE(2), 0x0304)
-  t.equal(bl.readUInt16LE(2), 0x0403)
-  t.equal(bl.readInt16BE(2), 0x0304)
-  t.equal(bl.readInt16LE(2), 0x0403)
-  t.equal(bl.readUInt16BE(3), 0x0423)
-  t.equal(bl.readUInt16LE(3), 0x2304)
-  t.equal(bl.readInt16BE(3), 0x0423)
-  t.equal(bl.readInt16LE(3), 0x2304)
-  t.equal(bl.readUInt16BE(4), 0x2342)
-  t.equal(bl.readUInt16LE(4), 0x4223)
-  t.equal(bl.readInt16BE(4), 0x2342)
-  t.equal(bl.readInt16LE(4), 0x4223)
-  t.end()
-})
-
-tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
-  var buf1 = new Buffer(1)
-    , buf2 = new Buffer(3)
-    , buf3 = new Buffer(3)
-    , bl   = new BufferList()
-
-  buf2[1] = 0x3
-  buf2[2] = 0x4
-  buf3[0] = 0x23
-  buf3[1] = 0x42
-
-  bl.append(buf1)
-  bl.append(buf2)
-  bl.append(buf3)
-
-  t.equal(bl.readUInt32BE(2), 0x03042342)
-  t.equal(bl.readUInt32LE(2), 0x42230403)
-  t.equal(bl.readInt32BE(2), 0x03042342)
-  t.equal(bl.readInt32LE(2), 0x42230403)
-  t.end()
-})
-
-tape('test readFloatLE / readFloatBE', function (t) {
-  var buf1 = new Buffer(1)
-    , buf2 = new Buffer(3)
-    , buf3 = new Buffer(3)
-    , bl   = new BufferList()
-
-  buf2[1] = 0x00
-  buf2[2] = 0x00
-  buf3[0] = 0x80
-  buf3[1] = 0x3f
-
-  bl.append(buf1)
-  bl.append(buf2)
-  bl.append(buf3)
-
-  t.equal(bl.readFloatLE(2), 0x01)
-  t.end()
-})
-
-tape('test readDoubleLE / readDoubleBE', function (t) {
-  var buf1 = new Buffer(1)
-    , buf2 = new Buffer(3)
-    , buf3 = new Buffer(10)
-    , bl   = new BufferList()
-
-  buf2[1] = 0x55
-  buf2[2] = 0x55
-  buf3[0] = 0x55
-  buf3[1] = 0x55
-  buf3[2] = 0x55
-  buf3[3] = 0x55
-  buf3[4] = 0xd5
-  buf3[5] = 0x3f
-
-  bl.append(buf1)
-  bl.append(buf2)
-  bl.append(buf3)
-
-  t.equal(bl.readDoubleLE(2), 0.3333333333333333)
-  t.end()
-})
-
-tape('test toString', function (t) {
-  var bl = new BufferList()
-
-  bl.append(new Buffer('abcd'))
-  bl.append(new Buffer('efg'))
-  bl.append(new Buffer('hi'))
-  bl.append(new Buffer('j'))
-
-  t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
-  t.equal(bl.toString('ascii', 3, 10), 'defghij')
-  t.equal(bl.toString('ascii', 3, 6), 'def')
-  t.equal(bl.toString('ascii', 3, 8), 'defgh')
-  t.equal(bl.toString('ascii', 5, 10), 'fghij')
-
-  t.end()
-})
-
-tape('test toString encoding', function (t) {
-  var bl = new BufferList()
-    , b  = new Buffer('abcdefghij\xff\x00')
-
-  bl.append(new Buffer('abcd'))
-  bl.append(new Buffer('efg'))
-  bl.append(new Buffer('hi'))
-  bl.append(new Buffer('j'))
-  bl.append(new Buffer('\xff\x00'))
-
-  encodings.forEach(function (enc) {
-      t.equal(bl.toString(enc), b.toString(enc), enc)
-    })
-
-  t.end()
-})
-
-!process.browser && tape('test stream', function (t) {
-  var random = crypto.randomBytes(65534)
-    , rndhash = hash(random, 'md5')
-    , md5sum = crypto.createHash('md5')
-    , bl     = new BufferList(function (err, buf) {
-        t.ok(Buffer.isBuffer(buf))
-        t.ok(err === null)
-        t.equal(rndhash, hash(bl.slice(), 'md5'))
-        t.equal(rndhash, hash(buf, 'md5'))
-
-        bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
-          .on('close', function () {
-            var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
-            s.on('data', md5sum.update.bind(md5sum))
-            s.on('end', function() {
-              t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
-              t.end()
-            })
-          })
-
-      })
-
-  fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
-  fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
-})
-
-tape('instantiation with Buffer', function (t) {
-  var buf  = crypto.randomBytes(1024)
-    , buf2 = crypto.randomBytes(1024)
-    , b    = BufferList(buf)
-
-  t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
-  b = BufferList([ buf, buf2 ])
-  t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
-  t.end()
-})
-
-tape('test String appendage', function (t) {
-  var bl = new BufferList()
-    , b  = new Buffer('abcdefghij\xff\x00')
-
-  bl.append('abcd')
-  bl.append('efg')
-  bl.append('hi')
-  bl.append('j')
-  bl.append('\xff\x00')
-
-  encodings.forEach(function (enc) {
-      t.equal(bl.toString(enc), b.toString(enc))
-    })
-
-  t.end()
-})
-
-tape('write nothing, should get empty buffer', function (t) {
-  t.plan(3)
-  BufferList(function (err, data) {
-    t.notOk(err, 'no error')
-    t.ok(Buffer.isBuffer(data), 'got a buffer')
-    t.equal(0, data.length, 'got a zero-length buffer')
-    t.end()
-  }).end()
-})
-
-tape('unicode string', function (t) {
-  t.plan(2)
-  var inp1 = '\u2600'
-    , inp2 = '\u2603'
-    , exp = inp1 + ' and ' + inp2
-    , bl = BufferList()
-  bl.write(inp1)
-  bl.write(' and ')
-  bl.write(inp2)
-  t.equal(exp, bl.toString())
-  t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
-})
-
-tape('should emit finish', function (t) {
-  var source = BufferList()
-    , dest = BufferList()
-
-  source.write('hello')
-  source.pipe(dest)
-
-  dest.on('finish', function () {
-    t.equal(dest.toString('utf8'), 'hello')
-    t.end()
-  })
-})
-
-tape('basic copy', function (t) {
-  var buf  = crypto.randomBytes(1024)
-    , buf2 = new Buffer(1024)
-    , b    = BufferList(buf)
-
-  b.copy(buf2)
-  t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
-  t.end()
-})
-
-tape('copy after many appends', function (t) {
-  var buf  = crypto.randomBytes(512)
-    , buf2 = new Buffer(1024)
-    , b    = BufferList(buf)
-
-  b.append(buf)
-  b.copy(buf2)
-  t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
-  t.end()
-})
-
-tape('copy at a precise position', function (t) {
-  var buf  = crypto.randomBytes(1004)
-    , buf2 = new Buffer(1024)
-    , b    = BufferList(buf)
-
-  b.copy(buf2, 20)
-  t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
-  t.end()
-})
-
-tape('copy starting from a precise location', function (t) {
-  var buf  = crypto.randomBytes(10)
-    , buf2 = new Buffer(5)
-    , b    = BufferList(buf)
-
-  b.copy(buf2, 0, 5)
-  t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
-  t.end()
-})
-
-tape('copy in an interval', function (t) {
-  var rnd      = crypto.randomBytes(10)
-    , b        = BufferList(rnd) // put the random bytes there
-    , actual   = new Buffer(3)
-    , expected = new Buffer(3)
-
-  rnd.copy(expected, 0, 5, 8)
-  b.copy(actual, 0, 5, 8)
-
-  t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
-  t.end()
-})
-
-tape('copy an interval between two buffers', function (t) {
-  var buf      = crypto.randomBytes(10)
-    , buf2     = new Buffer(10)
-    , b        = BufferList(buf)
-
-  b.append(buf)
-  b.copy(buf2, 0, 5, 15)
-
-  t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
-  t.end()
-})
-
-tape('duplicate', function (t) {
-  t.plan(2)
-
-  var bl = new BufferList('abcdefghij\xff\x00')
-    , dup = bl.duplicate()
-
-  t.equal(bl.prototype, dup.prototype)
-  t.equal(bl.toString('hex'), dup.toString('hex'))
-})
-
-tape('destroy no pipe', function (t) {
-  t.plan(2)
-
-  var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
-  bl.destroy()
-
-  t.equal(bl._bufs.length, 0)
-  t.equal(bl.length, 0)
-})
-
-!process.browser && tape('destroy with pipe before read end', function (t) {
-  t.plan(2)
-
-  var bl = new BufferList()
-  fs.createReadStream(__dirname + '/sauce.js')
-    .pipe(bl)
-
-  bl.destroy()
-
-  t.equal(bl._bufs.length, 0)
-  t.equal(bl.length, 0)
-
-})
-
-!process.browser && tape('destroy with pipe before read end with race', function (t) {
-  t.plan(2)
-
-  var bl = new BufferList()
-  fs.createReadStream(__dirname + '/sauce.js')
-    .pipe(bl)
-
-  setTimeout(function () {
-    bl.destroy()
-    setTimeout(function () {
-      t.equal(bl._bufs.length, 0)
-      t.equal(bl.length, 0)
-    }, 500)
-  }, 500)
-})
-
-!process.browser && tape('destroy with pipe after read end', function (t) {
-  t.plan(2)
-
-  var bl = new BufferList()
-  fs.createReadStream(__dirname + '/sauce.js')
-    .on('end', onEnd)
-    .pipe(bl)
-
-  function onEnd () {
-    bl.destroy()
-
-    t.equal(bl._bufs.length, 0)
-    t.equal(bl.length, 0)
-  }
-})
-
-!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
-  t.plan(4)
-
-  var bl = new BufferList()
-    , ds = new BufferList()
-
-  fs.createReadStream(__dirname + '/sauce.js')
-    .on('end', onEnd)
-    .pipe(bl)
-
-  function onEnd () {
-    bl.pipe(ds)
-
-    setTimeout(function () {
-      bl.destroy()
-
-      t.equals(bl._bufs.length, 0)
-      t.equals(bl.length, 0)
-
-      ds.destroy()
-
-      t.equals(bl._bufs.length, 0)
-      t.equals(bl.length, 0)
-
-    }, 100)
-  }
-})
-
-!process.browser && tape('handle error', function (t) {
-  t.plan(2)
-  fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
-    t.ok(err instanceof Error, 'has error')
-    t.notOk(data, 'no data')
-  }))
-})
diff --git a/deps/npm/node_modules/request/node_modules/bl/test/sauce.js b/deps/npm/node_modules/request/node_modules/bl/test/sauce.js
deleted file mode 100644 (file)
index a6d2862..0000000
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env node
-
-const user       = process.env.SAUCE_USER
-    , key        = process.env.SAUCE_KEY
-    , path       = require('path')
-    , brtapsauce = require('brtapsauce')
-    , testFile   = path.join(__dirname, 'basic-test.js')
-
-    , capabilities = [
-          { browserName: 'chrome'            , platform: 'Windows XP', version: ''   }
-        , { browserName: 'firefox'           , platform: 'Windows 8' , version: ''   }
-        , { browserName: 'firefox'           , platform: 'Windows XP', version: '4'  }
-        , { browserName: 'internet explorer' , platform: 'Windows 8' , version: '10' }
-        , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '9'  }
-        , { browserName: 'internet explorer' , platform: 'Windows 7' , version: '8'  }
-        , { browserName: 'internet explorer' , platform: 'Windows XP', version: '7'  }
-        , { browserName: 'internet explorer' , platform: 'Windows XP', version: '6'  }
-        , { browserName: 'safari'            , platform: 'Windows 7' , version: '5'  }
-        , { browserName: 'safari'            , platform: 'OS X 10.8' , version: '6'  }
-        , { browserName: 'opera'             , platform: 'Windows 7' , version: ''   }
-        , { browserName: 'opera'             , platform: 'Windows 7' , version: '11' }
-        , { browserName: 'ipad'              , platform: 'OS X 10.8' , version: '6'  }
-        , { browserName: 'android'           , platform: 'Linux'     , version: '4.0', 'device-type': 'tablet' }
-      ]
-
-if (!user)
-  throw new Error('Must set a SAUCE_USER env var')
-if (!key)
-  throw new Error('Must set a SAUCE_KEY env var')
-
-brtapsauce({
-    name         : 'Traversty'
-  , user         : user
-  , key          : key
-  , brsrc        : testFile
-  , capabilities : capabilities
-  , options      : { timeout: 60 * 6 }
-})
\ No newline at end of file
index aa9b487..8c8d0cf 100644 (file)
@@ -1,9 +1,557 @@
-require('./basic-test')
+var tape       = require('tape')
+  , crypto     = require('crypto')
+  , fs         = require('fs')
+  , hash       = require('hash_file')
+  , BufferList = require('../')
 
-if (!process.env.SAUCE_KEY || !process.env.SAUCE_USER)
-  return console.log('SAUCE_KEY and/or SAUCE_USER not set, not running sauce tests')
+  , encodings  =
+      ('hex utf8 utf-8 ascii binary base64'
+          + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
 
-if (!/v0\.10/.test(process.version))
-  return console.log('Not Node v0.10.x, not running sauce tests')
+tape('single bytes from single buffer', function (t) {
+  var bl = new BufferList()
+  bl.append(new Buffer('abcd'))
 
-require('./sauce.js')
\ No newline at end of file
+  t.equal(bl.length, 4)
+
+  t.equal(bl.get(0), 97)
+  t.equal(bl.get(1), 98)
+  t.equal(bl.get(2), 99)
+  t.equal(bl.get(3), 100)
+
+  t.end()
+})
+
+tape('single bytes from multiple buffers', function (t) {
+  var bl = new BufferList()
+  bl.append(new Buffer('abcd'))
+  bl.append(new Buffer('efg'))
+  bl.append(new Buffer('hi'))
+  bl.append(new Buffer('j'))
+
+  t.equal(bl.length, 10)
+
+  t.equal(bl.get(0), 97)
+  t.equal(bl.get(1), 98)
+  t.equal(bl.get(2), 99)
+  t.equal(bl.get(3), 100)
+  t.equal(bl.get(4), 101)
+  t.equal(bl.get(5), 102)
+  t.equal(bl.get(6), 103)
+  t.equal(bl.get(7), 104)
+  t.equal(bl.get(8), 105)
+  t.equal(bl.get(9), 106)
+  t.end()
+})
+
+tape('multi bytes from single buffer', function (t) {
+  var bl = new BufferList()
+  bl.append(new Buffer('abcd'))
+
+  t.equal(bl.length, 4)
+
+  t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
+  t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
+  t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
+
+  t.end()
+})
+
+tape('multiple bytes from multiple buffers', function (t) {
+  var bl = new BufferList()
+
+  bl.append(new Buffer('abcd'))
+  bl.append(new Buffer('efg'))
+  bl.append(new Buffer('hi'))
+  bl.append(new Buffer('j'))
+
+  t.equal(bl.length, 10)
+
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+  t.end()
+})
+
+tape('multiple bytes from multiple buffer lists', function (t) {
+  var bl = new BufferList()
+
+  bl.append(new BufferList([new Buffer('abcd'), new Buffer('efg')]))
+  bl.append(new BufferList([new Buffer('hi'), new Buffer('j')]))
+
+  t.equal(bl.length, 10)
+
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
+  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
+  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
+  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
+
+  t.end()
+})
+
+tape('consuming from multiple buffers', function (t) {
+  var bl = new BufferList()
+
+  bl.append(new Buffer('abcd'))
+  bl.append(new Buffer('efg'))
+  bl.append(new Buffer('hi'))
+  bl.append(new Buffer('j'))
+
+  t.equal(bl.length, 10)
+
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
+
+  bl.consume(3)
+  t.equal(bl.length, 7)
+  t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
+
+  bl.consume(2)
+  t.equal(bl.length, 5)
+  t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
+
+  bl.consume(1)
+  t.equal(bl.length, 4)
+  t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
+
+  bl.consume(1)
+  t.equal(bl.length, 3)
+  t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
+
+  bl.consume(2)
+  t.equal(bl.length, 1)
+  t.equal(bl.slice(0, 1).toString('ascii'), 'j')
+
+  t.end()
+})
+
+tape('test readUInt8 / readInt8', function (t) {
+  var buf1 = new Buffer(1)
+    , buf2 = new Buffer(3)
+    , buf3 = new Buffer(3)
+    , bl  = new BufferList()
+
+  buf2[1] = 0x3
+  buf2[2] = 0x4
+  buf3[0] = 0x23
+  buf3[1] = 0x42
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readUInt8(2), 0x3)
+  t.equal(bl.readInt8(2), 0x3)
+  t.equal(bl.readUInt8(3), 0x4)
+  t.equal(bl.readInt8(3), 0x4)
+  t.equal(bl.readUInt8(4), 0x23)
+  t.equal(bl.readInt8(4), 0x23)
+  t.equal(bl.readUInt8(5), 0x42)
+  t.equal(bl.readInt8(5), 0x42)
+  t.end()
+})
+
+tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
+  var buf1 = new Buffer(1)
+    , buf2 = new Buffer(3)
+    , buf3 = new Buffer(3)
+    , bl   = new BufferList()
+
+  buf2[1] = 0x3
+  buf2[2] = 0x4
+  buf3[0] = 0x23
+  buf3[1] = 0x42
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readUInt16BE(2), 0x0304)
+  t.equal(bl.readUInt16LE(2), 0x0403)
+  t.equal(bl.readInt16BE(2), 0x0304)
+  t.equal(bl.readInt16LE(2), 0x0403)
+  t.equal(bl.readUInt16BE(3), 0x0423)
+  t.equal(bl.readUInt16LE(3), 0x2304)
+  t.equal(bl.readInt16BE(3), 0x0423)
+  t.equal(bl.readInt16LE(3), 0x2304)
+  t.equal(bl.readUInt16BE(4), 0x2342)
+  t.equal(bl.readUInt16LE(4), 0x4223)
+  t.equal(bl.readInt16BE(4), 0x2342)
+  t.equal(bl.readInt16LE(4), 0x4223)
+  t.end()
+})
+
+tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
+  var buf1 = new Buffer(1)
+    , buf2 = new Buffer(3)
+    , buf3 = new Buffer(3)
+    , bl   = new BufferList()
+
+  buf2[1] = 0x3
+  buf2[2] = 0x4
+  buf3[0] = 0x23
+  buf3[1] = 0x42
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readUInt32BE(2), 0x03042342)
+  t.equal(bl.readUInt32LE(2), 0x42230403)
+  t.equal(bl.readInt32BE(2), 0x03042342)
+  t.equal(bl.readInt32LE(2), 0x42230403)
+  t.end()
+})
+
+tape('test readFloatLE / readFloatBE', function (t) {
+  var buf1 = new Buffer(1)
+    , buf2 = new Buffer(3)
+    , buf3 = new Buffer(3)
+    , bl   = new BufferList()
+
+  buf2[1] = 0x00
+  buf2[2] = 0x00
+  buf3[0] = 0x80
+  buf3[1] = 0x3f
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readFloatLE(2), 0x01)
+  t.end()
+})
+
+tape('test readDoubleLE / readDoubleBE', function (t) {
+  var buf1 = new Buffer(1)
+    , buf2 = new Buffer(3)
+    , buf3 = new Buffer(10)
+    , bl   = new BufferList()
+
+  buf2[1] = 0x55
+  buf2[2] = 0x55
+  buf3[0] = 0x55
+  buf3[1] = 0x55
+  buf3[2] = 0x55
+  buf3[3] = 0x55
+  buf3[4] = 0xd5
+  buf3[5] = 0x3f
+
+  bl.append(buf1)
+  bl.append(buf2)
+  bl.append(buf3)
+
+  t.equal(bl.readDoubleLE(2), 0.3333333333333333)
+  t.end()
+})
+
+tape('test toString', function (t) {
+  var bl = new BufferList()
+
+  bl.append(new Buffer('abcd'))
+  bl.append(new Buffer('efg'))
+  bl.append(new Buffer('hi'))
+  bl.append(new Buffer('j'))
+
+  t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
+  t.equal(bl.toString('ascii', 3, 10), 'defghij')
+  t.equal(bl.toString('ascii', 3, 6), 'def')
+  t.equal(bl.toString('ascii', 3, 8), 'defgh')
+  t.equal(bl.toString('ascii', 5, 10), 'fghij')
+
+  t.end()
+})
+
+tape('test toString encoding', function (t) {
+  var bl = new BufferList()
+    , b  = new Buffer('abcdefghij\xff\x00')
+
+  bl.append(new Buffer('abcd'))
+  bl.append(new Buffer('efg'))
+  bl.append(new Buffer('hi'))
+  bl.append(new Buffer('j'))
+  bl.append(new Buffer('\xff\x00'))
+
+  encodings.forEach(function (enc) {
+      t.equal(bl.toString(enc), b.toString(enc), enc)
+    })
+
+  t.end()
+})
+
+!process.browser && tape('test stream', function (t) {
+  var random = crypto.randomBytes(65534)
+    , rndhash = hash(random, 'md5')
+    , md5sum = crypto.createHash('md5')
+    , bl     = new BufferList(function (err, buf) {
+        t.ok(Buffer.isBuffer(buf))
+        t.ok(err === null)
+        t.equal(rndhash, hash(bl.slice(), 'md5'))
+        t.equal(rndhash, hash(buf, 'md5'))
+
+        bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
+          .on('close', function () {
+            var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
+            s.on('data', md5sum.update.bind(md5sum))
+            s.on('end', function() {
+              t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
+              t.end()
+            })
+          })
+
+      })
+
+  fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
+  fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
+})
+
+tape('instantiation with Buffer', function (t) {
+  var buf  = crypto.randomBytes(1024)
+    , buf2 = crypto.randomBytes(1024)
+    , b    = BufferList(buf)
+
+  t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
+  b = BufferList([ buf, buf2 ])
+  t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('test String appendage', function (t) {
+  var bl = new BufferList()
+    , b  = new Buffer('abcdefghij\xff\x00')
+
+  bl.append('abcd')
+  bl.append('efg')
+  bl.append('hi')
+  bl.append('j')
+  bl.append('\xff\x00')
+
+  encodings.forEach(function (enc) {
+      t.equal(bl.toString(enc), b.toString(enc))
+    })
+
+  t.end()
+})
+
+tape('test Number appendage', function (t) {
+  var bl = new BufferList()
+    , b  = new Buffer('1234567890')
+
+  bl.append(1234)
+  bl.append(567)
+  bl.append(89)
+  bl.append(0)
+
+  encodings.forEach(function (enc) {
+      t.equal(bl.toString(enc), b.toString(enc))
+    })
+
+  t.end()
+})
+
+tape('write nothing, should get empty buffer', function (t) {
+  t.plan(3)
+  BufferList(function (err, data) {
+    t.notOk(err, 'no error')
+    t.ok(Buffer.isBuffer(data), 'got a buffer')
+    t.equal(0, data.length, 'got a zero-length buffer')
+    t.end()
+  }).end()
+})
+
+tape('unicode string', function (t) {
+  t.plan(2)
+  var inp1 = '\u2600'
+    , inp2 = '\u2603'
+    , exp = inp1 + ' and ' + inp2
+    , bl = BufferList()
+  bl.write(inp1)
+  bl.write(' and ')
+  bl.write(inp2)
+  t.equal(exp, bl.toString())
+  t.equal(new Buffer(exp).toString('hex'), bl.toString('hex'))
+})
+
+tape('should emit finish', function (t) {
+  var source = BufferList()
+    , dest = BufferList()
+
+  source.write('hello')
+  source.pipe(dest)
+
+  dest.on('finish', function () {
+    t.equal(dest.toString('utf8'), 'hello')
+    t.end()
+  })
+})
+
+tape('basic copy', function (t) {
+  var buf  = crypto.randomBytes(1024)
+    , buf2 = new Buffer(1024)
+    , b    = BufferList(buf)
+
+  b.copy(buf2)
+  t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy after many appends', function (t) {
+  var buf  = crypto.randomBytes(512)
+    , buf2 = new Buffer(1024)
+    , b    = BufferList(buf)
+
+  b.append(buf)
+  b.copy(buf2)
+  t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy at a precise position', function (t) {
+  var buf  = crypto.randomBytes(1004)
+    , buf2 = new Buffer(1024)
+    , b    = BufferList(buf)
+
+  b.copy(buf2, 20)
+  t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy starting from a precise location', function (t) {
+  var buf  = crypto.randomBytes(10)
+    , buf2 = new Buffer(5)
+    , b    = BufferList(buf)
+
+  b.copy(buf2, 0, 5)
+  t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy in an interval', function (t) {
+  var rnd      = crypto.randomBytes(10)
+    , b        = BufferList(rnd) // put the random bytes there
+    , actual   = new Buffer(3)
+    , expected = new Buffer(3)
+
+  rnd.copy(expected, 0, 5, 8)
+  b.copy(actual, 0, 5, 8)
+
+  t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('copy an interval between two buffers', function (t) {
+  var buf      = crypto.randomBytes(10)
+    , buf2     = new Buffer(10)
+    , b        = BufferList(buf)
+
+  b.append(buf)
+  b.copy(buf2, 0, 5, 15)
+
+  t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
+  t.end()
+})
+
+tape('duplicate', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList('abcdefghij\xff\x00')
+    , dup = bl.duplicate()
+
+  t.equal(bl.prototype, dup.prototype)
+  t.equal(bl.toString('hex'), dup.toString('hex'))
+})
+
+tape('destroy no pipe', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
+  bl.destroy()
+
+  t.equal(bl._bufs.length, 0)
+  t.equal(bl.length, 0)
+})
+
+!process.browser && tape('destroy with pipe before read end', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList()
+  fs.createReadStream(__dirname + '/test.js')
+    .pipe(bl)
+
+  bl.destroy()
+
+  t.equal(bl._bufs.length, 0)
+  t.equal(bl.length, 0)
+
+})
+
+!process.browser && tape('destroy with pipe before read end with race', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList()
+  fs.createReadStream(__dirname + '/test.js')
+    .pipe(bl)
+
+  setTimeout(function () {
+    bl.destroy()
+    setTimeout(function () {
+      t.equal(bl._bufs.length, 0)
+      t.equal(bl.length, 0)
+    }, 500)
+  }, 500)
+})
+
+!process.browser && tape('destroy with pipe after read end', function (t) {
+  t.plan(2)
+
+  var bl = new BufferList()
+  fs.createReadStream(__dirname + '/test.js')
+    .on('end', onEnd)
+    .pipe(bl)
+
+  function onEnd () {
+    bl.destroy()
+
+    t.equal(bl._bufs.length, 0)
+    t.equal(bl.length, 0)
+  }
+})
+
+!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
+  t.plan(4)
+
+  var bl = new BufferList()
+    , ds = new BufferList()
+
+  fs.createReadStream(__dirname + '/test.js')
+    .on('end', onEnd)
+    .pipe(bl)
+
+  function onEnd () {
+    bl.pipe(ds)
+
+    setTimeout(function () {
+      bl.destroy()
+
+      t.equals(bl._bufs.length, 0)
+      t.equals(bl.length, 0)
+
+      ds.destroy()
+
+      t.equals(bl._bufs.length, 0)
+      t.equals(bl.length, 0)
+
+    }, 100)
+  }
+})
+
+!process.browser && tape('handle error', function (t) {
+  t.plan(2)
+  fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
+    t.ok(err instanceof Error, 'has error')
+    t.notOk(data, 'no data')
+  }))
+})
index 50e0855..2cd79ea 100644 (file)
   "devDependencies": {
     "tape": "^2.10.2"
   },
-  "readme": "## Caseless -- wrap an object to set and get property with caseless semantics but also preserve caseing.\n\nThis library is incredibly useful when working with HTTP headers. It allows you to get/set/check for headers in a caseless manner while also preserving the caseing of headers the first time they are set.\n\n## Usage\n\n```javascript\nvar headers = {}\n  , c = caseless(headers)\n  ;\nc.set('a-Header', 'asdf')\nc.get('a-header') === 'asdf'\n```\n\n## has(key)\n\nHas takes a name and if it finds a matching header will return that header name with the preserved caseing it was set with.\n\n```javascript\nc.has('a-header') === 'a-Header'\n```\n\n## set(key, value[, clobber=true])\n\nSet is fairly straight forward except that if the header exists and clobber is disabled it will add `','+value` to the existing header.\n\n```javascript\nc.set('a-Header', 'fdas')\nc.set('a-HEADER', 'more', false)\nc.get('a-header') === 'fdsa,more'\n```\n\n## swap(key)\n\nSwaps the casing of a header with the new one that is passed in.\n\n```javascript\nvar headers = {}\n  , c = caseless(headers)\n  ;\nc.set('a-Header', 'fdas')\nc.swap('a-HEADER')\nc.has('a-header') === 'a-HEADER'\nheaders === {'a-HEADER': 'fdas'}\n```\n",
-  "readmeFilename": "README.md",
+  "gitHead": "c578232a02cc2b46b6da8851caf57fdbfac89ff5",
   "homepage": "https://github.com/mikeal/caseless#readme",
   "_id": "caseless@0.11.0",
   "_shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7",
+  "_from": "caseless@>=0.11.0 <0.12.0",
+  "_npmVersion": "2.8.3",
+  "_nodeVersion": "1.8.1",
+  "_npmUser": {
+    "name": "mikeal",
+    "email": "mikeal.rogers@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "mikeal",
+      "email": "mikeal.rogers@gmail.com"
+    },
+    {
+      "name": "nylen",
+      "email": "jnylen@gmail.com"
+    },
+    {
+      "name": "simov",
+      "email": "simeonvelichkov@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "715b96ea9841593cc33067923f5ec60ebda4f7d7",
+    "tarball": "http://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/caseless/-/caseless-0.11.0.tgz",
-  "_from": "caseless@>=0.11.0 <0.12.0"
+  "readme": "ERROR: No README data found!"
 }
index 5741476..8ac66b8 100644 (file)
     "fake": "0.2.0",
     "far": "0.0.1"
   },
-  "readme": "# delayed-stream\n\nBuffers events from a stream until you are ready to handle them.\n\n## Installation\n\n``` bash\nnpm install delayed-stream\n```\n\n## Usage\n\nThe following example shows how to write a http echo server that delays its\nresponse by 1000 ms.\n\n``` javascript\nvar DelayedStream = require('delayed-stream');\nvar http = require('http');\n\nhttp.createServer(function(req, res) {\n  var delayed = DelayedStream.create(req);\n\n  setTimeout(function() {\n    res.writeHead(200);\n    delayed.pipe(res);\n  }, 1000);\n});\n```\n\nIf you are not using `Stream#pipe`, you can also manually release the buffered\nevents by calling `delayedStream.resume()`:\n\n``` javascript\nvar delayed = DelayedStream.create(req);\n\nsetTimeout(function() {\n  // Emit all buffered events and resume underlaying source\n  delayed.resume();\n}, 1000);\n```\n\n## Implementation\n\nIn order to use this meta stream properly, here are a few things you should\nknow about the implementation.\n\n### Event Buffering / Proxying\n\nAll events of the `source` stream are hijacked by overwriting the `source.emit`\nmethod. Until node implements a catch-all event listener, this is the only way.\n\nHowever, delayed-stream still continues to emit all events it captures on the\n`source`, regardless of whether you have released the delayed stream yet or\nnot.\n\nUpon creation, delayed-stream captures all `source` events and stores them in\nan internal event buffer. Once `delayedStream.release()` is called, all\nbuffered events are emitted on the `delayedStream`, and the event buffer is\ncleared. After that, delayed-stream merely acts as a proxy for the underlaying\nsource.\n\n### Error handling\n\nError events on `source` are buffered / proxied just like any other events.\nHowever, `delayedStream.create` attaches a no-op `'error'` listener to the\n`source`. This way you only have to handle errors on the `delayedStream`\nobject, rather than in two places.\n\n### Buffer limits\n\ndelayed-stream provides a `maxDataSize` property that can be used to limit\nthe amount of data being buffered. In order to protect you from bad `source`\nstreams that don't react to `source.pause()`, this feature is enabled by\ndefault.\n\n## API\n\n### DelayedStream.create(source, [options])\n\nReturns a new `delayedStream`. Available options are:\n\n* `pauseStream`\n* `maxDataSize`\n\nThe description for those properties can be found below.\n\n### delayedStream.source\n\nThe `source` stream managed by this object. This is useful if you are\npassing your `delayedStream` around, and you still want to access properties\non the `source` object.\n\n### delayedStream.pauseStream = true\n\nWhether to pause the underlaying `source` when calling\n`DelayedStream.create()`. Modifying this property afterwards has no effect.\n\n### delayedStream.maxDataSize = 1024 * 1024\n\nThe amount of data to buffer before emitting an `error`.\n\nIf the underlaying source is emitting `Buffer` objects, the `maxDataSize`\nrefers to bytes.\n\nIf the underlaying source is emitting JavaScript strings, the size refers to\ncharacters.\n\nIf you know what you are doing, you can set this property to `Infinity` to\ndisable this feature. You can also modify this property during runtime.\n\n### delayedStream.dataSize = 0\n\nThe amount of data buffered so far.\n\n### delayedStream.readable\n\nAn ECMA5 getter that returns the value of `source.readable`.\n\n### delayedStream.resume()\n\nIf the `delayedStream` has not been released so far, `delayedStream.release()`\nis called.\n\nIn either case, `source.resume()` is called.\n\n### delayedStream.pause()\n\nCalls `source.pause()`.\n\n### delayedStream.pipe(dest)\n\nCalls `delayedStream.resume()` and then proxies the arguments to `source.pipe`.\n\n### delayedStream.release()\n\nEmits and clears all events that have been buffered up so far. This does not\nresume the underlaying source, use `delayedStream.resume()` instead.\n\n## License\n\ndelayed-stream is licensed under the MIT license.\n",
-  "readmeFilename": "Readme.md",
+  "gitHead": "07a9dc99fb8f1a488160026b9ad77493f766fb84",
   "bugs": {
     "url": "https://github.com/felixge/node-delayed-stream/issues"
   },
   "_id": "delayed-stream@1.0.0",
   "_shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619",
+  "_from": "delayed-stream@>=1.0.0 <1.1.0",
+  "_npmVersion": "2.8.3",
+  "_nodeVersion": "1.6.4",
+  "_npmUser": {
+    "name": "apechimp",
+    "email": "apeherder@gmail.com"
+  },
+  "dist": {
+    "shasum": "df3ae199acadfb7d440aaae0b29e2272b24ec619",
+    "tarball": "http://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "felixge",
+      "email": "felix@debuggable.com"
+    },
+    {
+      "name": "apechimp",
+      "email": "apeherder@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
-  "_from": "delayed-stream@>=1.0.0 <1.1.0"
+  "readme": "ERROR: No README data found!"
 }
index 56a56db..e0cd160 100644 (file)
     "far": "~0.0.7"
   },
   "license": "MIT",
-  "readme": "# combined-stream\n\nA stream that emits multiple other streams one after another.\n\n**NB** Currently `combined-stream` works with streams vesrion 1 only. There is ongoing effort to switch this library to streams version 2. Any help is welcome. :) Meanwhile you can explore other libraries that provide streams2 support with more or less compatability with `combined-stream`.\n\n- [combined-stream2](https://www.npmjs.com/package/combined-stream2): A drop-in streams2-compatible replacement for the combined-stream module.\n\n- [multistream](https://www.npmjs.com/package/multistream): A stream that emits multiple other streams one after another.\n\n## Installation\n\n``` bash\nnpm install combined-stream\n```\n\n## Usage\n\nHere is a simple example that shows how you can use combined-stream to combine\ntwo files into one:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nWhile the example above works great, it will pause all source streams until\nthey are needed. If you don't want that to happen, you can set `pauseStreams`\nto `false`:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create({pauseStreams: false});\ncombinedStream.append(fs.createReadStream('file1.txt'));\ncombinedStream.append(fs.createReadStream('file2.txt'));\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\nHowever, what if you don't have all the source streams yet, or you don't want\nto allocate the resources (file descriptors, memory, etc.) for them right away?\nWell, in that case you can simply provide a callback that supplies the stream\nby calling a `next()` function:\n\n``` javascript\nvar CombinedStream = require('combined-stream');\nvar fs = require('fs');\n\nvar combinedStream = CombinedStream.create();\ncombinedStream.append(function(next) {\n  next(fs.createReadStream('file1.txt'));\n});\ncombinedStream.append(function(next) {\n  next(fs.createReadStream('file2.txt'));\n});\n\ncombinedStream.pipe(fs.createWriteStream('combined.txt'));\n```\n\n## API\n\n### CombinedStream.create([options])\n\nReturns a new combined stream object. Available options are:\n\n* `maxDataSize`\n* `pauseStreams`\n\nThe effect of those options is described below.\n\n### combinedStream.pauseStreams = `true`\n\nWhether to apply back pressure to the underlaying streams. If set to `false`,\nthe underlaying streams will never be paused. If set to `true`, the\nunderlaying streams will be paused right after being appended, as well as when\n`delayedStream.pipe()` wants to throttle.\n\n### combinedStream.maxDataSize = `2 * 1024 * 1024`\n\nThe maximum amount of bytes (or characters) to buffer for all source streams.\nIf this value is exceeded, `combinedStream` emits an `'error'` event.\n\n### combinedStream.dataSize = `0`\n\nThe amount of bytes (or characters) currently buffered by `combinedStream`.\n\n### combinedStream.append(stream)\n\nAppends the given `stream` to the combinedStream object. If `pauseStreams` is\nset to `true, this stream will also be paused right away.\n\n`streams` can also be a function that takes one parameter called `next`. `next`\nis a function that must be invoked in order to provide the `next` stream, see\nexample above.\n\nRegardless of how the `stream` is appended, combined-stream always attaches an\n`'error'` listener to it, so you don't have to do that manually.\n\nSpecial case: `stream` can also be a String or Buffer.\n\n### combinedStream.write(data)\n\nYou should not call this, `combinedStream` takes care of piping the appended\nstreams into itself for you.\n\n### combinedStream.resume()\n\nCauses `combinedStream` to start drain the streams it manages. The function is\nidempotent, and also emits a `'resume'` event each time which usually goes to\nthe stream that is currently being drained.\n\n### combinedStream.pause();\n\nIf `combinedStream.pauseStreams` is set to `false`, this does nothing.\nOtherwise a `'pause'` event is emitted, this goes to the stream that is\ncurrently being drained, so you can use it to apply back pressure.\n\n### combinedStream.end();\n\nSets `combinedStream.writable` to false, emits an `'end'` event, and removes\nall streams from the queue.\n\n### combinedStream.destroy();\n\nSame as `combinedStream.end()`, except it emits a `'close'` event instead of\n`'end'`.\n\n## License\n\ncombined-stream is licensed under the MIT license.\n",
-  "readmeFilename": "Readme.md",
+  "gitHead": "cfc7b815d090a109bcedb5bb0f6713148d55a6b7",
   "bugs": {
     "url": "https://github.com/felixge/node-combined-stream/issues"
   },
   "_id": "combined-stream@1.0.5",
   "_shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009",
+  "_from": "combined-stream@>=1.0.5 <1.1.0",
+  "_npmVersion": "2.10.1",
+  "_nodeVersion": "0.12.4",
+  "_npmUser": {
+    "name": "alexindigo",
+    "email": "iam@alexindigo.com"
+  },
+  "dist": {
+    "shasum": "938370a57b4a51dea2c77c15d5c5fdf895164009",
+    "tarball": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "felixge",
+      "email": "felix@debuggable.com"
+    },
+    {
+      "name": "celer",
+      "email": "dtyree77@gmail.com"
+    },
+    {
+      "name": "alexindigo",
+      "email": "iam@alexindigo.com"
+    },
+    {
+      "name": "apechimp",
+      "email": "apeherder@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.5.tgz",
-  "_from": "combined-stream@>=1.0.5 <1.1.0"
+  "readme": "ERROR: No README data found!"
 }
diff --git a/deps/npm/node_modules/request/node_modules/extend/.eslintrc b/deps/npm/node_modules/request/node_modules/extend/.eslintrc
deleted file mode 100644 (file)
index d49f173..0000000
+++ /dev/null
@@ -1,192 +0,0 @@
-{
-       "env": {
-               "browser": false,
-               "node": true,
-               "amd": false,
-               "mocha": false,
-               "jasmine": false
-       },
-
-       "rules": {
-               "accessor-pairs": [2, { getWithoutSet: false, setWithoutGet: true }],
-               "array-bracket-spacing": [2, "never", {
-                       "singleValue": false,
-                       "objectsInArrays": false,
-                       "arraysInArrays": false
-               }],
-               "block-scoped-var": [0],
-               "brace-style": [2, "1tbs", { "allowSingleLine": true }],
-               "camelcase": [2],
-               "comma-dangle": [2, "never"],
-               "comma-spacing": [2],
-               "comma-style": [2, "last"],
-               "complexity": [2, 15],
-               "computed-property-spacing": [2, "never"],
-               "consistent-return": [2],
-               "consistent-this": [0, "that"],
-               "constructor-super": [2],
-               "curly": [2, "all"],
-               "default-case": [2],
-               "dot-notation": [2, { "allowKeywords": true }],
-               "eol-last": [2],
-               "eqeqeq": [2],
-               "func-names": [0],
-               "func-style": [2, "expression"],
-               "generator-star-spacing": [2, { "before": false, "after": true }],
-               "global-strict": [0, "never"],
-               "guard-for-in": [0],
-               "handle-callback-err": [0],
-               "key-spacing": [2, { "beforeColon": false, "afterColon": true }],
-               "linebreak-style": [2, "unix"],
-               "lines-around-comment": [2, {
-                       "beforeBlockComment": false,
-                       "afterBlockComment": false,
-                       "beforeLineComment": false,
-                       "beforeLineComment": false,
-                       "allowBlockStart": true,
-                       "allowBlockEnd": true
-               }],
-               "quotes": [2, "single", "avoid-escape"],
-               "max-depth": [1, 4],
-               "max-len": [0, 80, 4],
-               "max-nested-callbacks": [2, 2],
-               "max-params": [2, 2],
-               "max-statements": [2, 21],
-               "new-parens": [2],
-               "new-cap": [2],
-               "newline-after-var": [0],
-               "no-alert": [2],
-               "no-array-constructor": [2],
-               "no-bitwise": [0],
-               "no-caller": [2],
-               "no-catch-shadow": [2],
-               "no-cond-assign": [2],
-               "no-console": [2],
-               "no-constant-condition": [2],
-               "no-continue": [2],
-               "no-control-regex": [2],
-               "no-debugger": [2],
-               "no-delete-var": [2],
-               "no-div-regex": [0],
-               "no-dupe-args": [2],
-               "no-dupe-keys": [2],
-               "no-duplicate-case": [2],
-               "no-else-return": [0],
-               "no-empty": [2],
-               "no-empty-character-class": [2],
-               "no-empty-label": [2],
-               "no-eq-null": [0],
-               "no-eval": [2],
-               "no-ex-assign": [2],
-               "no-extend-native": [2],
-               "no-extra-bind": [2],
-               "no-extra-boolean-cast": [2],
-               "no-extra-parens": [0],
-               "no-extra-semi": [2],
-               "no-fallthrough": [2],
-               "no-floating-decimal": [2],
-               "no-func-assign": [2],
-               "no-implied-eval": [2],
-               "no-inline-comments": [0],
-               "no-inner-declarations": [2, "functions"],
-               "no-invalid-regexp": [2],
-               "no-irregular-whitespace": [2],
-               "no-iterator": [2],
-               "no-label-var": [2],
-               "no-labels": [2],
-               "no-lone-blocks": [2],
-               "no-lonely-if": [2],
-               "no-loop-func": [2],
-               "no-mixed-requires": [0, false],
-               "no-mixed-spaces-and-tabs": [2, false],
-               "no-multi-spaces": [2],
-               "no-multi-str": [2],
-               "no-multiple-empty-lines": [2, {"max": 1}],
-               "no-native-reassign": [2],
-               "no-negated-in-lhs": [2],
-               "no-nested-ternary": [0],
-               "no-new": [2],
-               "no-new-func": [2],
-               "no-new-object": [2],
-               "no-new-require": [0],
-               "no-new-wrappers": [2],
-               "no-obj-calls": [2],
-               "no-octal": [2],
-               "no-octal-escape": [2],
-               "no-param-reassign": [2],
-               "no-path-concat": [0],
-               "no-plusplus": [0],
-               "no-process-env": [0],
-               "no-process-exit": [2],
-               "no-proto": [2],
-               "no-redeclare": [2],
-               "no-regex-spaces": [2],
-               "no-reserved-keys": [2],
-               "no-restricted-modules": [0],
-               "no-return-assign": [2, "always"],
-               "no-script-url": [2],
-               "no-self-compare": [0],
-               "no-sequences": [2],
-               "no-shadow": [2],
-               "no-shadow-restricted-names": [2],
-               "no-space-before-semi": [2],
-               "no-spaced-func": [2],
-               "no-sparse-arrays": [2],
-               "no-sync": [0],
-               "no-ternary": [0],
-               "no-this-before-super": [2],
-               "no-throw-literal": [2],
-               "no-trailing-spaces": [2, { "skipBlankLines": false }],
-               "no-undef": [2],
-               "no-undef-init": [2],
-               "no-undefined": [0],
-               "no-underscore-dangle": [2],
-               "no-unexpected-multiline": [2],
-               "no-unneeded-ternary": [2],
-               "no-unreachable": [2],
-               "no-unused-expressions": [2],
-               "no-unused-vars": [2, { "vars": "all", "args": "after-used" }],
-               "no-use-before-define": [2],
-               "no-void": [0],
-               "no-warning-comments": [0, { "terms": ["todo", "fixme", "xxx"], "location": "start" }],
-               "no-with": [2],
-               "no-wrap-func": [2],
-               "object-curly-spacing": [2, "always"],
-               "object-shorthand": [2, "never"],
-               "one-var": [0],
-               "operator-assignment": [0, "always"],
-               "operator-linebreak": [2, "none"],
-               "padded-blocks": [0],
-               "prefer-const": [0],
-               "quote-props": [0],
-               "radix": [0],
-               "semi": [2],
-               "semi-spacing": [2, { "before": false, "after": true }],
-               "sort-vars": [0],
-               "space-after-keywords": [2, "always"],
-               "space-before-function-paren": [2, { "anonymous": "always", "named": "never" }],
-               "space-before-blocks": [0, "always"],
-               "space-in-brackets": [0, "never", {
-                       "singleValue": true,
-                       "arraysInArrays": false,
-                       "arraysInObjects": false,
-                       "objectsInArrays": true,
-                       "objectsInObjects": true,
-                       "propertyName": false
-               }],
-               "space-in-parens": [2, "never"],
-               "space-infix-ops": [2],
-               "space-return-throw-case": [2],
-               "space-unary-ops": [2, { "words": true, "nonwords": false }],
-               "spaced-comment": [2, "always"],
-               "spaced-line-comment": [0, "always"],
-               "strict": [2, "global"],
-               "use-isnan": [2],
-               "valid-jsdoc": [0],
-               "valid-typeof": [2],
-               "vars-on-top": [0],
-               "wrap-iife": [2],
-               "wrap-regex": [2],
-               "yoda": [2, "never", { "exceptRange": true, "onlyEquality": false }]
-       }
-}
index 5c87f64..c8c7cac 100644 (file)
     "eslint": "^0.24.0"
   },
   "license": "MIT",
-  "readme": "[![Build Status][travis-svg]][travis-url]\n[![dependency status][deps-svg]][deps-url]\n[![dev dependency status][dev-deps-svg]][dev-deps-url]\n\n# extend() for Node.js <sup>[![Version Badge][npm-version-png]][npm-url]</sup>\n\n`node-extend` is a port of the classic extend() method from jQuery. It behaves as you expect. It is simple, tried and true.\n\n## Installation\n\nThis package is available on [npm][npm-url] as: `extend`\n\n``` sh\nnpm install extend\n```\n\n## Usage\n\n**Syntax:** extend **(** [`deep`], `target`, `object1`, [`objectN`] **)**\n\n*Extend one object with one or more others, returning the modified object.*\n\nKeep in mind that the target object will be modified, and will be returned from extend().\n\nIf a boolean true is specified as the first argument, extend performs a deep copy, recursively copying any objects it finds. Otherwise, the copy will share structure with the original object(s).\nUndefined properties are not copied. However, properties inherited from the object's prototype will be copied over.\nWarning: passing `false` as the first argument is not supported.\n\n### Arguments\n\n* `deep` *Boolean* (optional)\nIf set, the merge becomes recursive (i.e. deep copy).\n* `target`\t*Object*\nThe object to extend.\n* `object1`\t*Object*\nThe object that will be merged into the first.\n* `objectN` *Object* (Optional)\nMore objects to merge into the first.\n\n## License\n\n`node-extend` is licensed under the [MIT License][mit-license-url].\n\n## Acknowledgements\n\nAll credit to the jQuery authors for perfecting this amazing utility.\n\nPorted to Node.js by [Stefan Thomas][github-justmoon] with contributions by [Jonathan Buchanan][github-insin] and [Jordan Harband][github-ljharb].\n\n[travis-svg]: https://travis-ci.org/justmoon/node-extend.svg\n[travis-url]: https://travis-ci.org/justmoon/node-extend\n[npm-url]: https://npmjs.org/package/extend\n[mit-license-url]: http://opensource.org/licenses/MIT\n[github-justmoon]: https://github.com/justmoon\n[github-insin]: https://github.com/insin\n[github-ljharb]: https://github.com/ljharb\n[npm-version-png]: http://vb.teelaun.ch/justmoon/node-extend.svg\n[deps-svg]: https://david-dm.org/justmoon/node-extend.svg\n[deps-url]: https://david-dm.org/justmoon/node-extend\n[dev-deps-svg]: https://david-dm.org/justmoon/node-extend/dev-status.svg\n[dev-deps-url]: https://david-dm.org/justmoon/node-extend#info=devDependencies\n\n",
-  "readmeFilename": "README.md",
+  "gitHead": "148e7270cab2e9413af2cd0cab147070d755ed6d",
   "bugs": {
     "url": "https://github.com/justmoon/node-extend/issues"
   },
   "homepage": "https://github.com/justmoon/node-extend#readme",
   "_id": "extend@3.0.0",
   "_shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4",
+  "_from": "extend@>=3.0.0 <3.1.0",
+  "_npmVersion": "2.11.3",
+  "_nodeVersion": "2.3.1",
+  "_npmUser": {
+    "name": "ljharb",
+    "email": "ljharb@gmail.com"
+  },
+  "dist": {
+    "shasum": "5a474353b9f3353ddd8176dfd37b91c83a46f1d4",
+    "tarball": "http://registry.npmjs.org/extend/-/extend-3.0.0.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "justmoon",
+      "email": "justmoon@members.fsf.org"
+    },
+    {
+      "name": "ljharb",
+      "email": "ljharb@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz",
-  "_from": "extend@>=3.0.0 <3.1.0"
+  "readme": "ERROR: No README data found!"
 }
index 1d672c1..f57036b 100644 (file)
   "engines": {
     "node": "*"
   },
-  "readme": "forever-agent\n=============\n\nHTTP Agent that keeps socket connections alive between keep-alive requests. Formerly part of mikeal/request, now a standalone module.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "1b3b6163f2b3c2c4122bbfa288c1325c0df9871d",
   "bugs": {
     "url": "https://github.com/mikeal/forever-agent/issues"
   },
-  "homepage": "https://github.com/mikeal/forever-agent#readme",
+  "homepage": "https://github.com/mikeal/forever-agent",
   "_id": "forever-agent@0.6.1",
+  "scripts": {},
   "_shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
+  "_from": "forever-agent@>=0.6.1 <0.7.0",
+  "_npmVersion": "1.4.28",
+  "_npmUser": {
+    "name": "simov",
+    "email": "simeonvelichkov@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "mikeal",
+      "email": "mikeal.rogers@gmail.com"
+    },
+    {
+      "name": "nylen",
+      "email": "jnylen@gmail.com"
+    },
+    {
+      "name": "simov",
+      "email": "simeonvelichkov@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "fbc71f0c41adeb37f96c577ad1ed42d8fdacca91",
+    "tarball": "http://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz",
-  "_from": "forever-agent@>=0.6.1 <0.7.0"
+  "readme": "ERROR: No README data found!"
 }
index b7a40dd..fcb2b2c 100644 (file)
@@ -1,3 +1,15 @@
+# v1.5.2
+- Allow using `"consructor"` as an argument in `memoize` (#998)
+- Give a better error messsage when `auto` dependency checking fails (#994)
+- Various doc updates (#936, #956, #979, #1002)
+
+# v1.5.1
+- Fix issue with `pause` in `queue` with concurrency enabled (#946)
+- `while` and `until` now pass the final result to callback (#963)
+- `auto` will properly handle concurrency when there is no callback (#966)
+- `auto` will now  properly stop execution when an error occurs (#988, #993)
+- Various doc fixes (#971, #980)
+
 # v1.5.0
 
 - Added `transform`, analogous to [`_.transform`](http://lodash.com/docs#transform) (#892)
index 071d069..3a0f017 100644 (file)
@@ -627,9 +627,9 @@ __Arguments__
 * `iterator(item, callback)` - A truth test to apply to each item in the array
   in parallel. The iterator is passed a `callback(truthValue)` which must be
   called with a  boolean argument once it has completed.
-* `callback(result)` - *Optional* A callback which is called after all the `iterator`
-  functions have finished. Result will be either `true` or `false` depending on
-  the values of the async tests.
+* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns
+  `false`, or after all the iterator functions have finished. Result will be
+  either `true` or `false` depending on the values of the async tests.
 
  **Note: the callbacks do not take an error as their first argument.**
 
@@ -773,7 +773,7 @@ __Arguments__
   a `callback(err, result)` which it must call on completion with an error `err`
   (which can be `null`) and an optional `result` value.
 * `callback(err, results)` - An optional callback to run once all the functions
-  have completed. This function gets a results array (or object) containing all
+  have completed successfully. This function gets a results array (or object) containing all
   the result arguments passed to the task callbacks.
 
 __Example__
@@ -834,8 +834,9 @@ __Arguments__
 * `fn(callback)` - A function which is called each time `test` passes. The function is
   passed a `callback(err)`, which must be called once it has completed with an
   optional `err` argument.
-* `callback(err)` - A callback which is called after the test fails and repeated
-  execution of `fn` has stopped.
+* `callback(err, [results])` - A callback which is called after the test
+  function has failed and repeated execution of `fn` has stopped. `callback`
+  will be passed an error and any arguments passed to the final `fn`'s callback.
 
 __Example__
 
@@ -846,10 +847,12 @@ async.whilst(
     function () { return count < 5; },
     function (callback) {
         count++;
-        setTimeout(callback, 1000);
+        setTimeout(function () {
+            callback(null, count);
+        }, 1000);
     },
-    function (err) {
-        // 5 seconds have passed
+    function (err, n) {
+        // 5 seconds have passed, n = 5
     }
 );
 ```
@@ -870,7 +873,8 @@ the order of operations, the arguments `test` and `fn` are switched.
 ### until(test, fn, callback)
 
 Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
-or an error occurs.
+or an error occurs. `callback` will be passed an error and any arguments passed
+to the final `fn`'s callback.
 
 The inverse of [`whilst`](#whilst).
 
@@ -981,6 +985,52 @@ async.waterfall([
     // result now equals 'done'
 });
 ```
+Or, with named functions:
+
+```js
+async.waterfall([
+    myFirstFunction,
+    mySecondFunction,
+    myLastFunction,
+], function (err, result) {
+    // result now equals 'done'
+});
+function myFirstFunction(callback) {
+  callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+  // arg1 now equals 'one' and arg2 now equals 'two'
+  callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+  // arg1 now equals 'three'
+  callback(null, 'done');
+}
+```
+
+Or, if you need to pass any argument to the first function:
+
+```js
+async.waterfall([
+    async.apply(myFirstFunction, 'zero'),
+    mySecondFunction,
+    myLastFunction,
+], function (err, result) {
+    // result now equals 'done'
+});
+function myFirstFunction(arg1, callback) {
+  // arg1 now equals 'zero'
+  callback(null, 'one', 'two');
+}
+function mySecondFunction(arg1, arg2, callback) {
+  // arg1 now equals 'one' and arg2 now equals 'two'
+  callback(null, 'three');
+}
+function myLastFunction(arg1, callback) {
+  // arg1 now equals 'three'
+  callback(null, 'done');
+}
+```
 
 ---------------------------------------
 <a name="compose" />
@@ -1395,8 +1445,10 @@ result (if any) of the final attempt.
 
 __Arguments__
 
-* `opts` - Can be either an object with `times` and `interval` or a number. `times` is how many attempts should be made before giving up. `interval` is how long to wait inbetween attempts. Defaults to {times: 5, interval: 0}
-  * if a number is passed in it sets `times` only (with `interval` defaulting to 0).
+* `opts` - Can be either an object with `times` and `interval` or a number.
+  * `times` - The number of attempts to make before giving up.  The default is `5`.
+  * `interval` - The time to wait between retries, in milliseconds.  The default is `0`.
+  * If `opts` is a number, the number specifies the number of times to retry, with the default interval of `0`.
 * `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
   which must be called when finished, passing `err` (which can be `null`) and the `result` of
   the function's execution, and (2) a `results` object, containing the results of
@@ -1404,21 +1456,29 @@ __Arguments__
 * `callback(err, results)` - An optional callback which is called when the
   task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
 
-The [`retry`](#retry) function can be used as a stand-alone control flow by passing a
-callback, as shown below:
+The [`retry`](#retry) function can be used as a stand-alone control flow by passing a callback, as shown below:
 
 ```js
+// try calling apiMethod 3 times
 async.retry(3, apiMethod, function(err, result) {
     // do something with the result
 });
 ```
 
 ```js
+// try calling apiMethod 3 times, waiting 200 ms between each retry
 async.retry({times: 3, interval: 200}, apiMethod, function(err, result) {
     // do something with the result
 });
 ```
 
+```js
+// try calling apiMethod the default 5 times no delay between each retry
+async.retry(apiMethod, function(err, result) {
+    // do something with the result
+});
+```
+
 It can also be embedded within other control flow functions to retry individual methods
 that are not as reliable, like this:
 
@@ -1723,6 +1783,32 @@ async.waterfall([
 ], callback)
 ```
 
+If the function passed to `asyncify` returns a Promise, that promises's resolved/rejected state will be used to call the callback, rather than simply the synchronous return value.  Example:
+
+```js
+async.waterfall([
+  async.apply(fs.readFile, filename, "utf8"),
+  async.asyncify(function (contents) {
+    return db.model.create(contents);
+  }),
+  function (model, next) {
+    // `model` is the instantiated model object.
+    // If there was an error, this function would be skipped.
+  }
+], callback)
+```
+
+This also means you can asyncify ES2016 `async` functions.
+
+```js
+var q = async.queue(async.asyncify(async function (file) {
+  var intermediateStep = await processFile(file);
+  return await somePromise(intermediateStep)
+}));
+
+q.push(files);
+```
+
 ---------------------------------------
 
 <a name="log" />
index 8889344..ee0a268 100644 (file)
     };
 
     async.auto = function (tasks, concurrency, callback) {
-        if (!callback) {
+        if (typeof arguments[1] === 'function') {
             // concurrency is optional, shift the args.
             callback = concurrency;
             concurrency = null;
         var results = {};
         var runningTasks = 0;
 
+        var hasError = false;
+
         var listeners = [];
         function addListener(fn) {
             listeners.unshift(fn);
         });
 
         _arrayEach(keys, function (k) {
+            if (hasError) return;
             var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
             var taskCallback = _restParam(function(err, args) {
                 runningTasks--;
                         safeResults[rkey] = val;
                     });
                     safeResults[k] = args;
+                    hasError = true;
+
                     callback(err, safeResults);
                 }
                 else {
             var dep;
             while (len--) {
                 if (!(dep = tasks[requires[len]])) {
-                    throw new Error('Has inexistant dependency');
+                    throw new Error('Has nonexistent dependency in ' + requires.join(', '));
                 }
                 if (_isArray(dep) && _indexOf(dep, k) >= 0) {
                     throw new Error('Has cyclic dependencies');
                 } else if (test.apply(this, args)) {
                     iterator(next);
                 } else {
-                    callback(null);
+                    callback.apply(null, [null].concat(args));
                 }
             });
             iterator(next);
                 _insert(q, data, true, callback);
             },
             process: function () {
-                if (!q.paused && workers < q.concurrency && q.tasks.length) {
-                    while(workers < q.concurrency && q.tasks.length){
-                        var tasks = q.payload ?
-                            q.tasks.splice(0, q.payload) :
-                            q.tasks.splice(0, q.tasks.length);
-
-                        var data = _map(tasks, function (task) {
-                            return task.data;
-                        });
+                while(!q.paused && workers < q.concurrency && q.tasks.length){
 
-                        if (q.tasks.length === 0) {
-                            q.empty();
-                        }
-                        workers += 1;
-                        workersList.push(tasks[0]);
-                        var cb = only_once(_next(q, tasks));
-                        worker(data, cb);
+                    var tasks = q.payload ?
+                        q.tasks.splice(0, q.payload) :
+                        q.tasks.splice(0, q.tasks.length);
+
+                    var data = _map(tasks, function (task) {
+                        return task.data;
+                    });
+
+                    if (q.tasks.length === 0) {
+                        q.empty();
                     }
+                    workers += 1;
+                    workersList.push(tasks[0]);
+                    var cb = only_once(_next(q, tasks));
+                    worker(data, cb);
                 }
             },
             length: function () {
     async.memoize = function (fn, hasher) {
         var memo = {};
         var queues = {};
+        var has = Object.prototype.hasOwnProperty;
         hasher = hasher || identity;
         var memoized = _restParam(function memoized(args) {
             var callback = args.pop();
             var key = hasher.apply(null, args);
-            if (key in memo) {
+            if (has.call(memo, key)) {
                 async.setImmediate(function () {
                     callback.apply(null, memo[key]);
                 });
             }
-            else if (key in queues) {
+            else if (has.call(queues, key)) {
                 queues[key].push(callback);
             }
             else {
index b947fc4..2490016 100644 (file)
@@ -1,2 +1,2 @@
-!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function a(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function f(n){return a(Array(n),function(n,t){return t})}function l(n,t,e){return c(n,function(n,r,u){e=t(e,n,r,u)}),e}function s(n,t){c(W(n),function(e){t(n[e],e)})}function p(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function h(n){var t,e,r=-1;return o(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(C.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(C.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function I(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function x(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?C.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void C.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){if(!s.paused&&f<s.concurrency&&s.tasks.length)for(;f<s.concurrency&&s.tasks.length;){var n=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=a(n,function(n){return n.data});0===s.tasks.length&&s.empty(),f+=1,l.push(n[0]);var r=u(o(s,n));t(e,r)}},length:function(){return s.tasks.length},running:function(){return f},workersList:function(){return l},idle:function(){return s.tasks.length+f===0},pause:function(){s.paused=!0},resume:function(){if(s.paused!==!1){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),t=1;n>=t;t++)C.setImmediate(s.process)}}};return s}function j(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?C.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,C={},P="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=P&&(q=P.async),C.noConflict=function(){return P.async=q,C};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?C.nextTick=process.nextTick:C.nextTick=D,C.setImmediate=B?D:C.nextTick,C.forEach=C.each=function(n,t,e){return C.eachOf(n,y(t),e)},C.forEachSeries=C.eachSeries=function(n,t,e){return C.eachOfSeries(n,y(t),e)},C.forEachLimit=C.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},C.forEachOf=C.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},C.forEachOfSeries=C.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?C.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},C.forEachOfLimit=C.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},C.map=d(b),C.mapSeries=k(b),C.mapLimit=g(b),C.inject=C.foldl=C.reduce=function(n,t,e,r){C.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},C.foldr=C.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();C.reduce(i,e,r,u)},C.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),C.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},C.select=C.filter=d(w),C.selectLimit=C.filterLimit=g(w),C.selectSeries=C.filterSeries=k(w),C.reject=d(O),C.rejectLimit=g(O),C.rejectSeries=k(O),C.any=C.some=S(C.eachOf,e,t),C.someLimit=S(C.eachOfLimit,e,t),C.all=C.every=S(C.eachOf,r,r),C.everyLimit=S(C.eachOfLimit,r,r),C.detect=S(C.eachOf,t,E),C.detectSeries=S(C.eachOfSeries,t,E),C.detectLimit=S(C.eachOfLimit,t,E),C.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}C.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},C.auto=function(t,e,r){function u(n){d.unshift(n)}function o(n){var t=p(d,n);t>=0&&d.splice(t,1)}function a(){h--,c(d.slice(0),function(n){n()})}r||(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(g,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](d,y))}for(var f,h=M(t[n])?t[n]:[t[n]],d=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,r(t,u)}else y[n]=e,C.setImmediate(a)}),g=h.slice(0,h.length-1),k=g.length;k--;){if(!(f=t[g[k]]))throw new Error("Has inexistant dependency");if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](d,y)):u(c)})},C.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}C.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},C.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(C.iterator(t))():e()},C.parallel=function(n,t){L(C.eachOf,n,t)},C.parallelLimit=function(n,t,e){L(v(t),n,e)},C.series=function(n,t){L(C.eachOfSeries,n,t)},C.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},C.apply=m(function(n,t){return m(function(e){return n.apply(null,t.concat(e))})}),C.concat=d(I),C.concatSeries=k(I),C.whilst=function(t,e,r){if(r=r||n,t()){var u=m(function(n,i){n?r(n):t.apply(this,i)?e(u):r(null)});e(u)}else r(null)},C.doWhilst=function(n,t,e){var r=0;return C.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},C.until=function(n,t,e){return C.whilst(function(){return!n.apply(this,arguments)},t,e)},C.doUntil=function(n,t,e){return C.doWhilst(n,function(){return!t.apply(this,arguments)},e)},C.during=function(t,e,r){r=r||n;var u=m(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},C.doDuring=function(n,t,e){var r=0;C.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},C.queue=function(n,t){var e=x(function(t,e){n(t[0],e)},t,1);return e},C.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?C.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),C.setImmediate(t.process)})}var o=C.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},C.cargo=function(n,t){return x(n,1,t)},C.log=j("log"),C.dir=j("dir"),C.memoize=function(n,e){var r={},u={};e=e||t;var i=m(function(t){var i=t.pop(),o=e.apply(null,t);o in r?C.setImmediate(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,t.concat([m(function(n){r[o]=n;var t=u[o];delete u[o];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return i.memo=r,i.unmemoized=n,i},C.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},C.times=A(C.map),C.timesSeries=A(C.mapSeries),C.timesLimit=function(n,t,e,r){return C.mapLimit(f(n),t,e,r)},C.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,C.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},C.compose=function(){return C.seq.apply(null,Array.prototype.reverse.call(arguments))},C.applyEach=T(C.eachOf),C.applyEachSeries=T(C.eachOfSeries),C.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},C.ensureAsync=z,C.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),C.wrapSync=C.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=C:"function"==typeof define&&define.amd?define([],function(){return C}):P.async=C}();
+!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function a(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function f(n){return a(Array(n),function(n,t){return t})}function l(n,t,e){return c(n,function(n,r,u){e=t(e,n,r,u)}),e}function s(n,t){c(W(n),function(e){t(n[e],e)})}function p(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function h(n){var t,e,r=-1;return o(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(P.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(P.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function j(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function I(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?P.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void P.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){for(;!s.paused&&f<s.concurrency&&s.tasks.length;){var n=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=a(n,function(n){return n.data});0===s.tasks.length&&s.empty(),f+=1,l.push(n[0]);var r=u(o(s,n));t(e,r)}},length:function(){return s.tasks.length},running:function(){return f},workersList:function(){return l},idle:function(){return s.tasks.length+f===0},pause:function(){s.paused=!0},resume:function(){if(s.paused!==!1){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),t=1;n>=t;t++)P.setImmediate(s.process)}}};return s}function x(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?P.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,P={},C="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=C&&(q=C.async),P.noConflict=function(){return C.async=q,P};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?P.nextTick=process.nextTick:P.nextTick=D,P.setImmediate=B?D:P.nextTick,P.forEach=P.each=function(n,t,e){return P.eachOf(n,y(t),e)},P.forEachSeries=P.eachSeries=function(n,t,e){return P.eachOfSeries(n,y(t),e)},P.forEachLimit=P.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},P.forEachOf=P.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},P.forEachOfSeries=P.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?P.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},P.forEachOfLimit=P.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},P.map=d(b),P.mapSeries=k(b),P.mapLimit=g(b),P.inject=P.foldl=P.reduce=function(n,t,e,r){P.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},P.foldr=P.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();P.reduce(i,e,r,u)},P.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),P.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},P.select=P.filter=d(w),P.selectLimit=P.filterLimit=g(w),P.selectSeries=P.filterSeries=k(w),P.reject=d(O),P.rejectLimit=g(O),P.rejectSeries=k(O),P.any=P.some=S(P.eachOf,e,t),P.someLimit=S(P.eachOfLimit,e,t),P.all=P.every=S(P.eachOf,r,r),P.everyLimit=S(P.eachOfLimit,r,r),P.detect=S(P.eachOf,t,E),P.detectSeries=S(P.eachOfSeries,t,E),P.detectLimit=S(P.eachOfLimit,t,E),P.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}P.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},P.auto=function(t,e,r){function u(n){g.unshift(n)}function o(n){var t=p(g,n);t>=0&&g.splice(t,1)}function a(){h--,c(g.slice(0),function(n){n()})}"function"==typeof arguments[1]&&(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,g=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(k,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](g,y))}if(!d){for(var f,h=M(t[n])?t[n]:[t[n]],g=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,d=!0,r(t,u)}else y[n]=e,P.setImmediate(a)}),k=h.slice(0,h.length-1),b=k.length;b--;){if(!(f=t[k[b]]))throw new Error("Has nonexistent dependency in "+k.join(", "));if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](g,y)):u(c)}})},P.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}P.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},P.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(P.iterator(t))():e()},P.parallel=function(n,t){L(P.eachOf,n,t)},P.parallelLimit=function(n,t,e){L(v(t),n,e)},P.series=function(n,t){L(P.eachOfSeries,n,t)},P.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},P.apply=m(function(n,t){return m(function(e){return n.apply(null,t.concat(e))})}),P.concat=d(j),P.concatSeries=k(j),P.whilst=function(t,e,r){if(r=r||n,t()){var u=m(function(n,i){n?r(n):t.apply(this,i)?e(u):r.apply(null,[null].concat(i))});e(u)}else r(null)},P.doWhilst=function(n,t,e){var r=0;return P.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},P.until=function(n,t,e){return P.whilst(function(){return!n.apply(this,arguments)},t,e)},P.doUntil=function(n,t,e){return P.doWhilst(n,function(){return!t.apply(this,arguments)},e)},P.during=function(t,e,r){r=r||n;var u=m(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},P.doDuring=function(n,t,e){var r=0;P.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},P.queue=function(n,t){var e=I(function(t,e){n(t[0],e)},t,1);return e},P.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?P.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)})}var o=P.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},P.cargo=function(n,t){return I(n,1,t)},P.log=x("log"),P.dir=x("dir"),P.memoize=function(n,e){var r={},u={},i=Object.prototype.hasOwnProperty;e=e||t;var o=m(function(t){var o=t.pop(),c=e.apply(null,t);i.call(r,c)?P.setImmediate(function(){o.apply(null,r[c])}):i.call(u,c)?u[c].push(o):(u[c]=[o],n.apply(null,t.concat([m(function(n){r[c]=n;var t=u[c];delete u[c];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return o.memo=r,o.unmemoized=n,o},P.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},P.times=A(P.map),P.timesSeries=A(P.mapSeries),P.timesLimit=function(n,t,e,r){return P.mapLimit(f(n),t,e,r)},P.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,P.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},P.compose=function(){return P.seq.apply(null,Array.prototype.reverse.call(arguments))},P.applyEach=T(P.eachOf),P.applyEachSeries=T(P.eachOfSeries),P.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},P.ensureAsync=z,P.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),P.wrapSync=P.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=P:"function"==typeof define&&define.amd?define([],function(){return P}):C.async=P}();
 //# sourceMappingURL=dist/async.min.map
\ No newline at end of file
index 8889344..ee0a268 100644 (file)
     };
 
     async.auto = function (tasks, concurrency, callback) {
-        if (!callback) {
+        if (typeof arguments[1] === 'function') {
             // concurrency is optional, shift the args.
             callback = concurrency;
             concurrency = null;
         var results = {};
         var runningTasks = 0;
 
+        var hasError = false;
+
         var listeners = [];
         function addListener(fn) {
             listeners.unshift(fn);
         });
 
         _arrayEach(keys, function (k) {
+            if (hasError) return;
             var task = _isArray(tasks[k]) ? tasks[k]: [tasks[k]];
             var taskCallback = _restParam(function(err, args) {
                 runningTasks--;
                         safeResults[rkey] = val;
                     });
                     safeResults[k] = args;
+                    hasError = true;
+
                     callback(err, safeResults);
                 }
                 else {
             var dep;
             while (len--) {
                 if (!(dep = tasks[requires[len]])) {
-                    throw new Error('Has inexistant dependency');
+                    throw new Error('Has nonexistent dependency in ' + requires.join(', '));
                 }
                 if (_isArray(dep) && _indexOf(dep, k) >= 0) {
                     throw new Error('Has cyclic dependencies');
                 } else if (test.apply(this, args)) {
                     iterator(next);
                 } else {
-                    callback(null);
+                    callback.apply(null, [null].concat(args));
                 }
             });
             iterator(next);
                 _insert(q, data, true, callback);
             },
             process: function () {
-                if (!q.paused && workers < q.concurrency && q.tasks.length) {
-                    while(workers < q.concurrency && q.tasks.length){
-                        var tasks = q.payload ?
-                            q.tasks.splice(0, q.payload) :
-                            q.tasks.splice(0, q.tasks.length);
-
-                        var data = _map(tasks, function (task) {
-                            return task.data;
-                        });
+                while(!q.paused && workers < q.concurrency && q.tasks.length){
 
-                        if (q.tasks.length === 0) {
-                            q.empty();
-                        }
-                        workers += 1;
-                        workersList.push(tasks[0]);
-                        var cb = only_once(_next(q, tasks));
-                        worker(data, cb);
+                    var tasks = q.payload ?
+                        q.tasks.splice(0, q.payload) :
+                        q.tasks.splice(0, q.tasks.length);
+
+                    var data = _map(tasks, function (task) {
+                        return task.data;
+                    });
+
+                    if (q.tasks.length === 0) {
+                        q.empty();
                     }
+                    workers += 1;
+                    workersList.push(tasks[0]);
+                    var cb = only_once(_next(q, tasks));
+                    worker(data, cb);
                 }
             },
             length: function () {
     async.memoize = function (fn, hasher) {
         var memo = {};
         var queues = {};
+        var has = Object.prototype.hasOwnProperty;
         hasher = hasher || identity;
         var memoized = _restParam(function memoized(args) {
             var callback = args.pop();
             var key = hasher.apply(null, args);
-            if (key in memo) {
+            if (has.call(memo, key)) {
                 async.setImmediate(function () {
                     callback.apply(null, memo[key]);
                 });
             }
-            else if (key in queues) {
+            else if (has.call(queues, key)) {
                 queues[key].push(callback);
             }
             else {
index 1b5f241..369755e 100644 (file)
@@ -10,7 +10,7 @@
   "author": {
     "name": "Caolan McMahon"
   },
-  "version": "1.5.0",
+  "version": "1.5.2",
   "keywords": [
     "async",
     "callback",
       "tests"
     ]
   },
-  "readme": "# Async.js\n\n[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)\n[![NPM version](http://img.shields.io/npm/v/async.svg)](https://www.npmjs.org/package/async)\n[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master)\n[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [Node.js](http://nodejs.org) and installable via `npm install async`,\nit can also be used directly in the browser.\n\nAsync is also installable via:\n\n- [bower](http://bower.io/): `bower install async`\n- [component](https://github.com/component/component): `component install\n  caolan/async`\n- [jam](http://jamjs.org/): `jam install async`\n- [spm](http://spmjs.io/): `spm install async`\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns\nfor asynchronous control flow (`parallel`, `series`, `waterfall`…). All these\nfunctions assume you follow the Node.js convention of providing a single\ncallback as the last argument of your `async` function.\n\n\n## Quick Examples\n\n```javascript\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n    // results is now an array of stats for each file\n});\n\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n    // results now equals an array of the existing files\n});\n\nasync.parallel([\n    function(){ ... },\n    function(){ ... }\n], callback);\n\nasync.series([\n    function(){ ... },\n    function(){ ... }\n]);\n```\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n## Common Pitfalls <sub>[(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js)</sub>\n### Synchronous iteration functions\n\nIf you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator.  By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers.  Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop.\n\nThis can also arise by accident if you callback early in certain cases:\n\n```js\nasync.eachSeries(hugeArray, function iterator(item, callback) {\n  if (inCache(item)) {\n    callback(null, cache[item]); // if many items are cached, you'll overflow\n  } else {\n    doSomeIO(item, callback);\n  }\n}, function done() {\n  //...\n});\n```\n\nJust change it to:\n\n```js\nasync.eachSeries(hugeArray, function iterator(item, callback) {\n  if (inCache(item)) {\n    async.setImmediate(function () {\n      callback(null, cache[item]);\n    });\n  } else {\n    doSomeIO(item, callback);\n  //...\n```\n\nAsync guards against synchronous functions in some, but not all, cases.  If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync)  Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral.\n\nIf JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works.\n\n\n### Multiple callbacks\n\nMake sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases.\n\n```js\nasync.waterfall([\n    function (callback) {\n        getSomething(options, function (err, result) {\n          if (err) {\n            callback(new Error(\"failed getting something:\" + err.message));\n            // we should return here\n          }\n          // since we did not return, this callback still will be called and\n          // `processData` will be called twice\n          callback(null, result);\n        });\n    },\n    processData\n], done)\n```\n\nIt is always good practice to `return callback(err, result)`  whenever a callback call is not the last statement of a function.\n\n\n### Binding a context to an iterator\n\nThis section is really about `bind`, not about `async`. If you are wondering how to\nmake `async` execute your iterators in a given context, or are confused as to why\na method of another library isn't working as an iterator, study this example:\n\n```js\n// Here is a simple object with an (unnecessarily roundabout) squaring method\nvar AsyncSquaringLibrary = {\n  squareExponent: 2,\n  square: function(number, callback){\n    var result = Math.pow(number, this.squareExponent);\n    setTimeout(function(){\n      callback(null, result);\n    }, 200);\n  }\n};\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){\n  // result is [NaN, NaN, NaN]\n  // This fails because the `this.squareExponent` expression in the square\n  // function is not evaluated in the context of AsyncSquaringLibrary, and is\n  // therefore undefined.\n});\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){\n  // result is [1, 4, 9]\n  // With the help of bind we can attach a context to the iterator before\n  // passing it to async. Now the square function will be executed in its\n  // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`\n  // will be as expected.\n});\n```\n\n## Download\n\nThe source is available for download from\n[GitHub](https://github.com/caolan/async/blob/master/lib/async.js).\nAlternatively, you can install using Node Package Manager (`npm`):\n\n    npm install async\n\nAs well as using Bower:\n\n    bower install async\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed\n\n## In the Browser\n\nSo far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.\n\nUsage:\n\n```html\n<script type=\"text/javascript\" src=\"async.js\"></script>\n<script type=\"text/javascript\">\n\n    async.map(data, asyncProcess, function(err, results){\n        alert(results);\n    });\n\n</script>\n```\n\n## Documentation\n\nSome functions are also available in the following forms:\n* `<name>Series` - the same as `<name>` but runs only a single async operation at a time\n* `<name>Limit` - the same as `<name>` but runs a maximum of `limit` async operations at a time\n\n### Collections\n\n* [`each`](#each), `eachSeries`, `eachLimit`\n* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit`\n* [`map`](#map), `mapSeries`, `mapLimit`\n* [`filter`](#filter), `filterSeries`, `filterLimit`\n* [`reject`](#reject), `rejectSeries`, `rejectLimit`\n* [`reduce`](#reduce), [`reduceRight`](#reduceRight)\n* [`detect`](#detect), `detectSeries`, `detectLimit`\n* [`sortBy`](#sortBy)\n* [`some`](#some), `someLimit`\n* [`every`](#every), `everyLimit`\n* [`concat`](#concat), `concatSeries`\n\n### Control Flow\n\n* [`series`](#seriestasks-callback)\n* [`parallel`](#parallel), `parallelLimit`\n* [`whilst`](#whilst), [`doWhilst`](#doWhilst)\n* [`until`](#until), [`doUntil`](#doUntil)\n* [`during`](#during), [`doDuring`](#doDuring)\n* [`forever`](#forever)\n* [`waterfall`](#waterfall)\n* [`compose`](#compose)\n* [`seq`](#seq)\n* [`applyEach`](#applyEach), `applyEachSeries`\n* [`queue`](#queue), [`priorityQueue`](#priorityQueue)\n* [`cargo`](#cargo)\n* [`auto`](#auto)\n* [`retry`](#retry)\n* [`iterator`](#iterator)\n* [`times`](#times), `timesSeries`, `timesLimit`\n\n### Utils\n\n* [`apply`](#apply)\n* [`nextTick`](#nextTick)\n* [`memoize`](#memoize)\n* [`unmemoize`](#unmemoize)\n* [`ensureAsync`](#ensureAsync)\n* [`constant`](#constant)\n* [`asyncify`](#asyncify)\n* [`wrapSync`](#wrapSync)\n* [`log`](#log)\n* [`dir`](#dir)\n* [`noConflict`](#noConflict)\n\n## Collections\n\n<a name=\"forEach\" />\n<a name=\"each\" />\n### each(arr, iterator, [callback])\n\nApplies the function `iterator` to each item in `arr`, in parallel.\nThe `iterator` is called with an item from the list, and a callback for when it\nhas finished. If the `iterator` passes an error to its `callback`, the main\n`callback` (for the `each` function) is immediately called with the error.\n\nNote, that since this function applies `iterator` to each item in parallel,\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n  The iterator is passed a `callback(err)` which must be called once it has\n  completed. If no error has occurred, the `callback` should be run without\n  arguments or with an explicit `null` argument.  The array index is not passed\n  to the iterator.  If you need the index, use [`forEachOf`](#forEachOf).\n* `callback(err)` - *Optional* A callback which is called when all `iterator` functions\n  have finished, or an error occurs.\n\n__Examples__\n\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n    // if any of the saves produced an error, err would equal that error\n});\n```\n\n```js\n// assuming openFiles is an array of file names\n\nasync.each(openFiles, function(file, callback) {\n\n  // Perform operation on file here.\n  console.log('Processing file ' + file);\n\n  if( file.length > 32 ) {\n    console.log('This file name is too long');\n    callback('File name too long');\n  } else {\n    // Do work to process file here\n    console.log('File processed');\n    callback();\n  }\n}, function(err){\n    // if any of the file processing produced an error, err would equal that error\n    if( err ) {\n      // One of the iterations produced an error.\n      // All processing will now stop.\n      console.log('A file failed to process');\n    } else {\n      console.log('All files have been processed successfully');\n    }\n});\n```\n\n__Related__\n\n* eachSeries(arr, iterator, [callback])\n* eachLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"forEachOf\" />\n<a name=\"eachOf\" />\n\n### forEachOf(obj, iterator, [callback])\n\nLike `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.\n\n__Arguments__\n\n* `obj` - An object or array to iterate over.\n* `iterator(item, key, callback)` - A function to apply to each item in `obj`.\nThe `key` is the item's key, or index in the case of an array. The iterator is\npassed a `callback(err)` which must be called once it has completed. If no\nerror has occurred, the callback should be run without arguments or with an\nexplicit `null` argument.\n* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.\n\n__Example__\n\n```js\nvar obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\nvar configs = {};\n\nasync.forEachOf(obj, function (value, key, callback) {\n  fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n    if (err) return callback(err);\n    try {\n      configs[key] = JSON.parse(data);\n    } catch (e) {\n      return callback(e);\n    }\n    callback();\n  })\n}, function (err) {\n  if (err) console.error(err.message);\n  // configs is now a map of JSON data\n  doSomethingWith(configs);\n})\n```\n\n__Related__\n\n* forEachOfSeries(obj, iterator, [callback])\n* forEachOfLimit(obj, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"map\" />\n### map(arr, iterator, [callback])\n\nProduces a new array of values by mapping each value in `arr` through\nthe `iterator` function. The `iterator` is called with an item from `arr` and a\ncallback for when it has finished processing. Each of these callback takes 2 arguments:\nan `error`, and the transformed item from `arr`. If `iterator` passes an error to its\ncallback, the main `callback` (for the `map` function) is immediately called with the error.\n\nNote, that since this function applies the `iterator` to each item in parallel,\nthere is no guarantee that the `iterator` functions will complete in order.\nHowever, the results array will be in the same order as the original `arr`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n  The iterator is passed a `callback(err, transformed)` which must be called once\n  it has completed with an error (which can be `null`) and a transformed item.\n* `callback(err, results)` - *Optional* A callback which is called when all `iterator`\n  functions have finished, or an error occurs. Results is an array of the\n  transformed items from the `arr`.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n    // results is now an array of stats for each file\n});\n```\n\n__Related__\n* mapSeries(arr, iterator, [callback])\n* mapLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"select\" />\n<a name=\"filter\" />\n### filter(arr, iterator, [callback])\n\n__Alias:__ `select`\n\nReturns a new array of all the values in `arr` which pass an async truth test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n  The `iterator` is passed a `callback(truthValue)`, which must be called with a\n  boolean argument once it has completed.\n* `callback(results)` - *Optional* A callback which is called after all the `iterator`\n  functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n    // results now equals an array of the existing files\n});\n```\n\n__Related__\n\n* filterSeries(arr, iterator, [callback])\n* filterLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"reject\" />\n### reject(arr, iterator, [callback])\n\nThe opposite of [`filter`](#filter). Removes values that pass an `async` truth test.\n\n__Related__\n\n* rejectSeries(arr, iterator, [callback])\n* rejectLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"reduce\" />\n### reduce(arr, memo, iterator, [callback])\n\n__Aliases:__ `inject`, `foldl`\n\nReduces `arr` into a single value using an async `iterator` to return\neach successive step. `memo` is the initial state of the reduction.\nThis function only operates in series.\n\nFor performance reasons, it may make sense to split a call to this function into\na parallel map, and then use the normal `Array.prototype.reduce` on the results.\nThis function is for situations where each step in the reduction needs to be async;\nif you can get the data before reducing it, then it's probably a good idea to do so.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `memo` - The initial state of the reduction.\n* `iterator(memo, item, callback)` - A function applied to each item in the\n  array to produce the next step in the reduction. The `iterator` is passed a\n  `callback(err, reduction)` which accepts an optional error as its first\n  argument, and the state of the reduction as the second. If an error is\n  passed to the callback, the reduction is stopped and the main `callback` is\n  immediately called with the error.\n* `callback(err, result)` - *Optional* A callback which is called after all the `iterator`\n  functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n    // pointless async:\n    process.nextTick(function(){\n        callback(null, memo + item)\n    });\n}, function(err, result){\n    // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n<a name=\"reduceRight\" />\n### reduceRight(arr, memo, iterator, [callback])\n\n__Alias:__ `foldr`\n\nSame as [`reduce`](#reduce), only operates on `arr` in reverse order.\n\n\n---------------------------------------\n\n<a name=\"detect\" />\n### detect(arr, iterator, [callback])\n\nReturns the first value in `arr` that passes an async truth test. The\n`iterator` is applied in parallel, meaning the first iterator to return `true` will\nfire the detect `callback` with that result. That means the result might not be\nthe first item in the original `arr` (in terms of order) that passes the test.\n\nIf order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n  The iterator is passed a `callback(truthValue)` which must be called with a\n  boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n  `true`, or after all the `iterator` functions have finished. Result will be\n  the first item in the array that passes the truth test (iterator) or the\n  value `undefined` if none passed.  **Note: this callback does not take an error as its first argument.**\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n    // result now equals the first file in the list that exists\n});\n```\n\n__Related__\n\n* detectSeries(arr, iterator, [callback])\n* detectLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"sortBy\" />\n### sortBy(arr, iterator, [callback])\n\nSorts a list by the results of running each `arr` value through an async `iterator`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n  The iterator is passed a `callback(err, sortValue)` which must be called once it\n  has completed with an error (which can be `null`) and a value to use as the sort\n  criteria.\n* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`\n  functions have finished, or an error occurs. Results is the items from\n  the original `arr` sorted by the values returned by the `iterator` calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n    fs.stat(file, function(err, stats){\n        callback(err, stats.mtime);\n    });\n}, function(err, results){\n    // results is now the original array of files sorted by\n    // modified date\n});\n```\n\n__Sort Order__\n\nBy modifying the callback parameter the sorting order can be influenced:\n\n```js\n//ascending order\nasync.sortBy([1,9,3,5], function(x, callback){\n    callback(null, x);\n}, function(err,result){\n    //result callback\n} );\n\n//descending order\nasync.sortBy([1,9,3,5], function(x, callback){\n    callback(null, x*-1);    //<- x*-1 instead of x, turns the order around\n}, function(err,result){\n    //result callback\n} );\n```\n\n---------------------------------------\n\n<a name=\"some\" />\n### some(arr, iterator, [callback])\n\n__Alias:__ `any`\n\nReturns `true` if at least one element in the `arr` satisfies an async test.\n_The callback for each iterator call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. Once any iterator\ncall returns `true`, the main `callback` is immediately called.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n  in parallel. The iterator is passed a `callback(truthValue)`` which must be\n  called with a boolean argument once it has completed.\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n  `true`, or after all the iterator functions have finished. Result will be\n  either `true` or `false` depending on the values of the async tests.\n\n **Note: the callbacks do not take an error as their first argument.**\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n    // if result is true then at least one of the files exists\n});\n```\n\n__Related__\n\n* someLimit(arr, limit, iterator, callback)\n\n---------------------------------------\n\n<a name=\"every\" />\n### every(arr, iterator, [callback])\n\n__Alias:__ `all`\n\nReturns `true` if every element in `arr` satisfies an async test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n  in parallel. The iterator is passed a `callback(truthValue)` which must be\n  called with a  boolean argument once it has completed.\n* `callback(result)` - *Optional* A callback which is called after all the `iterator`\n  functions have finished. Result will be either `true` or `false` depending on\n  the values of the async tests.\n\n **Note: the callbacks do not take an error as their first argument.**\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n    // if result is true then every file exists\n});\n```\n\n__Related__\n\n* everyLimit(arr, limit, iterator, callback)\n\n---------------------------------------\n\n<a name=\"concat\" />\n### concat(arr, iterator, [callback])\n\nApplies `iterator` to each item in `arr`, concatenating the results. Returns the\nconcatenated list. The `iterator`s are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of `arr` passed to the `iterator` function.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n  The iterator is passed a `callback(err, results)` which must be called once it\n  has completed with an error (which can be `null`) and an array of results.\n* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`\n  functions have finished, or an error occurs. Results is an array containing\n  the concatenated results of the `iterator` function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n    // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n__Related__\n\n* concatSeries(arr, iterator, [callback])\n\n\n## Control Flow\n\n<a name=\"series\" />\n### series(tasks, [callback])\n\nRun the functions in the `tasks` array in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run, and `callback` is immediately called with the value of the error.\nOtherwise, `callback` receives an array of results when `tasks` have completed.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function, and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`series`](#series).\n\n**Note** that while many implementations preserve the order of object properties, the\n[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\nexplicitly states that\n\n> The mechanics and order of enumerating the properties is not specified.\n\nSo if you rely on the order in which your series of functions are executed, and want\nthis to work on all platforms, consider using an array.\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run, each function is passed\n  a `callback(err, result)` it must call on completion with an error `err` (which can\n  be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n  have completed. This function gets a results array (or object) containing all\n  the result arguments passed to the `task` callbacks.\n\n__Example__\n\n```js\nasync.series([\n    function(callback){\n        // do some stuff ...\n        callback(null, 'one');\n    },\n    function(callback){\n        // do some more stuff ...\n        callback(null, 'two');\n    }\n],\n// optional callback\nfunction(err, results){\n    // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n    one: function(callback){\n        setTimeout(function(){\n            callback(null, 1);\n        }, 200);\n    },\n    two: function(callback){\n        setTimeout(function(){\n            callback(null, 2);\n        }, 100);\n    }\n},\nfunction(err, results) {\n    // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n<a name=\"parallel\" />\n### parallel(tasks, [callback])\n\nRun the `tasks` array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main `callback` is immediately called with the value of the error.\nOnce the `tasks` have completed, the results are passed to the final `callback` as an\narray.\n\n**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code.  If your tasks do not use any timers or perform any I/O, they will actually be executed in series.  Any synchronous setup sections for each task will happen one after the other.  JavaScript remains single-threaded.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`parallel`](#parallel).\n\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run. Each function is passed\n  a `callback(err, result)` which it must call on completion with an error `err`\n  (which can be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n  have completed. This function gets a results array (or object) containing all\n  the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n    function(callback){\n        setTimeout(function(){\n            callback(null, 'one');\n        }, 200);\n    },\n    function(callback){\n        setTimeout(function(){\n            callback(null, 'two');\n        }, 100);\n    }\n],\n// optional callback\nfunction(err, results){\n    // the results array will equal ['one','two'] even though\n    // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n    one: function(callback){\n        setTimeout(function(){\n            callback(null, 1);\n        }, 200);\n    },\n    two: function(callback){\n        setTimeout(function(){\n            callback(null, 2);\n        }, 100);\n    }\n},\nfunction(err, results) {\n    // results is now equals to: {one: 1, two: 2}\n});\n```\n\n__Related__\n\n* parallelLimit(tasks, limit, [callback])\n\n---------------------------------------\n\n<a name=\"whilst\" />\n### whilst(test, fn, callback)\n\nRepeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,\nor an error occurs.\n\n__Arguments__\n\n* `test()` - synchronous truth test to perform before each execution of `fn`.\n* `fn(callback)` - A function which is called each time `test` passes. The function is\n  passed a `callback(err)`, which must be called once it has completed with an\n  optional `err` argument.\n* `callback(err)` - A callback which is called after the test fails and repeated\n  execution of `fn` has stopped.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n    function () { return count < 5; },\n    function (callback) {\n        count++;\n        setTimeout(callback, 1000);\n    },\n    function (err) {\n        // 5 seconds have passed\n    }\n);\n```\n\n---------------------------------------\n\n<a name=\"doWhilst\" />\n### doWhilst(fn, test, callback)\n\nThe post-check version of [`whilst`](#whilst). To reflect the difference in\nthe order of operations, the arguments `test` and `fn` are switched.\n\n`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n<a name=\"until\" />\n### until(test, fn, callback)\n\nRepeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,\nor an error occurs.\n\nThe inverse of [`whilst`](#whilst).\n\n---------------------------------------\n\n<a name=\"doUntil\" />\n### doUntil(fn, test, callback)\n\nLike [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n<a name=\"during\" />\n### during(test, fn, callback)\n\nLike [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.during(\n    function (callback) {\n      return callback(null, count < 5);\n    },\n    function (callback) {\n        count++;\n        setTimeout(callback, 1000);\n    },\n    function (err) {\n        // 5 seconds have passed\n    }\n);\n```\n\n---------------------------------------\n\n<a name=\"doDuring\" />\n### doDuring(fn, test, callback)\n\nThe post-check version of [`during`](#during). To reflect the difference in\nthe order of operations, the arguments `test` and `fn` are switched.\n\nAlso a version of [`doWhilst`](#doWhilst) with asynchronous `test` function.\n\n---------------------------------------\n\n<a name=\"forever\" />\n### forever(fn, [errback])\n\nCalls the asynchronous function `fn` with a callback parameter that allows it to\ncall itself again, in series, indefinitely.\n\nIf an error is passed to the callback then `errback` is called with the\nerror, and execution stops, otherwise it will never be called.\n\n```js\nasync.forever(\n    function(next) {\n        // next is suitable for passing to things that need a callback(err [, whatever]);\n        // it will result in this function being called again.\n    },\n    function(err) {\n        // if next is called with a value in its first parameter, it will appear\n        // in here as 'err', and execution will stop.\n    }\n);\n```\n\n---------------------------------------\n\n<a name=\"waterfall\" />\n### waterfall(tasks, [callback])\n\nRuns the `tasks` array of functions in series, each passing their results to the next in\nthe array. However, if any of the `tasks` pass an error to their own callback, the\nnext function is not executed, and the main `callback` is immediately called with\nthe error.\n\n__Arguments__\n\n* `tasks` - An array of functions to run, each function is passed a\n  `callback(err, result1, result2, ...)` it must call on completion. The first\n  argument is an error (which can be `null`) and any further arguments will be\n  passed as arguments in order to the next task.\n* `callback(err, [results])` - An optional callback to run once all the functions\n  have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n    function(callback) {\n        callback(null, 'one', 'two');\n    },\n    function(arg1, arg2, callback) {\n      // arg1 now equals 'one' and arg2 now equals 'two'\n        callback(null, 'three');\n    },\n    function(arg1, callback) {\n        // arg1 now equals 'three'\n        callback(null, 'done');\n    }\n], function (err, result) {\n    // result now equals 'done'\n});\n```\n\n---------------------------------------\n<a name=\"compose\" />\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions `f()`, `g()`, and `h()` would produce the result of\n`f(g(h()))`, only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n    setTimeout(function () {\n        callback(null, n + 1);\n    }, 10);\n}\n\nfunction mul3(n, callback) {\n    setTimeout(function () {\n        callback(null, n * 3);\n    }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n   // result now equals 15\n});\n```\n\n---------------------------------------\n<a name=\"seq\" />\n### seq(fn1, fn2...)\n\nVersion of the compose function that is more natural to read.\nEach function consumes the return value of the previous function.\nIt is the equivalent of [`compose`](#compose) with the arguments reversed.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\n// Requires lodash (or underscore), express3 and dresende's orm2.\n// Part of an app, that fetches cats of the logged user.\n// This example uses `seq` function to avoid overnesting and error\n// handling clutter.\napp.get('/cats', function(request, response) {\n  var User = request.models.User;\n  async.seq(\n    _.bind(User.get, User),  // 'User.get' has signature (id, callback(err, data))\n    function(user, fn) {\n      user.getCats(fn);      // 'getCats' has signature (callback(err, data))\n    }\n  )(req.session.user_id, function (err, cats) {\n    if (err) {\n      console.error(err);\n      response.json({ status: 'error', message: err.message });\n    } else {\n      response.json({ status: 'ok', message: 'Cats found', data: cats });\n    }\n  });\n});\n```\n\n---------------------------------------\n<a name=\"applyEach\" />\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling\n`callback` after all functions have completed. If you only provide the first\nargument, then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* `fns` - the asynchronous functions to all call with the same arguments\n* `args...` - any number of separate arguments to pass to the function\n* `callback` - the final argument should be the callback, called when all\n  functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n    buckets,\n    async.applyEach([enableSearch, updateSchema]),\n    callback\n);\n```\n\n__Related__\n\n* applyEachSeries(tasks, args..., [callback])\n\n---------------------------------------\n\n<a name=\"queue\" />\n### queue(worker, [concurrency])\n\nCreates a `queue` object with the specified `concurrency`. Tasks added to the\n`queue` are processed in parallel (up to the `concurrency` limit). If all\n`worker`s are in progress, the task is queued until one becomes available.\nOnce a `worker` completes a `task`, that `task`'s callback is called.\n\n__Arguments__\n\n* `worker(task, callback)` - An asynchronous function for processing a queued\n  task, which must call its `callback(err)` argument when finished, with an\n  optional `error` as an argument.  If you want to handle errors from an individual task, pass a callback to `q.push()`.\n* `concurrency` - An `integer` for determining how many `worker` functions should be\n  run in parallel.  If omitted, the concurrency defaults to `1`.  If the concurrency is `0`, an error is thrown.\n\n__Queue objects__\n\nThe `queue` object returned by this function has the following properties and\nmethods:\n\n* `length()` - a function returning the number of items waiting to be processed.\n* `started` - a function returning whether or not any items have been pushed and processed by the queue\n* `running()` - a function returning the number of items currently being processed.\n* `workersList()` - a function returning the array of items currently being processed.\n* `idle()` - a function returning false if there are items waiting or being processed, or true if not.\n* `concurrency` - an integer for determining how many `worker` functions should be\n  run in parallel. This property can be changed after a `queue` is created to\n  alter the concurrency on-the-fly.\n* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once\n  the `worker` has finished processing the task. Instead of a single task, a `tasks` array\n  can be submitted. The respective callback is used for every task in the list.\n* `unshift(task, [callback])` - add a new task to the front of the `queue`.\n* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,\n   and further tasks will be queued.\n* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.\n* `paused` - a boolean for determining whether the queue is in a paused state\n* `pause()` - a function that pauses the processing of tasks until `resume()` is called.\n* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.\n* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n    console.log('hello ' + task.name);\n    callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n    console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n    console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n    console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n    console.log('finished processing item');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n    console.log('finished processing bar');\n});\n```\n\n\n---------------------------------------\n\n<a name=\"priorityQueue\" />\n### priorityQueue(worker, concurrency)\n\nThe same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:\n\n* `push(task, priority, [callback])` - `priority` should be a number. If an array of\n  `tasks` is given, all tasks will be assigned the same priority.\n* The `unshift` method was removed.\n\n---------------------------------------\n\n<a name=\"cargo\" />\n### cargo(worker, [payload])\n\nCreates a `cargo` object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the `payload` limit). If the\n`worker` is in progress, the task is queued until it becomes available. Once\nthe `worker` has completed some tasks, each callback of those tasks is called.\nCheck out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.\n\nWhile [queue](#queue) passes only one task to one of a group of workers\nat a time, cargo passes an array of tasks to a single worker, repeating\nwhen the worker is finished.\n\n__Arguments__\n\n* `worker(tasks, callback)` - An asynchronous function for processing an array of\n  queued tasks, which must call its `callback(err)` argument when finished, with\n  an optional `err` argument.\n* `payload` - An optional `integer` for determining how many tasks should be\n  processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe `cargo` object returned by this function has the following properties and\nmethods:\n\n* `length()` - A function returning the number of items waiting to be processed.\n* `payload` - An `integer` for determining how many tasks should be\n  process per round. This property can be changed after a `cargo` is created to\n  alter the payload on-the-fly.\n* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called\n  once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`\n  can be submitted. The respective callback is used for every task in the list.\n* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.\n* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.\n* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n    for(var i=0; i<tasks.length; i++){\n      console.log('hello ' + tasks[i].name);\n    }\n    callback();\n}, 2);\n\n\n// add some items\n\ncargo.push({name: 'foo'}, function (err) {\n    console.log('finished processing foo');\n});\ncargo.push({name: 'bar'}, function (err) {\n    console.log('finished processing bar');\n});\ncargo.push({name: 'baz'}, function (err) {\n    console.log('finished processing baz');\n});\n```\n\n---------------------------------------\n\n<a name=\"auto\" />\n### auto(tasks, [concurrency], [callback])\n\nDetermines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied.\n\nIf any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error.  Functions also receive an object containing the results of functions which have completed so far.\n\nNote, all functions are called with a `results` object as a second argument,\nso it is unsafe to pass functions in the `tasks` object which cannot handle the\nextra argument.\n\nFor example, this snippet of code:\n\n```js\nasync.auto({\n  readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling `readFile` with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to `readFile` in a function which does not forward the\n`results` object:\n\n```js\nasync.auto({\n  readData: function(cb, results){\n    fs.readFile('data.txt', 'utf-8', cb);\n  }\n}, callback);\n```\n\n__Arguments__\n\n* `tasks` - An object. Each of its properties is either a function or an array of\n  requirements, with the function itself the last item in the array. The object's key\n  of a property serves as the name of the task defined by that property,\n  i.e. can be used when specifying requirements for other tasks.\n  The function receives two arguments: (1) a `callback(err, result)` which must be\n  called when finished, passing an `error` (which can be `null`) and the result of\n  the function's execution, and (2) a `results` object, containing the results of\n  the previously executed functions.\n* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible.\n* `callback(err, results)` - An optional callback which is called when all the\n  tasks have been completed. It receives the `err` argument if any `tasks`\n  pass an error to their callback. Results are always returned; however, if\n  an error occurs, no further `tasks` will be performed, and the results\n  object will only contain partial results.\n\n\n__Example__\n\n```js\nasync.auto({\n    get_data: function(callback){\n        console.log('in get_data');\n        // async code to get some data\n        callback(null, 'data', 'converted to array');\n    },\n    make_folder: function(callback){\n        console.log('in make_folder');\n        // async code to create a directory to store a file in\n        // this is run at the same time as getting the data\n        callback(null, 'folder');\n    },\n    write_file: ['get_data', 'make_folder', function(callback, results){\n        console.log('in write_file', JSON.stringify(results));\n        // once there is some data and the directory exists,\n        // write the data to a file in the directory\n        callback(null, 'filename');\n    }],\n    email_link: ['write_file', function(callback, results){\n        console.log('in email_link', JSON.stringify(results));\n        // once the file is written let's email a link to it...\n        // results.write_file contains the filename returned by write_file.\n        callback(null, {'file':results.write_file, 'email':'user@example.com'});\n    }]\n}, function(err, results) {\n    console.log('err = ', err);\n    console.log('results = ', results);\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n    function(callback){\n        console.log('in get_data');\n        // async code to get some data\n        callback(null, 'data', 'converted to array');\n    },\n    function(callback){\n        console.log('in make_folder');\n        // async code to create a directory to store a file in\n        // this is run at the same time as getting the data\n        callback(null, 'folder');\n    }\n],\nfunction(err, results){\n    async.series([\n        function(callback){\n            console.log('in write_file', JSON.stringify(results));\n            // once there is some data and the directory exists,\n            // write the data to a file in the directory\n            results.push('filename');\n            callback(null);\n        },\n        function(callback){\n            console.log('in email_link', JSON.stringify(results));\n            // once the file is written let's email a link to it...\n            callback(null, {'file':results.pop(), 'email':'user@example.com'});\n        }\n    ]);\n});\n```\n\nFor a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding\nnew tasks much easier (and the code more readable).\n\n\n---------------------------------------\n\n<a name=\"retry\" />\n### retry([opts = {times: 5, interval: 0}| 5], task, [callback])\n\nAttempts to get a successful response from `task` no more than `times` times before\nreturning an error. If the task is successful, the `callback` will be passed the result\nof the successful task. If all attempts fail, the callback will be passed the error and\nresult (if any) of the final attempt.\n\n__Arguments__\n\n* `opts` - Can be either an object with `times` and `interval` or a number. `times` is how many attempts should be made before giving up. `interval` is how long to wait inbetween attempts. Defaults to {times: 5, interval: 0}\n  * if a number is passed in it sets `times` only (with `interval` defaulting to 0).\n* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`\n  which must be called when finished, passing `err` (which can be `null`) and the `result` of\n  the function's execution, and (2) a `results` object, containing the results of\n  the previously executed functions (if nested inside another control flow).\n* `callback(err, results)` - An optional callback which is called when the\n  task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.\n\nThe [`retry`](#retry) function can be used as a stand-alone control flow by passing a\ncallback, as shown below:\n\n```js\nasync.retry(3, apiMethod, function(err, result) {\n    // do something with the result\n});\n```\n\n```js\nasync.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n    // do something with the result\n});\n```\n\nIt can also be embedded within other control flow functions to retry individual methods\nthat are not as reliable, like this:\n\n```js\nasync.auto({\n    users: api.getUsers.bind(api),\n    payments: async.retry(3, api.getPayments.bind(api))\n}, function(err, results) {\n  // do something with the results\n});\n```\n\n\n---------------------------------------\n\n<a name=\"iterator\" />\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the `tasks` array,\nreturning a continuation to call the next one after that. It's also possible to\n“peek” at the next iterator with `iterator.next()`.\n\nThis function is used internally by the `async` module, but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* `tasks` - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n    function(){ sys.p('one'); },\n    function(){ sys.p('two'); },\n    function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n<a name=\"apply\" />\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied.\n\nUseful as a shorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to automatically apply when the\n  continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n    async.apply(fs.writeFile, 'testfile1', 'test1'),\n    async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n    function(callback){\n        fs.writeFile('testfile1', 'test1', callback);\n    },\n    function(callback){\n        fs.writeFile('testfile2', 'test2', callback);\n    }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n<a name=\"nextTick\" />\n### nextTick(callback), setImmediate(callback)\n\nCalls `callback` on a later loop around the event loop. In Node.js this just\ncalls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`\nif available, otherwise `setTimeout(callback, 0)`, which means other higher priority\nevents may precede the execution of `callback`.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* `callback` - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n    call_order.push('two');\n    // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n<a name=\"times\" />\n### times(n, iterator, [callback])\n\nCalls the `iterator` function `n` times, and accumulates results in the same manner\nyou would use with [`map`](#map).\n\n__Arguments__\n\n* `n` - The number of times to run the function.\n* `iterator` - The function to call `n` times.\n* `callback` - see [`map`](#map)\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n  callback(null, {\n    id: 'user' + id\n  })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n    createUser(n, function(err, user) {\n      next(err, user)\n    })\n}, function(err, users) {\n  // we should now have 5 users\n});\n```\n\n__Related__\n\n* timesSeries(n, iterator, [callback])\n* timesLimit(n, limit, iterator, [callback])\n\n\n## Utils\n\n<a name=\"memoize\" />\n### memoize(fn, [hasher])\n\nCaches the results of an `async` function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nIf no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* `fn` - The function to proxy and cache results from.\n* `hasher` - An optional function for generating a custom hash for storing\n  results. It has all the arguments applied to it apart from the callback, and\n  must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n    // do something\n    callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n    // callback\n});\n```\n\n<a name=\"unmemoize\" />\n### unmemoize(fn)\n\nUndoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized\nform. Handy for testing.\n\n__Arguments__\n\n* `fn` - the memoized function\n\n---------------------------------------\n\n<a name=\"ensureAsync\" />\n### ensureAsync(fn)\n\nWrap an async function and ensure it calls its callback on a later tick of the event loop.  If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.\n\n__Arguments__\n\n* `fn` - an async function, one that expects a node-style callback as its last argument\n\nReturns a wrapped function with the exact same call signature as the function passed in.\n\n__Example__\n\n```js\nfunction sometimesAsync(arg, callback) {\n  if (cache[arg]) {\n    return callback(null, cache[arg]); // this would be synchronous!!\n  } else {\n    doSomeIO(arg, callback); // this IO would be asynchronous\n  }\n}\n\n// this has a risk of stack overflows if many results are cached in a row\nasync.mapSeries(args, sometimesAsync, done);\n\n// this will defer sometimesAsync's callback if necessary,\n// preventing stack overflows\nasync.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n\n```\n\n---------------------------------------\n\n<a name=\"constant\">\n### constant(values...)\n\nReturns a function that when called, calls-back with the values provided.  Useful as the first function in a `waterfall`, or for plugging values in to `auto`.\n\n__Example__\n\n```js\nasync.waterfall([\n  async.constant(42),\n  function (value, next) {\n    // value === 42\n  },\n  //...\n], callback);\n\nasync.waterfall([\n  async.constant(filename, \"utf8\"),\n  fs.readFile,\n  function (fileData, next) {\n    //...\n  }\n  //...\n], callback);\n\nasync.auto({\n  hostname: async.constant(\"https://server.net/\"),\n  port: findFreePort,\n  launchServer: [\"hostname\", \"port\", function (cb, options) {\n    startServer(options, cb);\n  }],\n  //...\n}, callback);\n\n```\n\n---------------------------------------\n\n<a name=\"asyncify\">\n<a name=\"wrapSync\">\n### asyncify(func)\n\n__Alias:__ `wrapSync`\n\nTake a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback.\n\n__Example__\n\n```js\nasync.waterfall([\n  async.apply(fs.readFile, filename, \"utf8\"),\n  async.asyncify(JSON.parse),\n  function (data, next) {\n    // data is the result of parsing the text.\n    // If there was a parsing error, it would have been caught.\n  }\n], callback)\n```\n\n---------------------------------------\n\n<a name=\"log\" />\n### log(function, arguments)\n\nLogs the result of an `async` function to the `console`. Only works in Node.js or\nin browsers that support `console.log` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.log` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n    setTimeout(function(){\n        callback(null, 'hello ' + name);\n    }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n<a name=\"dir\" />\n### dir(function, arguments)\n\nLogs the result of an `async` function to the `console` using `console.dir` to\ndisplay the properties of the resulting object. Only works in Node.js or\nin browsers that support `console.dir` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.dir` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n    setTimeout(function(){\n        callback(null, {hello: name});\n    }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n<a name=\"noConflict\" />\n### noConflict()\n\nChanges the value of `async` back to its original value, returning a reference to the\n`async` object.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "9ab5c67b7cb3a4c3dad4a2d4552a2f6775545d6c",
   "homepage": "https://github.com/caolan/async#readme",
-  "_id": "async@1.5.0",
-  "_shasum": "2796642723573859565633fc6274444bee2f8ce3",
-  "_resolved": "https://registry.npmjs.org/async/-/async-1.5.0.tgz",
-  "_from": "async@>=1.4.0 <2.0.0"
+  "_id": "async@1.5.2",
+  "_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
+  "_from": "async@>=1.4.0 <2.0.0",
+  "_npmVersion": "3.5.2",
+  "_nodeVersion": "4.2.3",
+  "_npmUser": {
+    "name": "aearly",
+    "email": "alexander.early@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "caolan",
+      "email": "caolan.mcmahon@gmail.com"
+    },
+    {
+      "name": "beaugunderson",
+      "email": "beau@beaugunderson.com"
+    },
+    {
+      "name": "aearly",
+      "email": "alexander.early@gmail.com"
+    },
+    {
+      "name": "megawac",
+      "email": "megawac@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
+    "tarball": "http://registry.npmjs.org/async/-/async-1.5.2.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
+  "readme": "ERROR: No README data found!"
 }
index bac334d..662e628 100644 (file)
     "pre-commit": "^1.0.10",
     "request": "^2.60.0"
   },
-  "readme": "# Form-Data [![Join the chat at https://gitter.im/form-data/form-data](http://form-data.github.io/images/gitterbadge.svg)](https://gitter.im/form-data/form-data) [![Build Status](https://img.shields.io/travis/form-data/form-data/master.svg)](https://travis-ci.org/form-data/form-data) [![Dependency Status](https://img.shields.io/david/form-data/form-data.svg)](https://david-dm.org/form-data/form-data)\n\nA library to create readable ```\"multipart/form-data\"``` streams. Can be used to submit forms and file uploads to other web applications.\n\nThe API of this library is inspired by the [XMLHttpRequest-2 FormData Interface][xhr2-fd].\n\n[xhr2-fd]: http://dev.w3.org/2006/webapi/XMLHttpRequest-2/Overview.html#the-formdata-interface\n[streams2-thing]: http://nodejs.org/api/stream.html#stream_compatibility_with_older_node_versions\n\n## Install\n\n```\nnpm install form-data\n```\n\n## Usage\n\nIn this example we are constructing a form with 3 fields that contain a string,\na buffer and a file stream.\n\n``` javascript\nvar FormData = require('form-data');\nvar fs = require('fs');\n\nvar form = new FormData();\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_file', fs.createReadStream('/foo/bar.jpg'));\n```\n\nAlso you can use http-response stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar http = require('http');\n\nvar form = new FormData();\n\nhttp.request('http://nodejs.org/images/logo.png', function(response) {\n  form.append('my_field', 'my value');\n  form.append('my_buffer', new Buffer(10));\n  form.append('my_logo', response);\n});\n```\n\nOr @mikeal's [request](https://github.com/request/request) stream:\n\n``` javascript\nvar FormData = require('form-data');\nvar request = require('request');\n\nvar form = new FormData();\n\nform.append('my_field', 'my value');\nform.append('my_buffer', new Buffer(10));\nform.append('my_logo', request('http://nodejs.org/images/logo.png'));\n```\n\nIn order to submit this form to a web application, call ```submit(url, [callback])``` method:\n\n``` javascript\nform.submit('http://example.org/', function(err, res) {\n  // res – response object (http.IncomingMessage)  //\n  res.resume();\n});\n\n```\n\nFor more advanced request manipulations ```submit()``` method returns ```http.ClientRequest``` object, or you can choose from one of the alternative submission methods.\n\n### Alternative submission methods\n\nYou can use node's http client interface:\n\n``` javascript\nvar http = require('http');\n\nvar request = http.request({\n  method: 'post',\n  host: 'example.org',\n  path: '/upload',\n  headers: form.getHeaders()\n});\n\nform.pipe(request);\n\nrequest.on('response', function(res) {\n  console.log(res.statusCode);\n});\n```\n\nOr if you would prefer the `'Content-Length'` header to be set for you:\n\n``` javascript\nform.submit('example.org/upload', function(err, res) {\n  console.log(res.statusCode);\n});\n```\n\nTo use custom headers and pre-known length in parts:\n\n``` javascript\nvar CRLF = '\\r\\n';\nvar form = new FormData();\n\nvar options = {\n  header: CRLF + '--' + form.getBoundary() + CRLF + 'X-Custom-Header: 123' + CRLF + CRLF,\n  knownLength: 1\n};\n\nform.append('my_buffer', buffer, options);\n\nform.submit('http://example.com/', function(err, res) {\n  if (err) throw err;\n  console.log('Done');\n});\n```\n\nForm-Data can recognize and fetch all the required information from common types of streams (```fs.readStream```, ```http.response``` and ```mikeal's request```), for some other types of streams you'd need to provide \"file\"-related information manually:\n\n``` javascript\nsomeModule.stream(function(err, stdout, stderr) {\n  if (err) throw err;\n\n  var form = new FormData();\n\n  form.append('file', stdout, {\n    filename: 'unicycle.jpg',\n    contentType: 'image/jpg',\n    knownLength: 19806\n  });\n\n  form.submit('http://example.com/', function(err, res) {\n    if (err) throw err;\n    console.log('Done');\n  });\n});\n```\n\nFor edge cases, like POST request to URL with query string or to pass HTTP auth credentials, object can be passed to `form.submit()` as first parameter:\n\n``` javascript\nform.submit({\n  host: 'example.com',\n  path: '/probably.php?extra=params',\n  auth: 'username:password'\n}, function(err, res) {\n  console.log(res.statusCode);\n});\n```\n\nIn case you need to also send custom HTTP headers with the POST request, you can use the `headers` key in first parameter of `form.submit()`:\n\n``` javascript\nform.submit({\n  host: 'example.com',\n  path: '/surelynot.php',\n  headers: {'x-test-header': 'test-header-value'}\n}, function(err, res) {\n  console.log(res.statusCode);\n});\n```\n\n### Integration with other libraries\n\n#### Request\n\nForm submission using  [request](https://github.com/request/request):\n\n```javascript\nvar formData = {\n  my_field: 'my_value',\n  my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n};\n\nrequest.post({url:'http://service.com/upload', formData: formData}, function(err, httpResponse, body) {\n  if (err) {\n    return console.error('upload failed:', err);\n  }\n  console.log('Upload successful!  Server responded with:', body);\n});\n```\n\nFor more details see [request readme](https://github.com/request/request#multipartform-data-multipart-form-uploads).\n\n#### node-fetch\n\nYou can also submit a form using [node-fetch](https://github.com/bitinn/node-fetch):\n\n```javascript\nvar form = new FormData();\n\nform.append('a', 1);\n\nfetch('http://example.com', { method: 'POST', body: form })\n    .then(function(res) {\n        return res.json();\n    }).then(function(json) {\n        console.log(json);\n    });\n```\n\n## Notes\n\n- ```getLengthSync()``` method DOESN'T calculate length for streams, use ```knownLength``` options as workaround.\n- If it feels like FormData hangs after submit and you're on ```node-0.10```, please check [Compatibility with Older Node Versions][streams2-thing]\n\n## License\n\nForm-Data is licensed under the MIT license.\n",
-  "readmeFilename": "Readme.md",
+  "gitHead": "c174f1b7f3a78a00ec5af0360469280445e37804",
   "bugs": {
     "url": "https://github.com/form-data/form-data/issues"
   },
   "homepage": "https://github.com/form-data/form-data#readme",
   "_id": "form-data@1.0.0-rc3",
   "_shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577",
+  "_from": "form-data@>=1.0.0-rc3 <1.1.0",
+  "_npmVersion": "2.11.0",
+  "_nodeVersion": "2.2.1",
+  "_npmUser": {
+    "name": "dylanpiercey",
+    "email": "pierceydylan@gmail.com"
+  },
+  "dist": {
+    "shasum": "d35bc62e7fbc2937ae78f948aaa0d38d90607577",
+    "tarball": "http://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "felixge",
+      "email": "felix@debuggable.com"
+    },
+    {
+      "name": "idralyuk",
+      "email": "igor@buran.us"
+    },
+    {
+      "name": "alexindigo",
+      "email": "iam@alexindigo.com"
+    },
+    {
+      "name": "mikeal",
+      "email": "mikeal.rogers@gmail.com"
+    },
+    {
+      "name": "celer",
+      "email": "dtyree77@gmail.com"
+    },
+    {
+      "name": "dylanpiercey",
+      "email": "pierceydylan@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/form-data/-/form-data-1.0.0-rc3.tgz",
-  "_from": "form-data@>=1.0.0-rc3 <1.1.0"
+  "readme": "ERROR: No README data found!"
 }
index 2399b31..91526e6 100644 (file)
@@ -52,16 +52,9 @@ har-validator --schema request request.json
   a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object
 
 ```js
-var HAR = require('./har.json')
-var validate = require('har-validator')
-
-validate(HAR)
-  .then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.log(data)
@@ -72,14 +65,9 @@ validate(HAR)
   a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object
 
 ```js
-var validate = require('har-validator')
-
-validate.log(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.log(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.cache(data)
@@ -90,14 +78,9 @@ validate.log(data.then(function (HAR) {
   a [cache](http://www.softwareishard.com/blog/har-12-spec/#cache) object
 
 ```js
-var validate = require('har-validator')
-
-validate.cache(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.cache(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.cacheEntry(data)
@@ -108,14 +91,9 @@ validate.cache(data.then(function (HAR) {
   a ["beforeRequest" or "afterRequest"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects
 
 ```js
-var validate = require('har-validator')
-
-validate.cacheEntry(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.cacheEntry(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.content(data)
@@ -126,14 +104,9 @@ validate.cacheEntry(data.then(function (HAR) {
   a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object
 
 ```js
-var validate = require('har-validator')
-
-validate.content(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.content(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.cookie(data)
@@ -144,14 +117,9 @@ validate.content(data.then(function (HAR) {
   a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object
 
 ```js
-var validate = require('har-validator')
-
-validate.cookie(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.cookie(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.creator(data)
@@ -162,14 +130,9 @@ validate.cookie(data.then(function (HAR) {
   a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object
 
 ```js
-var validate = require('har-validator')
-
-validate.creator(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.creator(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.entry(data)
@@ -180,14 +143,9 @@ validate.creator(data.then(function (HAR) {
   an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object
 
 ```js
-var validate = require('har-validator')
-
-validate.entry(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.entry(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.log(data)
@@ -202,14 +160,9 @@ alias of [`Validate(data)`](#validate-data-callback-)
   a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object
 
 ```js
-var validate = require('har-validator')
-
-validate.page(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.page(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.pageTimings(data)
@@ -220,14 +173,9 @@ validate.page(data.then(function (HAR) {
   a [pageTimings](http://www.softwareishard.com/blog/har-12-spec/#pageTimings) object
 
 ```js
-var validate = require('har-validator')
-
-validate.pageTimings(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.pageTimings(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.postData(data)
@@ -238,14 +186,9 @@ validate.pageTimings(data.then(function (HAR) {
   a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object
 
 ```js
-var validate = require('har-validator')
-
-validate.postData(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.postData(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.record(data)
@@ -256,14 +199,9 @@ validate.postData(data.then(function (HAR) {
   a [record](http://www.softwareishard.com/blog/har-12-spec/#headers) object
 
 ```js
-var validate = require('har-validator')
-
-validate.record(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.record(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.request(data)
@@ -274,14 +212,9 @@ validate.record(data.then(function (HAR) {
   a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object
 
 ```js
-var validate = require('har-validator')
-
-validate.request(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.request(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.response(data)
@@ -292,14 +225,9 @@ validate.request(data.then(function (HAR) {
   a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object
 
 ```js
-var validate = require('har-validator')
-
-validate.cacheEntry(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.cacheEntry(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ### Validate.timings(data)
@@ -310,14 +238,9 @@ validate.cacheEntry(data.then(function (HAR) {
   a [timings](http://www.softwareishard.com/blog/har-12-spec/#timings) object
 
 ```js
-var validate = require('har-validator')
-
-validate.timings(data.then(function (HAR) {
-    console.log('horray!')
-  })
-  .catch(function (error) {
-    console.error(error)
-  })
+validate.timings(data)
+  .then(data => console.log('horray!'))
+  .catch(console.error)
 ```
 
 ----
index f2e9595..b6a9cea 100644 (file)
   },
   "maintainers": [
     {
-      "name": "Sindre Sorhus",
-      "email": "sindresorhus@gmail.com",
-      "url": "sindresorhus.com"
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
     },
     {
-      "name": "Joshua Appelman",
-      "email": "jappelman@xebia.com",
-      "url": "jbnicolai.com"
+      "name": "jbnicolai",
+      "email": "jappelman@xebia.com"
     }
   ],
   "engines": {
   "devDependencies": {
     "mocha": "*"
   },
-  "readme": "# ansi-styles [![Build Status](https://travis-ci.org/chalk/ansi-styles.svg?branch=master)](https://travis-ci.org/chalk/ansi-styles)\n\n> [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code#Colors_and_Styles) for styling strings in the terminal\n\nYou probably want the higher-level [chalk](https://github.com/chalk/chalk) module for styling your strings.\n\n![](screenshot.png)\n\n\n## Install\n\n```\n$ npm install --save ansi-styles\n```\n\n\n## Usage\n\n```js\nvar ansi = require('ansi-styles');\n\nconsole.log(ansi.green.open + 'Hello world!' + ansi.green.close);\n```\n\n\n## API\n\nEach style has an `open` and `close` property.\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue`\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## Advanced usage\n\nBy default you get a map of styles, but the styles are also available as groups. They are non-enumerable so they don't show up unless you access them explicitly. This makes it easier to expose only a subset in a higher-level module.\n\n- `ansi.modifiers`\n- `ansi.colors`\n- `ansi.bgColors`\n\n\n###### Example\n\n```js\nconsole.log(ansi.colors.green.open);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
-  "readmeFilename": "readme.md",
+  "gitHead": "18421cbe4a2d93359ec2599a894f704be126d066",
   "bugs": {
     "url": "https://github.com/chalk/ansi-styles/issues"
   },
-  "homepage": "https://github.com/chalk/ansi-styles#readme",
+  "homepage": "https://github.com/chalk/ansi-styles",
   "_id": "ansi-styles@2.1.0",
   "_shasum": "990f747146927b559a932bf92959163d60c0d0e2",
+  "_from": "ansi-styles@>=2.1.0 <3.0.0",
+  "_npmVersion": "2.10.1",
+  "_nodeVersion": "0.12.4",
+  "_npmUser": {
+    "name": "jbnicolai",
+    "email": "jappelman@xebia.com"
+  },
+  "dist": {
+    "shasum": "990f747146927b559a932bf92959163d60c0d0e2",
+    "tarball": "http://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-2.1.0.tgz",
-  "_from": "ansi-styles@>=2.1.0 <3.0.0"
+  "readme": "ERROR: No README data found!"
 }
index b2bafb2..d0f6c0f 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "escape-string-regexp",
-  "version": "1.0.3",
+  "version": "1.0.4",
   "description": "Escape RegExp special characters",
   "license": "MIT",
   "repository": {
   "author": {
     "name": "Sindre Sorhus",
     "email": "sindresorhus@gmail.com",
-    "url": "http://sindresorhus.com"
+    "url": "sindresorhus.com"
   },
   "maintainers": [
     {
-      "name": "Sindre Sorhus",
-      "email": "sindresorhus@gmail.com",
-      "url": "http://sindresorhus.com"
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
     },
     {
-      "name": "Joshua Appelman",
-      "email": "jappelman@xebia.com",
-      "url": "http://jbnicolai.com"
+      "name": "jbnicolai",
+      "email": "jappelman@xebia.com"
     }
   ],
   "engines": {
     "node": ">=0.8.0"
   },
   "scripts": {
-    "test": "mocha"
+    "test": "xo && ava"
   },
   "files": [
     "index.js"
   ],
   "keywords": [
+    "escape",
     "regex",
     "regexp",
     "re",
     "regular",
     "expression",
-    "escape",
     "string",
     "str",
     "special",
     "characters"
   ],
   "devDependencies": {
-    "mocha": "*"
+    "ava": "*",
+    "xo": "*"
   },
-  "readme": "# escape-string-regexp [![Build Status](https://travis-ci.org/sindresorhus/escape-string-regexp.svg?branch=master)](https://travis-ci.org/sindresorhus/escape-string-regexp)\n\n> Escape RegExp special characters\n\n\n## Install\n\n```sh\n$ npm install --save escape-string-regexp\n```\n\n\n## Usage\n\n```js\nvar escapeStringRegexp = require('escape-string-regexp');\n\nvar escapedString = escapeStringRegexp('how much $ for a unicorn?');\n//=> how much \\$ for a unicorn\\?\n\nnew RegExp(escapedString);\n```\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
-  "readmeFilename": "readme.md",
+  "gitHead": "e9ca6832a9506ca26402cb0e6dc95efcf35b0b97",
   "bugs": {
     "url": "https://github.com/sindresorhus/escape-string-regexp/issues"
   },
-  "homepage": "https://github.com/sindresorhus/escape-string-regexp#readme",
-  "_id": "escape-string-regexp@1.0.3",
-  "_shasum": "9e2d8b25bc2555c3336723750e03f099c2735bb5",
-  "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.3.tgz",
-  "_from": "escape-string-regexp@>=1.0.2 <2.0.0"
+  "homepage": "https://github.com/sindresorhus/escape-string-regexp",
+  "_id": "escape-string-regexp@1.0.4",
+  "_shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
+  "_from": "escape-string-regexp@>=1.0.2 <2.0.0",
+  "_npmVersion": "2.14.7",
+  "_nodeVersion": "4.2.1",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "dist": {
+    "shasum": "b85e679b46f72d03fbbe8a3bf7259d535c21b62f",
+    "tarball": "http://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.4.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 808a963..87ac82d 100644 (file)
@@ -5,7 +5,7 @@
 
 ## Install
 
-```sh
+```
 $ npm install --save escape-string-regexp
 ```
 
@@ -13,10 +13,10 @@ $ npm install --save escape-string-regexp
 ## Usage
 
 ```js
-var escapeStringRegexp = require('escape-string-regexp');
+const escapeStringRegexp = require('escape-string-regexp');
 
-var escapedString = escapeStringRegexp('how much $ for a unicorn?');
-//=> how much \$ for a unicorn\?
+const escapedString = escapeStringRegexp('how much $ for a unicorn?');
+//=> 'how much \$ for a unicorn\?'
 
 new RegExp(escapedString);
 ```
index 15f6237..d39a62e 100644 (file)
   },
   "maintainers": [
     {
-      "name": "Sindre Sorhus",
-      "email": "sindresorhus@gmail.com",
-      "url": "sindresorhus.com"
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
     },
     {
-      "name": "Joshua Appelman",
-      "email": "jappelman@xebia.com",
-      "url": "jbnicolai.com"
+      "name": "jbnicolai",
+      "email": "jappelman@xebia.com"
     }
   ],
   "engines": {
   "devDependencies": {
     "ava": "0.0.4"
   },
-  "readme": "# has-ansi [![Build Status](https://travis-ci.org/sindresorhus/has-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/has-ansi)\n\n> Check if a string has [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code)\n\n\n## Install\n\n```\n$ npm install --save has-ansi\n```\n\n\n## Usage\n\n```js\nvar hasAnsi = require('has-ansi');\n\nhasAnsi('\\u001b[4mcake\\u001b[0m');\n//=> true\n\nhasAnsi('cake');\n//=> false\n```\n\n\n## Related\n\n- [has-ansi-cli](https://github.com/sindresorhus/has-ansi-cli) - CLI for this module\n- [strip-ansi](https://github.com/sindresorhus/strip-ansi) - Strip ANSI escape codes\n- [ansi-regex](https://github.com/sindresorhus/ansi-regex) - Regular expression for matching ANSI escape codes\n- [chalk](https://github.com/sindresorhus/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
-  "readmeFilename": "readme.md",
+  "gitHead": "0722275e1bef139fcd09137da6e5550c3cd368b9",
   "bugs": {
     "url": "https://github.com/sindresorhus/has-ansi/issues"
   },
-  "homepage": "https://github.com/sindresorhus/has-ansi#readme",
+  "homepage": "https://github.com/sindresorhus/has-ansi",
   "_id": "has-ansi@2.0.0",
   "_shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91",
+  "_from": "has-ansi@>=2.0.0 <3.0.0",
+  "_npmVersion": "2.11.2",
+  "_nodeVersion": "0.12.5",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "dist": {
+    "shasum": "34f5049ce1ecdf2b0649af3ef24e45ed35416d91",
+    "tarball": "http://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/has-ansi/-/has-ansi-2.0.0.tgz",
-  "_from": "has-ansi@>=2.0.0 <3.0.0"
+  "readme": "ERROR: No README data found!"
 }
index c43b7aa..38a1ecb 100644 (file)
   },
   "maintainers": [
     {
-      "name": "Sindre Sorhus",
-      "email": "sindresorhus@gmail.com",
-      "url": "sindresorhus.com"
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
     },
     {
-      "name": "Joshua Appelman",
-      "email": "jappelman@xebia.com",
-      "url": "jbnicolai.com"
+      "name": "jbnicolai",
+      "email": "jappelman@xebia.com"
     }
   ],
   "engines": {
     "mocha": "*",
     "require-uncached": "^1.0.2"
   },
-  "readme": "# supports-color [![Build Status](https://travis-ci.org/chalk/supports-color.svg?branch=master)](https://travis-ci.org/chalk/supports-color)\n\n> Detect whether a terminal supports color\n\n\n## Install\n\n```\n$ npm install --save supports-color\n```\n\n\n## Usage\n\n```js\nvar supportsColor = require('supports-color');\n\nif (supportsColor) {\n\tconsole.log('Terminal supports color');\n}\n```\n\nIt obeys the `--color` and `--no-color` CLI flags.\n\nFor situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n\n## Related\n\n- [supports-color-cli](https://github.com/chalk/supports-color-cli) - CLI for this module\n- [chalk](https://github.com/chalk/chalk) - Terminal string styling done right\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
-  "readmeFilename": "readme.md",
+  "gitHead": "8400d98ade32b2adffd50902c06d9e725a5c6588",
   "bugs": {
     "url": "https://github.com/chalk/supports-color/issues"
   },
-  "homepage": "https://github.com/chalk/supports-color#readme",
+  "homepage": "https://github.com/chalk/supports-color",
   "_id": "supports-color@2.0.0",
   "_shasum": "535d045ce6b6363fa40117084629995e9df324c7",
+  "_from": "supports-color@>=2.0.0 <3.0.0",
+  "_npmVersion": "2.11.2",
+  "_nodeVersion": "0.12.5",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "dist": {
+    "shasum": "535d045ce6b6363fa40117084629995e9df324c7",
+    "tarball": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz",
-  "_from": "supports-color@>=2.0.0 <3.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 2ad36d4..dc5e754 100644 (file)
@@ -9,19 +9,16 @@
   },
   "maintainers": [
     {
-      "name": "Sindre Sorhus",
-      "email": "sindresorhus@gmail.com",
-      "url": "sindresorhus.com"
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
     },
     {
-      "name": "Joshua Appelman",
-      "email": "jappelman@xebia.com",
-      "url": "jbnicolai.com"
+      "name": "jbnicolai",
+      "email": "jappelman@xebia.com"
     },
     {
-      "name": "JD Ballard",
-      "email": "i.am.qix@gmail.com",
-      "url": "github.com/qix-"
+      "name": "unicorn",
+      "email": "sindresorhus+unicorn@gmail.com"
     }
   ],
   "engines": {
       "mocha"
     ]
   },
-  "readme": "<h1 align=\"center\">\n\t<br>\n\t<br>\n\t<img width=\"360\" src=\"https://cdn.rawgit.com/chalk/chalk/19935d6484811c5e468817f846b7b3d417d7bf4a/logo.svg\" alt=\"chalk\">\n\t<br>\n\t<br>\n\t<br>\n</h1>\n\n> Terminal string styling done right\n\n[![Build Status](https://travis-ci.org/chalk/chalk.svg?branch=master)](https://travis-ci.org/chalk/chalk)\n[![Coverage Status](https://coveralls.io/repos/chalk/chalk/badge.svg?branch=master)](https://coveralls.io/r/chalk/chalk?branch=master)\n[![](http://img.shields.io/badge/unicorn-approved-ff69b4.svg)](https://www.youtube.com/watch?v=9auOCbH5Ns4)\n\n\n[colors.js](https://github.com/Marak/colors.js) used to be the most popular string styling module, but it has serious deficiencies like extending `String.prototype` which causes all kinds of [problems](https://github.com/yeoman/yo/issues/68). Although there are other ones, they either do too much or not enough.\n\n**Chalk is a clean and focused alternative.**\n\n![](https://github.com/chalk/ansi-styles/raw/master/screenshot.png)\n\n\n## Why\n\n- Highly performant\n- Doesn't extend `String.prototype`\n- Expressive API\n- Ability to nest styles\n- Clean and focused\n- Auto-detects color support\n- Actively maintained\n- [Used by ~4500 modules](https://www.npmjs.com/browse/depended/chalk) as of July 15, 2015\n\n\n## Install\n\n```\n$ npm install --save chalk\n```\n\n\n## Usage\n\nChalk comes with an easy to use composable API where you just chain and nest the styles you want.\n\n```js\nvar chalk = require('chalk');\n\n// style a string\nchalk.blue('Hello world!');\n\n// combine styled and normal strings\nchalk.blue('Hello') + 'World' + chalk.red('!');\n\n// compose multiple styles using the chainable API\nchalk.blue.bgRed.bold('Hello world!');\n\n// pass in multiple arguments\nchalk.blue('Hello', 'World!', 'Foo', 'bar', 'biz', 'baz');\n\n// nest styles\nchalk.red('Hello', chalk.underline.bgBlue('world') + '!');\n\n// nest styles of the same type even (color, underline, background)\nchalk.green(\n\t'I am a green line ' +\n\tchalk.blue.underline.bold('with a blue substring') +\n\t' that becomes green again!'\n);\n```\n\nEasily define your own themes.\n\n```js\nvar chalk = require('chalk');\nvar error = chalk.bold.red;\nconsole.log(error('Error!'));\n```\n\nTake advantage of console.log [string substitution](http://nodejs.org/docs/latest/api/console.html#console_console_log_data).\n\n```js\nvar name = 'Sindre';\nconsole.log(chalk.green('Hello %s'), name);\n//=> Hello Sindre\n```\n\n\n## API\n\n### chalk.`<style>[.<style>...](string, [string...])`\n\nExample: `chalk.red.bold.underline('Hello', 'world');`\n\nChain [styles](#styles) and call the last one as a method with a string argument. Order doesn't matter, and later styles take precedent in case of a conflict. This simply means that `Chalk.red.yellow.green` is equivalent to `Chalk.green`.\n\nMultiple arguments will be separated by space.\n\n### chalk.enabled\n\nColor support is automatically detected, but you can override it by setting the `enabled` property. You should however only do this in your own code as it applies globally to all chalk consumers.\n\nIf you need to change this in a reusable module create a new instance:\n\n```js\nvar ctx = new chalk.constructor({enabled: false});\n```\n\n### chalk.supportsColor\n\nDetect whether the terminal [supports color](https://github.com/chalk/supports-color). Used internally and handled for you, but exposed for convenience.\n\nCan be overridden by the user with the flags `--color` and `--no-color`. For situations where using `--color` is not possible, add an environment variable `FORCE_COLOR` with any value to force color. Trumps `--no-color`.\n\n### chalk.styles\n\nExposes the styles as [ANSI escape codes](https://github.com/chalk/ansi-styles).\n\nGenerally not useful, but you might need just the `.open` or `.close` escape code if you're mixing externally styled strings with your own.\n\n```js\nvar chalk = require('chalk');\n\nconsole.log(chalk.styles.red);\n//=> {open: '\\u001b[31m', close: '\\u001b[39m'}\n\nconsole.log(chalk.styles.red.open + 'Hello' + chalk.styles.red.close);\n```\n\n### chalk.hasColor(string)\n\nCheck whether a string [has color](https://github.com/chalk/has-ansi).\n\n### chalk.stripColor(string)\n\n[Strip color](https://github.com/chalk/strip-ansi) from a string.\n\nCan be useful in combination with `.supportsColor` to strip color on externally styled text when it's not supported.\n\nExample:\n\n```js\nvar chalk = require('chalk');\nvar styledString = getText();\n\nif (!chalk.supportsColor) {\n\tstyledString = chalk.stripColor(styledString);\n}\n```\n\n\n## Styles\n\n### Modifiers\n\n- `reset`\n- `bold`\n- `dim`\n- `italic` *(not widely supported)*\n- `underline`\n- `inverse`\n- `hidden`\n- `strikethrough` *(not widely supported)*\n\n### Colors\n\n- `black`\n- `red`\n- `green`\n- `yellow`\n- `blue` *(on Windows the bright version is used as normal blue is illegible)*\n- `magenta`\n- `cyan`\n- `white`\n- `gray`\n\n### Background colors\n\n- `bgBlack`\n- `bgRed`\n- `bgGreen`\n- `bgYellow`\n- `bgBlue`\n- `bgMagenta`\n- `bgCyan`\n- `bgWhite`\n\n\n## 256-colors\n\nChalk does not support anything other than the base eight colors, which guarantees it will work on all terminals and systems. Some terminals, specifically `xterm` compliant ones, will support the full range of 8-bit colors. For this the lower level [ansi-256-colors](https://github.com/jbnicolai/ansi-256-colors) package can be used.\n\n\n## Windows\n\nIf you're on Windows, do yourself a favor and use [`cmder`](http://bliker.github.io/cmder/) instead of `cmd.exe`.\n\n\n## Related\n\n- [chalk-cli](https://github.com/chalk/chalk-cli) - CLI for this module\n- [ansi-styles](https://github.com/chalk/ansi-styles/) - ANSI escape codes for styling strings in the terminal\n- [supports-color](https://github.com/chalk/supports-color/) - Detect whether a terminal supports color\n- [strip-ansi](https://github.com/chalk/strip-ansi) - Strip ANSI escape codes\n- [has-ansi](https://github.com/chalk/has-ansi) - Check if a string has ANSI escape codes\n- [ansi-regex](https://github.com/chalk/ansi-regex) - Regular expression for matching ANSI escape codes\n- [wrap-ansi](https://github.com/chalk/wrap-ansi) - Wordwrap a string with ANSI escape codes\n\n\n## License\n\nMIT © [Sindre Sorhus](http://sindresorhus.com)\n",
-  "readmeFilename": "readme.md",
+  "gitHead": "8b554e254e89c85c1fd04dcc444beeb15824e1a5",
   "bugs": {
     "url": "https://github.com/chalk/chalk/issues"
   },
   "homepage": "https://github.com/chalk/chalk#readme",
   "_id": "chalk@1.1.1",
   "_shasum": "509afb67066e7499f7eb3535c77445772ae2d019",
+  "_from": "chalk@>=1.1.1 <2.0.0",
+  "_npmVersion": "2.13.5",
+  "_nodeVersion": "0.12.7",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "dist": {
+    "shasum": "509afb67066e7499f7eb3535c77445772ae2d019",
+    "tarball": "http://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/chalk/-/chalk-1.1.1.tgz",
-  "_from": "chalk@>=1.1.1 <2.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 64d7d64..5b8486a 100644 (file)
   "scripts": {
     "test": "echo \"Error: no test specified\" && exit 1"
   },
-  "readme": "# graceful-readlink\n[![NPM Version](http://img.shields.io/npm/v/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)\n[![NPM Downloads](https://img.shields.io/npm/dm/graceful-readlink.svg?style=flat)](https://www.npmjs.org/package/graceful-readlink)\n\n\n## Usage\n\n```js\nvar readlinkSync = require('graceful-readlink').readlinkSync;\nconsole.log(readlinkSync(f));\n// output\n//  the file pointed to when `f` is a symbolic link\n//  the `f` itself when `f` is not a symbolic link\n```\n## Licence\n\nMIT License\n",
-  "readmeFilename": "README.md",
+  "gitHead": "f6655275bebef706fb63fd01b5f062a7052419a5",
   "_id": "graceful-readlink@1.0.1",
   "_shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725",
+  "_from": "graceful-readlink@>=1.0.0",
+  "_npmVersion": "2.1.17",
+  "_nodeVersion": "0.11.14",
+  "_npmUser": {
+    "name": "zhiyelee",
+    "email": "zhiyelee@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "zhiyelee",
+      "email": "zhiyelee@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "4cafad76bc62f02fa039b2f94e9a3dd3a391a725",
+    "tarball": "http://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/graceful-readlink/-/graceful-readlink-1.0.1.tgz",
-  "_from": "graceful-readlink@>=1.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 3dd2795..15a0435 100644 (file)
   "dependencies": {
     "graceful-readlink": ">= 1.0.0"
   },
-  "readme": "# Commander.js\n\n\n[![Build Status](https://api.travis-ci.org/tj/commander.js.svg)](http://travis-ci.org/tj/commander.js)\n[![NPM Version](http://img.shields.io/npm/v/commander.svg?style=flat)](https://www.npmjs.org/package/commander)\n[![NPM Downloads](https://img.shields.io/npm/dm/commander.svg?style=flat)](https://www.npmjs.org/package/commander)\n[![Join the chat at https://gitter.im/tj/commander.js](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/tj/commander.js?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n  The complete solution for [node.js](http://nodejs.org) command-line interfaces, inspired by Ruby's [commander](https://github.com/tj/commander).  \n  [API documentation](http://tj.github.com/commander.js/)\n\n\n## Installation\n\n    $ npm install commander\n\n## Option parsing\n\n Options with commander are defined with the `.option()` method, also serving as documentation for the options. The example below parses args and options from `process.argv`, leaving remaining args as the `program.args` array which were not consumed by options.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n  .version('0.0.1')\n  .option('-p, --peppers', 'Add peppers')\n  .option('-P, --pineapple', 'Add pineapple')\n  .option('-b, --bbq-sauce', 'Add bbq sauce')\n  .option('-c, --cheese [type]', 'Add the specified type of cheese [marble]', 'marble')\n  .parse(process.argv);\n\nconsole.log('you ordered a pizza with:');\nif (program.peppers) console.log('  - peppers');\nif (program.pineapple) console.log('  - pineapple');\nif (program.bbqSauce) console.log('  - bbq');\nconsole.log('  - %s cheese', program.cheese);\n```\n\n Short flags may be passed as a single arg, for example `-abc` is equivalent to `-a -b -c`. Multi-word options such as \"--template-engine\" are camel-cased, becoming `program.templateEngine` etc.\n\n\n## Coercion\n\n```js\nfunction range(val) {\n  return val.split('..').map(Number);\n}\n\nfunction list(val) {\n  return val.split(',');\n}\n\nfunction collect(val, memo) {\n  memo.push(val);\n  return memo;\n}\n\nfunction increaseVerbosity(v, total) {\n  return total + 1;\n}\n\nprogram\n  .version('0.0.1')\n  .usage('[options] <file ...>')\n  .option('-i, --integer <n>', 'An integer argument', parseInt)\n  .option('-f, --float <n>', 'A float argument', parseFloat)\n  .option('-r, --range <a>..<b>', 'A range', range)\n  .option('-l, --list <items>', 'A list', list)\n  .option('-o, --optional [value]', 'An optional value')\n  .option('-c, --collect [value]', 'A repeatable value', collect, [])\n  .option('-v, --verbose', 'A value that can be increased', increaseVerbosity, 0)\n  .parse(process.argv);\n\nconsole.log(' int: %j', program.integer);\nconsole.log(' float: %j', program.float);\nconsole.log(' optional: %j', program.optional);\nprogram.range = program.range || [];\nconsole.log(' range: %j..%j', program.range[0], program.range[1]);\nconsole.log(' list: %j', program.list);\nconsole.log(' collect: %j', program.collect);\nconsole.log(' verbosity: %j', program.verbose);\nconsole.log(' args: %j', program.args);\n```\n\n## Regular Expression\n```js\nprogram\n  .version('0.0.1')\n  .option('-s --size <size>', 'Pizza size', /^(large|medium|small)$/i, 'medium')\n  .option('-d --drink [drink]', 'Drink', /^(coke|pepsi|izze)$/i)\n  .parse(process.argv);\n  \nconsole.log(' size: %j', program.size);\nconsole.log(' drink: %j', program.drink);\n```\n\n## Variadic arguments\n\n The last argument of a command can be variadic, and only the last argument.  To make an argument variadic you have to\n append `...` to the argument name.  Here is an example:\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n  .version('0.0.1')\n  .command('rmdir <dir> [otherDirs...]')\n  .action(function (dir, otherDirs) {\n    console.log('rmdir %s', dir);\n    if (otherDirs) {\n      otherDirs.forEach(function (oDir) {\n        console.log('rmdir %s', oDir);\n      });\n    }\n  });\n\nprogram.parse(process.argv);\n```\n\n An `Array` is used for the value of a variadic argument.  This applies to `program.args` as well as the argument passed\n to your action as demonstrated above.\n\n## Specify the argument syntax\n\n```js\n#!/usr/bin/env node\n\nvar program = require('../');\n\nprogram\n  .version('0.0.1')\n  .arguments('<cmd> [env]')\n  .action(function (cmd, env) {\n     cmdValue = cmd;\n     envValue = env;\n  });\n\nprogram.parse(process.argv);\n\nif (typeof cmdValue === 'undefined') {\n   console.error('no command given!');\n   process.exit(1);\n}\nconsole.log('command:', cmdValue);\nconsole.log('environment:', envValue || \"no environment given\");\n```\n\n## Git-style sub-commands\n\n```js\n// file: ./examples/pm\nvar program = require('..');\n\nprogram\n  .version('0.0.1')\n  .command('install [name]', 'install one or more packages')\n  .command('search [query]', 'search with optional query')\n  .command('list', 'list packages installed', {isDefault: true})\n  .parse(process.argv);\n```\n\nWhen `.command()` is invoked with a description argument, no `.action(callback)` should be called to handle sub-commands, otherwise there will be an error. This tells commander that you're going to use separate executables for sub-commands, much like `git(1)` and other popular tools.  \nThe commander will try to search the executables in the directory of the entry script (like `./examples/pm`) with the name `program-command`, like `pm-install`, `pm-search`.\n\nOptions can be passed with the call to `.command()`. Specifying `true` for `opts.noHelp` will remove the option from the generated help output. Specifying `true` for `opts.isDefault` will run the subcommand if no other subcommand is specified.\n\nIf the program is designed to be installed globally, make sure the executables have proper modes, like `755`.\n\n### `--harmony`\n\nYou can enable `--harmony` option in two ways:\n* Use `#! /usr/bin/env node --harmony` in the sub-commands scripts. Note some os version don’t support this pattern.\n* Use the `--harmony` option when call the command, like `node --harmony examples/pm publish`. The `--harmony` option will be preserved when spawning sub-command process.\n\n## Automated --help\n\n The help information is auto-generated based on the information commander already knows about your program, so the following `--help` info is for free:\n\n```  \n $ ./examples/pizza --help\n\n   Usage: pizza [options]\n\n   An application for pizzas ordering\n\n   Options:\n\n     -h, --help           output usage information\n     -V, --version        output the version number\n     -p, --peppers        Add peppers\n     -P, --pineapple      Add pineapple\n     -b, --bbq            Add bbq sauce\n     -c, --cheese <type>  Add the specified type of cheese [marble]\n     -C, --no-cheese      You do not want any cheese\n\n```\n\n## Custom help\n\n You can display arbitrary `-h, --help` information\n by listening for \"--help\". Commander will automatically\n exit once you are done so that the remainder of your program\n does not execute causing undesired behaviours, for example\n in the following executable \"stuff\" will not output when\n `--help` is used.\n\n```js\n#!/usr/bin/env node\n\n/**\n * Module dependencies.\n */\n\nvar program = require('commander');\n\nprogram\n  .version('0.0.1')\n  .option('-f, --foo', 'enable some foo')\n  .option('-b, --bar', 'enable some bar')\n  .option('-B, --baz', 'enable some baz');\n\n// must be before .parse() since\n// node's emit() is immediate\n\nprogram.on('--help', function(){\n  console.log('  Examples:');\n  console.log('');\n  console.log('    $ custom-help --help');\n  console.log('    $ custom-help -h');\n  console.log('');\n});\n\nprogram.parse(process.argv);\n\nconsole.log('stuff');\n```\n\nYields the following help output when `node script-name.js -h` or `node script-name.js --help` are run:\n\n```\n\nUsage: custom-help [options]\n\nOptions:\n\n  -h, --help     output usage information\n  -V, --version  output the version number\n  -f, --foo      enable some foo\n  -b, --bar      enable some bar\n  -B, --baz      enable some baz\n\nExamples:\n\n  $ custom-help --help\n  $ custom-help -h\n\n```\n\n## .outputHelp(cb)\n\nOutput help information without exiting.\nOptional callback cb allows post-processing of help text before it is displayed.\n\nIf you want to display help by default (e.g. if no command was provided), you can use something like:\n\n```js\nvar program = require('commander');\nvar colors = require('colors');\n\nprogram\n  .version('0.0.1')\n  .command('getstream [url]', 'get stream URL')\n  .parse(process.argv);\n\n  if (!process.argv.slice(2).length) {\n    program.outputHelp(make_red);\n  }\n\nfunction make_red(txt) {\n  return colors.red(txt); //display the help text in red on the console\n}\n```\n\n## .help(cb)\n\n  Output help information and exit immediately.\n  Optional callback cb allows post-processing of help text before it is displayed.\n\n## Examples\n\n```js\nvar program = require('commander');\n\nprogram\n  .version('0.0.1')\n  .option('-C, --chdir <path>', 'change the working directory')\n  .option('-c, --config <path>', 'set config path. defaults to ./deploy.conf')\n  .option('-T, --no-tests', 'ignore test hook')\n\nprogram\n  .command('setup [env]')\n  .description('run setup commands for all envs')\n  .option(\"-s, --setup_mode [mode]\", \"Which setup mode to use\")\n  .action(function(env, options){\n    var mode = options.setup_mode || \"normal\";\n    env = env || 'all';\n    console.log('setup for %s env(s) with %s mode', env, mode);\n  });\n\nprogram\n  .command('exec <cmd>')\n  .alias('ex')\n  .description('execute the given remote cmd')\n  .option(\"-e, --exec_mode <mode>\", \"Which exec mode to use\")\n  .action(function(cmd, options){\n    console.log('exec \"%s\" using %s mode', cmd, options.exec_mode);\n  }).on('--help', function() {\n    console.log('  Examples:');\n    console.log();\n    console.log('    $ deploy exec sequential');\n    console.log('    $ deploy exec async');\n    console.log();\n  });\n\nprogram\n  .command('*')\n  .action(function(env){\n    console.log('deploying \"%s\"', env);\n  });\n\nprogram.parse(process.argv);\n```\n\nMore Demos can be found in the [examples](https://github.com/tj/commander.js/tree/master/examples) directory.\n\n## License\n\nMIT\n\n",
-  "readmeFilename": "Readme.md",
+  "gitHead": "b2aad7a8471d434593a85306aa73777a526e9f75",
   "bugs": {
     "url": "https://github.com/tj/commander.js/issues"
   },
   "homepage": "https://github.com/tj/commander.js#readme",
   "_id": "commander@2.9.0",
   "_shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4",
+  "_from": "commander@>=2.9.0 <3.0.0",
+  "_npmVersion": "2.11.3",
+  "_nodeVersion": "0.12.7",
+  "_npmUser": {
+    "name": "zhiyelee",
+    "email": "zhiyelee@gmail.com"
+  },
+  "dist": {
+    "shasum": "9c99094176e12240cb22d6c5146098400fe0f7d4",
+    "tarball": "http://registry.npmjs.org/commander/-/commander-2.9.0.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "tjholowaychuk",
+      "email": "tj@vision-media.ca"
+    },
+    {
+      "name": "somekittens",
+      "email": "rkoutnik@gmail.com"
+    },
+    {
+      "name": "zhiyelee",
+      "email": "zhiyelee@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/commander/-/commander-2.9.0.tgz",
-  "_from": "commander@>=2.9.0 <3.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 3038dae..9cb8380 100644 (file)
@@ -11,4 +11,4 @@ exports['alpha'] = /^[a-zA-Z]+$/
 exports['alphanumeric'] = /^[a-zA-Z0-9]+$/
 exports['style'] = /\s*(.+?):\s*([^;]+);?/g
 exports['phone'] = /^\+(?:[0-9] ?){6,14}[0-9]$/
-exports['utc-millisec'] = /^[0-9]+(\.?[0-9]+)?$/
+exports['utc-millisec'] = /^[0-9]{1,15}\.?[0-9]{0,15}$/
index e2bc772..db1ac2a 100644 (file)
   "devDependencies": {
     "tape": "^2.13.4"
   },
-  "readme": "# generate-function\n\nModule that helps you write generated functions in Node\n\n```\nnpm install generate-function\n```\n\n[![build status](http://img.shields.io/travis/mafintosh/generate-function.svg?style=flat)](http://travis-ci.org/mafintosh/generate-function)\n\n## Disclamer\n\nWriting code that generates code is hard.\nYou should only use this if you really, really, really need this for performance reasons (like schema validators / parsers etc).\n\n## Usage\n\n``` js\nvar genfun = require('generate-function')\n\nvar addNumber = function(val) {\n  var fn = genfun()\n    ('function add(n) {')\n      ('return n + %d', val) // supports format strings to insert values\n    ('}')\n\n  return fn.toFunction() // will compile the function\n}\n\nvar add2 = addNumber(2)\n\nconsole.log('1+2=', add2(1))\nconsole.log(add2.toString()) // prints the generated function\n```\n\nIf you need to close over variables in your generated function pass them to `toFunction(scope)`\n\n``` js\nvar multiply = function(a, b) {\n  return a * b\n}\n\nvar addAndMultiplyNumber = function(val) {\n  var fn = genfun()\n    ('function(n) {')\n      ('if (typeof n !== \"number\") {') // ending a line with { will indent the source\n        ('throw new Error(\"argument should be a number\")')\n      ('}')\n      ('var result = multiply(%d, n+%d)', val, val)\n      ('return result')\n    ('}')\n\n  // use fn.toString() if you want to see the generated source\n\n  return fn.toFunction({\n    multiply: multiply\n  })\n}\n\nvar addAndMultiply2 = addAndMultiplyNumber(2)\n\nconsole.log('(3 + 2) * 2 =', addAndMultiply2(3))\n```\n\n## Related\n\nSee [generate-object-property](https://github.com/mafintosh/generate-object-property) if you need to safely generate code that\ncan be used to reference an object property\n\n## License\n\nMIT",
-  "readmeFilename": "README.md",
+  "gitHead": "3d5fc8de5859be95f58e3af9bfb5f663edd95149",
   "_id": "generate-function@2.0.0",
   "_shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74",
+  "_from": "generate-function@>=2.0.0 <3.0.0",
+  "_npmVersion": "1.4.23",
+  "_npmUser": {
+    "name": "mafintosh",
+    "email": "mathiasbuus@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "mafintosh",
+      "email": "mathiasbuus@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "6858fe7c0969b7d4e9093337647ac79f60dfbe74",
+    "tarball": "http://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/generate-function/-/generate-function-2.0.0.tgz",
-  "_from": "generate-function@>=2.0.0 <3.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 41225e2..9f23619 100644 (file)
     "name": "Mikola Lysenko"
   },
   "license": "MIT",
-  "readmeFilename": "README.md",
   "gitHead": "0a85ea5b6b1264ea1cdecc6e5cf186adbb3ffc50",
   "bugs": {
     "url": "https://github.com/mikolalysenko/is-property/issues"
   },
-  "readme": "is-property\n===========\nTests if a property of a JavaScript object can be accessed using the dot (.) notation or if it must be enclosed in brackets, (ie use x[\" ... \"])\n\nExample\n-------\n\n```javascript\nvar isProperty = require(\"is-property\")\n\nconsole.log(isProperty(\"foo\"))  //Prints true\nconsole.log(isProperty(\"0\"))    //Prints false\n```\n\nInstall\n-------\n\n    npm install is-property\n    \n### `require(\"is-property\")(str)`\nChecks if str is a property\n\n* `str` is a string which we will test if it is a property or not\n\n**Returns** true or false depending if str is a property\n\n## Credits\n(c) 2013 Mikola Lysenko. MIT License",
-  "homepage": "https://github.com/mikolalysenko/is-property#readme",
+  "homepage": "https://github.com/mikolalysenko/is-property",
   "_id": "is-property@1.0.2",
   "_shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84",
+  "_from": "is-property@>=1.0.0 <2.0.0",
+  "_npmVersion": "2.1.4",
+  "_nodeVersion": "0.10.26",
+  "_npmUser": {
+    "name": "mikolalysenko",
+    "email": "mikolalysenko@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "mikolalysenko",
+      "email": "mikolalysenko@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "57fe1c4e48474edd65b09911f26b1cd4095dda84",
+    "tarball": "http://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz"
+  },
   "_resolved": "https://registry.npmjs.org/is-property/-/is-property-1.0.2.tgz",
-  "_from": "is-property@>=1.0.0 <2.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 0d018ab..8bc73da 100644 (file)
     "url": "@mafintosh"
   },
   "license": "MIT",
-  "readme": "# generate-object-property\n\nGenerate safe JS code that can used to reference a object property\n\n\tnpm install generate-object-property\n\n[![build status](http://img.shields.io/travis/mafintosh/generate-object-property.svg?style=flat)](http://travis-ci.org/mafintosh/generate-object-property)\n\n## Usage\n\n``` js\nvar gen = require('generate-object-property');\nconsole.log(gen('a','b')); // prints a.b\nconsole.log(gen('a', 'foo-bar')); // prints a[\"foo-bar\"]\n```\n\n## License\n\nMIT",
-  "readmeFilename": "README.md",
+  "gitHead": "0dd7d411018de54b2eae63b424c15b3e50bd678c",
   "_id": "generate-object-property@1.2.0",
   "_shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0",
+  "_from": "generate-object-property@>=1.1.0 <2.0.0",
+  "_npmVersion": "2.9.0",
+  "_nodeVersion": "2.0.1",
+  "_npmUser": {
+    "name": "mafintosh",
+    "email": "mathiasbuus@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "mafintosh",
+      "email": "mathiasbuus@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "9c0e1c40308ce804f4783618b937fa88f99d50d0",
+    "tarball": "http://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/generate-object-property/-/generate-object-property-1.2.0.tgz",
-  "_from": "generate-object-property@>=1.1.0 <2.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 6becf96..4b06776 100644 (file)
     "test": "node test.js"
   },
   "license": "MIT",
-  "readme": "# JSON Pointer for nodejs\n\nThis is an implementation of [JSON Pointer](http://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-08).\n\n## Usage\n\n    var jsonpointer = require(\"jsonpointer\");\n    var obj = { foo: 1, bar: { baz: 2}, qux: [3, 4, 5]};\n    var one = jsonpointer.get(obj, \"/foo\");\n    var two = jsonpointer.get(obj, \"/bar/baz\");\n    var three = jsonpointer.get(obj, \"/qux/0\");\n    var four = jsonpointer.get(obj, \"/qux/1\");\n    var five = jsonpointer.get(obj, \"/qux/2\");\n    var notfound = jsonpointer.get(obj, \"/quo\"); // returns null\n\n    jsonpointer.set(obj, \"/foo\", 6); // obj.foo = 6;\n\n## Testing\n\n    $ node test.js\n    All tests pass.\n    $\n\n[![Build Status](https://travis-ci.org/janl/node-jsonpointer.png?branch=master)](https://travis-ci.org/janl/node-jsonpointer)\n\n## Author\n\n(c) 2011 Jan Lehnardt <jan@apache.org>\n\n## License\n\nMIT License.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "26ea4a5c0fcb6d9a2e87f733403791dd05637af8",
   "homepage": "https://github.com/janl/node-jsonpointer#readme",
   "_id": "jsonpointer@2.0.0",
   "_shasum": "3af1dd20fe85463910d469a385e33017d2a030d9",
+  "_from": "jsonpointer@2.0.0",
+  "_npmVersion": "2.10.1",
+  "_nodeVersion": "0.10.36",
+  "_npmUser": {
+    "name": "marcbachmann",
+    "email": "marc.brookman@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "jan",
+      "email": "jan@apache.org"
+    },
+    {
+      "name": "marcbachmann",
+      "email": "marc.brookman@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "3af1dd20fe85463910d469a385e33017d2a030d9",
+    "tarball": "http://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/jsonpointer/-/jsonpointer-2.0.0.tgz",
-  "_from": "jsonpointer@2.0.0"
+  "readme": "ERROR: No README data found!"
 }
diff --git a/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc b/deps/npm/node_modules/request/node_modules/har-validator/node_modules/is-my-json-valid/node_modules/xtend/.jshintrc
deleted file mode 100644 (file)
index 77887b5..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-    "maxdepth": 4,
-    "maxstatements": 200,
-    "maxcomplexity": 12,
-    "maxlen": 80,
-    "maxparams": 5,
-
-    "curly": true,
-    "eqeqeq": true,
-    "immed": true,
-    "latedef": false,
-    "noarg": true,
-    "noempty": true,
-    "nonew": true,
-    "undef": true,
-    "unused": "vars",
-    "trailing": true,
-
-    "quotmark": true,
-    "expr": true,
-    "asi": true,
-
-    "browser": false,
-    "esnext": true,
-    "devel": false,
-    "node": false,
-    "nonstandard": false,
-
-    "predef": ["require", "module", "__dirname", "__filename"]
-}
index cc323c6..6f380f0 100644 (file)
   "engines": {
     "node": ">=0.4"
   },
-  "readme": "# xtend\n\n[![browser support][3]][4]\n\n[![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges)\n\nExtend like a boss\n\nxtend is a basic utility library which allows you to extend an object by appending all of the properties from each object in a list. When there are identical properties, the right-most property takes precedence.\n\n## Examples\n\n```js\nvar extend = require(\"xtend\")\n\n// extend returns a new object. Does not mutate arguments\nvar combination = extend({\n    a: \"a\",\n    b: 'c'\n}, {\n    b: \"b\"\n})\n// { a: \"a\", b: \"b\" }\n```\n\n## Stability status: Locked\n\n## MIT Licenced\n\n\n  [3]: http://ci.testling.com/Raynos/xtend.png\n  [4]: http://ci.testling.com/Raynos/xtend\n",
-  "readmeFilename": "README.md",
+  "gitHead": "23dc302a89756da89c1897bc732a752317e35390",
   "_id": "xtend@4.0.1",
   "_shasum": "a5c6d532be656e23db820efb943a1f04998d63af",
+  "_from": "xtend@>=4.0.0 <5.0.0",
+  "_npmVersion": "2.14.1",
+  "_nodeVersion": "0.10.32",
+  "_npmUser": {
+    "name": "raynos",
+    "email": "raynos2@gmail.com"
+  },
+  "dist": {
+    "shasum": "a5c6d532be656e23db820efb943a1f04998d63af",
+    "tarball": "http://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "raynos",
+      "email": "raynos2@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.1.tgz",
-  "_from": "xtend@>=4.0.0 <5.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 0d63f3c..63ba1b8 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "is-my-json-valid",
-  "version": "2.12.3",
+  "version": "2.12.4",
   "description": "A JSONSchema validator that uses code generation to be extremely fast",
   "main": "index.js",
   "dependencies": {
     "url": "https://github.com/mafintosh/is-my-json-valid/issues"
   },
   "homepage": "https://github.com/mafintosh/is-my-json-valid",
-  "readme": "# is-my-json-valid\n\nA [JSONSchema](http://json-schema.org/) validator that uses code generation\nto be extremely fast\n\n```\nnpm install is-my-json-valid\n```\n\nIt passes the entire JSONSchema v4 test suite except for `remoteRefs` and `maxLength`/`minLength` when using unicode surrogate pairs.\n\n[![build status](http://img.shields.io/travis/mafintosh/is-my-json-valid.svg?style=flat)](http://travis-ci.org/mafintosh/is-my-json-valid)\n\n## Usage\n\nSimply pass a schema to compile it\n\n``` js\nvar validator = require('is-my-json-valid')\n\nvar validate = validator({\n  required: true,\n  type: 'object',\n  properties: {\n    hello: {\n      required: true,\n      type: 'string'\n    }\n  }\n})\n\nconsole.log('should be valid', validate({hello: 'world'}))\nconsole.log('should not be valid', validate({}))\n\n// get the last list of errors by checking validate.errors\n// the following will print [{field: 'data.hello', message: 'is required'}]\nconsole.log(validate.errors)\n```\n\nYou can also pass the schema as a string\n\n``` js\nvar validate = validate('{\"type\": ... }')\n```\n\nOptionally you can use the require submodule to load a schema from `__dirname`\n\n``` js\nvar validator = require('is-my-json-valid/require')\nvar validate = validator('my-schema.json')\n```\n\n## Custom formats\n\nis-my-json-valid supports the formats specified in JSON schema v4 (such as date-time).\nIf you want to add your own custom formats pass them as the formats options to the validator\n\n``` js\nvar validate = validator({\n  type: 'string',\n  required: true,\n  format: 'only-a'\n}, {\n  formats: {\n    'only-a': /^a+$/\n  }\n})\n\nconsole.log(validate('aa')) // true\nconsole.log(validate('ab')) // false\n```\n\n## External schemas\n\nYou can pass in external schemas that you reference using the `$ref` attribute as the `schemas` option\n\n``` js\nvar ext = {\n  required: true,\n  type: 'string'\n}\n\nvar schema = {\n  $ref: '#ext' // references another schema called ext\n}\n\n// pass the external schemas as an option\nvar validate = validator(schema, {schemas: {ext: ext}})\n\nvalidate('hello') // returns true\nvalidate(42) // return false\n```\n\n## Filtering away additional properties\n\nis-my-json-valid supports filtering away properties not in the schema\n\n``` js\nvar filter = validator.filter({\n  required: true,\n  type: 'object',\n  properties: {\n    hello: {type: 'string', required: true}\n  },\n  additionalProperties: false\n})\n\nvar doc = {hello: 'world', notInSchema: true}\nconsole.log(filter(doc)) // {hello: 'world'}\n```\n\n## Verbose mode outputs the value on errors\n\nis-my-json-valid outputs the value causing an error when verbose is set to true\n\n``` js\nvar validate = validator({\n  required: true,\n  type: 'object',\n  properties: {\n    hello: {\n      required: true,\n      type: 'string'\n    }\n  }\n}, {\n  verbose: true\n})\n\nvalidate({hello: 100});\nconsole.log(validate.errors) // {field: 'data.hello', message: 'is the wrong type', value: 100}\n```\n\n## Greedy mode tries to validate as much as possible\n\nBy default is-my-json-valid bails on first validation error but when greedy is\nset to true it tries to validate as much as possible:\n\n``` js\nvar validate = validator({\n  type: 'object',\n  properties: {\n    x: {\n      type: 'number'\n    }\n  },\n  required: ['x', 'y']\n}, {\n  greedy: true\n});\n\nvalidate({x: 'string'});\nconsole.log(validate.errors) // [{field: 'data.y', message: 'is required'},\n                             //  {field: 'data.x', message: 'is the wrong type'}]\n```\n\n## Performance\n\nis-my-json-valid uses code generation to turn your JSON schema into basic javascript code that is easily optimizeable by v8.\n\nAt the time of writing, is-my-json-valid is the __fastest validator__ when running\n\n* [json-schema-benchmark](https://github.com/Muscula/json-schema-benchmark)\n* [cosmicreals.com benchmark](http://cosmicrealms.com/blog/2014/08/29/benchmark-of-node-dot-js-json-validation-modules-part-3/)\n* [jsck benchmark](https://github.com/pandastrike/jsck/issues/72#issuecomment-70992684)\n* [themis benchmark](https://cdn.rawgit.com/playlyfe/themis/master/benchmark/results.html)\n* [z-schema benchmark](https://rawgit.com/zaggino/z-schema/master/benchmark/results.html)\n\nIf you know any other relevant benchmarks open a PR and I'll add them.\n\n## License\n\nMIT\n",
-  "readmeFilename": "README.md",
-  "_id": "is-my-json-valid@2.12.3",
-  "_shasum": "5a39d1d76b2dbb83140bbd157b1d5ee4bdc85ad6",
-  "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.3.tgz",
-  "_from": "is-my-json-valid@>=2.12.3 <3.0.0"
+  "gitHead": "8978aa8f40eef4ac47a5d18270c13abd48927ddb",
+  "_id": "is-my-json-valid@2.12.4",
+  "_shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880",
+  "_from": "is-my-json-valid@>=2.12.4 <3.0.0",
+  "_npmVersion": "2.14.7",
+  "_nodeVersion": "4.2.3",
+  "_npmUser": {
+    "name": "mafintosh",
+    "email": "mathiasbuus@gmail.com"
+  },
+  "dist": {
+    "shasum": "d4ed2bc1d7f88daf8d0f763b3e3e39a69bd37880",
+    "tarball": "http://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "freeall",
+      "email": "freeall@gmail.com"
+    },
+    {
+      "name": "mafintosh",
+      "email": "mathiasbuus@gmail.com"
+    },
+    {
+      "name": "watson",
+      "email": "w@tson.dk"
+    },
+    {
+      "name": "yoshuawuyts",
+      "email": "i@yoshuawuyts.com"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/is-my-json-valid/-/is-my-json-valid-2.12.4.tgz",
+  "readme": "ERROR: No README data found!"
 }
index fb36c2a..14ce1bf 100644 (file)
@@ -5,7 +5,7 @@ var SETTLED = 'settled';
 var FULFILLED = 'fulfilled';
 var REJECTED = 'rejected';
 var NOOP = function () {};
-var isNode = typeof process !== 'undefined' && typeof process.emit === 'function';
+var isNode = typeof global !== 'undefined' && typeof global.process !== 'undefined' && typeof global.process.emit === 'function';
 
 var asyncSetTimer = typeof setImmediate === 'undefined' ? setTimeout : setImmediate;
 var asyncQueue = [];
@@ -156,12 +156,12 @@ function publishRejection(promise) {
        promise._state = REJECTED;
        publish(promise);
        if (!promise._handled && isNode) {
-               process.emit('unhandledRejection', promise._data, promise);
+               global.process.emit('unhandledRejection', promise._data, promise);
        }
 }
 
 function notifyRejectionHandled(promise) {
-       process.emit('rejectionHandled', promise);
+       global.process.emit('rejectionHandled', promise);
 }
 
 /**
index f64cd26..3d6fdc4 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "pinkie",
-  "version": "2.0.1",
+  "version": "2.0.4",
   "description": "Itty bitty little widdle twinkie pinkie ES2015 Promise implementation",
   "license": "MIT",
   "repository": {
     "promises-aplus-tests": "*",
     "xo": "^0.10.1"
   },
-  "readme": "<h1 align=\"center\">\n\t<br>\n\t<img width=\"256\" src=\"media/logo.png\" alt=\"pinkie\">\n\t<br>\n\t<br>\n</h1>\n\n> Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation\n\n[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master)\n\nThere are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality.\n\nThis module is an exact Promise specification polyfill (like [native-promise-only](https://github.com/getify/native-promise-only)), but in Node.js land (it should be browserify-able though).\n\n\n## Install\n\n```\n$ npm install --save pinkie\n```\n\n\n## Usage\n\n```js\nvar fs = require('fs');\nvar Promise = require('pinkie');\n\nnew Promise(function (resolve, reject) {\n\tfs.readFile('foo.json', 'utf8', function (err, data) {\n\t\tif (err) {\n\t\t\treject(err);\n\t\t\treturn;\n\t\t}\n\n\t\tresolve(data);\n\t});\n});\n//=> Promise\n```\n\n\n### API\n\n`pinkie` exports bare [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation and polyfills [Node.js rejection events](https://nodejs.org/api/process.html#process_event_unhandledrejection). In case you forgot:\n\n#### new Promise(executor)\n\nReturns new instance of `Promise`.\n\n##### executor\n\n*Required*  \nType: `function`\n\nFunction with two arguments `resolve` and `reject`. The first argument fulfills the promise, the second argument rejects it.\n\n#### pinkie.all(promises)\n\nReturns a promise that resolves when all of the promises in the `promises` Array argument have resolved.\n\n#### pinkie.race(promises)\n\nReturns a promise that resolves or rejects as soon as one of the promises in the `promises` Array resolves or rejects, with the value or reason from that promise.\n\n#### pinkie.reject(reason)\n\nReturns a Promise object that is rejected with the given `reason`.\n\n#### pinkie.resolve(value)\n\nReturns a Promise object that is resolved with the given `value`. If the `value` is a thenable (i.e. has a then method), the returned promise will \"follow\" that thenable, adopting its eventual state; otherwise the returned promise will be fulfilled with the `value`.\n\n\n## Related\n\n- [pinkie-promise](https://github.com/floatdrop/pinkie-promise) - Returns the native Promise or this module\n\n\n## License\n\nMIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)\n",
-  "readmeFilename": "readme.md",
+  "gitHead": "8d4a92447a5c62bff9f89756caeb4c9c8770579b",
   "bugs": {
     "url": "https://github.com/floatdrop/pinkie/issues"
   },
-  "homepage": "https://github.com/floatdrop/pinkie#readme",
-  "_id": "pinkie@2.0.1",
-  "_shasum": "4236c86fc29f261c2045bbe81f78cbb2a5e8306c",
-  "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.1.tgz",
-  "_from": "pinkie@>=2.0.0 <3.0.0"
+  "homepage": "https://github.com/floatdrop/pinkie",
+  "_id": "pinkie@2.0.4",
+  "_shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870",
+  "_from": "pinkie@>=2.0.0 <3.0.0",
+  "_npmVersion": "2.14.12",
+  "_nodeVersion": "4.2.4",
+  "_npmUser": {
+    "name": "floatdrop",
+    "email": "floatdrop@gmail.com"
+  },
+  "dist": {
+    "shasum": "72556b80cfa0d48a974e80e77248e80ed4f7f870",
+    "tarball": "http://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "floatdrop",
+      "email": "floatdrop@gmail.com"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 4d76909..54747f6 100644 (file)
@@ -7,7 +7,7 @@
 
 > Itty bitty little widdle twinkie pinkie [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) implementation
 
-[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie) [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master)
+[![Build Status](https://travis-ci.org/floatdrop/pinkie.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie)  [![Coverage Status](https://coveralls.io/repos/floatdrop/pinkie/badge.svg?branch=master&service=github)](https://coveralls.io/github/floatdrop/pinkie?branch=master)
 
 There are [tons of Promise implementations](https://github.com/promises-aplus/promises-spec/blob/master/implementations.md#standalone) out there, but all of them focus on browser compatibility and are often bloated with functionality.
 
index d51cdd3..6a88545 100644 (file)
   "devDependencies": {
     "mocha": "*"
   },
-  "readme": "# pinkie-promise [![Build Status](https://travis-ci.org/floatdrop/pinkie-promise.svg?branch=master)](https://travis-ci.org/floatdrop/pinkie-promise)\n\n> [ES2015 Promise](https://people.mozilla.org/~jorendorff/es6-draft.html#sec-promise-objects) ponyfill\n\nModule exports global Promise object (if available) or [`pinkie`](http://github.com/floatdrop/pinkie) Promise polyfill.\n\n## Install\n\n```\n$ npm install --save pinkie-promise\n```\n\n## Usage\n\n```js\nvar Promise = require('pinkie-promise');\n\nnew Promise(function (resolve) { resolve('unicorns'); });\n//=> Promise { 'unicorns' }\n```\n\n## Related\n\n- [pify](https://github.com/sindresorhus/pify) - Promisify a callback-style function\n\n## License\n\nMIT © [Vsevolod Strukchinsky](http://github.com/floatdrop)\n",
-  "readmeFilename": "readme.md",
+  "gitHead": "f90fcae9838bcae7ae1ae4ebc9b29f11e5db4980",
   "bugs": {
     "url": "https://github.com/floatdrop/pinkie-promise/issues"
   },
-  "homepage": "https://github.com/floatdrop/pinkie-promise#readme",
+  "homepage": "https://github.com/floatdrop/pinkie-promise",
   "_id": "pinkie-promise@2.0.0",
   "_shasum": "4c83538de1f6e660c29e0a13446844f7a7e88259",
+  "_from": "pinkie-promise@>=2.0.0 <3.0.0",
+  "_npmVersion": "2.14.7",
+  "_nodeVersion": "4.2.0",
+  "_npmUser": {
+    "name": "floatdrop",
+    "email": "floatdrop@gmail.com"
+  },
+  "dist": {
+    "shasum": "4c83538de1f6e660c29e0a13446844f7a7e88259",
+    "tarball": "http://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.0.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "floatdrop",
+      "email": "floatdrop@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.0.tgz",
-  "_from": "pinkie-promise@>=2.0.0 <3.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 196a4e8..f8b242f 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "version": "2.0.3",
+  "version": "2.0.6",
   "name": "har-validator",
   "description": "Extremely fast HTTP Archive (HAR) validator using JSON Schema",
   "author": {
     ]
   },
   "devDependencies": {
-    "codeclimate-test-reporter": "0.1.1",
-    "echint": "^1.5.0",
-    "istanbul": "^0.4.0",
+    "codeclimate-test-reporter": "0.2.1",
+    "echint": "^1.5.1",
+    "istanbul": "^0.4.2",
     "mocha": "^2.3.4",
     "require-directory": "^2.1.1",
-    "should": "^7.1.1",
-    "should-promised": "^0.3.1",
+    "should": "^8.1.1",
     "standard": "^5.4.1"
   },
   "dependencies": {
     "chalk": "^1.1.1",
     "commander": "^2.9.0",
-    "is-my-json-valid": "^2.12.3",
+    "is-my-json-valid": "^2.12.4",
     "pinkie-promise": "^2.0.0"
   },
-  "readme": "# HAR Validator [![version][npm-version]][npm-url] [![License][npm-license]][license-url]\n\nExtremely fast HTTP Archive ([HAR](http://www.softwareishard.com/blog/har-12-spec/)) validator using JSON Schema.\n\n[![Build Status][travis-image]][travis-url]\n[![Downloads][npm-downloads]][npm-url]\n[![Code Climate][codeclimate-quality]][codeclimate-url]\n[![Coverage Status][codeclimate-coverage]][codeclimate-url]\n[![Dependencies][david-image]][david-url]\n\n## Install\n\n```shell\n# to use in cli\nnpm install --global har-validator\n\n# to use as a module\nnpm install --save har-validator\n```\n\n## Usage\n\n```\n\n  Usage: har-validator [options] <files ...>\n\n  Options:\n\n    -h, --help           output usage information\n    -V, --version        output the version number\n    -s, --schema [name]  validate schema name (log, request, response, etc ...)\n\n```\n\n###### Example\n\n```shell\nhar-validator har.json\n\nhar-validator --schema request request.json\n```\n\n## API\n\n**Note**: as of [`v2.0.0`](https://github.com/ahmadnassri/har-validator/releases/tag/v2.0.0) this module defaults to Promise based API. *For backward comptability with `v1.x` an [async/callback API](#callback-api) is provided*\n\n### Validate(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a full [HAR](http://www.softwareishard.com/blog/har-12-spec/) object\n\n```js\nvar HAR = require('./har.json')\nvar validate = require('har-validator')\n\nvalidate(HAR)\n  .then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.log(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [log](http://www.softwareishard.com/blog/har-12-spec/#log) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.log(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.cache(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [cache](http://www.softwareishard.com/blog/har-12-spec/#cache) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.cache(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.cacheEntry(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [\"beforeRequest\" or \"afterRequest\"](http://www.softwareishard.com/blog/har-12-spec/#cache) objects\n\n```js\nvar validate = require('har-validator')\n\nvalidate.cacheEntry(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.content(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [content](http://www.softwareishard.com/blog/har-12-spec/#content) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.content(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.cookie(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [cookie](http://www.softwareishard.com/blog/har-12-spec/#cookies) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.cookie(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.creator(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [creator](http://www.softwareishard.com/blog/har-12-spec/#creator) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.creator(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.entry(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  an [entry](http://www.softwareishard.com/blog/har-12-spec/#entries) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.entry(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.log(data)\n\nalias of [`Validate(data)`](#validate-data-callback-)\n\n### Validate.page(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [page](http://www.softwareishard.com/blog/har-12-spec/#pages) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.page(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.pageTimings(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [pageTimings](http://www.softwareishard.com/blog/har-12-spec/#pageTimings) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.pageTimings(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.postData(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [postData](http://www.softwareishard.com/blog/har-12-spec/#postData) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.postData(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.record(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [record](http://www.softwareishard.com/blog/har-12-spec/#headers) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.record(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.request(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [request](http://www.softwareishard.com/blog/har-12-spec/#request) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.request(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.response(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [response](http://www.softwareishard.com/blog/har-12-spec/#response) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.cacheEntry(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n### Validate.timings(data)\n\n> Returns a promise that resolves to the valid object.\n\n- **data**: `Object` *(Required)*\n  a [timings](http://www.softwareishard.com/blog/har-12-spec/#timings) object\n\n```js\nvar validate = require('har-validator')\n\nvalidate.timings(data.then(function (HAR) {\n    console.log('horray!')\n  })\n  .catch(function (error) {\n    console.error(error)\n  })\n```\n\n----\n\n## Callback API\n\n### Validate(data [, callback])\n\n> Returns `true` or `false`.\n\n```js\nvar HAR = require('./har.json');\nvar validate = require('har-validator/lib/async');\n\nvalidate(HAR, function (e, valid) {\n  if (e) console.log(e.errors)\n\n  if (valid) console.log('horray!');\n});\n\n```\nThe async API provides exactly the same methods as the [Promise API](#promise-api)\n\n----\n\n## Support\n\nDonations are welcome to help support the continuous development of this project.\n\n[![Gratipay][gratipay-image]][gratipay-url]\n[![PayPal][paypal-image]][paypal-url]\n[![Flattr][flattr-image]][flattr-url]\n[![Bitcoin][bitcoin-image]][bitcoin-url]\n\n## License\n\n[ISC License](LICENSE) &copy; [Ahmad Nassri](https://www.ahmadnassri.com/)\n\n[license-url]: https://github.com/ahmadnassri/har-validator/blob/master/LICENSE\n\n[travis-url]: https://travis-ci.org/ahmadnassri/har-validator\n[travis-image]: https://img.shields.io/travis/ahmadnassri/har-validator.svg?style=flat-square\n\n[npm-url]: https://www.npmjs.com/package/har-validator\n[npm-license]: https://img.shields.io/npm/l/har-validator.svg?style=flat-square\n[npm-version]: https://img.shields.io/npm/v/har-validator.svg?style=flat-square\n[npm-downloads]: https://img.shields.io/npm/dm/har-validator.svg?style=flat-square\n\n[codeclimate-url]: https://codeclimate.com/github/ahmadnassri/har-validator\n[codeclimate-quality]: https://img.shields.io/codeclimate/github/ahmadnassri/har-validator.svg?style=flat-square\n[codeclimate-coverage]: https://img.shields.io/codeclimate/coverage/github/ahmadnassri/har-validator.svg?style=flat-square\n\n[david-url]: https://david-dm.org/ahmadnassri/har-validator\n[david-image]: https://img.shields.io/david/ahmadnassri/har-validator.svg?style=flat-square\n\n[gratipay-url]: https://www.gratipay.com/ahmadnassri/\n[gratipay-image]: https://img.shields.io/gratipay/ahmadnassri.svg?style=flat-square\n\n[paypal-url]: https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=UJ2B2BTK9VLRS&on0=project&os0=har-validator\n[paypal-image]: http://img.shields.io/badge/paypal-donate-green.svg?style=flat-square\n\n[flattr-url]: https://flattr.com/submit/auto?user_id=ahmadnassri&url=https://github.com/ahmadnassri/har-validator&title=har-validator&language=&tags=github&category=software\n[flattr-image]: http://img.shields.io/badge/flattr-donate-green.svg?style=flat-square\n\n[bitcoin-image]: http://img.shields.io/badge/bitcoin-1Nb46sZRVG3or7pNaDjthcGJpWhvoPpCxy-green.svg?style=flat-square\n[bitcoin-url]: https://www.coinbase.com/checkouts/ae383ae6bb931a2fa5ad11cec115191e?name=har-validator\n",
-  "readmeFilename": "README.md",
-  "_id": "har-validator@2.0.3",
-  "_shasum": "5a9e12564a571cf0b81ef93c2157bd1617168883",
-  "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.3.tgz",
-  "_from": "har-validator@>=2.0.2 <2.1.0"
+  "gitHead": "92ccddad2e5d13e6e32c764e06c347d67805b211",
+  "_id": "har-validator@2.0.6",
+  "_shasum": "cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d",
+  "_from": "har-validator@>=2.0.6 <2.1.0",
+  "_npmVersion": "3.3.12",
+  "_nodeVersion": "5.2.0",
+  "_npmUser": {
+    "name": "ahmadnassri",
+    "email": "ahmad@ahmadnassri.com"
+  },
+  "maintainers": [
+    {
+      "name": "ahmadnassri",
+      "email": "ahmad@ahmadnassri.com"
+    }
+  ],
+  "dist": {
+    "shasum": "cdcbc08188265ad119b6a5a7c8ab70eecfb5d27d",
+    "tarball": "http://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/har-validator/-/har-validator-2.0.6.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 4aff23f..6372503 100755 (executable)
@@ -75,12 +75,12 @@ and the server.
 
 ## Replay Protection
 
-Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more 
-than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when 
+Without replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more
+than once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when
 making requests. This gives the server enough information to prevent replay attacks.
 
 The nonce is generated by the client, and is a string unique across all requests with the same timestamp and
-key identifier combination. 
+key identifier combination.
 
 The timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards
 are rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks.
@@ -373,7 +373,7 @@ and for a finite period of time. Both the client and server can issue bewit cred
 credentials as the client to maintain clear traceability as to who issued which credentials.
 
 In order to simplify implementation, bewit credentials do not support single-use policy and can be replayed multiple times within
-the granted access timeframe. 
+the granted access timeframe.
 
 
 ## Bewit Usage Example
@@ -496,7 +496,7 @@ which can often affect how the request body is interpreted by the server. If the
 or value of such headers, an attacker can manipulate the request headers without being detected. Implementers should use the
 `ext` feature to pass application-specific information via the `Authorization` header which is protected by the request MAC.
 
-The response authentication, when performed, only covers the response payload, content-type, and the request information 
+The response authentication, when performed, only covers the response payload, content-type, and the request information
 provided by the client in it's request (method, resource, timestamp, nonce, etc.). It does not cover the HTTP status code or
 any other response header field (e.g. Location) which can affect the client's behaviour.
 
index 1554123..ac28ef7 100644 (file)
@@ -4,7 +4,10 @@
 
 ;
 
-function _typeof(obj) { return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj; }
+var _typeof = function (obj) {
+
+    return obj && typeof Symbol !== 'undefined' && obj.constructor === Symbol ? 'symbol' : typeof obj;
+};
 
 var Url = require('url');
 var Hoek = require('hoek');
index a883882..911b906 100755 (executable)
@@ -12,4 +12,3 @@ exports.uri = {
     authenticate: exports.server.authenticateBewit,
     getBewit: exports.client.getBewit
 };
-
index a325d56..2f76372 100755 (executable)
@@ -308,6 +308,11 @@ exports.header = function (credentials, artifacts, options) {
  * 'hostHeaderName', 'localtimeOffsetMsec', 'host', 'port'
  */
 
+
+//                       1     2             3           4
+internals.bewitRegex = /^(\/.*)([\?&])bewit\=([^&$]*)(?:&(.+))?$/;
+
+
 exports.authenticateBewit = function (req, credentialsFunc, options, callback) {
 
     callback = Hoek.nextTick(callback);
@@ -325,8 +330,11 @@ exports.authenticateBewit = function (req, credentialsFunc, options, callback) {
 
     // Extract bewit
 
-    //                                 1     2             3           4
-    var resource = request.url.match(/^(\/.*)([\?&])bewit\=([^&$]*)(?:&(.+))?$/);
+    if (request.url.length > Utils.limits.maxMatchLength) {
+        return callback(Boom.badRequest('Resource path exceeds max length'));
+    }
+
+    var resource = request.url.match(internals.bewitRegex);
     if (!resource) {
         return callback(Boom.unauthorized(null, 'Hawk'));
     }
index 8d2719a..2da3343 100755 (executable)
@@ -15,6 +15,11 @@ exports.version = function () {
 };
 
 
+exports.limits = {
+    maxMatchLength: 4096            // Limit the length of uris and headers to avoid a DoS attack on string matching
+};
+
+
 // Extract host and port from request
 
 //                                            $1                            $2
@@ -29,6 +34,10 @@ exports.parseHost = function (req, hostHeaderName) {
         return null;
     }
 
+    if (hostHeader.length > exports.limits.maxMatchLength) {
+        return null;
+    }
+
     var hostParts = hostHeader.match(internals.hostHeaderRegex);
     if (!hostParts) {
         return null;
@@ -63,8 +72,11 @@ exports.parseRequest = function (req, options) {
 
     // Obtain host and port information
 
-    if (!options.host || !options.port) {
-        var host = exports.parseHost(req, options.hostHeaderName);
+    var host;
+    if (!options.host ||
+        !options.port) {
+
+        host = exports.parseHost(req, options.hostHeaderName);
         if (!host) {
             return new Error('Invalid Host header');
         }
@@ -95,6 +107,10 @@ exports.nowSecs = function (localtimeOffsetMsec) {
 };
 
 
+internals.authHeaderRegex = /^(\w+)(?:\s+(.*))?$/;                                      // Header: scheme[ something]
+internals.attributeRegex = /^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/;   // !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
+
+
 // Parse Hawk HTTP Authorization header
 
 exports.parseAuthorizationHeader = function (header, keys) {
@@ -105,7 +121,11 @@ exports.parseAuthorizationHeader = function (header, keys) {
         return Boom.unauthorized(null, 'Hawk');
     }
 
-    var headerParts = header.match(/^(\w+)(?:\s+(.*))?$/);       // Header: scheme[ something]
+    if (header.length > exports.limits.maxMatchLength) {
+        return Boom.badRequest('Header length too long');
+    }
+
+    var headerParts = header.match(internals.authHeaderRegex);
     if (!headerParts) {
         return Boom.badRequest('Invalid header syntax');
     }
@@ -131,9 +151,9 @@ exports.parseAuthorizationHeader = function (header, keys) {
             return;
         }
 
-        // Allowed attribute value characters: !#$%&'()*+,-./:;<=>?@[]^_`{|}~ and space, a-z, A-Z, 0-9
+        // Allowed attribute value characters
 
-        if ($2.match(/^[ \w\!#\$%&'\(\)\*\+,\-\.\/\:;<\=>\?@\[\]\^`\{\|\}~]+$/) === null) {
+        if ($2.match(internals.attributeRegex) === null) {
             errorMessage = 'Bad attribute value: ' + $1;
             return;
         }
@@ -161,4 +181,3 @@ exports.unauthorized = function (message, attributes) {
 
     return Boom.unauthorized(message, 'Hawk', attributes);
 };
-
index f869d5e..4c5b386 100644 (file)
     "test-cov-html": "lab -a code -r html -o coverage.html -L"
   },
   "license": "BSD-3-Clause",
-  "readme": "![boom Logo](https://raw.github.com/hapijs/boom/master/images/boom.png)\n\nHTTP-friendly error objects\n\n[![Build Status](https://secure.travis-ci.org/hapijs/boom.png)](http://travis-ci.org/hapijs/boom)\n[![Current Version](https://img.shields.io/npm/v/boom.svg)](https://www.npmjs.com/package/boom)\n\nLead Maintainer: [Adam Bretz](https://github.com/arb)\n\n**boom** provides a set of utilities for returning HTTP errors. Each utility returns a `Boom` error response\nobject (instance of `Error`) which includes the following properties:\n- `isBoom` - if `true`, indicates this is a `Boom` object instance.\n- `isServer` - convenience bool indicating status code >= 500.\n- `message` - the error message.\n- `output` - the formatted response. Can be directly manipulated after object construction to return a custom\n  error response. Allowed root keys:\n    - `statusCode` - the HTTP status code (typically 4xx or 5xx).\n    - `headers` - an object containing any HTTP headers where each key is a header name and value is the header content.\n    - `payload` - the formatted object used as the response payload (stringified). Can be directly manipulated but any\n      changes will be lost\n      if `reformat()` is called. Any content allowed and by default includes the following content:\n        - `statusCode` - the HTTP status code, derived from `error.output.statusCode`.\n        - `error` - the HTTP status message (e.g. 'Bad Request', 'Internal Server Error') derived from `statusCode`.\n        - `message` - the error message derived from `error.message`.\n- inherited `Error` properties.\n\nThe `Boom` object also supports the following method:\n- `reformat()` - rebuilds `error.output` using the other object properties.\n\n## Overview\n\n- Helper methods\n  - [`wrap(error, [statusCode], [message])`](#wraperror-statuscode-message)\n  - [`create(statusCode, [message], [data])`](#createstatuscode-message-data)\n- HTTP 4xx Errors\n  - 400: [`Boom.badRequest([message], [data])`](#boombadrequestmessage-data)\n  - 401: [`Boom.unauthorized([message], [scheme], [attributes])`](#boomunauthorizedmessage-scheme-attributes)\n  - 403: [`Boom.forbidden([message], [data])`](#boomforbiddenmessage-data)\n  - 404: [`Boom.notFound([message], [data])`](#boomnotfoundmessage-data)\n  - 405: [`Boom.methodNotAllowed([message], [data])`](#boommethodnotallowedmessage-data)\n  - 406: [`Boom.notAcceptable([message], [data])`](#boomnotacceptablemessage-data)\n  - 407: [`Boom.proxyAuthRequired([message], [data])`](#boomproxyauthrequiredmessage-data)\n  - 408: [`Boom.clientTimeout([message], [data])`](#boomclienttimeoutmessage-data)\n  - 409: [`Boom.conflict([message], [data])`](#boomconflictmessage-data)\n  - 410: [`Boom.resourceGone([message], [data])`](#boomresourcegonemessage-data)\n  - 411: [`Boom.lengthRequired([message], [data])`](#boomlengthrequiredmessage-data)\n  - 412: [`Boom.preconditionFailed([message], [data])`](#boompreconditionfailedmessage-data)\n  - 413: [`Boom.entityTooLarge([message], [data])`](#boomentitytoolargemessage-data)\n  - 414: [`Boom.uriTooLong([message], [data])`](#boomuritoolongmessage-data)\n  - 415: [`Boom.unsupportedMediaType([message], [data])`](#boomunsupportedmediatypemessage-data)\n  - 416: [`Boom.rangeNotSatisfiable([message], [data])`](#boomrangenotsatisfiablemessage-data)\n  - 417: [`Boom.expectationFailed([message], [data])`](#boomexpectationfailedmessage-data)\n  - 422: [`Boom.badData([message], [data])`](#boombaddatamessage-data)\n  - 428: [`Boom.preconditionRequired([message], [data])`](#boompreconditionrequiredmessage-data)\n  - 429: [`Boom.tooManyRequests([message], [data])`](#boomtoomanyrequestsmessage-data)\n- HTTP 5xx Errors\n  - 500: [`Boom.badImplementation([message], [data])`](#boombadimplementationmessage-data)\n  - 501: [`Boom.notImplemented([message], [data])`](#boomnotimplementedmessage-data)\n  - 502: [`Boom.badGateway([message], [data])`](#boombadgatewaymessage-data)\n  - 503: [`Boom.serverTimeout([message], [data])`](#boomservertimeoutmessage-data)\n  - 504: [`Boom.gatewayTimeout([message], [data])`](#boomgatewaytimeoutmessage-data)\n- [FAQ](#faq)\n\n\n## Helper Methods\n\n### `wrap(error, [statusCode], [message])`\n\nDecorates an error with the **boom** properties where:\n- `error` - the error object to wrap. If `error` is already a **boom** object, returns back the same object.\n- `statusCode` - optional HTTP status code. Defaults to `500`.\n- `message` - optional message string. If the error already has a message, it adds the message as a prefix.\n  Defaults to no message.\n\n```js\nvar error = new Error('Unexpected input');\nBoom.wrap(error, 400);\n```\n\n### `create(statusCode, [message], [data])`\n\nGenerates an `Error` object with the **boom** decorations where:\n- `statusCode` - an HTTP error code number. Must be greater or equal 400.\n- `message` - optional message string.\n- `data` - additional error data set to `error.data` property.\n\n```js\nvar error = Boom.create(400, 'Bad request', { timestamp: Date.now() });\n```\n\n## HTTP 4xx Errors\n\n### `Boom.badRequest([message], [data])`\n\nReturns a 400 Bad Request error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.badRequest('invalid query');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 400,\n    \"error\": \"Bad Request\",\n    \"message\": \"invalid query\"\n}\n```\n\n### `Boom.unauthorized([message], [scheme], [attributes])`\n\nReturns a 401 Unauthorized error where:\n- `message` - optional message.\n- `scheme` can be one of the following:\n  - an authentication scheme name\n  - an array of string values. These values will be separated by ', ' and set to the 'WWW-Authenticate' header.\n- `attributes` - an object of values to use while setting the 'WWW-Authenticate' header. This value is only used\n  when `schema` is a string, otherwise it is ignored. Every key/value pair will be included in the\n  'WWW-Authenticate' in the format of 'key=\"value\"' as well as in the response payload under the `attributes` key.\n  `null` and `undefined` will be replaced with an empty string. If `attributes` is set, `message` will be used as\n  the 'error' segment of the 'WWW-Authenticate' header. If `message` is unset, the 'error' segment of the header\n  will not be present and `isMissing` will be true on the error object.\n\nIf either `scheme` or `attributes` are set, the resultant `Boom` object will have the 'WWW-Authenticate' header set for the response.\n\n```js\nBoom.unauthorized('invalid password');\n```\n\nGenerates the following response:\n\n```json\n\"payload\": {\n    \"statusCode\": 401,\n    \"error\": \"Unauthorized\",\n    \"message\": \"invalid password\"\n},\n\"headers\" {}\n```\n\n```js\nBoom.unauthorized('invalid password', 'sample');\n```\n\nGenerates the following response:\n\n```json\n\"payload\": {\n    \"statusCode\": 401,\n    \"error\": \"Unauthorized\",\n    \"message\": \"invalid password\",\n    \"attributes\": {\n        \"error\": \"invalid password\"\n    }\n},\n\"headers\" {\n  \"WWW-Authenticate\": \"sample error=\\\"invalid password\\\"\"\n}\n```\n\n```js\nBoom.unauthorized('invalid password', 'sample', { ttl: 0, cache: null, foo: 'bar' });\n```\n\nGenerates the following response:\n\n```json\n\"payload\": {\n    \"statusCode\": 401,\n    \"error\": \"Unauthorized\",\n    \"message\": \"invalid password\",\n    \"attributes\": {\n        \"error\": \"invalid password\",\n        \"ttl\": 0,\n        \"cache\": \"\",\n        \"foo\": \"bar\"\n    }\n},\n\"headers\" {\n  \"WWW-Authenticate\": \"sample ttl=\\\"0\\\", cache=\\\"\\\", foo=\\\"bar\\\", error=\\\"invalid password\\\"\"\n}\n```\n\n### `Boom.forbidden([message], [data])`\n\nReturns a 403 Forbidden error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.forbidden('try again some time');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 403,\n    \"error\": \"Forbidden\",\n    \"message\": \"try again some time\"\n}\n```\n\n### `Boom.notFound([message], [data])`\n\nReturns a 404 Not Found error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.notFound('missing');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 404,\n    \"error\": \"Not Found\",\n    \"message\": \"missing\"\n}\n```\n\n### `Boom.methodNotAllowed([message], [data])`\n\nReturns a 405 Method Not Allowed error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.methodNotAllowed('that method is not allowed');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 405,\n    \"error\": \"Method Not Allowed\",\n    \"message\": \"that method is not allowed\"\n}\n```\n\n### `Boom.notAcceptable([message], [data])`\n\nReturns a 406 Not Acceptable error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.notAcceptable('unacceptable');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 406,\n    \"error\": \"Not Acceptable\",\n    \"message\": \"unacceptable\"\n}\n```\n\n### `Boom.proxyAuthRequired([message], [data])`\n\nReturns a 407 Proxy Authentication Required error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.proxyAuthRequired('auth missing');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 407,\n    \"error\": \"Proxy Authentication Required\",\n    \"message\": \"auth missing\"\n}\n```\n\n### `Boom.clientTimeout([message], [data])`\n\nReturns a 408 Request Time-out error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.clientTimeout('timed out');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 408,\n    \"error\": \"Request Time-out\",\n    \"message\": \"timed out\"\n}\n```\n\n### `Boom.conflict([message], [data])`\n\nReturns a 409 Conflict error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.conflict('there was a conflict');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 409,\n    \"error\": \"Conflict\",\n    \"message\": \"there was a conflict\"\n}\n```\n\n### `Boom.resourceGone([message], [data])`\n\nReturns a 410 Gone error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.resourceGone('it is gone');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 410,\n    \"error\": \"Gone\",\n    \"message\": \"it is gone\"\n}\n```\n\n### `Boom.lengthRequired([message], [data])`\n\nReturns a 411 Length Required error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.lengthRequired('length needed');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 411,\n    \"error\": \"Length Required\",\n    \"message\": \"length needed\"\n}\n```\n\n### `Boom.preconditionFailed([message], [data])`\n\nReturns a 412 Precondition Failed error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.preconditionFailed();\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 412,\n    \"error\": \"Precondition Failed\"\n}\n```\n\n### `Boom.entityTooLarge([message], [data])`\n\nReturns a 413 Request Entity Too Large error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.entityTooLarge('too big');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 413,\n    \"error\": \"Request Entity Too Large\",\n    \"message\": \"too big\"\n}\n```\n\n### `Boom.uriTooLong([message], [data])`\n\nReturns a 414 Request-URI Too Large error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.uriTooLong('uri is too long');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 414,\n    \"error\": \"Request-URI Too Large\",\n    \"message\": \"uri is too long\"\n}\n```\n\n### `Boom.unsupportedMediaType([message], [data])`\n\nReturns a 415 Unsupported Media Type error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.unsupportedMediaType('that media is not supported');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 415,\n    \"error\": \"Unsupported Media Type\",\n    \"message\": \"that media is not supported\"\n}\n```\n\n### `Boom.rangeNotSatisfiable([message], [data])`\n\nReturns a 416 Requested Range Not Satisfiable error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.rangeNotSatisfiable();\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 416,\n    \"error\": \"Requested Range Not Satisfiable\"\n}\n```\n\n### `Boom.expectationFailed([message], [data])`\n\nReturns a 417 Expectation Failed error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.expectationFailed('expected this to work');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 417,\n    \"error\": \"Expectation Failed\",\n    \"message\": \"expected this to work\"\n}\n```\n\n### `Boom.badData([message], [data])`\n\nReturns a 422 Unprocessable Entity error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.badData('your data is bad and you should feel bad');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 422,\n    \"error\": \"Unprocessable Entity\",\n    \"message\": \"your data is bad and you should feel bad\"\n}\n```\n\n### `Boom.preconditionRequired([message], [data])`\n\nReturns a 428 Precondition Required error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.preconditionRequired('you must supply an If-Match header');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 428,\n    \"error\": \"Precondition Required\",\n    \"message\": \"you must supply an If-Match header\"\n}\n```\n\n### `Boom.tooManyRequests([message], [data])`\n\nReturns a 429 Too Many Requests error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.tooManyRequests('you have exceeded your request limit');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 429,\n    \"error\": \"Too Many Requests\",\n    \"message\": \"you have exceeded your request limit\"\n}\n```\n\n## HTTP 5xx Errors\n\nAll 500 errors hide your message from the end user. Your message is recorded in the server log.\n\n### `Boom.badImplementation([message], [data])`\n\nReturns a 500 Internal Server Error error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.badImplementation('terrible implementation');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 500,\n    \"error\": \"Internal Server Error\",\n    \"message\": \"An internal server error occurred\"\n}\n```\n\n### `Boom.notImplemented([message], [data])`\n\nReturns a 501 Not Implemented error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.notImplemented('method not implemented');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 501,\n    \"error\": \"Not Implemented\",\n    \"message\": \"method not implemented\"\n}\n```\n\n### `Boom.badGateway([message], [data])`\n\nReturns a 502 Bad Gateway error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.badGateway('that is a bad gateway');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 502,\n    \"error\": \"Bad Gateway\",\n    \"message\": \"that is a bad gateway\"\n}\n```\n\n### `Boom.serverTimeout([message], [data])`\n\nReturns a 503 Service Unavailable error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.serverTimeout('unavailable');\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 503,\n    \"error\": \"Service Unavailable\",\n    \"message\": \"unavailable\"\n}\n```\n\n### `Boom.gatewayTimeout([message], [data])`\n\nReturns a 504 Gateway Time-out error where:\n- `message` - optional message.\n- `data` - optional additional error data.\n\n```js\nBoom.gatewayTimeout();\n```\n\nGenerates the following response payload:\n\n```json\n{\n    \"statusCode\": 504,\n    \"error\": \"Gateway Time-out\"\n}\n```\n\n## F.A.Q.\n\n###### How do I include extra information in my responses? `output.payload` is missing `data`, what gives?\n\nThere is a reason the values passed back in the response payloads are pretty locked down. It's mostly for security and to not leak any important information back to the client. This means you will need to put in a little more effort to include extra information about your custom error. Check out the [\"Error transformation\"](https://github.com/hapijs/hapi/blob/master/API.md#error-transformation) section in the hapi documentation.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "ff1a662a86b39426cdd18f4441b112d307a34a6f",
   "bugs": {
     "url": "https://github.com/hapijs/boom/issues"
   },
   "homepage": "https://github.com/hapijs/boom#readme",
   "_id": "boom@2.10.1",
   "_shasum": "39c8918ceff5799f83f9492a848f625add0c766f",
+  "_from": "boom@>=2.0.0 <3.0.0",
+  "_npmVersion": "2.11.1",
+  "_nodeVersion": "0.10.40",
+  "_npmUser": {
+    "name": "arb",
+    "email": "arbretz@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "hueniverse",
+      "email": "eran@hueniverse.com"
+    },
+    {
+      "name": "wyatt",
+      "email": "wpreul@gmail.com"
+    },
+    {
+      "name": "arb",
+      "email": "arbretz@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "39c8918ceff5799f83f9492a848f625add0c766f",
+    "tarball": "http://registry.npmjs.org/boom/-/boom-2.10.1.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/boom/-/boom-2.10.1.tgz",
-  "_from": "boom@>=2.0.0 <3.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 16d0b49..c65fd09 100644 (file)
     "test-cov-html": "lab -a code -r html -o coverage.html"
   },
   "license": "BSD-3-Clause",
-  "readme": "cryptiles\n=========\n\nGeneral purpose crypto utilities\n\n[![Build Status](https://secure.travis-ci.org/hapijs/cryptiles.png)](http://travis-ci.org/hapijs/cryptiles)\n\nLead Maintainer - [C J Silverio](https://github.com/ceejbot)\n\n## Methods\n\n### `randomString(<Number> size)`\nReturns a cryptographically strong pseudo-random data string. Takes a size argument for the length of the string.\n\n### `fixedTimeComparison(<String> a, <String> b)`\nCompare two strings using fixed time algorithm (to prevent time-based analysis of MAC digest match). Returns `true` if the strings match, `false` if they differ.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "9bc5a852f01cd51e615814e1cb255fe2df810649",
   "bugs": {
     "url": "https://github.com/hapijs/cryptiles/issues"
   },
   "homepage": "https://github.com/hapijs/cryptiles#readme",
   "_id": "cryptiles@2.0.5",
   "_shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8",
+  "_from": "cryptiles@>=2.0.0 <3.0.0",
+  "_npmVersion": "2.14.2",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "hueniverse",
+    "email": "eran@hammer.io"
+  },
+  "dist": {
+    "shasum": "3bdfecdc608147c1c67202fa291e7dca59eaa3b8",
+    "tarball": "http://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "hueniverse",
+      "email": "eran@hueniverse.com"
+    },
+    {
+      "name": "ceejbot",
+      "email": "ceejceej@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/cryptiles/-/cryptiles-2.0.5.tgz",
-  "_from": "cryptiles@>=2.0.0 <3.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 6e76778..4e3968f 100644 (file)
     "test-cov-html": "lab -a code -t 100 -L -r html -o coverage.html"
   },
   "license": "BSD-3-Clause",
-  "readme": "![hoek Logo](https://raw.github.com/hapijs/hoek/master/images/hoek.png)\n\nUtility methods for the hapi ecosystem. This module is not intended to solve every problem for everyone, but rather as a central place to store hapi-specific methods. If you're looking for a general purpose utility module, check out [lodash](https://github.com/lodash/lodash) or [underscore](https://github.com/jashkenas/underscore).\n\n[![Build Status](https://secure.travis-ci.org/hapijs/hoek.svg)](http://travis-ci.org/hapijs/hoek)\n\nLead Maintainer: [Nathan LaFreniere](https://github.com/nlf)\n\n# Table of Contents\n\n* [Introduction](#introduction \"Introduction\")\n* [Object](#object \"Object\")\n  * [clone](#cloneobj \"clone\")\n  * [cloneWithShallow](#clonewithshallowobj-keys \"cloneWithShallow\")\n  * [merge](#mergetarget-source-isnulloverride-ismergearrays \"merge\")\n  * [applyToDefaults](#applytodefaultsdefaults-options-isnulloverride \"applyToDefaults\")\n  * [applyToDefaultsWithShallow](#applytodefaultswithshallowdefaults-options-keys \"applyToDefaultsWithShallow\")\n  * [deepEqual](#deepequala-b \"deepEqual\")\n  * [unique](#uniquearray-key \"unique\")\n  * [mapToObject](#maptoobjectarray-key \"mapToObject\")\n  * [intersect](#intersectarray1-array2 \"intersect\")\n  * [contain](#containref-values-options \"contain\")\n  * [flatten](#flattenarray-target \"flatten\")\n  * [reach](#reachobj-chain-options \"reach\")\n  * [reachTemplate](#reachtemplateobj-template-options \"reachTemplate\")\n  * [transform](#transformobj-transform-options \"transform\")\n  * [shallow](#shallowobj \"shallow\")\n  * [stringify](#stringifyobj \"stringify\")\n* [Timer](#timer \"Timer\")\n* [Bench](#bench \"Bench\")\n* [Binary Encoding/Decoding](#binary-encodingdecoding \"Binary Encoding/Decoding\")\n  * [base64urlEncode](#base64urlencodevalue \"binary64urlEncode\")\n  * [base64urlDecode](#base64urldecodevalue \"binary64urlDecode\")\n* [Escaping Characters](#escaping-characters \"Escaping Characters\")\n  * [escapeHtml](#escapehtmlstring \"escapeHtml\")\n  * [escapeHeaderAttribute](#escapeheaderattributeattribute \"escapeHeaderAttribute\")\n  * [escapeRegex](#escaperegexstring \"escapeRegex\")\n* [Errors](#errors \"Errors\")\n  * [assert](#assertcondition-message \"assert\")\n  * [abort](#abortmessage \"abort\")\n  * [displayStack](#displaystackslice \"displayStack\")\n  * [callStack](#callstackslice \"callStack\")\n* [Function](#function \"Function\")\n  * [nextTick](#nexttickfn \"nextTick\")\n  * [once](#oncefn \"once\")\n  * [ignore](#ignore \"ignore\")\n* [Miscellaneous](#miscellaneous \"Miscellaneous\")\n  * [uniqueFilename](#uniquefilenamepath-extension \"uniqueFilename\")\n  * [isAbsolutePath](#isabsolutepathpath-platform \"isAbsolutePath\")\n  * [isInteger](#isintegervalue \"isInteger\")\n\n\n\n# Introduction\n\nThe *Hoek* library contains some common functions used within the hapi ecosystem. It comes with useful methods for Arrays (clone, merge, applyToDefaults), Objects (removeKeys, copy), Asserting and more.\n\nFor example, to use Hoek to set configuration with default options:\n```javascript\nvar Hoek = require('hoek');\n\nvar default = {url : \"www.github.com\", port : \"8000\", debug : true};\n\nvar config = Hoek.applyToDefaults(default, {port : \"3000\", admin : true});\n\n// In this case, config would be { url: 'www.github.com', port: '3000', debug: true, admin: true }\n```\n\nUnder each of the sections (such as Array), there are subsections which correspond to Hoek methods. Each subsection will explain how to use the corresponding method. In each js excerpt below, the `var Hoek = require('hoek');` is omitted for brevity.\n\n## Object\n\nHoek provides several helpful methods for objects and arrays.\n\n### clone(obj)\n\nThis method is used to clone an object or an array. A *deep copy* is made (duplicates everything, including values that are objects, as well as non-enumerable properties).\n\n```javascript\n\nvar nestedObj = {\n        w: /^something$/ig,\n        x: {\n            a: [1, 2, 3],\n            b: 123456,\n            c: new Date()\n        },\n        y: 'y',\n        z: new Date()\n    };\n\nvar copy = Hoek.clone(nestedObj);\n\ncopy.x.b = 100;\n\nconsole.log(copy.y);        // results in 'y'\nconsole.log(nestedObj.x.b); // results in 123456\nconsole.log(copy.x.b);      // results in 100\n```\n\n### cloneWithShallow(obj, keys)\nkeys is an array of key names to shallow copy\n\nThis method is also used to clone an object or array, however any keys listed in the `keys` array are shallow copied while those not listed are deep copied.\n\n```javascript\n\nvar nestedObj = {\n        w: /^something$/ig,\n        x: {\n            a: [1, 2, 3],\n            b: 123456,\n            c: new Date()\n        },\n        y: 'y',\n        z: new Date()\n    };\n\nvar copy = Hoek.cloneWithShallow(nestedObj, ['x']);\n\ncopy.x.b = 100;\n\nconsole.log(copy.y);        // results in 'y'\nconsole.log(nestedObj.x.b); // results in 100\nconsole.log(copy.x.b);      // results in 100\n```\n\n### merge(target, source, isNullOverride, isMergeArrays)\nisNullOverride, isMergeArrays default to true\n\nMerge all the properties of source into target, source wins in conflict, and by default null and undefined from source are applied.\nMerge is destructive where the target is modified. For non destructive merge, use `applyToDefaults`.\n\n\n```javascript\n\nvar target = {a: 1, b : 2};\nvar source = {a: 0, c: 5};\nvar source2 = {a: null, c: 5};\n\nHoek.merge(target, source);         // results in {a: 0, b: 2, c: 5}\nHoek.merge(target, source2);        // results in {a: null, b: 2, c: 5}\nHoek.merge(target, source2, false); // results in {a: 1, b: 2, c: 5}\n\nvar targetArray = [1, 2, 3];\nvar sourceArray = [4, 5];\n\nHoek.merge(targetArray, sourceArray);              // results in [1, 2, 3, 4, 5]\nHoek.merge(targetArray, sourceArray, true, false); // results in [4, 5]\n```\n\n### applyToDefaults(defaults, options, isNullOverride)\nisNullOverride defaults to false\n\nApply options to a copy of the defaults\n\n```javascript\n\nvar defaults = { host: \"localhost\", port: 8000 };\nvar options = { port: 8080 };\n\nvar config = Hoek.applyToDefaults(defaults, options); // results in { host: \"localhost\", port: 8080 }\n```\n\nApply options with a null value to a copy of the defaults\n\n```javascript\n\nvar defaults = { host: \"localhost\", port: 8000 };\nvar options = { host: null, port: 8080 };\n\nvar config = Hoek.applyToDefaults(defaults, options, true); // results in { host: null, port: 8080 }\n```\n\n### applyToDefaultsWithShallow(defaults, options, keys)\nkeys is an array of key names to shallow copy\n\nApply options to a copy of the defaults. Keys specified in the last parameter are shallow copied from options instead of merged.\n\n```javascript\n\nvar defaults = {\n        server: {\n            host: \"localhost\",\n            port: 8000\n        },\n        name: 'example'\n    };\n\nvar options = { server: { port: 8080 } };\n\nvar config = Hoek.applyToDefaultsWithShallow(defaults, options, ['server']); // results in { server: { port: 8080 }, name: 'example' }\n```\n\n### deepEqual(b, a, [options])\n\nPerforms a deep comparison of the two values including support for circular dependencies, prototype, and properties. To skip prototype comparisons, use `options.prototype = false`\n\n```javascript\nHoek.deepEqual({ a: [1, 2], b: 'string', c: { d: true } }, { a: [1, 2], b: 'string', c: { d: true } }); //results in true\nHoek.deepEqual(Object.create(null), {}, { prototype: false }); //results in true\nHoek.deepEqual(Object.create(null), {}); //results in false\n```\n\n### unique(array, key)\n\nRemove duplicate items from Array\n\n```javascript\n\nvar array = [1, 2, 2, 3, 3, 4, 5, 6];\n\nvar newArray = Hoek.unique(array);    // results in [1,2,3,4,5,6]\n\narray = [{id: 1}, {id: 1}, {id: 2}];\n\nnewArray = Hoek.unique(array, \"id\");  // results in [{id: 1}, {id: 2}]\n```\n\n### mapToObject(array, key)\n\nConvert an Array into an Object\n\n```javascript\n\nvar array = [1,2,3];\nvar newObject = Hoek.mapToObject(array);   // results in [{\"1\": true}, {\"2\": true}, {\"3\": true}]\n\narray = [{id: 1}, {id: 2}];\nnewObject = Hoek.mapToObject(array, \"id\"); // results in [{\"id\": 1}, {\"id\": 2}]\n```\n\n### intersect(array1, array2)\n\nFind the common unique items in two arrays\n\n```javascript\n\nvar array1 = [1, 2, 3];\nvar array2 = [1, 4, 5];\n\nvar newArray = Hoek.intersect(array1, array2); // results in [1]\n```\n\n### contain(ref, values, [options])\n\nTests if the reference value contains the provided values where:\n- `ref` - the reference string, array, or object.\n- `values` - a single or array of values to find within the `ref` value. If `ref` is an object, `values` can be a key name,\n  an array of key names, or an object with key-value pairs to compare.\n- `options` - an optional object with the following optional settings:\n    - `deep` - if `true`, performed a deep comparison of the values.\n    - `once` - if `true`, allows only one occurrence of each value.\n    - `only` - if `true`, does not allow values not explicitly listed.\n    - `part` - if `true`, allows partial match of the values (at least one must always match).\n\nNote: comparing a string to overlapping values will result in failed comparison (e.g. `contain('abc', ['ab', 'bc'])`).\nAlso, if an object key's value does not match the provided value, `false` is returned even when `part` is specified.\n\n```javascript\nHoek.contain('aaa', 'a', { only: true });\t\t\t\t\t\t\t// true\nHoek.contain([{ a: 1 }], [{ a: 1 }], { deep: true });\t\t\t\t// true\nHoek.contain([1, 2, 2], [1, 2], { once: true });\t\t\t\t\t// false\nHoek.contain({ a: 1, b: 2, c: 3 }, { a: 1, d: 4 }, { part: true }); // true\n```\n\n### flatten(array, [target])\n\nFlatten an array\n\n```javascript\n\nvar array = [1, [2, 3]];\n\nvar flattenedArray = Hoek.flatten(array); // results in [1, 2, 3]\n\narray = [1, [2, 3]];\ntarget = [4, [5]];\n\nflattenedArray = Hoek.flatten(array, target); // results in [4, [5], 1, 2, 3]\n```\n\n### reach(obj, chain, [options])\n\nConverts an object key chain string to reference\n\n- `options` - optional settings\n    - `separator` - string to split chain path on, defaults to '.'\n    - `default` - value to return if the path or value is not present, default is `undefined`\n    - `strict` - if `true`, will throw an error on missing member, default is `false`\n    - `functions` - if `true` allow traversing functions for properties. `false` will throw an error if a function is part of the chain.\n\nA chain including negative numbers will work like negative indices on an\narray.\n\nIf chain is `null`, `undefined` or `false`, the object itself will be returned.\n\n```javascript\n\nvar chain = 'a.b.c';\nvar obj = {a : {b : { c : 1}}};\n\nHoek.reach(obj, chain); // returns 1\n\nvar chain = 'a.b.-1';\nvar obj = {a : {b : [2,3,6]}};\n\nHoek.reach(obj, chain); // returns 6\n```\n\n### reachTemplate(obj, template, [options])\n\nReplaces string parameters (`{name}`) with their corresponding object key values by applying the\n(`reach()`)[#reachobj-chain-options] method where:\n\n- `obj` - the context object used for key lookup.\n- `template` - a string containing `{}` parameters.\n- `options` - optional (`reach()`)[#reachobj-chain-options] options.\n\n```javascript\n\nvar chain = 'a.b.c';\nvar obj = {a : {b : { c : 1}}};\n\nHoek.reachTemplate(obj, '1+{a.b.c}=2'); // returns '1+1=2'\n```\n\n### transform(obj, transform, [options])\n\nTransforms an existing object into a new one based on the supplied `obj` and `transform` map. `options` are the same as the `reach` options. The first argument can also be an array of objects. In that case the method will return an array of transformed objects.\n\n```javascript\nvar source = {\n    address: {\n        one: '123 main street',\n        two: 'PO Box 1234'\n    },\n    title: 'Warehouse',\n    state: 'CA'\n};\n\nvar result = Hoek.transform(source, {\n    'person.address.lineOne': 'address.one',\n    'person.address.lineTwo': 'address.two',\n    'title': 'title',\n    'person.address.region': 'state'\n});\n// Results in\n// {\n//     person: {\n//         address: {\n//             lineOne: '123 main street',\n//             lineTwo: 'PO Box 1234',\n//             region: 'CA'\n//         }\n//     },\n//     title: 'Warehouse'\n// }\n```\n\n### shallow(obj)\n\nPerforms a shallow copy by copying the references of all the top level children where:\n- `obj` - the object to be copied.\n\n```javascript\nvar shallow = Hoek.shallow({ a: { b: 1 } });\n```\n\n### stringify(obj)\n\nConverts an object to string using the built-in `JSON.stringify()` method with the difference that any errors are caught\nand reported back in the form of the returned string. Used as a shortcut for displaying information to the console (e.g. in\nerror message) without the need to worry about invalid conversion.\n\n```javascript\nvar a = {};\na.b = a;\nHoek.stringify(a);\t\t// Returns '[Cannot display object: Converting circular structure to JSON]'\n```\n\n# Timer\n\nA Timer object. Initializing a new timer object sets the ts to the number of milliseconds elapsed since 1 January 1970 00:00:00 UTC.\n\n```javascript\n\nvar timerObj = new Hoek.Timer();\nconsole.log(\"Time is now: \" + timerObj.ts);\nconsole.log(\"Elapsed time from initialization: \" + timerObj.elapsed() + 'milliseconds');\n```\n\n\n# Bench\n\nSame as Timer with the exception that `ts` stores the internal node clock which is not related to `Date.now()` and cannot be used to display\nhuman-readable timestamps. More accurate for benchmarking or internal timers.\n\n# Binary Encoding/Decoding\n\n### base64urlEncode(value)\n\nEncodes value in Base64 or URL encoding\n\n### base64urlDecode(value)\n\nDecodes data in Base64 or URL encoding.\n# Escaping Characters\n\nHoek provides convenient methods for escaping html characters. The escaped characters are as followed:\n\n```javascript\n\ninternals.htmlEscaped = {\n    '&': '&amp;',\n    '<': '&lt;',\n    '>': '&gt;',\n    '\"': '&quot;',\n    \"'\": '&#x27;',\n    '`': '&#x60;'\n};\n```\n\n### escapeHtml(string)\n\n```javascript\n\nvar string = '<html> hey </html>';\nvar escapedString = Hoek.escapeHtml(string); // returns &lt;html&gt; hey &lt;/html&gt;\n```\n\n### escapeHeaderAttribute(attribute)\n\nEscape attribute value for use in HTTP header\n\n```javascript\n\nvar a = Hoek.escapeHeaderAttribute('I said \"go w\\\\o me\"');  //returns I said \\\"go w\\\\o me\\\"\n```\n\n\n### escapeRegex(string)\n\nEscape string for Regex construction\n\n```javascript\n\nvar a = Hoek.escapeRegex('4^f$s.4*5+-_?%=#!:@|~\\\\/`\"(>)[<]d{}s,');  // returns 4\\^f\\$s\\.4\\*5\\+\\-_\\?%\\=#\\!\\:@\\|~\\\\\\/`\"\\(>\\)\\[<\\]d\\{\\}s\\,\n```\n\n# Errors\n\n### assert(condition, message)\n\n```javascript\n\nvar a = 1, b = 2;\n\nHoek.assert(a === b, 'a should equal b');  // Throws 'a should equal b'\n```\n\nNote that you may also pass an already created Error object as the second parameter, and `assert` will throw that object.\n\n```javascript\n\nvar a = 1, b = 2;\n\nHoek.assert(a === b, new Error('a should equal b')); // Throws the given error object\n```\n\n### abort(message)\n\nFirst checks if `process.env.NODE_ENV === 'test'`, and if so, throws error message. Otherwise,\ndisplays most recent stack and then exits process.\n\n\n\n### displayStack(slice)\n\nDisplays the trace stack\n\n```javascript\n\nvar stack = Hoek.displayStack();\nconsole.log(stack); // returns something like:\n\n[ 'null (/Users/user/Desktop/hoek/test.js:4:18)',\n  'Module._compile (module.js:449:26)',\n  'Module._extensions..js (module.js:467:10)',\n  'Module.load (module.js:356:32)',\n  'Module._load (module.js:312:12)',\n  'Module.runMain (module.js:492:10)',\n  'startup.processNextTick.process._tickCallback (node.js:244:9)' ]\n```\n\n### callStack(slice)\n\nReturns a trace stack array.\n\n```javascript\n\nvar stack = Hoek.callStack();\nconsole.log(stack);  // returns something like:\n\n[ [ '/Users/user/Desktop/hoek/test.js', 4, 18, null, false ],\n  [ 'module.js', 449, 26, 'Module._compile', false ],\n  [ 'module.js', 467, 10, 'Module._extensions..js', false ],\n  [ 'module.js', 356, 32, 'Module.load', false ],\n  [ 'module.js', 312, 12, 'Module._load', false ],\n  [ 'module.js', 492, 10, 'Module.runMain', false ],\n  [ 'node.js',\n    244,\n    9,\n    'startup.processNextTick.process._tickCallback',\n    false ] ]\n```\n\n## Function\n\n### nextTick(fn)\n\nReturns a new function that wraps `fn` in `process.nextTick`.\n\n```javascript\n\nvar myFn = function () {\n    console.log('Do this later');\n};\n\nvar nextFn = Hoek.nextTick(myFn);\n\nnextFn();\nconsole.log('Do this first');\n\n// Results in:\n//\n// Do this first\n// Do this later\n```\n\n### once(fn)\n\nReturns a new function that can be run multiple times, but makes sure `fn` is only run once.\n\n```javascript\n\nvar myFn = function () {\n    console.log('Ran myFn');\n};\n\nvar onceFn = Hoek.once(myFn);\nonceFn(); // results in \"Ran myFn\"\nonceFn(); // results in undefined\n```\n\n### ignore\n\nA simple no-op function. It does nothing at all.\n\n## Miscellaneous\n\n### uniqueFilename(path, extension)\n`path` to prepend with the randomly generated file name. `extension` is the optional file extension, defaults to `''`.\n\nReturns a randomly generated file name at the specified `path`. The result is a fully resolved path to a file.\n\n```javascript\nvar result = Hoek.uniqueFilename('./test/modules', 'txt'); // results in \"full/path/test/modules/{random}.txt\"\n```\n\n### isAbsolutePath(path, [platform])\n\nDetermines whether `path` is an absolute path. Returns `true` or `false`.\n\n- `path` - A file path to test for whether it is absolute or not.\n- `platform` - An optional parameter used for specifying the platform. Defaults to `process.platform`.\n\n### isInteger(value)\n\nCheck `value` to see if it is an integer.  Returns true/false.\n\n```javascript\nvar result = Hoek.isInteger('23')\n```\n",
-  "readmeFilename": "README.md",
+  "gitHead": "20f36e85616264d4b73a64a374803175213a9121",
   "bugs": {
     "url": "https://github.com/hapijs/hoek/issues"
   },
   "homepage": "https://github.com/hapijs/hoek#readme",
   "_id": "hoek@2.16.3",
   "_shasum": "20bb7403d3cea398e91dc4710a8ff1b8274a25ed",
+  "_from": "hoek@>=2.0.0 <3.0.0",
+  "_npmVersion": "3.3.3",
+  "_nodeVersion": "4.1.0",
+  "_npmUser": {
+    "name": "nlf",
+    "email": "quitlahok@gmail.com"
+  },
+  "dist": {
+    "shasum": "20bb7403d3cea398e91dc4710a8ff1b8274a25ed",
+    "tarball": "http://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "hueniverse",
+      "email": "eran@hueniverse.com"
+    },
+    {
+      "name": "wyatt",
+      "email": "wpreul@gmail.com"
+    },
+    {
+      "name": "nlf",
+      "email": "quitlahok@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/hoek/-/hoek-2.16.3.tgz",
-  "_from": "hoek@>=2.0.0 <3.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 9ae1b92..8b664b6 100644 (file)
       "url": "http://github.com/hueniverse/sntp/raw/master/LICENSE"
     }
   ],
-  "readme": "# sntp\n\nAn SNTP v4 client (RFC4330) for node. Simpy connects to the NTP or SNTP server requested and returns the server time\nalong with the roundtrip duration and clock offset. To adjust the local time to the NTP time, add the returned `t` offset\nto the local time.\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/sntp.png)](http://travis-ci.org/hueniverse/sntp)\n\n# Usage\n\n```javascript\nvar Sntp = require('sntp');\n\n// All options are optional\n\nvar options = {\n    host: 'nist1-sj.ustiming.org',  // Defaults to pool.ntp.org\n    port: 123,                      // Defaults to 123 (NTP)\n    resolveReference: true,         // Default to false (not resolving)\n    timeout: 1000                   // Defaults to zero (no timeout)\n};\n\n// Request server time\n\nSntp.time(options, function (err, time) {\n\n    if (err) {\n        console.log('Failed: ' + err.message);\n        process.exit(1);\n    }\n\n    console.log('Local clock is off by: ' + time.t + ' milliseconds');\n    process.exit(0);\n});\n```\n\nIf an application needs to maintain continuous time synchronization, the module provides a stateful method for\nquerying the current offset only when the last one is too old (defaults to daily).\n\n```javascript\n// Request offset once\n\nSntp.offset(function (err, offset) {\n\n    console.log(offset);                    // New (served fresh)\n\n    // Request offset again\n\n    Sntp.offset(function (err, offset) {\n\n        console.log(offset);                // Identical (served from cache)\n    });\n});\n```\n\nTo set a background offset refresh, start the interval and use the provided now() method. If for any reason the\nclient fails to obtain an up-to-date offset, the current system clock is used.\n\n```javascript\nvar before = Sntp.now();                    // System time without offset\n\nSntp.start(function () {\n\n    var now = Sntp.now();                   // With offset\n    Sntp.stop();\n});\n```\n\n",
-  "readmeFilename": "README.md",
+  "gitHead": "ee2e35284f684609990681734d39010cd356d7da",
   "bugs": {
     "url": "https://github.com/hueniverse/sntp/issues"
   },
-  "homepage": "https://github.com/hueniverse/sntp#readme",
+  "homepage": "https://github.com/hueniverse/sntp",
   "_id": "sntp@1.0.9",
   "_shasum": "6541184cc90aeea6c6e7b35e2659082443c66198",
+  "_from": "sntp@>=1.0.0 <2.0.0",
+  "_npmVersion": "1.4.23",
+  "_npmUser": {
+    "name": "hueniverse",
+    "email": "eran@hueniverse.com"
+  },
+  "maintainers": [
+    {
+      "name": "hueniverse",
+      "email": "eran@hueniverse.com"
+    }
+  ],
+  "dist": {
+    "shasum": "6541184cc90aeea6c6e7b35e2659082443c66198",
+    "tarball": "http://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/sntp/-/sntp-1.0.9.tgz",
-  "_from": "sntp@>=1.0.0 <2.0.0"
+  "readme": "ERROR: No README data found!"
 }
index f3b98e7..7ed5f0f 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "hawk",
   "description": "HTTP Hawk Authentication Scheme",
-  "version": "3.1.2",
+  "version": "3.1.3",
   "author": {
     "name": "Eran Hammer",
     "email": "eran@hammer.io",
     "test-cov-html": "lab -a code -r html -o coverage.html"
   },
   "license": "BSD-3-Clause",
-  "readme": "![hawk Logo](https://raw.github.com/hueniverse/hawk/master/images/hawk.png)\n\n<img align=\"right\" src=\"https://raw.github.com/hueniverse/hawk/master/images/logo.png\" /> **Hawk** is an HTTP authentication scheme using a message authentication code (MAC) algorithm to provide partial\nHTTP request cryptographic verification. For more complex use cases such as access delegation, see [Oz](https://github.com/hueniverse/oz).\n\nCurrent version: **3.x**\n\nNote: 3.x and 2.x are the same exact protocol as 1.1. The version increments reflect changes in the node API.\n\n[![Build Status](https://secure.travis-ci.org/hueniverse/hawk.png)](http://travis-ci.org/hueniverse/hawk)\n\n# Table of Content\n\n- [**Introduction**](#introduction)\n  - [Replay Protection](#replay-protection)\n  - [Usage Example](#usage-example)\n  - [Protocol Example](#protocol-example)\n    - [Payload Validation](#payload-validation)\n    - [Response Payload Validation](#response-payload-validation)\n  - [Browser Support and Considerations](#browser-support-and-considerations)\n<p></p>\n- [**Single URI Authorization**](#single-uri-authorization)\n  - [Usage Example](#bewit-usage-example)\n<p></p>\n- [**Security Considerations**](#security-considerations)\n  - [MAC Keys Transmission](#mac-keys-transmission)\n  - [Confidentiality of Requests](#confidentiality-of-requests)\n  - [Spoofing by Counterfeit Servers](#spoofing-by-counterfeit-servers)\n  - [Plaintext Storage of Credentials](#plaintext-storage-of-credentials)\n  - [Entropy of Keys](#entropy-of-keys)\n  - [Coverage Limitations](#coverage-limitations)\n  - [Future Time Manipulation](#future-time-manipulation)\n  - [Client Clock Poisoning](#client-clock-poisoning)\n  - [Bewit Limitations](#bewit-limitations)\n  - [Host Header Forgery](#host-header-forgery)\n<p></p>\n- [**Frequently Asked Questions**](#frequently-asked-questions)\n<p></p>\n- [**Implementations**](#implementations)\n- [**Acknowledgements**](#acknowledgements)\n\n# Introduction\n\n**Hawk** is an HTTP authentication scheme providing mechanisms for making authenticated HTTP requests with\npartial cryptographic verification of the request and response, covering the HTTP method, request URI, host,\nand optionally the request payload.\n\nSimilar to the HTTP [Digest access authentication schemes](http://www.ietf.org/rfc/rfc2617.txt), **Hawk** uses a set of\nclient credentials which include an identifier (e.g. username) and key (e.g. password). Likewise, just as with the Digest scheme,\nthe key is never included in authenticated requests. Instead, it is used to calculate a request MAC value which is\nincluded in its place.\n\nHowever, **Hawk** has several differences from Digest. In particular, while both use a nonce to limit the possibility of\nreplay attacks, in **Hawk** the client generates the nonce and uses it in combination with a timestamp, leading to less\n\"chattiness\" (interaction with the server).\n\nAlso unlike Digest, this scheme is not intended to protect the key itself (the password in Digest) because\nthe client and server must both have access to the key material in the clear.\n\nThe primary design goals of this scheme are to:\n* simplify and improve HTTP authentication for services that are unwilling or unable to deploy TLS for all resources,\n* secure credentials against leakage (e.g., when the client uses some form of dynamic configuration to determine where\n  to send an authenticated request), and\n* avoid the exposure of credentials sent to a malicious server over an unauthenticated secure channel due to client\n  failure to validate the server's identity as part of its TLS handshake.\n\nIn addition, **Hawk** supports a method for granting third-parties temporary access to individual resources using\na query parameter called _bewit_ (in falconry, a leather strap used to attach a tracking device to the leg of a hawk).\n\nThe **Hawk** scheme requires the establishment of a shared symmetric key between the client and the server,\nwhich is beyond the scope of this module. Typically, the shared credentials are established via an initial\nTLS-protected phase or derived from some other shared confidential information available to both the client\nand the server.\n\n\n## Replay Protection\n\nWithout replay protection, an attacker can use a compromised (but otherwise valid and authenticated) request more \nthan once, gaining access to a protected resource. To mitigate this, clients include both a nonce and a timestamp when \nmaking requests. This gives the server enough information to prevent replay attacks.\n\nThe nonce is generated by the client, and is a string unique across all requests with the same timestamp and\nkey identifier combination. \n\nThe timestamp enables the server to restrict the validity period of the credentials where requests occuring afterwards\nare rejected. It also removes the need for the server to retain an unbounded number of nonce values for future checks.\nBy default, **Hawk** uses a time window of 1 minute to allow for time skew between the client and server (which in\npractice translates to a maximum of 2 minutes as the skew can be positive or negative).\n\nUsing a timestamp requires the client's clock to be in sync with the server's clock. **Hawk** requires both the client\nclock and the server clock to use NTP to ensure synchronization. However, given the limitations of some client types\n(e.g. browsers) to deploy NTP, the server provides the client with its current time (in seconds precision) in response\nto a bad timestamp.\n\nThere is no expectation that the client will adjust its system clock to match the server (in fact, this would be a\npotential attack vector). Instead, the client only uses the server's time to calculate an offset used only\nfor communications with that particular server. The protocol rewards clients with synchronized clocks by reducing\nthe number of round trips required to authenticate the first request.\n\n\n## Usage Example\n\nServer code:\n\n```javascript\nvar Http = require('http');\nvar Hawk = require('hawk');\n\n\n// Credentials lookup function\n\nvar credentialsFunc = function (id, callback) {\n\n    var credentials = {\n        key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n        algorithm: 'sha256',\n        user: 'Steve'\n    };\n\n    return callback(null, credentials);\n};\n\n// Create HTTP server\n\nvar handler = function (req, res) {\n\n    // Authenticate incoming request\n\n    Hawk.server.authenticate(req, credentialsFunc, {}, function (err, credentials, artifacts) {\n\n        // Prepare response\n\n        var payload = (!err ? 'Hello ' + credentials.user + ' ' + artifacts.ext : 'Shoosh!');\n        var headers = { 'Content-Type': 'text/plain' };\n\n        // Generate Server-Authorization response header\n\n        var header = Hawk.server.header(credentials, artifacts, { payload: payload, contentType: headers['Content-Type'] });\n        headers['Server-Authorization'] = header;\n\n        // Send the response back\n\n        res.writeHead(!err ? 200 : 401, headers);\n        res.end(payload);\n    });\n};\n\n// Start server\n\nHttp.createServer(handler).listen(8000, 'example.com');\n```\n\nClient code:\n\n```javascript\nvar Request = require('request');\nvar Hawk = require('hawk');\n\n\n// Client credentials\n\nvar credentials = {\n    id: 'dh37fgj492je',\n    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n    algorithm: 'sha256'\n}\n\n// Request options\n\nvar requestOptions = {\n    uri: 'http://example.com:8000/resource/1?b=1&a=2',\n    method: 'GET',\n    headers: {}\n};\n\n// Generate Authorization request header\n\nvar header = Hawk.client.header('http://example.com:8000/resource/1?b=1&a=2', 'GET', { credentials: credentials, ext: 'some-app-data' });\nrequestOptions.headers.Authorization = header.field;\n\n// Send authenticated request\n\nRequest(requestOptions, function (error, response, body) {\n\n    // Authenticate the server's response\n\n    var isValid = Hawk.client.authenticate(response, credentials, header.artifacts, { payload: body });\n\n    // Output results\n\n    console.log(response.statusCode + ': ' + body + (isValid ? ' (valid)' : ' (invalid)'));\n});\n```\n\n**Hawk** utilized the [**SNTP**](https://github.com/hueniverse/sntp) module for time sync management. By default, the local\nmachine time is used. To automatically retrieve and synchronice the clock within the application, use the SNTP 'start()' method.\n\n```javascript\nHawk.sntp.start();\n```\n\n\n## Protocol Example\n\nThe client attempts to access a protected resource without authentication, sending the following HTTP request to\nthe resource server:\n\n```\nGET /resource/1?b=1&a=2 HTTP/1.1\nHost: example.com:8000\n```\n\nThe resource server returns an authentication challenge.\n\n```\nHTTP/1.1 401 Unauthorized\nWWW-Authenticate: Hawk\n```\n\nThe client has previously obtained a set of **Hawk** credentials for accessing resources on the \"http://example.com/\"\nserver. The **Hawk** credentials issued to the client include the following attributes:\n\n* Key identifier: dh37fgj492je\n* Key: werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn\n* Algorithm: sha256\n\nThe client generates the authentication header by calculating a timestamp (e.g. the number of seconds since January 1,\n1970 00:00:00 GMT), generating a nonce, and constructing the normalized request string (each value followed by a newline\ncharacter):\n\n```\nhawk.1.header\n1353832234\nj4h3g2\nGET\n/resource/1?b=1&a=2\nexample.com\n8000\n\nsome-app-ext-data\n\n```\n\nThe request MAC is calculated using HMAC with the specified hash algorithm \"sha256\" and the key over the normalized request string.\nThe result is base64-encoded to produce the request MAC:\n\n```\n6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=\n```\n\nThe client includes the **Hawk** key identifier, timestamp, nonce, application specific data, and request MAC with the request using\nthe HTTP `Authorization` request header field:\n\n```\nGET /resource/1?b=1&a=2 HTTP/1.1\nHost: example.com:8000\nAuthorization: Hawk id=\"dh37fgj492je\", ts=\"1353832234\", nonce=\"j4h3g2\", ext=\"some-app-ext-data\", mac=\"6R4rV5iE+NPoym+WwjeHzjAGXUtLNIxmo1vpMofpLAE=\"\n```\n\nThe server validates the request by calculating the request MAC again based on the request received and verifies the validity\nand scope of the **Hawk** credentials. If valid, the server responds with the requested resource.\n\n\n### Payload Validation\n\n**Hawk** provides optional payload validation. When generating the authentication header, the client calculates a payload hash\nusing the specified hash algorithm. The hash is calculated over the concatenated value of (each followed by a newline character):\n* `hawk.1.payload`\n* the content-type in lowercase, without any parameters (e.g. `application/json`)\n* the request payload prior to any content encoding (the exact representation requirements should be specified by the server for payloads other than simple single-part ascii to ensure interoperability)\n\nFor example:\n\n* Payload: `Thank you for flying Hawk`\n* Content Type: `text/plain`\n* Hash (sha256): `Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=`\n\nResults in the following input to the payload hash function (newline terminated values):\n\n```\nhawk.1.payload\ntext/plain\nThank you for flying Hawk\n\n```\n\nWhich produces the following hash value:\n\n```\nYi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\n```\n\nThe client constructs the normalized request string (newline terminated values):\n\n```\nhawk.1.header\n1353832234\nj4h3g2\nPOST\n/resource/1?a=1&b=2\nexample.com\n8000\nYi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\nsome-app-ext-data\n\n```\n\nThen calculates the request MAC and includes the **Hawk** key identifier, timestamp, nonce, payload hash, application specific data,\nand request MAC, with the request using the HTTP `Authorization` request header field:\n\n```\nPOST /resource/1?a=1&b=2 HTTP/1.1\nHost: example.com:8000\nAuthorization: Hawk id=\"dh37fgj492je\", ts=\"1353832234\", nonce=\"j4h3g2\", hash=\"Yi9LfIIFRtBEPt74PVmbTF/xVAwPn7ub15ePICfgnuY=\", ext=\"some-app-ext-data\", mac=\"aSe1DERmZuRl3pI36/9BdZmnErTw3sNzOOAUlfeKjVw=\"\n```\n\nIt is up to the server if and when it validates the payload for any given request, based solely on it's security policy\nand the nature of the data included.\n\nIf the payload is available at the time of authentication, the server uses the hash value provided by the client to construct\nthe normalized string and validates the MAC. If the MAC is valid, the server calculates the payload hash and compares the value\nwith the provided payload hash in the header. In many cases, checking the MAC first is faster than calculating the payload hash.\n\nHowever, if the payload is not available at authentication time (e.g. too large to fit in memory, streamed elsewhere, or processed\nat a different stage in the application), the server may choose to defer payload validation for later by retaining the hash value\nprovided by the client after validating the MAC.\n\nIt is important to note that MAC validation does not mean the hash value provided by the client is valid, only that the value\nincluded in the header was not modified. Without calculating the payload hash on the server and comparing it to the value provided\nby the client, the payload may be modified by an attacker.\n\n\n## Response Payload Validation\n\n**Hawk** provides partial response payload validation. The server includes the `Server-Authorization` response header which enables the\nclient to authenticate the response and ensure it is talking to the right server. **Hawk** defines the HTTP `Server-Authorization` header\nas a response header using the exact same syntax as the `Authorization` request header field.\n\nThe header is contructed using the same process as the client's request header. The server uses the same credentials and other\nartifacts provided by the client to constructs the normalized request string. The `ext` and `hash` values are replaced with\nnew values based on the server response. The rest as identical to those used by the client.\n\nThe result MAC digest is included with the optional `hash` and `ext` values:\n\n```\nServer-Authorization: Hawk mac=\"XIJRsMl/4oL+nn+vKoeVZPdCHXB4yJkNnBbTbHFZUYE=\", hash=\"f9cDF/TDm7TkYRLnGwRMfeDzT6LixQVLvrIKhh0vgmM=\", ext=\"response-specific\"\n```\n\n\n## Browser Support and Considerations\n\nA browser script is provided for including using a `<script>` tag in [lib/browser.js](/lib/browser.js). It's also a [component](http://component.io/hueniverse/hawk).\n\n**Hawk** relies on the _Server-Authorization_ and _WWW-Authenticate_ headers in its response to communicate with the client.\nTherefore, in case of CORS requests, it is important to consider sending _Access-Control-Expose-Headers_ with the value\n_\"WWW-Authenticate, Server-Authorization\"_ on each response from your server. As explained in the\n[specifications](http://www.w3.org/TR/cors/#access-control-expose-headers-response-header), it will indicate that these headers\ncan safely be accessed by the client (using getResponseHeader() on the XmlHttpRequest object). Otherwise you will be met with a\n[\"simple response header\"](http://www.w3.org/TR/cors/#simple-response-header) which excludes these fields and would prevent the\nHawk client from authenticating the requests.You can read more about the why and how in this\n[article](http://www.html5rocks.com/en/tutorials/cors/#toc-adding-cors-support-to-the-server)\n\n\n# Single URI Authorization\n\nThere are cases in which limited and short-term access to a protected resource is granted to a third party which does not\nhave access to the shared credentials. For example, displaying a protected image on a web page accessed by anyone. **Hawk**\nprovides limited support for such URIs in the form of a _bewit_ - a URI query parameter appended to the request URI which contains\nthe necessary credentials to authenticate the request.\n\nBecause of the significant security risks involved in issuing such access, bewit usage is purposely limited only to GET requests\nand for a finite period of time. Both the client and server can issue bewit credentials, however, the server should not use the same\ncredentials as the client to maintain clear traceability as to who issued which credentials.\n\nIn order to simplify implementation, bewit credentials do not support single-use policy and can be replayed multiple times within\nthe granted access timeframe. \n\n\n## Bewit Usage Example\n\nServer code:\n\n```javascript\nvar Http = require('http');\nvar Hawk = require('hawk');\n\n\n// Credentials lookup function\n\nvar credentialsFunc = function (id, callback) {\n\n    var credentials = {\n        key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n        algorithm: 'sha256'\n    };\n\n    return callback(null, credentials);\n};\n\n// Create HTTP server\n\nvar handler = function (req, res) {\n\n    Hawk.uri.authenticate(req, credentialsFunc, {}, function (err, credentials, attributes) {\n\n        res.writeHead(!err ? 200 : 401, { 'Content-Type': 'text/plain' });\n        res.end(!err ? 'Access granted' : 'Shoosh!');\n    });\n};\n\nHttp.createServer(handler).listen(8000, 'example.com');\n```\n\nBewit code generation:\n\n```javascript\nvar Request = require('request');\nvar Hawk = require('hawk');\n\n\n// Client credentials\n\nvar credentials = {\n    id: 'dh37fgj492je',\n    key: 'werxhqb98rpaxn39848xrunpaw3489ruxnpa98w4rxn',\n    algorithm: 'sha256'\n}\n\n// Generate bewit\n\nvar duration = 60 * 5;      // 5 Minutes\nvar bewit = Hawk.uri.getBewit('http://example.com:8080/resource/1?b=1&a=2', { credentials: credentials, ttlSec: duration, ext: 'some-app-data' });\nvar uri = 'http://example.com:8000/resource/1?b=1&a=2' + '&bewit=' + bewit;\n```\n\n\n# Security Considerations\n\nThe greatest sources of security risks are usually found not in **Hawk** but in the policies and procedures surrounding its use.\nImplementers are strongly encouraged to assess how this module addresses their security requirements. This section includes\nan incomplete list of security considerations that must be reviewed and understood before deploying **Hawk** on the server.\nMany of the protections provided in **Hawk** depends on whether and how they are used.\n\n### MAC Keys Transmission\n\n**Hawk** does not provide any mechanism for obtaining or transmitting the set of shared credentials required. Any mechanism used\nto obtain **Hawk** credentials must ensure that these transmissions are protected using transport-layer mechanisms such as TLS.\n\n### Confidentiality of Requests\n\nWhile **Hawk** provides a mechanism for verifying the integrity of HTTP requests, it provides no guarantee of request\nconfidentiality. Unless other precautions are taken, eavesdroppers will have full access to the request content. Servers should\ncarefully consider the types of data likely to be sent as part of such requests, and employ transport-layer security mechanisms\nto protect sensitive resources.\n\n### Spoofing by Counterfeit Servers\n\n**Hawk** provides limited verification of the server authenticity. When receiving a response back from the server, the server\nmay choose to include a response `Server-Authorization` header which the client can use to verify the response. However, it is up to\nthe server to determine when such measure is included, to up to the client to enforce that policy.\n\nA hostile party could take advantage of this by intercepting the client's requests and returning misleading or otherwise\nincorrect responses. Service providers should consider such attacks when developing services using this protocol, and should\nrequire transport-layer security for any requests where the authenticity of the resource server or of server responses is an issue.\n\n### Plaintext Storage of Credentials\n\nThe **Hawk** key functions the same way passwords do in traditional authentication systems. In order to compute the request MAC,\nthe server must have access to the key in plaintext form. This is in contrast, for example, to modern operating systems, which\nstore only a one-way hash of user credentials.\n\nIf an attacker were to gain access to these keys - or worse, to the server's database of all such keys - he or she would be able\nto perform any action on behalf of any resource owner. Accordingly, it is critical that servers protect these keys from unauthorized\naccess.\n\n### Entropy of Keys\n\nUnless a transport-layer security protocol is used, eavesdroppers will have full access to authenticated requests and request\nMAC values, and will thus be able to mount offline brute-force attacks to recover the key used. Servers should be careful to\nassign keys which are long enough, and random enough, to resist such attacks for at least the length of time that the **Hawk**\ncredentials are valid.\n\nFor example, if the credentials are valid for two weeks, servers should ensure that it is not possible to mount a brute force\nattack that recovers the key in less than two weeks. Of course, servers are urged to err on the side of caution, and use the\nlongest key reasonable.\n\nIt is equally important that the pseudo-random number generator (PRNG) used to generate these keys be of sufficiently high\nquality. Many PRNG implementations generate number sequences that may appear to be random, but which nevertheless exhibit\npatterns or other weaknesses which make cryptanalysis or brute force attacks easier. Implementers should be careful to use\ncryptographically secure PRNGs to avoid these problems.\n\n### Coverage Limitations\n\nThe request MAC only covers the HTTP `Host` header and optionally the `Content-Type` header. It does not cover any other headers\nwhich can often affect how the request body is interpreted by the server. If the server behavior is influenced by the presence\nor value of such headers, an attacker can manipulate the request headers without being detected. Implementers should use the\n`ext` feature to pass application-specific information via the `Authorization` header which is protected by the request MAC.\n\nThe response authentication, when performed, only covers the response payload, content-type, and the request information \nprovided by the client in it's request (method, resource, timestamp, nonce, etc.). It does not cover the HTTP status code or\nany other response header field (e.g. Location) which can affect the client's behaviour.\n\n### Future Time Manipulation\n\nThe protocol relies on a clock sync between the client and server. To accomplish this, the server informs the client of its\ncurrent time when an invalid timestamp is received.\n\nIf an attacker is able to manipulate this information and cause the client to use an incorrect time, it would be able to cause\nthe client to generate authenticated requests using time in the future. Such requests will fail when sent by the client, and will\nnot likely leave a trace on the server (given the common implementation of nonce, if at all enforced). The attacker will then\nbe able to replay the request at the correct time without detection.\n\nThe client must only use the time information provided by the server if:\n* it was delivered over a TLS connection and the server identity has been verified, or\n* the `tsm` MAC digest calculated using the same client credentials over the timestamp has been verified.\n\n### Client Clock Poisoning\n\nWhen receiving a request with a bad timestamp, the server provides the client with its current time. The client must never use\nthe time received from the server to adjust its own clock, and must only use it to calculate an offset for communicating with\nthat particular server.\n\n### Bewit Limitations\n\nSpecial care must be taken when issuing bewit credentials to third parties. Bewit credentials are valid until expiration and cannot\nbe revoked or limited without using other means. Whatever resource they grant access to will be completely exposed to anyone with\naccess to the bewit credentials which act as bearer credentials for that particular resource. While bewit usage is limited to GET\nrequests only and therefore cannot be used to perform transactions or change server state, it can still be used to expose private\nand sensitive information.\n\n### Host Header Forgery\n\nHawk validates the incoming request MAC against the incoming HTTP Host header. However, unless the optional `host` and `port`\noptions are used with `server.authenticate()`, a malicous client can mint new host names pointing to the server's IP address and\nuse that to craft an attack by sending a valid request that's meant for another hostname than the one used by the server. Server\nimplementors must manually verify that the host header received matches their expectation (or use the options mentioned above).\n\n# Frequently Asked Questions\n\n### Where is the protocol specification?\n\nIf you are looking for some prose explaining how all this works, **this is it**. **Hawk** is being developed as an open source\nproject instead of a standard. In other words, the [code](/hueniverse/hawk/tree/master/lib) is the specification. Not sure about\nsomething? Open an issue!\n\n### Is it done?\n\nAs of version 0.10.0, **Hawk** is feature-complete. However, until this module reaches version 1.0.0 it is considered experimental\nand is likely to change. This also means your feedback and contribution are very welcome. Feel free to open issues with questions\nand suggestions.\n\n### Where can I find **Hawk** implementations in other languages?\n\n**Hawk**'s only reference implementation is provided in JavaScript as a node.js module. However, it has been ported to other languages.\nThe full list is maintained [here](https://github.com/hueniverse/hawk/issues?labels=port&state=closed). Please add an issue if you are\nworking on another port. A cross-platform test-suite is in the works.\n\n### Why isn't the algorithm part of the challenge or dynamically negotiated?\n\nThe algorithm used is closely related to the key issued as different algorithms require different key sizes (and other\nrequirements). While some keys can be used for multiple algorithm, the protocol is designed to closely bind the key and algorithm\ntogether as part of the issued credentials.\n\n### Why is Host and Content-Type the only headers covered by the request MAC?\n\nIt is really hard to include other headers. Headers can be changed by proxies and other intermediaries and there is no\nwell-established way to normalize them. Many platforms change the case of header field names and values. The only\nstraight-forward solution is to include the headers in some blob (say, base64 encoded JSON) and include that with the request,\nan approach taken by JWT and other such formats. However, that design violates the HTTP header boundaries, repeats information,\nand introduces other security issues because firewalls will not be aware of these \"hidden\" headers. In addition, any information\nrepeated must be compared to the duplicated information in the header and therefore only moves the problem elsewhere.\n\n### Why not just use HTTP Digest?\n\nDigest requires pre-negotiation to establish a nonce. This means you can't just make a request - you must first send\na protocol handshake to the server. This pattern has become unacceptable for most web services, especially mobile\nwhere extra round-trip are costly.\n\n### Why bother with all this nonce and timestamp business?\n\n**Hawk** is an attempt to find a reasonable, practical compromise between security and usability. OAuth 1.0 got timestamp\nand nonces halfway right but failed when it came to scalability and consistent developer experience. **Hawk** addresses\nit by requiring the client to sync its clock, but provides it with tools to accomplish it.\n\nIn general, replay protection is a matter of application-specific threat model. It is less of an issue on a TLS-protected\nsystem where the clients are implemented using best practices and are under the control of the server. Instead of dropping\nreplay protection, **Hawk** offers a required time window and an optional nonce verification. Together, it provides developers\nwith the ability to decide how to enforce their security policy without impacting the client's implementation.\n\n### What are `app` and `dlg` in the authorization header and normalized mac string?\n\nThe original motivation for **Hawk** was to replace the OAuth 1.0 use cases. This included both a simple client-server mode which\nthis module is specifically designed for, and a delegated access mode which is being developed separately in\n[Oz](https://github.com/hueniverse/oz). In addition to the **Hawk** use cases, Oz requires another attribute: the application id `app`.\nThis provides binding between the credentials and the application in a way that prevents an attacker from tricking an application\nto use credentials issued to someone else. It also has an optional 'delegated-by' attribute `dlg` which is the application id of the\napplication the credentials were directly issued to. The goal of these two additions is to allow Oz to utilize **Hawk** directly,\nbut with the additional security of delegated credentials.\n\n### What is the purpose of the static strings used in each normalized MAC input?\n\nWhen calculating a hash or MAC, a static prefix (tag) is added. The prefix is used to prevent MAC values from being\nused or reused for a purpose other than what they were created for (i.e. prevents switching MAC values between a request,\nresponse, and a bewit use cases). It also protects against exploits created after a potential change in how the protocol\ncreates the normalized string. For example, if a future version would switch the order of nonce and timestamp, it\ncan create an exploit opportunity for cases where the nonce is similar in format to a timestamp.\n\n### Does **Hawk** have anything to do with OAuth?\n\nShort answer: no.\n\n**Hawk** was originally proposed as the OAuth MAC Token specification. However, the OAuth working group in its consistent\nincompetence failed to produce a final, usable solution to address one of the most popular use cases of OAuth 1.0 - using it\nto authenticate simple client-server transactions (i.e. two-legged). As you can guess, the OAuth working group is still hard\nat work to produce more garbage.\n\n**Hawk** provides a simple HTTP authentication scheme for making client-server requests. It does not address the OAuth use case\nof delegating access to a third party. If you are looking for an OAuth alternative, check out [Oz](https://github.com/hueniverse/oz).\n\n# Implementations\n\n- [Logibit Hawk in F#/.Net](https://github.com/logibit/logibit.hawk/)\n- [Tent Hawk in Ruby](https://github.com/tent/hawk-ruby)\n- [Wealdtech in Java](https://github.com/wealdtech/hawk)\n- [Kumar's Mohawk in Python](https://github.com/kumar303/mohawk/)\n\n# Acknowledgements\n\n**Hawk** is a derivative work of the [HTTP MAC Authentication Scheme](http://tools.ietf.org/html/draft-hammer-oauth-v2-mac-token-05) proposal\nco-authored by Ben Adida, Adam Barth, and Eran Hammer, which in turn was based on the OAuth 1.0 community specification.\n\nSpecial thanks to Ben Laurie for his always insightful feedback and advice.\n\nThe **Hawk** logo was created by [Chris Carrasco](http://chriscarrasco.com).\n",
-  "readmeFilename": "README.md",
+  "gitHead": "2f0b93b34ed9b0ebc865838ef70c6a4035591430",
   "bugs": {
     "url": "https://github.com/hueniverse/hawk/issues"
   },
   "homepage": "https://github.com/hueniverse/hawk#readme",
-  "_id": "hawk@3.1.2",
-  "_shasum": "90c90118886e21975d1ad4ae9b3e284ed19a2de8",
-  "_resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.2.tgz",
-  "_from": "hawk@>=3.1.0 <3.2.0"
+  "_id": "hawk@3.1.3",
+  "_shasum": "078444bd7c1640b0fe540d2c9b73d59678e8e1c4",
+  "_from": "hawk@>=3.1.0 <3.2.0",
+  "_npmVersion": "3.3.12",
+  "_nodeVersion": "5.4.1",
+  "_npmUser": {
+    "name": "hueniverse",
+    "email": "eran@hammer.io"
+  },
+  "dist": {
+    "shasum": "078444bd7c1640b0fe540d2c9b73d59678e8e1c4",
+    "tarball": "http://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "hueniverse",
+      "email": "eran@hueniverse.com"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/hawk/-/hawk-3.1.3.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 6af4b89..0fdf13d 100755 (executable)
@@ -970,6 +970,33 @@ describe('Server', function () {
         });
     });
 
+    describe('authenticateBewit()', function () {
+
+        it('errors on uri too long', function (done) {
+
+            var long = '/';
+            for (var i = 0; i < 5000; ++i) {
+                long += 'x';
+            }
+
+            var req = {
+                method: 'GET',
+                url: long,
+                host: 'example.com',
+                port: 8080,
+                authorization: 'Hawk id="1", ts="1353788437", nonce="k3j4h2", mac="zy79QQ5/EYFmQqutVnYb73gAc/U=", ext="hello"'
+            };
+
+            Hawk.server.authenticateBewit(req, credentialsFunc, {}, function (err, credentials, bewit) {
+
+                expect(err).to.exist();
+                expect(err.output.statusCode).to.equal(400);
+                expect(err.message).to.equal('Resource path exceeds max length');
+                done();
+            });
+        });
+    });
+
     describe('authenticateMessage()', function () {
 
         it('errors on invalid authorization (ts)', function (done) {
index 1bfef65..a2f17e5 100755 (executable)
@@ -93,6 +93,34 @@ describe('Utils', function () {
             expect(host.name).to.equal('[123:123:123]');
             done();
         });
+
+        it('errors on header too long', function (done) {
+
+            var long = '';
+            for (var i = 0; i < 5000; ++i) {
+                long += 'x';
+            }
+
+            expect(Hawk.utils.parseHost({ headers: { host: long } })).to.be.null();
+            done();
+        });
+    });
+
+    describe('parseAuthorizationHeader()', function () {
+
+        it('errors on header too long', function (done) {
+
+            var long = 'Scheme a="';
+            for (var i = 0; i < 5000; ++i) {
+                long += 'x';
+            }
+            long += '"';
+
+            var err = Hawk.utils.parseAuthorizationHeader(long, ['a']);
+            expect(err).to.be.instanceof(Error);
+            expect(err.message).to.equal('Header length too long');
+            done();
+        });
     });
 
     describe('version()', function () {
index 66248e7..3e4b138 100644 (file)
@@ -1,5 +1,12 @@
 # node-http-signature changelog
 
+## 1.1.1
+
+- Version of dependency `assert-plus` updated: old version was missing
+  some license information
+- Corrected examples in `http_signing.md`, added auto-tests to
+  automatically validate these examples
+
 ## 1.1.0
 
 - Bump version of `sshpk` dependency, remove peerDependency on it since
index d08a525..4f24d28 100644 (file)
@@ -231,7 +231,7 @@ will want to enforce, but service providers SHOULD at minimum include the
 
 # Appendix A - Test Values
 
-The following test data uses the RSA (2048b) keys, which we will refer
+The following test data uses the RSA (1024b) keys, which we will refer
 to as `keyId=Test` in the following samples:
 
     -----BEGIN PUBLIC KEY-----
@@ -259,6 +259,8 @@ to as `keyId=Test` in the following samples:
 
 And all examples use this request:
 
+<!-- httpreq -->
+
     POST /foo?param=value&pet=dog HTTP/1.1
     Host: example.com
     Date: Thu, 05 Jan 2014 21:31:40 GMT
@@ -268,21 +270,35 @@ And all examples use this request:
 
     {"hello": "world"}
 
+<!-- /httpreq -->
+
 ### Default
 
 The string to sign would be:
 
+<!-- sign {"name": "Default", "options": {"keyId":"Test", "algorithm": "rsa-sha256"}} -->
+<!-- signstring -->
+
     date: Thu, 05 Jan 2014 21:31:40 GMT
 
+<!-- /signstring -->
+
 The Authorization header would be:
 
-    Authorization: Signature keyId="Test",algorithm="rsa-sha256",signature="ATp0r26dbMIxOopqw0OfABDT7CKMIoENumuruOtarj8n/97Q3htHFYpH8yOSQk3Z5zh8UxUym6FYTb5+A0Nz3NRsXJibnYi7brE/4tx5But9kkFGzG+xpUmimN4c3TMN7OFH//+r8hBf7BT9/GmHDUVZT2JzWGLZES2xDOUuMtA="
+<!-- authz -->
+
+    Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="date",signature="jKyvPcxB4JbmYY4mByyBY7cZfNl4OW9HpFQlG7N4YcJPteKTu4MWCLyk+gIr0wDgqtLWf9NLpMAMimdfsH7FSWGfbMFSrsVTHNTk0rK3usrfFnti1dxsM4jl0kYJCKTGI/UWkqiaxwNiKqGcdlEDrTcUhhsFsOIo8VhddmZTZ8w="
+
+<!-- /authz -->
 
 ### All Headers
 
 Parameterized to include all headers, the string to sign would be (`+ "\n"`
 inserted for readability):
 
+<!-- sign {"name": "All Headers", "options": {"keyId":"Test", "algorithm": "rsa-sha256", "headers": ["(request-target)", "host", "date", "content-type", "digest", "content-length"]}} -->
+<!-- signstring -->
+
     (request-target): post /foo?param=value&pet=dog
     host: example.com
     date: Thu, 05 Jan 2014 21:31:40 GMT
@@ -290,6 +306,58 @@ inserted for readability):
     digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
     content-length: 18
 
+<!-- /signstring -->
+
 The Authorization header would be:
 
-    Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="(request-target) host date content-type digest content-length",signature="jgSqYK0yKclIHfF9zdApVEbDp5eqj8C4i4X76pE+XHoxugXv7qnVrGR+30bmBgtpR39I4utq17s9ghz/2QFVxlnToYAvbSVZJ9ulLd1HQBugO0jOyn9sXOtcN7uNHBjqNCqUsnt0sw/cJA6B6nJZpyNqNyAXKdxZZItOuhIs78w="
+<!-- authz -->
+
+    Authorization: Signature keyId="Test",algorithm="rsa-sha256",headers="(request-target) host date content-type digest content-length",signature="Ef7MlxLXoBovhil3AlyjtBwAL9g4TN3tibLj7uuNB3CROat/9KaeQ4hW2NiJ+pZ6HQEOx9vYZAyi+7cmIkmJszJCut5kQLAwuX+Ms/mUFvpKlSo9StS2bMXDBNjOh4Auj774GFj4gwjS+3NhFeoqyr/MuN6HsEnkvn6zdgfE2i0="
+
+<!-- /authz -->
+
+## Generating and verifying signatures using `openssl`
+
+The `openssl` commandline tool can be used to generate or verify the signatures listed above.
+
+Compose the signing string as usual, and pipe it into the the `openssl dgst` command, then into `openssl enc -base64`, as follows:
+
+    $ printf 'date: Thu, 05 Jan 2014 21:31:40 GMT' | \
+      openssl dgst -binary -sign /path/to/private.pem -sha256 | \
+      openssl enc -base64
+    jKyvPcxB4JbmYY4mByyBY7cZfNl4OW9Hp...
+    $
+
+The `-sha256` option is necessary to produce an `rsa-sha256` signature. You can select other hash algorithms such as `sha1` by changing this argument.
+
+To verify a signature, first save the signature data, Base64-decoded, into a file, then use `openssl dgst` again with the `-verify` option:
+
+    $ echo 'jKyvPcxB4JbmYY4mByy...' | openssl enc -A -d -base64 > signature
+    $ printf 'date: Thu, 05 Jan 2014 21:31:40 GMT' | \
+      openssl dgst -sha256 -verify /path/to/public.pem -signature ./signature
+    Verified OK
+    $
+
+## Generating and verifying signatures using `sshpk-sign`
+
+You can also generate and check signatures using the `sshpk-sign` tool which is
+included with the `sshpk` package in `npm`.
+
+Compose the signing string as above, and pipe it into `sshpk-sign` as follows:
+
+    $ printf 'date: Thu, 05 Jan 2014 21:31:40 GMT' | \
+      sshpk-sign -i /path/to/private.pem
+    jKyvPcxB4JbmYY4mByyBY7cZfNl4OW9Hp...
+    $
+
+This will produce an `rsa-sha256` signature by default, as you can see using
+the `-v` option:
+
+    sshpk-sign: using rsa-sha256 with a 1024 bit key
+
+You can also use `sshpk-verify` in a similar manner:
+
+    $ printf 'date: Thu, 05 Jan 2014 21:31:40 GMT' | \
+      sshpk-verify -i ./public.pem -s 'jKyvPcxB4JbmYY...'
+    OK
+    $
index c8fd366..ef9946f 100644 (file)
@@ -342,6 +342,11 @@ module.exports = {
         stringToSign += '\n';
     }
 
+    /* This is just for unit tests. */
+    if (request.hasOwnProperty('_stringToSign')) {
+      request._stringToSign = stringToSign;
+    }
+
     var signature;
     if (alg[0] === 'hmac') {
       if (typeof (options.key) !== 'string' && !Buffer.isBuffer(options.key))
index c0c3a53..0b39593 100644 (file)
@@ -1,24 +1,26 @@
-# node-assert-plus
+# assert-plus
 
 This library is a super small wrapper over node's assert module that has two
 things: (1) the ability to disable assertions with the environment variable
-NODE_NDEBUG, and (2) some API wrappers for argument testing.  Like
+NODE\_NDEBUG, and (2) some API wrappers for argument testing.  Like
 `assert.string(myArg, 'myArg')`.  As a simple example, most of my code looks
 like this:
 
+```javascript
     var assert = require('assert-plus');
 
     function fooAccount(options, callback) {
-           assert.object(options, 'options');
-               assert.number(options.id, 'options.id);
-               assert.bool(options.isManager, 'options.isManager');
-               assert.string(options.name, 'options.name');
-               assert.arrayOfString(options.email, 'options.email');
-               assert.func(callback, 'callback');
+        assert.object(options, 'options');
+        assert.number(options.id, 'options.id');
+        assert.bool(options.isManager, 'options.isManager');
+        assert.string(options.name, 'options.name');
+        assert.arrayOfString(options.email, 'options.email');
+        assert.func(callback, 'callback');
 
         // Do stuff
-               callback(null, {});
+        callback(null, {});
     }
+```
 
 # API
 
@@ -27,60 +29,87 @@ take an argument, and then a string 'name' that's not a message; `AssertionError
 will be thrown if the assertion fails with a message like:
 
     AssertionError: foo (string) is required
-       at test (/home/mark/work/foo/foo.js:3:9)
-       at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
-       at Module._compile (module.js:446:26)
-       at Object..js (module.js:464:10)
-       at Module.load (module.js:353:31)
-       at Function._load (module.js:311:12)
-       at Array.0 (module.js:484:10)
-       at EventEmitter._tickCallback (node.js:190:38)
+    at test (/home/mark/work/foo/foo.js:3:9)
+    at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
+    at Module._compile (module.js:446:26)
+    at Object..js (module.js:464:10)
+    at Module.load (module.js:353:31)
+    at Function._load (module.js:311:12)
+    at Array.0 (module.js:484:10)
+    at EventEmitter._tickCallback (node.js:190:38)
 
 from:
 
+```javascript
     function test(foo) {
-           assert.string(foo, 'foo');
+        assert.string(foo, 'foo');
     }
+```
 
-There you go.  You can check that arrays are of a homogenous type with `Arrayof$Type`:
+There you go.  You can check that arrays are of a homogeneous type with `Arrayof$Type`:
 
+```javascript
     function test(foo) {
-           assert.arrayOfString(foo, 'foo');
+        assert.arrayOfString(foo, 'foo');
     }
+```
 
 You can assert IFF an argument is not `undefined` (i.e., an optional arg):
 
+```javascript
     assert.optionalString(foo, 'foo');
+```
 
 Lastly, you can opt-out of assertion checking altogether by setting the
 environment variable `NODE_NDEBUG=1`.  This is pseudo-useful if you have
 lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
-production.
+production.  Be advised:  The standard functions re-exported from `assert` are
+also disabled in assert-plus if NDEBUG is specified.  Using them directly from
+the `assert` module avoids this behavior.
 
 The complete list of APIs is:
 
+* assert.array
 * assert.bool
 * assert.buffer
 * assert.func
 * assert.number
 * assert.object
 * assert.string
+* assert.stream
+* assert.date
+* assert.regex
+* assert.uuid
+* assert.arrayOfArray
 * assert.arrayOfBool
+* assert.arrayOfBuffer
 * assert.arrayOfFunc
 * assert.arrayOfNumber
 * assert.arrayOfObject
 * assert.arrayOfString
+* assert.arrayOfStream
+* assert.arrayOfDate
+* assert.arrayOfUuid
+* assert.optionalArray
 * assert.optionalBool
 * assert.optionalBuffer
 * assert.optionalFunc
 * assert.optionalNumber
 * assert.optionalObject
 * assert.optionalString
+* assert.optionalStream
+* assert.optionalDate
+* assert.optionalUuid
+* assert.optionalArrayOfArray
 * assert.optionalArrayOfBool
+* assert.optionalArrayOfBuffer
 * assert.optionalArrayOfFunc
 * assert.optionalArrayOfNumber
 * assert.optionalArrayOfObject
 * assert.optionalArrayOfString
+* assert.optionalArrayOfStream
+* assert.optionalArrayOfDate
+* assert.optionalArrayOfUuid
 * assert.AssertionError
 * assert.fail
 * assert.ok
index ff2ba02..6bce4d8 100644 (file)
 // Copyright (c) 2012, Mark Cavage. All rights reserved.
+// Copyright 2015 Joyent, Inc.
 
 var assert = require('assert');
 var Stream = require('stream').Stream;
 var util = require('util');
 
 
-
 ///--- Globals
 
-var NDEBUG = process.env.NODE_NDEBUG || false;
+/* JSSTYLED */
 var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
 
 
-
-///--- Messages
-
-var ARRAY_TYPE_REQUIRED = '%s ([%s]) required';
-var TYPE_REQUIRED = '%s (%s) is required';
-
-
-
 ///--- Internal
 
-function capitalize(str) {
-        return (str.charAt(0).toUpperCase() + str.slice(1));
+function _capitalize(str) {
+    return (str.charAt(0).toUpperCase() + str.slice(1));
 }
 
-function uncapitalize(str) {
-        return (str.charAt(0).toLowerCase() + str.slice(1));
+function _toss(name, expected, oper, arg, actual) {
+    throw new assert.AssertionError({
+        message: util.format('%s (%s) is required', name, expected),
+        actual: (actual === undefined) ? typeof (arg) : actual(arg),
+        expected: expected,
+        operator: oper || '===',
+        stackStartFunction: _toss.caller
+    });
 }
 
-function _() {
-        return (util.format.apply(util, arguments));
+function _getClass(arg) {
+    return (Object.prototype.toString.call(arg).slice(8, -1));
 }
 
-
-function _assert(arg, type, name, stackFunc) {
-        if (!NDEBUG) {
-                name = name || type;
-                stackFunc = stackFunc || _assert.caller;
-                var t = typeof (arg);
-
-                if (t !== type) {
-                        throw new assert.AssertionError({
-                                message: _(TYPE_REQUIRED, name, type),
-                                actual: t,
-                                expected: type,
-                                operator: '===',
-                                stackStartFunction: stackFunc
-                        });
-                }
-        }
+function noop() {
+    // Why even bother with asserts?
 }
 
 
-function _instanceof(arg, type, name, stackFunc) {
-        if (!NDEBUG) {
-                name = name || type;
-                stackFunc = stackFunc || _instanceof.caller;
+///--- Exports
 
-                if (!(arg instanceof type)) {
-                        throw new assert.AssertionError({
-                                message: _(TYPE_REQUIRED, name, type.name),
-                                actual: _getClass(arg),
-                                expected: type.name,
-                                operator: 'instanceof',
-                                stackStartFunction: stackFunc
-                        });
-                }
+var types = {
+    bool: {
+        check: function (arg) { return typeof (arg) === 'boolean'; }
+    },
+    func: {
+        check: function (arg) { return typeof (arg) === 'function'; }
+    },
+    string: {
+        check: function (arg) { return typeof (arg) === 'string'; }
+    },
+    object: {
+        check: function (arg) {
+            return typeof (arg) === 'object' && arg !== null;
         }
-}
-
-function _getClass(object) {
-        return (Object.prototype.toString.call(object).slice(8, -1));
+    },
+    number: {
+        check: function (arg) {
+            return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);
+        }
+    },
+    buffer: {
+        check: function (arg) { return Buffer.isBuffer(arg); },
+        operator: 'Buffer.isBuffer'
+    },
+    array: {
+        check: function (arg) { return Array.isArray(arg); },
+        operator: 'Array.isArray'
+    },
+    stream: {
+        check: function (arg) { return arg instanceof Stream; },
+        operator: 'instanceof',
+        actual: _getClass
+    },
+    date: {
+        check: function (arg) { return arg instanceof Date; },
+        operator: 'instanceof',
+        actual: _getClass
+    },
+    regexp: {
+        check: function (arg) { return arg instanceof RegExp; },
+        operator: 'instanceof',
+        actual: _getClass
+    },
+    uuid: {
+        check: function (arg) {
+            return typeof (arg) === 'string' && UUID_REGEXP.test(arg);
+        },
+        operator: 'isUUID'
+    }
 };
 
+function _setExports(ndebug) {
+    var keys = Object.keys(types);
+    var out;
+
+    /* re-export standard assert */
+    if (process.env.NODE_NDEBUG) {
+        out = noop;
+    } else {
+        out = function (arg, msg) {
+            if (!arg) {
+                _toss(msg, 'true', arg);
+            }
+        };
+    }
 
-
-///--- API
-
-function array(arr, type, name) {
-        if (!NDEBUG) {
-                name = name || type;
-
-                if (!Array.isArray(arr)) {
-                        throw new assert.AssertionError({
-                                message: _(ARRAY_TYPE_REQUIRED, name, type),
-                                actual: typeof (arr),
-                                expected: 'array',
-                                operator: 'Array.isArray',
-                                stackStartFunction: array.caller
-                        });
-                }
-
-                for (var i = 0; i < arr.length; i++) {
-                        _assert(arr[i], type, name, array);
-                }
+    /* standard checks */
+    keys.forEach(function (k) {
+        if (ndebug) {
+            out[k] = noop;
+            return;
         }
-}
-
-
-function bool(arg, name) {
-        _assert(arg, 'boolean', name, bool);
-}
-
-
-function buffer(arg, name) {
-        if (!Buffer.isBuffer(arg)) {
-                throw new assert.AssertionError({
-                        message: _(TYPE_REQUIRED, name || '', 'Buffer'),
-                        actual: typeof (arg),
-                        expected: 'buffer',
-                        operator: 'Buffer.isBuffer',
-                        stackStartFunction: buffer
-                });
+        var type = types[k];
+        out[k] = function (arg, msg) {
+            if (!type.check(arg)) {
+                _toss(msg, k, type.operator, arg, type.actual);
+            }
+        };
+    });
+
+    /* optional checks */
+    keys.forEach(function (k) {
+        var name = 'optional' + _capitalize(k);
+        if (ndebug) {
+            out[name] = noop;
+            return;
         }
-}
-
-
-function func(arg, name) {
-        _assert(arg, 'function', name);
-}
-
-
-function number(arg, name) {
-        _assert(arg, 'number', name);
-        if (!NDEBUG && (isNaN(arg) || !isFinite(arg))) {
-                throw new assert.AssertionError({
-                        message: _(TYPE_REQUIRED, name, 'number'),
-                        actual: arg,
-                        expected: 'number',
-                        operator: 'isNaN',
-                        stackStartFunction: number
-                });
+        var type = types[k];
+        out[name] = function (arg, msg) {
+            if (arg === undefined || arg === null) {
+                return;
+            }
+            if (!type.check(arg)) {
+                _toss(msg, k, type.operator, arg, type.actual);
+            }
+        };
+    });
+
+    /* arrayOf checks */
+    keys.forEach(function (k) {
+        var name = 'arrayOf' + _capitalize(k);
+        if (ndebug) {
+            out[name] = noop;
+            return;
         }
-}
-
-
-function object(arg, name) {
-        _assert(arg, 'object', name);
-}
-
-
-function stream(arg, name) {
-        _instanceof(arg, Stream, name);
-}
-
-
-function date(arg, name) {
-        _instanceof(arg, Date, name);
-}
-
-function regexp(arg, name) {
-        _instanceof(arg, RegExp, name);
-}
-
-
-function string(arg, name) {
-        _assert(arg, 'string', name);
-}
-
-
-function uuid(arg, name) {
-        string(arg, name);
-        if (!NDEBUG && !UUID_REGEXP.test(arg)) {
-                throw new assert.AssertionError({
-                        message: _(TYPE_REQUIRED, name, 'uuid'),
-                        actual: 'string',
-                        expected: 'uuid',
-                        operator: 'test',
-                        stackStartFunction: uuid
-                });
+        var type = types[k];
+        var expected = '[' + k + ']';
+        out[name] = function (arg, msg) {
+            if (!Array.isArray(arg)) {
+                _toss(msg, expected, type.operator, arg, type.actual);
+            }
+            var i;
+            for (i = 0; i < arg.length; i++) {
+                if (!type.check(arg[i])) {
+                    _toss(msg, expected, type.operator, arg, type.actual);
+                }
+            }
+        };
+    });
+
+    /* optionalArrayOf checks */
+    keys.forEach(function (k) {
+        var name = 'optionalArrayOf' + _capitalize(k);
+        if (ndebug) {
+            out[name] = noop;
+            return;
         }
-}
-
-
-///--- Exports
-
-module.exports = {
-        bool: bool,
-        buffer: buffer,
-        date: date,
-        func: func,
-        number: number,
-        object: object,
-        regexp: regexp,
-        stream: stream,
-        string: string,
-        uuid: uuid
-};
-
-
-Object.keys(module.exports).forEach(function (k) {
-        if (k === 'buffer')
+        var type = types[k];
+        var expected = '[' + k + ']';
+        out[name] = function (arg, msg) {
+            if (arg === undefined || arg === null) {
                 return;
-
-        var name = 'arrayOf' + capitalize(k);
-
-        if (k === 'bool')
-                k = 'boolean';
-        if (k === 'func')
-                k = 'function';
-        module.exports[name] = function (arg, name) {
-                array(arg, k, name);
+            }
+            if (!Array.isArray(arg)) {
+                _toss(msg, expected, type.operator, arg, type.actual);
+            }
+            var i;
+            for (i = 0; i < arg.length; i++) {
+                if (!type.check(arg[i])) {
+                    _toss(msg, expected, type.operator, arg, type.actual);
+                }
+            }
         };
-});
-
-Object.keys(module.exports).forEach(function (k) {
-        var _name = 'optional' + capitalize(k);
-        var s = uncapitalize(k.replace('arrayOf', ''));
-        if (s === 'bool')
-                s = 'boolean';
-        if (s === 'func')
-                s = 'function';
-
-        if (k.indexOf('arrayOf') !== -1) {
-          module.exports[_name] = function (arg, name) {
-                  if (!NDEBUG && arg !== undefined) {
-                          array(arg, s, name);
-                  }
-          };
-        } else {
-          module.exports[_name] = function (arg, name) {
-                  if (!NDEBUG && arg !== undefined) {
-                          _assert(arg, s, name);
-                  }
-          };
-        }
-});
-
+    });
 
-// Reexport built-in assertions
-Object.keys(assert).forEach(function (k) {
+    /* re-export built-in assertions */
+    Object.keys(assert).forEach(function (k) {
         if (k === 'AssertionError') {
-                module.exports[k] = assert[k];
-                return;
+            out[k] = assert[k];
+            return;
         }
+        if (ndebug) {
+            out[k] = noop;
+            return;
+        }
+        out[k] = assert[k];
+    });
 
-        module.exports[k] = function () {
-                if (!NDEBUG) {
-                        assert[k].apply(assert[k], arguments);
-                }
-        };
-});
+    /* export ourselves (for unit tests _only_) */
+    out._setExports = _setExports;
+
+    return out;
+}
+
+module.exports = _setExports(process.env.NODE_NDEBUG);
index b331767..0be073f 100644 (file)
@@ -5,10 +5,17 @@
   },
   "name": "assert-plus",
   "description": "Extra assertions on top of node's assert module",
-  "version": "0.1.5",
+  "version": "0.2.0",
+  "license": "MIT",
   "main": "./assert.js",
-  "devDependencies": {},
+  "devDependencies": {
+    "tape": "4.2.2",
+    "faucet": "0.0.1"
+  },
   "optionalDependencies": {},
+  "scripts": {
+    "test": "tape tests/*.js | ./node_modules/.bin/faucet"
+  },
   "repository": {
     "type": "git",
     "url": "git+https://github.com/mcavage/node-assert-plus.git"
   "engines": {
     "node": ">=0.8"
   },
-  "readme": "# node-assert-plus\n\nThis library is a super small wrapper over node's assert module that has two\nthings: (1) the ability to disable assertions with the environment variable\nNODE_NDEBUG, and (2) some API wrappers for argument testing.  Like\n`assert.string(myArg, 'myArg')`.  As a simple example, most of my code looks\nlike this:\n\n    var assert = require('assert-plus');\n\n    function fooAccount(options, callback) {\n\t    assert.object(options, 'options');\n\t\tassert.number(options.id, 'options.id);\n\t\tassert.bool(options.isManager, 'options.isManager');\n\t\tassert.string(options.name, 'options.name');\n\t\tassert.arrayOfString(options.email, 'options.email');\n\t\tassert.func(callback, 'callback');\n\n        // Do stuff\n\t\tcallback(null, {});\n    }\n\n# API\n\nAll methods that *aren't* part of node's core assert API are simply assumed to\ntake an argument, and then a string 'name' that's not a message; `AssertionError`\nwill be thrown if the assertion fails with a message like:\n\n    AssertionError: foo (string) is required\n\tat test (/home/mark/work/foo/foo.js:3:9)\n\tat Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)\n\tat Module._compile (module.js:446:26)\n\tat Object..js (module.js:464:10)\n\tat Module.load (module.js:353:31)\n\tat Function._load (module.js:311:12)\n\tat Array.0 (module.js:484:10)\n\tat EventEmitter._tickCallback (node.js:190:38)\n\nfrom:\n\n    function test(foo) {\n\t    assert.string(foo, 'foo');\n    }\n\nThere you go.  You can check that arrays are of a homogenous type with `Arrayof$Type`:\n\n    function test(foo) {\n\t    assert.arrayOfString(foo, 'foo');\n    }\n\nYou can assert IFF an argument is not `undefined` (i.e., an optional arg):\n\n    assert.optionalString(foo, 'foo');\n\nLastly, you can opt-out of assertion checking altogether by setting the\nenvironment variable `NODE_NDEBUG=1`.  This is pseudo-useful if you have\nlots of assertions, and don't want to pay `typeof ()` taxes to v8 in\nproduction.\n\nThe complete list of APIs is:\n\n* assert.bool\n* assert.buffer\n* assert.func\n* assert.number\n* assert.object\n* assert.string\n* assert.arrayOfBool\n* assert.arrayOfFunc\n* assert.arrayOfNumber\n* assert.arrayOfObject\n* assert.arrayOfString\n* assert.optionalBool\n* assert.optionalBuffer\n* assert.optionalFunc\n* assert.optionalNumber\n* assert.optionalObject\n* assert.optionalString\n* assert.optionalArrayOfBool\n* assert.optionalArrayOfFunc\n* assert.optionalArrayOfNumber\n* assert.optionalArrayOfObject\n* assert.optionalArrayOfString\n* assert.AssertionError\n* assert.fail\n* assert.ok\n* assert.equal\n* assert.notEqual\n* assert.deepEqual\n* assert.notDeepEqual\n* assert.strictEqual\n* assert.notStrictEqual\n* assert.throws\n* assert.doesNotThrow\n* assert.ifError\n\n# Installation\n\n    npm install assert-plus\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-assert-plus/issues>.\n",
-  "readmeFilename": "README.md",
+  "contributors": [
+    {
+      "name": "Dave Eddy",
+      "email": "dave@daveeddy.com"
+    },
+    {
+      "name": "Fred Kuo",
+      "email": "fred.kuo@joyent.com"
+    },
+    {
+      "name": "Lars-Magnus Skog",
+      "email": "ralphtheninja@riseup.net"
+    },
+    {
+      "name": "Mark Cavage",
+      "email": "mcavage@gmail.com"
+    },
+    {
+      "name": "Patrick Mooney",
+      "email": "pmooney@pfmooney.com"
+    },
+    {
+      "name": "Rob Gulewich",
+      "email": "robert.gulewich@joyent.com"
+    }
+  ],
   "bugs": {
     "url": "https://github.com/mcavage/node-assert-plus/issues"
   },
   "homepage": "https://github.com/mcavage/node-assert-plus#readme",
   "dependencies": {},
-  "_id": "assert-plus@0.1.5",
-  "_shasum": "ee74009413002d84cec7219c6ac811812e723160",
-  "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz",
-  "_from": "assert-plus@>=0.1.5 <0.2.0"
+  "_id": "assert-plus@0.2.0",
+  "_shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234",
+  "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz",
+  "_from": "assert-plus@>=0.2.0 <0.3.0",
+  "_npmVersion": "3.3.8",
+  "_nodeVersion": "0.10.36",
+  "_npmUser": {
+    "name": "pfmooney",
+    "email": "patrick.f.mooney@gmail.com"
+  },
+  "dist": {
+    "shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234",
+    "tarball": "http://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "mcavage",
+      "email": "mcavage@gmail.com"
+    },
+    {
+      "name": "pfmooney",
+      "email": "patrick.f.mooney@gmail.com"
+    }
+  ],
+  "directories": {},
+  "readme": "ERROR: No README data found!"
 }
index 526727f..8be381a 100644 (file)
   "engines": [
     "node >=0.6.0"
   ],
-  "readme": "# extsprintf: extended POSIX-style sprintf\n\nStripped down version of s[n]printf(3c).  We make a best effort to throw an\nexception when given a format string we don't understand, rather than ignoring\nit, so that we won't break existing programs if/when we go implement the rest\nof this.\n\nThis implementation currently supports specifying\n\n* field alignment ('-' flag),\n* zero-pad ('0' flag)\n* always show numeric sign ('+' flag),\n* field width\n* conversions for strings, decimal integers, and floats (numbers).\n* argument size specifiers.  These are all accepted but ignored, since\n  Javascript has no notion of the physical size of an argument.\n\nEverything else is currently unsupported, most notably: precision, unsigned\nnumbers, non-decimal numbers, and characters.\n\nBesides the usual POSIX conversions, this implementation supports:\n\n* `%j`: pretty-print a JSON object (using node's \"inspect\")\n* `%r`: pretty-print an Error object\n\n# Example\n\nFirst, install it:\n\n    # npm install extsprintf\n\nNow, use it:\n\n    var mod_extsprintf = require('extsprintf');\n    console.log(mod_extsprintf.sprintf('hello %25s', 'world'));\n\noutputs:\n\n    hello                     world\n",
-  "readmeFilename": "README.md",
-  "bugs": {
-    "url": "https://github.com/davepacheco/node-extsprintf/issues"
-  },
-  "homepage": "https://github.com/davepacheco/node-extsprintf#readme",
   "_id": "extsprintf@1.0.2",
+  "dist": {
+    "shasum": "e1080e0658e300b06294990cc70e1502235fd550",
+    "tarball": "http://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz"
+  },
+  "_npmVersion": "1.1.65",
+  "_npmUser": {
+    "name": "dap",
+    "email": "dap@cs.brown.edu"
+  },
+  "maintainers": [
+    {
+      "name": "dap",
+      "email": "dap@cs.brown.edu"
+    }
+  ],
+  "directories": {},
   "_shasum": "e1080e0658e300b06294990cc70e1502235fd550",
   "_resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.0.2.tgz",
-  "_from": "extsprintf@1.0.2"
+  "_from": "extsprintf@1.0.2",
+  "bugs": {
+    "url": "https://github.com/davepacheco/node-extsprintf/issues"
+  },
+  "readme": "ERROR: No README data found!",
+  "homepage": "https://github.com/davepacheco/node-extsprintf#readme"
 }
index 28114a4..99d230d 100644 (file)
@@ -7,7 +7,7 @@
   "description": "JSON Schema validation and specifications",
   "maintainers": [
     {
-      "name": "Kris Zyp",
+      "name": "kriszyp",
       "email": "kriszyp@gmail.com"
     }
   ],
     "test": "echo TESTS DISABLED vows --spec test/*.js"
   },
   "readme": "JSON Schema is a repository for the JSON Schema specification, reference schemas and a CommonJS implementation of JSON Schema (not the only JavaScript implementation of JSON Schema, JSV is another excellent JavaScript validator).\r\n\r\nCode is licensed under the AFL or BSD license as part of the Persevere \r\nproject which is administered under the Dojo foundation,\r\nand all contributions require a Dojo CLA.",
-  "readmeFilename": "README.md",
-  "bugs": {
-    "url": "https://github.com/kriszyp/json-schema/issues"
-  },
-  "homepage": "https://github.com/kriszyp/json-schema#readme",
   "_id": "json-schema@0.2.2",
+  "dist": {
+    "shasum": "50354f19f603917c695f70b85afa77c3b0f23506",
+    "tarball": "http://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz"
+  },
+  "_npmVersion": "1.1.59",
+  "_npmUser": {
+    "name": "kriszyp",
+    "email": "kriszyp@gmail.com"
+  },
   "_shasum": "50354f19f603917c695f70b85afa77c3b0f23506",
   "_resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.2.tgz",
-  "_from": "json-schema@0.2.2"
+  "_from": "json-schema@0.2.2",
+  "bugs": {
+    "url": "https://github.com/kriszyp/json-schema/issues"
+  },
+  "homepage": "https://github.com/kriszyp/json-schema#readme"
 }
index ad53117..569d999 100644 (file)
   "scripts": {
     "test": "make test"
   },
-  "readme": "# verror: richer JavaScript errors\n\nThis module provides two classes: VError, for accretive errors, and WError, for\nwrapping errors.  Both support printf-style error messages using extsprintf.\n\n## Printf-style errors\n\nAt the most basic level, VError is just like JavaScript's Error class, but with\nprintf-style arguments:\n\n    var verror = require('verror');\n\n    var opname = 'read';\n    var err = new verror.VError('\"%s\" operation failed', opname);\n    console.log(err.message);\n    console.log(err.stack);\n\nThis prints:\n\n    \"read\" operation failed\n    \"read\" operation failed\n        at Object.<anonymous> (/Users/dap/node-verror/examples/varargs.js:4:11)\n        at Module._compile (module.js:449:26)\n        at Object.Module._extensions..js (module.js:467:10)\n        at Module.load (module.js:356:32)\n        at Function.Module._load (module.js:312:12)\n        at Module.runMain (module.js:492:10)\n        at process.startup.processNextTick.process._tickCallback (node.js:244:9)\n\n\n## VError for accretive error messages\n\nMore interestingly, you can use VError to build up an error describing what\nhappened at various levels in the stack.  For example, suppose you have a\nrequest handler that stats a file and fails if it doesn't exist:\n\n    var fs = require('fs');\n    var verror = require('verror');\n\n    function checkFile(filename, callback) {\n        fs.stat(filename, function (err) {\n            if (err)\n\t\t/* Annotate the \"stat\" error with what we were doing. */\n\t    \treturn (callback(new verror.VError(err,\n\t\t    'failed to check \"%s\"', filename)));\n\n\t    /* ... */\n        });\n    }\n\n    function handleRequest(filename, callback) {\n    \tcheckFile('/nonexistent', function (err) {\n    \t    if (err) {\n    \t    \t/* Annotate the \"checkFile\" error with what we were doing. */\n    \t    \treturn (callback(new verror.VError(err, 'request failed')));\n    \t    }\n\n    \t    /* ... */\n    \t});\n    }\n\n    handleRequest('/nonexistent', function (err) {\n\tif (err)\n\t\tconsole.log(err.message);\n\t/* ... */\n    });\n\nSince the file \"/nonexistent\" doesn't exist, this prints out:\n\n    request failed: failed to check \"/nonexistent\": ENOENT, stat '/nonexistent'\n\nThe idea here is that the lowest level (Node's \"fs.stat\" function) generates an\narbitrary error, and each higher level (request handler and stat callback)\ncreates a new VError that annotates the previous error with what it was doing,\nso that the result is a clear message explaining what failed at each level.\n\nThis plays nicely with extsprintf's \"%r\" specifier, which prints out a\nJava-style stacktrace with the whole chain of exceptions:\n\n    EXCEPTION: VError: request failed: failed to check \"/nonexistent\": ENOENT, stat '/nonexistent'\n        at /Users/dap/work/node-verror/examples/levels.js:21:21\n        at /Users/dap/work/node-verror/examples/levels.js:9:12\n        at Object.oncomplete (fs.js:297:15)\n    Caused by: EXCEPTION: VError: failed to check \"/nonexistent\": ENOENT, stat '/nonexistent'\n        at /Users/dap/work/node-verror/examples/levels.js:9:21\n        at Object.oncomplete (fs.js:297:15)\n    Caused by: EXCEPTION: Error: Error: ENOENT, stat '/nonexistent'\n\n\n## WError for wrapped errors\n\nSometimes you don't want an Error's \"message\" field to include the details of\nall of the low-level errors, but you still want to be able to get at them\nprogrammatically.  For example, in an HTTP server, you probably don't want to\nspew all of the low-level errors back to the client, but you do want to include\nthem in the audit log entry for the request.  In that case, you can use a\nWError, which is created exactly like VError (and also supports both\nprintf-style arguments and an optional cause), but the resulting \"message\" only\ncontains the top-level error.  It's also more verbose, including the class\nassociated with each error in the cause chain.  Using the same example above,\nbut replacing the VError in handleRequest with WError, we get this output:\n\n    request failed\n\nThat's what we wanted -- just a high-level summary for the client.  But we can\nget the object's toString() for the full details:\n\n    WError: request failed; caused by WError: failed to check \"/nonexistent\";\n    caused by Error: ENOENT, stat '/nonexistent'\n\n# Contributing\n\nContributions welcome.  Code should be \"make check\" clean.  To run \"make check\",\nyou'll need these tools:\n\n* https://github.com/davepacheco/jsstyle\n* https://github.com/davepacheco/javascriptlint\n\nIf you're changing something non-trivial or user-facing, you may want to submit\nan issue first.\n",
-  "readmeFilename": "README.md",
-  "bugs": {
-    "url": "https://github.com/davepacheco/node-verror/issues"
-  },
-  "homepage": "https://github.com/davepacheco/node-verror#readme",
   "_id": "verror@1.3.6",
+  "dist": {
+    "shasum": "cff5df12946d297d2baaefaa2689e25be01c005c",
+    "tarball": "http://registry.npmjs.org/verror/-/verror-1.3.6.tgz"
+  },
+  "_npmVersion": "1.1.65",
+  "_npmUser": {
+    "name": "dap",
+    "email": "dap@cs.brown.edu"
+  },
+  "maintainers": [
+    {
+      "name": "dap",
+      "email": "dap@cs.brown.edu"
+    }
+  ],
+  "directories": {},
   "_shasum": "cff5df12946d297d2baaefaa2689e25be01c005c",
   "_resolved": "https://registry.npmjs.org/verror/-/verror-1.3.6.tgz",
-  "_from": "verror@1.3.6"
+  "_from": "verror@1.3.6",
+  "bugs": {
+    "url": "https://github.com/davepacheco/node-verror/issues"
+  },
+  "readme": "ERROR: No README data found!",
+  "homepage": "https://github.com/davepacheco/node-verror#readme"
 }
index 97cd15a..e77992e 100644 (file)
     "node >=0.6.0"
   ],
   "license": "MIT",
-  "readme": "# jsprim: utilities for primitive JavaScript types\n\nThis module provides miscellaneous facilities for working with strings,\nnumbers, dates, and objects and arrays of these basic types.\n\n\n### deepCopy(obj)\n\nCreates a deep copy of a primitive type, object, or array of primitive types.\n\n\n### deepEqual(obj1, obj2)\n\nReturns whether two objects are equal.\n\n\n### isEmpty(obj)\n\nReturns true if the given object has no properties and false otherwise.  This\nis O(1) (unlike `Object.keys(obj).length === 0`, which is O(N)).\n\n\n### forEachKey(obj, callback)\n\nLike Array.forEach, but iterates properties of an object rather than elements\nof an array.  Equivalent to:\n\n    for (var key in obj)\n            callback(key, obj[key]);\n\n\n### flattenObject(obj, depth)\n\nFlattens an object up to a given level of nesting, returning an array of arrays\nof length \"depth + 1\", where the first \"depth\" elements correspond to flattened\ncolumns and the last element contains the remaining object .  For example:\n\n    flattenObject({\n        'I': {\n            'A': {\n                'i': {\n                    'datum1': [ 1, 2 ],\n                    'datum2': [ 3, 4 ]\n                },\n                'ii': {\n                    'datum1': [ 3, 4 ]\n                }\n            },\n            'B': {\n                'i': {\n                    'datum1': [ 5, 6 ]\n                },\n                'ii': {\n                    'datum1': [ 7, 8 ],\n                    'datum2': [ 3, 4 ],\n                },\n                'iii': {\n                }\n            }\n        },\n        'II': {\n            'A': {\n                'i': {\n                    'datum1': [ 1, 2 ],\n                    'datum2': [ 3, 4 ]\n                }\n            }\n        }\n    }, 3)\n\nbecomes:\n\n    [\n        [ 'I',  'A', 'i',   { 'datum1': [ 1, 2 ], 'datum2': [ 3, 4 ] } ],\n        [ 'I',  'A', 'ii',  { 'datum1': [ 3, 4 ] } ],\n        [ 'I',  'B', 'i',   { 'datum1': [ 5, 6 ] } ],\n        [ 'I',  'B', 'ii',  { 'datum1': [ 7, 8 ], 'datum2': [ 3, 4 ] } ],\n        [ 'I',  'B', 'iii', {} ],\n        [ 'II', 'A', 'i',   { 'datum1': [ 1, 2 ], 'datum2': [ 3, 4 ] } ]\n    ]\n\nThis function is strict: \"depth\" must be a non-negative integer and \"obj\" must\nbe a non-null object with at least \"depth\" levels of nesting under all keys.\n\n\n### flattenIter(obj, depth, func)\n\nThis is similar to `flattenObject` except that instead of returning an array,\nthis function invokes `func(entry)` for each `entry` in the array that\n`flattenObject` would return.  `flattenIter(obj, depth, func)` is logically\nequivalent to `flattenObject(obj, depth).forEach(func)`.  Importantly, this\nversion never constructs the full array.  Its memory usage is O(depth) rather\nthan O(n) (where `n` is the number of flattened elements).\n\nThere's another difference between `flattenObject` and `flattenIter` that's\nrelated to the special case where `depth === 0`.  In this case, `flattenObject`\nomits the array wrapping `obj` (which is regrettable).\n\n\n### pluck(obj, key)\n\nFetch nested property \"key\" from object \"obj\", traversing objects as needed.\nFor example, `pluck(obj, \"foo.bar.baz\")` is roughly equivalent to\n`obj.foo.bar.baz`, except that:\n\n1. If traversal fails, the resulting value is undefined, and no error is\n   thrown.  For example, `pluck({}, \"foo.bar\")` is just undefined.\n2. If \"obj\" has property \"key\" directly (without traversing), the\n   corresponding property is returned.  For example,\n   `pluck({ 'foo.bar': 1 }, 'foo.bar')` is 1, not undefined.  This is also\n   true recursively, so `pluck({ 'a': { 'foo.bar': 1 } }, 'a.foo.bar')` is\n   also 1, not undefined.\n\n\n### randElt(array)\n\nReturns an element from \"array\" selected uniformly at random.  If \"array\" is\nempty, throws an Error.\n\n\n### startsWith(str, prefix)\n\nReturns true if the given string starts with the given prefix and false\notherwise.\n\n\n### endsWith(str, suffix)\n\nReturns true if the given string ends with the given suffix and false\notherwise.\n\n\n### iso8601(date)\n\nConverts a Date object to an ISO8601 date string of the form\n\"YYYY-MM-DDTHH:MM:SS.sssZ\".  This format is not customizable.\n\n\n### parseDateTime(str)\n\nParses a date expressed as a string, as either a number of milliseconds since\nthe epoch or any string format that Date accepts, giving preference to the\nformer where these two sets overlap (e.g., strings containing small numbers).\n\n\n### hrtimeDiff(timeA, timeB)\n\nGiven two hrtime readings (as from Node's `process.hrtime()`), where timeA is\nlater than timeB, compute the difference and return that as an hrtime.  It is\nillegal to invoke this for a pair of times where timeB is newer than timeA.\n\n### hrtimeAdd(timeA, timeB)\n\nAdd two hrtime intervals (as from Node's `process.hrtime()`), returning a new\nhrtime interval array.  This function does not modify either input argument.\n\n\n### hrtimeAccum(timeA, timeB)\n\nAdd two hrtime intervals (as from Node's `process.hrtime()`), storing the\nresult in `timeA`.  This function overwrites (and returns) the first argument\npassed in.\n\n\n### hrtimeNanosec(timeA), hrtimeMicrosec(timeA), hrtimeMillisec(timeA)\n\nThis suite of functions converts a hrtime interval (as from Node's\n`process.hrtime()`) into a scalar number of nanoseconds, microseconds or\nmilliseconds.  Results are truncated, as with `Math.floor()`.\n\n\n### validateJsonObject(schema, object)\n\nUses JSON validation (via JSV) to validate the given object against the given\nschema.  On success, returns null.  On failure, *returns* (does not throw) a\nuseful Error object.\n\n\n### extraProperties(object, allowed)\n\nCheck an object for unexpected properties.  Accepts the object to check, and an\narray of allowed property name strings.  If extra properties are detected, an\narray of extra property names is returned.  If no properties other than those\nin the allowed list are present on the object, the returned array will be of\nzero length.\n\n### mergeObjects(provided, overrides, defaults)\n\nMerge properties from objects \"provided\", \"overrides\", and \"defaults\".  The\nintended use case is for functions that accept named arguments in an \"args\"\nobject, but want to provide some default values and override other values.  In\nthat case, \"provided\" is what the caller specified, \"overrides\" are what the\nfunction wants to override, and \"defaults\" contains default values.\n\nThe function starts with the values in \"defaults\", overrides them with the\nvalues in \"provided\", and then overrides those with the values in \"overrides\".\nFor convenience, any of these objects may be falsey, in which case they will be\nignored.  The input objects are never modified, but properties in the returned\nobject are not deep-copied.\n\nFor example:\n\n    mergeObjects(undefined, { 'objectMode': true }, { 'highWaterMark': 0 })\n\nreturns:\n\n    { 'objectMode': true, 'highWaterMark': 0 }\n\nFor another example:\n\n    mergeObjects(\n        { 'highWaterMark': 16, 'objectMode': 7 }, /* from caller */\n        { 'objectMode': true },                   /* overrides */\n        { 'highWaterMark': 0 });                  /* default */\n\nreturns:\n\n    { 'objectMode': true, 'highWaterMark': 16 }\n\n\n# Contributing\n\nCode should be \"make check\" clean.  This target assumes that\n[jsl](http://github.com/davepacheco/javascriptlint) and\n[jsstyle](http://github.com/davepacheco/jsstyle) are on your path.\n\nNew tests should generally accompany new functions and bug fixes.  The tests\nshould pass cleanly (run tests/basic.js).\n",
-  "readmeFilename": "README.md",
+  "gitHead": "0e709876c35eddfe4c1f95104ac3c4abfc9dab84",
   "bugs": {
     "url": "https://github.com/davepacheco/node-jsprim/issues"
   },
-  "homepage": "https://github.com/davepacheco/node-jsprim#readme",
+  "homepage": "https://github.com/davepacheco/node-jsprim",
   "_id": "jsprim@1.2.2",
+  "scripts": {},
   "_shasum": "f20c906ac92abd58e3b79ac8bc70a48832512da1",
+  "_from": "jsprim@>=1.2.2 <2.0.0",
+  "_npmVersion": "2.7.4",
+  "_nodeVersion": "0.12.2",
+  "_npmUser": {
+    "name": "dap",
+    "email": "dap@cs.brown.edu"
+  },
+  "maintainers": [
+    {
+      "name": "dap",
+      "email": "dap@cs.brown.edu"
+    }
+  ],
+  "dist": {
+    "shasum": "f20c906ac92abd58e3b79ac8bc70a48832512da1",
+    "tarball": "http://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.2.2.tgz",
-  "_from": "jsprim@>=1.2.2 <2.0.0"
+  "readme": "ERROR: No README data found!"
 }
index b592af7..8eec411 100755 (executable)
@@ -166,7 +166,7 @@ if (require.main === module) {
                        });
                } else {
                        var kind = 'public';
-                       if (PrivateKey.isPrivateKey(key))
+                       if (sshpk.PrivateKey.isPrivateKey(key))
                                kind = 'private';
                        console.log('%s: a %d bit %s %s key', inFileName,
                            key.size, key.type.toUpperCase(), kind);
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-sign
new file mode 100755 (executable)
index 0000000..c8b9193
--- /dev/null
@@ -0,0 +1,176 @@
+#!/usr/bin/env node
+// -*- mode: js -*-
+// vim: set filetype=javascript :
+// Copyright 2015 Joyent, Inc.  All rights reserved.
+
+var dashdash = require('dashdash');
+var sshpk = require('../lib/index');
+var fs = require('fs');
+var path = require('path');
+
+var options = [
+       {
+               names: ['hash', 'H'],
+               type: 'string',
+               help: 'Hash algorithm (sha1, sha256, sha384, sha512)'
+       },
+       {
+               names: ['verbose', 'v'],
+               type: 'bool',
+               help: 'Display verbose info about key and hash used'
+       },
+       {
+               names: ['identity', 'i'],
+               type: 'string',
+               help: 'Path to key to use'
+       },
+       {
+               names: ['file', 'f'],
+               type: 'string',
+               help: 'Input filename'
+       },
+       {
+               names: ['out', 'o'],
+               type: 'string',
+               help: 'Output filename'
+       },
+       {
+               names: ['format', 't'],
+               type: 'string',
+               help: 'Signature format (asn1, ssh, raw)'
+       },
+       {
+               names: ['binary', 'b'],
+               type: 'bool',
+               help: 'Output raw binary instead of base64'
+       },
+       {
+               names: ['help', 'h'],
+               type: 'bool',
+               help: 'Shows this help text'
+       }
+];
+
+if (require.main === module) {
+       var parser = dashdash.createParser({
+               options: options
+       });
+
+       try {
+               var opts = parser.parse(process.argv);
+       } catch (e) {
+               console.error('sshpk-sign: error: %s', e.message);
+               process.exit(1);
+       }
+
+       if (opts.help || opts._args.length > 1) {
+               var help = parser.help({}).trimRight();
+               console.error('sshpk-sign: sign data using an SSH key\n');
+               console.error(help);
+               process.exit(1);
+       }
+
+       if (!opts.identity) {
+               var help = parser.help({}).trimRight();
+               console.error('sshpk-sign: the -i or --identity option ' +
+                   'is required\n');
+               console.error(help);
+               process.exit(1);
+       }
+
+       var keyData = fs.readFileSync(opts.identity);
+
+       var key;
+       try {
+               key = sshpk.parsePrivateKey(keyData);
+       } catch (e) {
+               console.error('sshpk-sign: error loading private key "' +
+                   opts.identity + '": ' + e.name + ': ' + e.message);
+               process.exit(1);
+       }
+
+       var hash = opts.hash || key.defaultHashAlgorithm();
+
+       var signer;
+       try {
+               signer = key.createSign(hash);
+       } catch (e) {
+               console.error('sshpk-sign: error creating signer: ' +
+                   e.name + ': ' + e.message);
+               process.exit(1);
+       }
+
+       if (opts.verbose) {
+               console.error('sshpk-sign: using %s-%s with a %d bit key',
+                   key.type, hash, key.size);
+       }
+
+       var inFile = process.stdin;
+       var inFileName = 'stdin';
+
+       var inFilePath;
+       if (opts.file) {
+               inFilePath = opts.file;
+       } else if (opts._args.length === 1) {
+               inFilePath = opts._args[0];
+       }
+
+       if (inFilePath)
+               inFileName = path.basename(inFilePath);
+
+       try {
+               if (inFilePath) {
+                       fs.accessSync(inFilePath, fs.R_OK);
+                       inFile = fs.createReadStream(inFilePath);
+               }
+       } catch (e) {
+               console.error('sshpk-sign: error opening input file' +
+                    ': ' + e.name + ': ' + e.message);
+               process.exit(1);
+       }
+
+       var outFile = process.stdout;
+
+       try {
+               if (opts.out && !opts.identify) {
+                       fs.accessSync(path.dirname(opts.out), fs.W_OK);
+                       outFile = fs.createWriteStream(opts.out);
+               }
+       } catch (e) {
+               console.error('sshpk-sign: error opening output file' +
+                   ': ' + e.name + ': ' + e.message);
+               process.exit(1);
+       }
+
+       inFile.pipe(signer);
+       inFile.on('end', function () {
+               var sig;
+               try {
+                       sig = signer.sign();
+               } catch (e) {
+                       console.error('sshpk-sign: error signing data: ' +
+                           e.name + ': ' + e.message);
+                       process.exit(1);
+               }
+
+               var fmt = opts.format || 'asn1';
+               var output;
+               try {
+                       output = sig.toBuffer(fmt);
+                       if (!opts.binary)
+                               output = output.toString('base64');
+               } catch (e) {
+                       console.error('sshpk-sign: error converting signature' +
+                           ' to ' + fmt + ' format: ' + e.name + ': ' +
+                           e.message);
+                       process.exit(1);
+               }
+
+               outFile.write(output);
+               if (!opts.binary)
+                       outFile.write('\n');
+               outFile.once('drain', function () {
+                       process.exit(0);
+               });
+       });
+}
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-verify b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/bin/sshpk-verify
new file mode 100755 (executable)
index 0000000..a1669f4
--- /dev/null
@@ -0,0 +1,166 @@
+#!/usr/bin/env node
+// -*- mode: js -*-
+// vim: set filetype=javascript :
+// Copyright 2015 Joyent, Inc.  All rights reserved.
+
+var dashdash = require('dashdash');
+var sshpk = require('../lib/index');
+var fs = require('fs');
+var path = require('path');
+
+var options = [
+       {
+               names: ['hash', 'H'],
+               type: 'string',
+               help: 'Hash algorithm (sha1, sha256, sha384, sha512)'
+       },
+       {
+               names: ['verbose', 'v'],
+               type: 'bool',
+               help: 'Display verbose info about key and hash used'
+       },
+       {
+               names: ['identity', 'i'],
+               type: 'string',
+               help: 'Path to (public) key to use'
+       },
+       {
+               names: ['file', 'f'],
+               type: 'string',
+               help: 'Input filename'
+       },
+       {
+               names: ['format', 't'],
+               type: 'string',
+               help: 'Signature format (asn1, ssh, raw)'
+       },
+       {
+               names: ['signature', 's'],
+               type: 'string',
+               help: 'base64-encoded signature data'
+       },
+       {
+               names: ['help', 'h'],
+               type: 'bool',
+               help: 'Shows this help text'
+       }
+];
+
+if (require.main === module) {
+       var parser = dashdash.createParser({
+               options: options
+       });
+
+       try {
+               var opts = parser.parse(process.argv);
+       } catch (e) {
+               console.error('sshpk-verify: error: %s', e.message);
+               process.exit(3);
+       }
+
+       if (opts.help || opts._args.length > 1) {
+               var help = parser.help({}).trimRight();
+               console.error('sshpk-verify: sign data using an SSH key\n');
+               console.error(help);
+               process.exit(3);
+       }
+
+       if (!opts.identity) {
+               var help = parser.help({}).trimRight();
+               console.error('sshpk-verify: the -i or --identity option ' +
+                   'is required\n');
+               console.error(help);
+               process.exit(3);
+       }
+
+       if (!opts.signature) {
+               var help = parser.help({}).trimRight();
+               console.error('sshpk-verify: the -s or --signature option ' +
+                   'is required\n');
+               console.error(help);
+               process.exit(3);
+       }
+
+       var keyData = fs.readFileSync(opts.identity);
+
+       var key;
+       try {
+               key = sshpk.parseKey(keyData);
+       } catch (e) {
+               console.error('sshpk-verify: error loading key "' +
+                   opts.identity + '": ' + e.name + ': ' + e.message);
+               process.exit(2);
+       }
+
+       var fmt = opts.format || 'asn1';
+       var sigData = new Buffer(opts.signature, 'base64');
+
+       var sig;
+       try {
+               sig = sshpk.parseSignature(sigData, key.type, fmt);
+       } catch (e) {
+               console.error('sshpk-verify: error parsing signature: ' +
+                   e.name + ': ' + e.message);
+               process.exit(2);
+       }
+
+       var hash = opts.hash || key.defaultHashAlgorithm();
+
+       var verifier;
+       try {
+               verifier = key.createVerify(hash);
+       } catch (e) {
+               console.error('sshpk-verify: error creating verifier: ' +
+                   e.name + ': ' + e.message);
+               process.exit(2);
+       }
+
+       if (opts.verbose) {
+               console.error('sshpk-verify: using %s-%s with a %d bit key',
+                   key.type, hash, key.size);
+       }
+
+       var inFile = process.stdin;
+       var inFileName = 'stdin';
+
+       var inFilePath;
+       if (opts.file) {
+               inFilePath = opts.file;
+       } else if (opts._args.length === 1) {
+               inFilePath = opts._args[0];
+       }
+
+       if (inFilePath)
+               inFileName = path.basename(inFilePath);
+
+       try {
+               if (inFilePath) {
+                       fs.accessSync(inFilePath, fs.R_OK);
+                       inFile = fs.createReadStream(inFilePath);
+               }
+       } catch (e) {
+               console.error('sshpk-verify: error opening input file' +
+                    ': ' + e.name + ': ' + e.message);
+               process.exit(2);
+       }
+
+       inFile.pipe(verifier);
+       inFile.on('end', function () {
+               var ret;
+               try {
+                       ret = verifier.verify(sig);
+               } catch (e) {
+                       console.error('sshpk-verify: error verifying data: ' +
+                           e.name + ': ' + e.message);
+                       process.exit(1);
+               }
+
+               if (ret) {
+                       console.error('OK');
+                       process.exit(0);
+               }
+
+               console.error('NOT OK');
+               process.exit(1);
+       });
+}
index ad46339..5365fb1 100644 (file)
@@ -40,6 +40,8 @@ Verifier.prototype.update = function (chunk) {
 Verifier.prototype.verify = function (signature, fmt) {
        var sig;
        if (Signature.isSignature(signature, [2, 0])) {
+               if (signature.type !== 'ed25519')
+                       return (false);
                sig = signature.toBuffer('raw');
 
        } else if (typeof (signature) === 'string') {
index 0a841b9..d140f0e 100644 (file)
@@ -175,8 +175,14 @@ Key.prototype.createVerify = function (hashAlgo) {
        assert.ok(v, 'failed to create verifier');
        var oldVerify = v.verify.bind(v);
        var key = this.toBuffer('pkcs8');
+       var self = this;
        v.verify = function (signature, fmt) {
                if (Signature.isSignature(signature, [2, 0])) {
+                       if (signature.type !== self.type)
+                               return (false);
+                       if (signature.hashAlgorithm &&
+                           signature.hashAlgorithm !== hashAlgo)
+                               return (false);
                        return (oldVerify(key, signature.toBuffer('asn1')));
 
                } else if (typeof (signature) === 'string' ||
index c22c8a3..0b00277 100644 (file)
@@ -45,7 +45,8 @@ SSHBuffer.prototype.readBuffer = function () {
        var len = this._buffer.readUInt32BE(this._offset);
        this._offset += 4;
        assert.ok(this._offset + len <= this._buffer.length,
-           'length out of bounds at +0x' + this._offset.toString(16));
+           'length out of bounds at +0x' + this._offset.toString(16) +
+           ' (data truncated?)');
        var buf = this._buffer.slice(this._offset, this._offset + len);
        this._offset += len;
        return (buf);
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1 b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-conv.1
new file mode 100644 (file)
index 0000000..d03b306
--- /dev/null
@@ -0,0 +1,135 @@
+.TH sshpk\-conv 1 "Jan 2016" sshpk "sshpk Commands"
+.SH NAME
+.PP
+sshpk\-conv \- convert between key formats
+.SH SYNOPSYS
+.PP
+\fB\fCsshpk\-conv\fR \-t FORMAT [FILENAME] [OPTIONS...]
+.PP
+\fB\fCsshpk\-conv\fR \-i [FILENAME] [OPTIONS...]
+.SH DESCRIPTION
+.PP
+Reads in a public or private key and converts it between different formats,
+particularly formats used in the SSH protocol and the well\-known PEM PKCS#1/7
+formats.
+.PP
+In the second form, with the \fB\fC\-i\fR option given, identifies a key and prints to
+stderr information about its nature, size and fingerprint.
+.SH EXAMPLES
+.PP
+Assume the following SSH\-format public key in \fB\fCid_ecdsa.pub\fR:
+.PP
+.RS
+.nf
+ecdsa\-sha2\-nistp256 AAAAE2VjZHNhLXNoYTI...9M/4c4= user@host
+.fi
+.RE
+.PP
+Identify it with \fB\fC\-i\fR:
+.PP
+.RS
+.nf
+$ sshpk\-conv \-i id_ecdsa.pub
+id_ecdsa: a 256 bit ECDSA public key
+ECDSA curve: nistp256
+Comment: user@host
+Fingerprint:
+  SHA256:vCNX7eUkdvqqW0m4PoxQAZRv+CM4P4fS8+CbliAvS4k
+  81:ad:d5:57:e5:6f:7d:a2:93:79:56:af:d7:c0:38:51
+.fi
+.RE
+.PP
+Convert it to \fB\fCpkcs8\fR format, for use with e.g. OpenSSL:
+.PP
+.RS
+.nf
+$ sshpk\-conv \-t pkcs8 id_ecdsa
+\-\-\-\-\-BEGIN PUBLIC KEY\-\-\-\-\-
+MFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcDQgAEAsA4R6N6AS3gzaPBeLjG2ObSgUsR
+zOt+kWJoijLnw3ZMYUKmAx+lD0I5XUxdrPcs1vH5f3cn9TvRvO9L0z/hzg==
+\-\-\-\-\-END PUBLIC KEY\-\-\-\-\-
+.fi
+.RE
+.PP
+Retrieve the public half of a private key:
+.PP
+.RS
+.nf
+$ openssl genrsa 2048 | sshpk\-conv \-t ssh \-c foo@bar
+ssh\-rsa AAAAB3NzaC1yc2EAAA...koK7 foo@bar
+.fi
+.RE
+.PP
+Convert a private key to PKCS#1 (OpenSSL) format from a new\-style OpenSSH key
+format (the \fB\fCssh\-keygen \-o\fR format):
+.PP
+.RS
+.nf
+$ ssh\-keygen \-o \-f foobar
+\&...
+$ sshpk\-conv \-p \-t pkcs1 foobar
+\-\-\-\-\-BEGIN RSA PRIVATE KEY\-\-\-\-\-
+MIIDpAIBAAKCAQEA6T/GYJndb1TRH3+NL....
+\-\-\-\-\-END RSA PRIVATE KEY\-\-\-\-\-
+.fi
+.RE
+.SH OPTIONS
+.TP
+\fB\fC\-i, \-\-identify\fR
+Instead of converting the key, output identifying information about it to
+stderr, including its type, size and fingerprints.
+.TP
+\fB\fC\-p, \-\-private\fR
+Treat the key as a private key instead of a public key (the default). If you
+supply \fB\fCsshpk\-conv\fR with a private key and do not give this option, it will
+extract only the public half of the key from it and work with that.
+.TP
+\fB\fC\-f PATH, \-\-file=PATH\fR
+Input file to take the key from instead of stdin. If a filename is supplied
+as a positional argument, it is equivalent to using this option.
+.TP
+\fB\fC\-o PATH, \-\-out=PATH\fR
+Output file name to use instead of stdout.
+.PP
+\fB\fC\-T FORMAT, \-\-informat=FORMAT\fR
+.TP
+\fB\fC\-t FORMAT, \-\-outformat=FORMAT\fR
+Selects the input and output formats to be used (see FORMATS, below).
+.TP
+\fB\fC\-c TEXT, \-\-comment=TEXT\fR
+Sets the key comment for the output file, if supported.
+.SH FORMATS
+.PP
+Currently supported formats:
+.TP
+\fB\fCpem, pkcs1\fR
+The standard PEM format used by older OpenSSH and most TLS libraries such as
+OpenSSL. The classic \fB\fCid_rsa\fR file is usually in this format. It is an ASN.1
+encoded structure, base64\-encoded and placed between PEM headers.
+.TP
+\fB\fCssh\fR
+The SSH public key text format (the format of an \fB\fCid_rsa.pub\fR file). A single
+line, containing 3 space separated parts: the key type, key body and optional
+key comment.
+.TP
+\fB\fCpkcs8\fR
+A newer PEM format, usually used only for public keys by TLS libraries such
+as OpenSSL. The ASN.1 structure is more generic than that of \fB\fCpkcs1\fR\&.
+.TP
+\fB\fCopenssh\fR
+The new \fB\fCssh\-keygen \-o\fR format from OpenSSH. This can be mistaken for a PEM
+encoding but is actually an OpenSSH internal format.
+.TP
+\fB\fCrfc4253\fR
+The internal binary format of keys when sent over the wire in the SSH
+protocol. This is also the format that the \fB\fCssh\-agent\fR uses in its protocol.
+.SH SEE ALSO
+.PP
+.BR ssh-keygen (1),
+.BR openssl (1)
+.SH BUGS
+.PP
+Encrypted (password\-protected) keys are not supported.
+.PP
+Report bugs at Github
+\[la]https://github.com/arekinath/node-sshpk/issues\[ra]
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-sign.1 b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-sign.1
new file mode 100644 (file)
index 0000000..749916b
--- /dev/null
@@ -0,0 +1,81 @@
+.TH sshpk\-sign 1 "Jan 2016" sshpk "sshpk Commands"
+.SH NAME
+.PP
+sshpk\-sign \- sign data using an SSH key
+.SH SYNOPSYS
+.PP
+\fB\fCsshpk\-sign\fR \-i KEYPATH [OPTION...]
+.SH DESCRIPTION
+.PP
+Takes in arbitrary bytes, and signs them using an SSH private key. The key can
+be of any type or format supported by the \fB\fCsshpk\fR library, including the
+standard OpenSSH formats, as well as PEM PKCS#1 and PKCS#8.
+.PP
+The signature is printed out in Base64 encoding, unless the \fB\fC\-\-binary\fR or \fB\fC\-b\fR
+option is given.
+.SH EXAMPLES
+.PP
+Signing with default settings:
+.PP
+.RS
+.nf
+$ printf 'foo' | sshpk\-sign \-i ~/.ssh/id_ecdsa
+MEUCIAMdLS/vXrrtWFepwe...
+.fi
+.RE
+.PP
+Signing in SSH (RFC 4253) format (rather than the default ASN.1):
+.PP
+.RS
+.nf
+$ printf 'foo' | sshpk\-sign \-i ~/.ssh/id_ecdsa \-t ssh
+AAAAFGVjZHNhLXNoYTIt...
+.fi
+.RE
+.PP
+Saving the binary signature to a file:
+.PP
+.RS
+.nf
+$ printf 'foo' | sshpk\-sign \-i ~/.ssh/id_ecdsa \\
+                            \-o signature.bin \-b
+$ cat signature.bin | base64
+MEUCIAMdLS/vXrrtWFepwe...
+.fi
+.RE
+.SH OPTIONS
+.TP
+\fB\fC\-v, \-\-verbose\fR
+Print extra information about the key and signature to stderr when signing.
+.TP
+\fB\fC\-b, \-\-binary\fR
+Don't base64\-encode the signature before outputting it.
+.TP
+\fB\fC\-i KEY, \-\-identity=KEY\fR
+Select the key to be used for signing. \fB\fCKEY\fR must be a relative or absolute
+filesystem path to the key file. Any format supported by the \fB\fCsshpk\fR library
+is supported, including OpenSSH formats and standard PEM PKCS.
+.TP
+\fB\fC\-f PATH, \-\-file=PATH\fR
+Input file to sign instead of stdin.
+.TP
+\fB\fC\-o PATH, \-\-out=PATH\fR
+Output file to save signature in instead of stdout.
+.TP
+\fB\fC\-H HASH, \-\-hash=HASH\fR
+Set the hash algorithm to be used for signing. This should be one of \fB\fCsha1\fR,
+\fB\fCsha256\fR or \fB\fCsha512\fR\&. Some key types may place restrictions on which hash
+algorithms may be used (e.g. ED25519 keys can only use SHA\-512).
+.TP
+\fB\fC\-t FORMAT, \-\-format=FORMAT\fR
+Choose the signature format to use, from \fB\fCasn1\fR, \fB\fCssh\fR or \fB\fCraw\fR (only for
+ED25519 signatures). The \fB\fCasn1\fR format is the default, as it is the format
+used with TLS and typically the standard in most non\-SSH libraries (e.g.
+OpenSSL). The \fB\fCssh\fR format is used in the SSH protocol and by the ssh\-agent.
+.SH SEE ALSO
+.PP
+.BR sshpk-verify (1)
+.SH BUGS
+.PP
+Report bugs at Github
+\[la]https://github.com/arekinath/node-sshpk/issues\[ra]
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-verify.1 b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/man/man1/sshpk-verify.1
new file mode 100644 (file)
index 0000000..f79169d
--- /dev/null
@@ -0,0 +1,68 @@
+.TH sshpk\-verify 1 "Jan 2016" sshpk "sshpk Commands"
+.SH NAME
+.PP
+sshpk\-verify \- verify a signature on data using an SSH key
+.SH SYNOPSYS
+.PP
+\fB\fCsshpk\-verify\fR \-i KEYPATH \-s SIGNATURE [OPTION...]
+.SH DESCRIPTION
+.PP
+Takes in arbitrary bytes and a Base64\-encoded signature, and verifies that the
+signature was produced by the private half of the given SSH public key.
+.SH EXAMPLES
+.PP
+.RS
+.nf
+$ printf 'foo' | sshpk\-verify \-i ~/.ssh/id_ecdsa \-s MEUCIQCYp...
+OK
+$ printf 'foo' | sshpk\-verify \-i ~/.ssh/id_ecdsa \-s GARBAGE...
+NOT OK
+.fi
+.RE
+.SH EXIT STATUS
+.TP
+\fB\fC0\fR
+Signature validates and matches the key.
+.TP
+\fB\fC1\fR
+Signature is parseable and the correct length but does not match the key or
+otherwise is invalid.
+.TP
+\fB\fC2\fR
+The signature or key could not be parsed.
+.TP
+\fB\fC3\fR
+Invalid commandline options were supplied.
+.SH OPTIONS
+.TP
+\fB\fC\-v, \-\-verbose\fR
+Print extra information about the key and signature to stderr when verifying.
+.TP
+\fB\fC\-i KEY, \-\-identity=KEY\fR
+Select the key to be used for verification. \fB\fCKEY\fR must be a relative or
+absolute filesystem path to the key file. Any format supported by the \fB\fCsshpk\fR
+library is supported, including OpenSSH formats and standard PEM PKCS.
+.TP
+\fB\fC\-s BASE64, \-\-signature=BASE64\fR
+Supplies the base64\-encoded signature to be verified.
+.TP
+\fB\fC\-f PATH, \-\-file=PATH\fR
+Input file to verify instead of stdin.
+.TP
+\fB\fC\-H HASH, \-\-hash=HASH\fR
+Set the hash algorithm to be used for signing. This should be one of \fB\fCsha1\fR,
+\fB\fCsha256\fR or \fB\fCsha512\fR\&. Some key types may place restrictions on which hash
+algorithms may be used (e.g. ED25519 keys can only use SHA\-512).
+.TP
+\fB\fC\-t FORMAT, \-\-format=FORMAT\fR
+Choose the signature format to use, from \fB\fCasn1\fR, \fB\fCssh\fR or \fB\fCraw\fR (only for
+ED25519 signatures). The \fB\fCasn1\fR format is the default, as it is the format
+used with TLS and typically the standard in most non\-SSH libraries (e.g.
+OpenSSL). The \fB\fCssh\fR format is used in the SSH protocol and by the ssh\-agent.
+.SH SEE ALSO
+.PP
+.BR sshpk-sign (1)
+.SH BUGS
+.PP
+Report bugs at Github
+\[la]https://github.com/arekinath/node-sshpk/issues\[ra]
index 0cbc094..0e1bcc2 100644 (file)
     "test": "tap ./tst"
   },
   "license": "MIT",
-  "readme": "node-asn1 is a library for encoding and decoding ASN.1 datatypes in pure JS.\nCurrently BER encoding is supported; at some point I'll likely have to do DER.\n\n## Usage\n\nMostly, if you're *actually* needing to read and write ASN.1, you probably don't\nneed this readme to explain what and why.  If you have no idea what ASN.1 is,\nsee this: ftp://ftp.rsa.com/pub/pkcs/ascii/layman.asc\n\nThe source is pretty much self-explanatory, and has read/write methods for the\ncommon types out there.\n\n### Decoding\n\nThe following reads an ASN.1 sequence with a boolean.\n\n    var Ber = require('asn1').Ber;\n\n    var reader = new Ber.Reader(new Buffer([0x30, 0x03, 0x01, 0x01, 0xff]));\n\n    reader.readSequence();\n    console.log('Sequence len: ' + reader.length);\n    if (reader.peek() === Ber.Boolean)\n      console.log(reader.readBoolean());\n\n### Encoding\n\nThe following generates the same payload as above.\n\n    var Ber = require('asn1').Ber;\n\n    var writer = new Ber.Writer();\n\n    writer.startSequence();\n    writer.writeBoolean(true);\n    writer.endSequence();\n\n    console.log(writer.buffer);\n\n## Installation\n\n    npm install asn1\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-asn1/issues>.\n",
-  "readmeFilename": "README.md",
   "bugs": {
     "url": "https://github.com/mcavage/node-asn1/issues"
   },
-  "homepage": "https://github.com/mcavage/node-asn1#readme",
+  "homepage": "https://github.com/mcavage/node-asn1",
   "_id": "asn1@0.2.3",
   "_shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86",
   "_resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz",
-  "_from": "asn1@>=0.2.3 <0.3.0"
+  "_from": "asn1@>=0.2.3 <0.3.0",
+  "_npmVersion": "1.4.28",
+  "_npmUser": {
+    "name": "pfmooney",
+    "email": "patrick.f.mooney@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "mcavage",
+      "email": "mcavage@gmail.com"
+    },
+    {
+      "name": "pfmooney",
+      "email": "patrick.f.mooney@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "dac8787713c9966849fc8180777ebe9c1ddf3b86",
+    "tarball": "http://registry.npmjs.org/asn1/-/asn1-0.2.3.tgz"
+  },
+  "directories": {},
+  "readme": "ERROR: No README data found!"
 }
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/README.md
deleted file mode 100644 (file)
index 0b39593..0000000
+++ /dev/null
@@ -1,155 +0,0 @@
-# assert-plus
-
-This library is a super small wrapper over node's assert module that has two
-things: (1) the ability to disable assertions with the environment variable
-NODE\_NDEBUG, and (2) some API wrappers for argument testing.  Like
-`assert.string(myArg, 'myArg')`.  As a simple example, most of my code looks
-like this:
-
-```javascript
-    var assert = require('assert-plus');
-
-    function fooAccount(options, callback) {
-        assert.object(options, 'options');
-        assert.number(options.id, 'options.id');
-        assert.bool(options.isManager, 'options.isManager');
-        assert.string(options.name, 'options.name');
-        assert.arrayOfString(options.email, 'options.email');
-        assert.func(callback, 'callback');
-
-        // Do stuff
-        callback(null, {});
-    }
-```
-
-# API
-
-All methods that *aren't* part of node's core assert API are simply assumed to
-take an argument, and then a string 'name' that's not a message; `AssertionError`
-will be thrown if the assertion fails with a message like:
-
-    AssertionError: foo (string) is required
-    at test (/home/mark/work/foo/foo.js:3:9)
-    at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
-    at Module._compile (module.js:446:26)
-    at Object..js (module.js:464:10)
-    at Module.load (module.js:353:31)
-    at Function._load (module.js:311:12)
-    at Array.0 (module.js:484:10)
-    at EventEmitter._tickCallback (node.js:190:38)
-
-from:
-
-```javascript
-    function test(foo) {
-        assert.string(foo, 'foo');
-    }
-```
-
-There you go.  You can check that arrays are of a homogeneous type with `Arrayof$Type`:
-
-```javascript
-    function test(foo) {
-        assert.arrayOfString(foo, 'foo');
-    }
-```
-
-You can assert IFF an argument is not `undefined` (i.e., an optional arg):
-
-```javascript
-    assert.optionalString(foo, 'foo');
-```
-
-Lastly, you can opt-out of assertion checking altogether by setting the
-environment variable `NODE_NDEBUG=1`.  This is pseudo-useful if you have
-lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
-production.  Be advised:  The standard functions re-exported from `assert` are
-also disabled in assert-plus if NDEBUG is specified.  Using them directly from
-the `assert` module avoids this behavior.
-
-The complete list of APIs is:
-
-* assert.array
-* assert.bool
-* assert.buffer
-* assert.func
-* assert.number
-* assert.object
-* assert.string
-* assert.stream
-* assert.date
-* assert.regex
-* assert.uuid
-* assert.arrayOfArray
-* assert.arrayOfBool
-* assert.arrayOfBuffer
-* assert.arrayOfFunc
-* assert.arrayOfNumber
-* assert.arrayOfObject
-* assert.arrayOfString
-* assert.arrayOfStream
-* assert.arrayOfDate
-* assert.arrayOfUuid
-* assert.optionalArray
-* assert.optionalBool
-* assert.optionalBuffer
-* assert.optionalFunc
-* assert.optionalNumber
-* assert.optionalObject
-* assert.optionalString
-* assert.optionalStream
-* assert.optionalDate
-* assert.optionalUuid
-* assert.optionalArrayOfArray
-* assert.optionalArrayOfBool
-* assert.optionalArrayOfBuffer
-* assert.optionalArrayOfFunc
-* assert.optionalArrayOfNumber
-* assert.optionalArrayOfObject
-* assert.optionalArrayOfString
-* assert.optionalArrayOfStream
-* assert.optionalArrayOfDate
-* assert.optionalArrayOfUuid
-* assert.AssertionError
-* assert.fail
-* assert.ok
-* assert.equal
-* assert.notEqual
-* assert.deepEqual
-* assert.notDeepEqual
-* assert.strictEqual
-* assert.notStrictEqual
-* assert.throws
-* assert.doesNotThrow
-* assert.ifError
-
-# Installation
-
-    npm install assert-plus
-
-## License
-
-The MIT License (MIT)
-Copyright (c) 2012 Mark Cavage
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-## Bugs
-
-See <https://github.com/mcavage/node-assert-plus/issues>.
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/assert.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/assert.js
deleted file mode 100644 (file)
index 6bce4d8..0000000
+++ /dev/null
@@ -1,206 +0,0 @@
-// Copyright (c) 2012, Mark Cavage. All rights reserved.
-// Copyright 2015 Joyent, Inc.
-
-var assert = require('assert');
-var Stream = require('stream').Stream;
-var util = require('util');
-
-
-///--- Globals
-
-/* JSSTYLED */
-var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
-
-
-///--- Internal
-
-function _capitalize(str) {
-    return (str.charAt(0).toUpperCase() + str.slice(1));
-}
-
-function _toss(name, expected, oper, arg, actual) {
-    throw new assert.AssertionError({
-        message: util.format('%s (%s) is required', name, expected),
-        actual: (actual === undefined) ? typeof (arg) : actual(arg),
-        expected: expected,
-        operator: oper || '===',
-        stackStartFunction: _toss.caller
-    });
-}
-
-function _getClass(arg) {
-    return (Object.prototype.toString.call(arg).slice(8, -1));
-}
-
-function noop() {
-    // Why even bother with asserts?
-}
-
-
-///--- Exports
-
-var types = {
-    bool: {
-        check: function (arg) { return typeof (arg) === 'boolean'; }
-    },
-    func: {
-        check: function (arg) { return typeof (arg) === 'function'; }
-    },
-    string: {
-        check: function (arg) { return typeof (arg) === 'string'; }
-    },
-    object: {
-        check: function (arg) {
-            return typeof (arg) === 'object' && arg !== null;
-        }
-    },
-    number: {
-        check: function (arg) {
-            return typeof (arg) === 'number' && !isNaN(arg) && isFinite(arg);
-        }
-    },
-    buffer: {
-        check: function (arg) { return Buffer.isBuffer(arg); },
-        operator: 'Buffer.isBuffer'
-    },
-    array: {
-        check: function (arg) { return Array.isArray(arg); },
-        operator: 'Array.isArray'
-    },
-    stream: {
-        check: function (arg) { return arg instanceof Stream; },
-        operator: 'instanceof',
-        actual: _getClass
-    },
-    date: {
-        check: function (arg) { return arg instanceof Date; },
-        operator: 'instanceof',
-        actual: _getClass
-    },
-    regexp: {
-        check: function (arg) { return arg instanceof RegExp; },
-        operator: 'instanceof',
-        actual: _getClass
-    },
-    uuid: {
-        check: function (arg) {
-            return typeof (arg) === 'string' && UUID_REGEXP.test(arg);
-        },
-        operator: 'isUUID'
-    }
-};
-
-function _setExports(ndebug) {
-    var keys = Object.keys(types);
-    var out;
-
-    /* re-export standard assert */
-    if (process.env.NODE_NDEBUG) {
-        out = noop;
-    } else {
-        out = function (arg, msg) {
-            if (!arg) {
-                _toss(msg, 'true', arg);
-            }
-        };
-    }
-
-    /* standard checks */
-    keys.forEach(function (k) {
-        if (ndebug) {
-            out[k] = noop;
-            return;
-        }
-        var type = types[k];
-        out[k] = function (arg, msg) {
-            if (!type.check(arg)) {
-                _toss(msg, k, type.operator, arg, type.actual);
-            }
-        };
-    });
-
-    /* optional checks */
-    keys.forEach(function (k) {
-        var name = 'optional' + _capitalize(k);
-        if (ndebug) {
-            out[name] = noop;
-            return;
-        }
-        var type = types[k];
-        out[name] = function (arg, msg) {
-            if (arg === undefined || arg === null) {
-                return;
-            }
-            if (!type.check(arg)) {
-                _toss(msg, k, type.operator, arg, type.actual);
-            }
-        };
-    });
-
-    /* arrayOf checks */
-    keys.forEach(function (k) {
-        var name = 'arrayOf' + _capitalize(k);
-        if (ndebug) {
-            out[name] = noop;
-            return;
-        }
-        var type = types[k];
-        var expected = '[' + k + ']';
-        out[name] = function (arg, msg) {
-            if (!Array.isArray(arg)) {
-                _toss(msg, expected, type.operator, arg, type.actual);
-            }
-            var i;
-            for (i = 0; i < arg.length; i++) {
-                if (!type.check(arg[i])) {
-                    _toss(msg, expected, type.operator, arg, type.actual);
-                }
-            }
-        };
-    });
-
-    /* optionalArrayOf checks */
-    keys.forEach(function (k) {
-        var name = 'optionalArrayOf' + _capitalize(k);
-        if (ndebug) {
-            out[name] = noop;
-            return;
-        }
-        var type = types[k];
-        var expected = '[' + k + ']';
-        out[name] = function (arg, msg) {
-            if (arg === undefined || arg === null) {
-                return;
-            }
-            if (!Array.isArray(arg)) {
-                _toss(msg, expected, type.operator, arg, type.actual);
-            }
-            var i;
-            for (i = 0; i < arg.length; i++) {
-                if (!type.check(arg[i])) {
-                    _toss(msg, expected, type.operator, arg, type.actual);
-                }
-            }
-        };
-    });
-
-    /* re-export built-in assertions */
-    Object.keys(assert).forEach(function (k) {
-        if (k === 'AssertionError') {
-            out[k] = assert[k];
-            return;
-        }
-        if (ndebug) {
-            out[k] = noop;
-            return;
-        }
-        out[k] = assert[k];
-    });
-
-    /* export ourselves (for unit tests _only_) */
-    out._setExports = _setExports;
-
-    return out;
-}
-
-module.exports = _setExports(process.env.NODE_NDEBUG);
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/assert-plus/package.json
deleted file mode 100644 (file)
index e579f44..0000000
+++ /dev/null
@@ -1,63 +0,0 @@
-{
-  "author": {
-    "name": "Mark Cavage",
-    "email": "mcavage@gmail.com"
-  },
-  "name": "assert-plus",
-  "description": "Extra assertions on top of node's assert module",
-  "version": "0.2.0",
-  "license": "MIT",
-  "main": "./assert.js",
-  "devDependencies": {
-    "tape": "4.2.2",
-    "faucet": "0.0.1"
-  },
-  "optionalDependencies": {},
-  "scripts": {
-    "test": "tape tests/*.js | ./node_modules/.bin/faucet"
-  },
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/mcavage/node-assert-plus.git"
-  },
-  "engines": {
-    "node": ">=0.8"
-  },
-  "contributors": [
-    {
-      "name": "Dave Eddy",
-      "email": "dave@daveeddy.com"
-    },
-    {
-      "name": "Fred Kuo",
-      "email": "fred.kuo@joyent.com"
-    },
-    {
-      "name": "Lars-Magnus Skog",
-      "email": "ralphtheninja@riseup.net"
-    },
-    {
-      "name": "Mark Cavage",
-      "email": "mcavage@gmail.com"
-    },
-    {
-      "name": "Patrick Mooney",
-      "email": "pmooney@pfmooney.com"
-    },
-    {
-      "name": "Rob Gulewich",
-      "email": "robert.gulewich@joyent.com"
-    }
-  ],
-  "readme": "# assert-plus\n\nThis library is a super small wrapper over node's assert module that has two\nthings: (1) the ability to disable assertions with the environment variable\nNODE\\_NDEBUG, and (2) some API wrappers for argument testing.  Like\n`assert.string(myArg, 'myArg')`.  As a simple example, most of my code looks\nlike this:\n\n```javascript\n    var assert = require('assert-plus');\n\n    function fooAccount(options, callback) {\n        assert.object(options, 'options');\n        assert.number(options.id, 'options.id');\n        assert.bool(options.isManager, 'options.isManager');\n        assert.string(options.name, 'options.name');\n        assert.arrayOfString(options.email, 'options.email');\n        assert.func(callback, 'callback');\n\n        // Do stuff\n        callback(null, {});\n    }\n```\n\n# API\n\nAll methods that *aren't* part of node's core assert API are simply assumed to\ntake an argument, and then a string 'name' that's not a message; `AssertionError`\nwill be thrown if the assertion fails with a message like:\n\n    AssertionError: foo (string) is required\n    at test (/home/mark/work/foo/foo.js:3:9)\n    at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)\n    at Module._compile (module.js:446:26)\n    at Object..js (module.js:464:10)\n    at Module.load (module.js:353:31)\n    at Function._load (module.js:311:12)\n    at Array.0 (module.js:484:10)\n    at EventEmitter._tickCallback (node.js:190:38)\n\nfrom:\n\n```javascript\n    function test(foo) {\n        assert.string(foo, 'foo');\n    }\n```\n\nThere you go.  You can check that arrays are of a homogeneous type with `Arrayof$Type`:\n\n```javascript\n    function test(foo) {\n        assert.arrayOfString(foo, 'foo');\n    }\n```\n\nYou can assert IFF an argument is not `undefined` (i.e., an optional arg):\n\n```javascript\n    assert.optionalString(foo, 'foo');\n```\n\nLastly, you can opt-out of assertion checking altogether by setting the\nenvironment variable `NODE_NDEBUG=1`.  This is pseudo-useful if you have\nlots of assertions, and don't want to pay `typeof ()` taxes to v8 in\nproduction.  Be advised:  The standard functions re-exported from `assert` are\nalso disabled in assert-plus if NDEBUG is specified.  Using them directly from\nthe `assert` module avoids this behavior.\n\nThe complete list of APIs is:\n\n* assert.array\n* assert.bool\n* assert.buffer\n* assert.func\n* assert.number\n* assert.object\n* assert.string\n* assert.stream\n* assert.date\n* assert.regex\n* assert.uuid\n* assert.arrayOfArray\n* assert.arrayOfBool\n* assert.arrayOfBuffer\n* assert.arrayOfFunc\n* assert.arrayOfNumber\n* assert.arrayOfObject\n* assert.arrayOfString\n* assert.arrayOfStream\n* assert.arrayOfDate\n* assert.arrayOfUuid\n* assert.optionalArray\n* assert.optionalBool\n* assert.optionalBuffer\n* assert.optionalFunc\n* assert.optionalNumber\n* assert.optionalObject\n* assert.optionalString\n* assert.optionalStream\n* assert.optionalDate\n* assert.optionalUuid\n* assert.optionalArrayOfArray\n* assert.optionalArrayOfBool\n* assert.optionalArrayOfBuffer\n* assert.optionalArrayOfFunc\n* assert.optionalArrayOfNumber\n* assert.optionalArrayOfObject\n* assert.optionalArrayOfString\n* assert.optionalArrayOfStream\n* assert.optionalArrayOfDate\n* assert.optionalArrayOfUuid\n* assert.AssertionError\n* assert.fail\n* assert.ok\n* assert.equal\n* assert.notEqual\n* assert.deepEqual\n* assert.notDeepEqual\n* assert.strictEqual\n* assert.notStrictEqual\n* assert.throws\n* assert.doesNotThrow\n* assert.ifError\n\n# Installation\n\n    npm install assert-plus\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-assert-plus/issues>.\n",
-  "readmeFilename": "README.md",
-  "bugs": {
-    "url": "https://github.com/mcavage/node-assert-plus/issues"
-  },
-  "homepage": "https://github.com/mcavage/node-assert-plus#readme",
-  "dependencies": {},
-  "_id": "assert-plus@0.2.0",
-  "_shasum": "d74e1b87e7affc0db8aadb7021f3fe48101ab234",
-  "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.2.0.tgz",
-  "_from": "assert-plus@>=0.2.0 <0.3.0"
-}
index fdbe5f4..e47b106 100644 (file)
@@ -232,6 +232,52 @@ variable can also be included in **help output**:
         -f FILE, --file=FILE  File to process
 
 
+# Bash completion
+
+Dashdash provides a simple way to create a Bash completion file that you
+can place in your "bash_completion.d" directory -- sometimes that is
+"/usr/local/etc/bash_completion.d/"). Features:
+
+- Support for short and long opts
+- Support for knowing which options take arguments
+- Support for subcommands (e.g. 'git log <TAB>' to show just options for the
+  log subcommand). See
+  [node-cmdln](https://github.com/trentm/node-cmdln#bash-completion) for
+  how to integrate that.
+- Does the right thing with "--" to stop options.
+- Custom optarg and arg types for custom completions.
+
+Dashdash will return bash completion file content given a parser instance:
+
+    var parser = dashdash.createParser({options: options});
+    console.log( parser.bashCompletion({name: 'mycli'}) );
+
+or directly from a `options` array of options specs:
+
+    var code = dashdash.bashCompletionFromOptions({
+        name: 'mycli',
+        options: OPTIONS
+    });
+
+Write that content to "/usr/local/etc/bash_completion.d/mycli" and you will
+have Bash completions for `mycli`. Alternatively you can write it to
+any file (e.g. "~/.bashrc") and source it.
+
+You could add a `--completion` hidden option to your tool that emits the
+completion content and document for your users to call that to install
+Bash completions.
+
+See [examples/ddcompletion.js](examples/ddcompletion.js) for a complete
+example, including how one can define bash functions for completion of custom
+option types. Also see [node-cmdln](https://github.com/trentm/node-cmdln) for
+how it uses this for Bash completion for full multi-subcommand tools.
+
+- TODO: document specExtra
+- TODO: document includeHidden
+- TODO: document custom types, `function complete\_FOO` guide, completionType
+- TODO: document argtypes
+
+
 # Parser config
 
 Parser construction (i.e. `dashdash.createParser(CONFIG)`) takes the
@@ -279,12 +325,13 @@ following fields:
 
 # Option specs
 
-Example using all fields:
+Example using all fields (required fields are noted):
 
 ```javascript
 {
-    names: ['file', 'f'],       // Required (or `name`).
+    names: ['file', 'f'],       // Required (one of `names` or `name`).
     type: 'string',             // Required.
+    completionType: 'filename',
     env: 'MYTOOL_FILE',
     help: 'Config file to load before running "mytool"',
     helpArg: 'PATH',
@@ -320,6 +367,20 @@ Each option spec in the `options` array must/can have the following fields:
   You can add your own custom option types with `dashdash.addOptionType`.
   See below.
 
+- `completionType` (String). Optional. This is used for [Bash
+  completion](#bash-completion) for an option argument. If not specified,
+  then the value of `type` is used. Any string may be specified, but only the
+  following values have meaning:
+
+    - `none`: Provide no completions.
+    - `file`: Bash's default completion (i.e. `complete -o default`), which
+      includes filenames.
+    - *Any string FOO for which a `function complete_FOO` Bash function is
+      defined.* This is for custom completions for a given tool. Typically
+      these custom functions are provided in the `specExtra` argument to
+      `dashdash.bashCompletionFromOptions()`. See
+      ["examples/ddcompletion.js"](examples/ddcompletion.js) for an example.
+
 - `env` (String or Array of String). Optional. An environment variable name
   (or names) that can be used as a fallback for this option. For example,
   given a "foo.js" like this:
@@ -349,7 +410,8 @@ Each option spec in the `options` array must/can have the following fields:
   option isn't specified in argv.
 
 - `hidden` (Boolean). Optional, default false. If true, help output will not
-  include this option.
+  include this option. See also the `includeHidden` option to
+  `bashCompletionFromOptions()` for [Bash completion](#bash-completion).
 
 
 # Option group headings
@@ -423,7 +485,7 @@ The `parser.help(...)` function is configurable as follows:
 # Custom option types
 
 Dashdash includes a good starter set of option types that it will parse for
-you. However you can add your own via:
+you. However, you can add your own via:
 
     var dashdash = require('dashdash');
     dashdash.addOptionType({
@@ -433,7 +495,10 @@ you. However you can add your own via:
         parseArg: function (option, optstr, arg) {
             ...
         },
-        default: ...   // optional
+        array: false,  // optional
+        arrayFlatten: false,  // optional
+        default: ...,   // optional
+        completionType: ...  // optional
     });
 
 For example, a simple option type that accepts 'yes', 'y', 'no' or 'n' as
@@ -466,10 +531,11 @@ a boolean argument would look like:
     };
     var opts = dashdash.parse({options: options});
 
-See "examples/custom-option-duration.js" for another example adding a "duration"
-option type. Please let me know [on twitter](https://twitter.com/trentmick)
-or [with an issue](https://github.com/trentm/node-dashdash/issues/new) if you
-write a generally useful one.
+See "examples/custom-option-\*.js" for other examples.
+See the `addOptionType` block comment in "lib/dashdash.js" for more details.
+Please let me know [with an
+issue](https://github.com/trentm/node-dashdash/issues/new) if you write a
+generally useful one.
 
 
 
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/etc/dashdash.bash_completion.in b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/etc/dashdash.bash_completion.in
new file mode 100644 (file)
index 0000000..50b7d6e
--- /dev/null
@@ -0,0 +1,388 @@
+#!/bin/bash
+#
+# Bash completion generated for '{{name}}' at {{date}}.
+#
+# The original template lives here:
+# https://github.com/trentm/node-dashdash/blob/master/etc/dashdash.bash_completion.in
+#
+
+#
+# Copyright 2016 Trent Mick
+# Copyright 2016 Joyent, Inc.
+#
+#
+# A generic Bash completion driver script.
+#
+# This is meant to provide a re-usable chunk of Bash to use for
+# "etc/bash_completion.d/" files for individual tools. Only the "Configuration"
+# section with tool-specific info need differ. Features:
+#
+# - support for short and long opts
+# - support for knowing which options take arguments
+# - support for subcommands (e.g. 'git log <TAB>' to show just options for the
+#   log subcommand)
+# - does the right thing with "--" to stop options
+# - custom optarg and arg types for custom completions
+# - (TODO) support for shells other than Bash (tcsh, zsh, fish?, etc.)
+#
+#
+# Examples/design:
+#
+# 1. Bash "default" completion. By default Bash's 'complete -o default' is
+#    enabled. That means when there are no completions (e.g. if no opts match
+#    the current word), then you'll get Bash's default completion. Most notably
+#    that means you get filename completion. E.g.:
+#       $ tool ./<TAB>
+#       $ tool READ<TAB>
+#
+# 2. all opts and subcmds:
+#       $ tool <TAB>
+#       $ tool -v <TAB>     # assuming '-v' doesn't take an arg
+#       $ tool -<TAB>       # matching opts
+#       $ git lo<TAB>       # matching subcmds
+#
+#    Long opt completions are given *without* the '=', i.e. we prefer space
+#    separated because that's easier for good completions.
+#
+# 3. long opt arg with '='
+#       $ tool --file=<TAB>
+#       $ tool --file=./d<TAB>
+#    We maintain the "--file=" prefix. Limitation: With the attached prefix
+#    the 'complete -o filenames' doesn't know to do dirname '/' suffixing. Meh.
+#
+# 4. envvars:
+#       $ tool $<TAB>
+#       $ tool $P<TAB>
+#    Limitation: Currently only getting exported vars, so we miss "PS1" and
+#    others.
+#
+# 5. Defer to other completion in a subshell:
+#       $ tool --file $(cat ./<TAB>
+#    We get this from 'complete -o default ...'.
+#
+# 6. Custom completion types from a provided bash function.
+#       $ tool --profile <TAB>        # complete available "profiles"
+#
+#
+# Dev Notes:
+# - compgen notes, from http://unix.stackexchange.com/questions/151118/understand-compgen-builtin-command
+# - https://www.gnu.org/software/bash/manual/html_node/Programmable-Completion-Builtins.html
+#
+
+
+# Debugging this completion:
+#   1. Uncomment the "_{{name}}_log_file=..." line.
+#   2. 'tail -f /var/tmp/dashdash-completion.log' in one terminal.
+#   3. Re-source this bash completion file.
+#_{{name}}_log=/var/tmp/dashdash-completion.log
+
+function _{{name}}_completer {
+
+    # ---- cmd definition
+
+    {{spec}}
+
+
+    # ---- locals
+
+    declare -a argv
+
+
+    # ---- support functions
+
+    function trace {
+        [[ -n "$_{{name}}_log" ]] && echo "$*" >&2
+    }
+
+    function _dashdash_complete {
+        local idx context
+        idx=$1
+        context=$2
+
+        local shortopts longopts optargs subcmds allsubcmds argtypes
+        shortopts="$(eval "echo \${cmd${context}_shortopts}")"
+        longopts="$(eval "echo \${cmd${context}_longopts}")"
+        optargs="$(eval "echo \${cmd${context}_optargs}")"
+        subcmds="$(eval "echo \${cmd${context}_subcmds}")"
+        allsubcmds="$(eval "echo \${cmd${context}_allsubcmds}")"
+        IFS=', ' read -r -a argtypes <<< "$(eval "echo \${cmd${context}_argtypes}")"
+
+        trace ""
+        trace "_dashdash_complete(idx=$idx, context=$context)"
+        trace "  shortopts: $shortopts"
+        trace "  longopts: $longopts"
+        trace "  optargs: $optargs"
+        trace "  subcmds: $subcmds"
+        trace "  allsubcmds: $allsubcmds"
+
+        # Get 'state' of option parsing at this COMP_POINT.
+        # Copying "dashdash.js#parse()" behaviour here.
+        local state=
+        local nargs=0
+        local i=$idx
+        local argtype
+        local optname
+        local prefix
+        local word
+        local dashdashseen=
+        while [[ $i -lt $len && $i -le $COMP_CWORD ]]; do
+            argtype=
+            optname=
+            prefix=
+            word=
+
+            arg=${argv[$i]}
+            trace "  consider argv[$i]: '$arg'"
+
+            if [[ "$arg" == "--" && $i -lt $COMP_CWORD ]]; then
+                trace "    dashdash seen"
+                dashdashseen=yes
+                state=arg
+                word=$arg
+            elif [[ -z "$dashdashseen" && "${arg:0:2}" == "--" ]]; then
+                arg=${arg:2}
+                if [[ "$arg" == *"="* ]]; then
+                    optname=${arg%%=*}
+                    val=${arg##*=}
+                    trace "    long opt: optname='$optname' val='$val'"
+                    state=arg
+                    argtype=$(echo "$optargs" | awk -F "-$optname=" '{print $2}' | cut -d' ' -f1)
+                    word=$val
+                    prefix="--$optname="
+                else
+                    optname=$arg
+                    val=
+                    trace "    long opt: optname='$optname'"
+                    state=longopt
+                    word=--$optname
+
+                    if [[ "$optargs" == *"-$optname="* && $i -lt $COMP_CWORD ]]; then
+                        i=$(( $i + 1 ))
+                        state=arg
+                        argtype=$(echo "$optargs" | awk -F "-$optname=" '{print $2}' | cut -d' ' -f1)
+                        word=${argv[$i]}
+                        trace "    takes arg (consume argv[$i], word='$word')"
+                    fi
+                fi
+            elif [[ -z "$dashdashseen" && "${arg:0:1}" == "-" ]]; then
+                trace "    short opt group"
+                state=shortopt
+                word=$arg
+
+                local j=1
+                while [[ $j -lt ${#arg} ]]; do
+                    optname=${arg:$j:1}
+                    trace "    consider index $j: optname '$optname'"
+
+                    if [[ "$optargs" == *"-$optname="* ]]; then
+                        argtype=$(echo "$optargs" | awk -F "-$optname=" '{print $2}' | cut -d' ' -f1)
+                        if [[ $(( $j + 1 )) -lt ${#arg} ]]; then
+                            state=arg
+                            word=${arg:$(( $j + 1 ))}
+                            trace "      takes arg (rest of this arg, word='$word', argtype='$argtype')"
+                        elif [[ $i -lt $COMP_CWORD ]]; then
+                            state=arg
+                            i=$(( $i + 1 ))
+                            word=${argv[$i]}
+                            trace "    takes arg (word='$word', argtype='$argtype')"
+                        fi
+                        break
+                    fi
+
+                    j=$(( $j + 1 ))
+                done
+            elif [[ $i -lt $COMP_CWORD && -n "$arg" ]] && $(echo "$allsubcmds" | grep -w "$arg" >/dev/null); then
+                trace "    complete subcmd: recurse _dashdash_complete"
+                _dashdash_complete $(( $i + 1 )) "${context}__${arg/-/_}"
+                return
+            else
+                trace "    not an opt or a complete subcmd"
+                state=arg
+                word=$arg
+                nargs=$(( $nargs + 1 ))
+                if [[ ${#argtypes[@]} -gt 0 ]]; then
+                    argtype="${argtypes[$(( $nargs - 1 ))]}"
+                    if [[ -z "$argtype" ]]; then
+                        # If we have more args than argtypes, we use the
+                        # last type.
+                        argtype="${argtypes[@]: -1:1}"
+                    fi
+                fi
+            fi
+
+            trace "    state=$state prefix='$prefix' word='$word'"
+            i=$(( $i + 1 ))
+        done
+
+        trace "  parsed: state=$state optname='$optname' argtype='$argtype' prefix='$prefix' word='$word' dashdashseen=$dashdashseen"
+        local compgen_opts=
+        if [[ -n "$prefix" ]]; then
+            compgen_opts="$compgen_opts -P $prefix"
+        fi
+
+        case $state in
+        shortopt)
+            compgen $compgen_opts -W "$shortopts $longopts" -- "$word"
+            ;;
+        longopt)
+            compgen $compgen_opts -W "$longopts" -- "$word"
+            ;;
+        arg)
+            # If we don't know what completion to do, then emit nothing. We
+            # expect that we are running with:
+            #       complete -o default ...
+            # where "default" means: "Use Readline's default completion if
+            # the compspec generates no matches." This gives us the good filename
+            # completion, completion in subshells/backticks.
+            #
+            # We cannot support an argtype="directory" because
+            #       compgen -S '/' -A directory -- "$word"
+            # doesn't give a satisfying result. It doesn't stop at the trailing '/'
+            # so you cannot descend into dirs.
+            if [[ "${word:0:1}" == '$' ]]; then
+                # By default, Bash will complete '$<TAB>' to all envvars. Apparently
+                # 'complete -o default' does *not* give us that. The following
+                # gets *close* to the same completions: '-A export' misses envvars
+                # like "PS1".
+                trace "  completing envvars"
+                compgen $compgen_opts -P '$' -A export -- "${word:1}"
+            elif [[ -z "$argtype" ]]; then
+                # Only include opts in completions if $word is not empty.
+                # This is to avoid completing the leading '-', which foils
+                # using 'default' completion.
+                if [[ -n "$dashdashseen" ]]; then
+                    trace "  completing subcmds, if any (no argtype, dashdash seen)"
+                    compgen $compgen_opts -W "$subcmds" -- "$word"
+                elif [[ -z "$word" ]]; then
+                    trace "  completing subcmds, if any (no argtype, empty word)"
+                    compgen $compgen_opts -W "$subcmds" -- "$word"
+                else
+                    trace "  completing opts & subcmds (no argtype)"
+                    compgen $compgen_opts -W "$shortopts $longopts $subcmds" -- "$word"
+                fi
+            elif [[ $argtype == "none" ]]; then
+                # We want *no* completions, i.e. some way to get the active
+                # 'complete -o default' to not do filename completion.
+                trace "  completing 'none' (hack to imply no completions)"
+                echo "##-no completions-##"
+            elif [[ $argtype == "file" ]]; then
+                # 'complete -o default' gives the best filename completion, at least
+                # on Mac.
+                trace "  completing 'file' (let 'complete -o default' handle it)"
+                echo ""
+            elif ! type complete_$argtype 2>/dev/null >/dev/null; then
+                trace "  completing '$argtype' (fallback to default b/c complete_$argtype is unknown)"
+                echo ""
+            else
+                trace "  completing custom '$argtype'"
+                completions=$(complete_$argtype "$word")
+                if [[ -z "$completions" ]]; then
+                    trace "  no custom '$argtype' completions"
+                    # These are in alpha order so they show up correctly.
+                    echo "##-no -$argtype- completions-##"
+                else
+                    echo $completions
+                fi
+            fi
+            ;;
+        *)
+            trace "  unknown state: $state"
+            ;;
+        esac
+    }
+
+
+    trace ""
+    trace "-- $(date)"
+    #trace "\$IFS: '$IFS'"
+    #trace "\$@: '$@'"
+    #trace "COMP_WORDBREAKS: '$COMP_WORDBREAKS'"
+    trace "COMP_CWORD: '$COMP_CWORD'"
+    trace "COMP_LINE: '$COMP_LINE'"
+    trace "COMP_POINT: $COMP_POINT"
+
+    # Guard against negative COMP_CWORD. This is a Bash bug at least on
+    # Mac 10.10.4's bash. See
+    # <https://lists.gnu.org/archive/html/bug-bash/2009-07/msg00125.html>.
+    if [[ $COMP_CWORD -lt 0 ]]; then
+        trace "abort on negative COMP_CWORD"
+        exit 1;
+    fi
+
+    # I don't know how to do array manip on argv vars,
+    # so copy over to argv array to work on them.
+    shift   # the leading '--'
+    i=0
+    len=$#
+    while [[ $# -gt 0 ]]; do
+        argv[$i]=$1
+        shift;
+        i=$(( $i + 1 ))
+    done
+    trace "argv: '${argv[@]}'"
+    trace "argv[COMP_CWORD-1]: '${argv[$(( $COMP_CWORD - 1 ))]}'"
+    trace "argv[COMP_CWORD]: '${argv[$COMP_CWORD]}'"
+    trace "argv len: '$len'"
+
+    _dashdash_complete 1 ""
+}
+
+
+# ---- mainline
+
+# Note: This if-block to help work with 'compdef' and 'compctl' is
+# adapted from 'npm completion'.
+if type complete &>/dev/null; then
+    function _{{name}}_completion {
+        local _log_file=/dev/null
+        [[ -z "$_{{name}}_log" ]] || _log_file="$_{{name}}_log"
+        COMPREPLY=($(COMP_CWORD="$COMP_CWORD" \
+            COMP_LINE="$COMP_LINE" \
+            COMP_POINT="$COMP_POINT" \
+            _{{name}}_completer -- "${COMP_WORDS[@]}" \
+            2>$_log_file)) || return $?
+    }
+    complete -o default -F _{{name}}_completion {{name}}
+elif type compdef &>/dev/null; then
+    function _{{name}}_completion {
+        local _log_file=/dev/null
+        [[ -z "$_{{name}}_log" ]] || _log_file="$_{{name}}_log"
+        compadd -- $(COMP_CWORD=$((CURRENT-1)) \
+            COMP_LINE=$BUFFER \
+            COMP_POINT=0 \
+            _{{name}}_completer -- "${words[@]}" \
+            2>$_log_file)
+    }
+    compdef _{{name}}_completion {{name}}
+elif type compctl &>/dev/null; then
+    function _{{name}}_completion {
+        local cword line point words si
+        read -Ac words
+        read -cn cword
+        let cword-=1
+        read -l line
+        read -ln point
+        local _log_file=/dev/null
+        [[ -z "$_{{name}}_log" ]] || _log_file="$_{{name}}_log"
+        reply=($(COMP_CWORD="$cword" \
+            COMP_LINE="$line" \
+            COMP_POINT="$point" \
+            _{{name}}_completer -- "${words[@]}" \
+            2>$_log_file)) || return $?
+    }
+    compctl -K _{{name}}_completion {{name}}
+fi
+
+
+##
+## This is a Bash completion file for the '{{name}}' command. You can install
+## with either:
+##
+##     cp FILE /usr/local/etc/bash_completion.d/{{name}}   # Mac
+##     cp FILE /etc/bash_completion.d/{{name}}             # Linux
+##
+## or:
+##
+##     cp FILE > ~/.{{name}}.completion
+##     echo "source ~/.{{name}}.completion" >> ~/.bashrc
+##
\ No newline at end of file
index 014b2ed..d57285a 100644 (file)
@@ -4,10 +4,11 @@
  */
 // vim: set ts=4 sts=4 sw=4 et:
 
-var p = console.log;
+var assert = require('assert-plus');
 var format = require('util').format;
+var fs = require('fs');
+var path = require('path');
 
-var assert = require('assert-plus');
 
 var DEBUG = true;
 if (DEBUG) {
@@ -20,6 +21,13 @@ if (DEBUG) {
 
 // ---- internal support stuff
 
+// Replace {{variable}} in `s` with the template data in `d`.
+function renderTemplate(s, d) {
+    return s.replace(/{{([a-zA-Z]+)}}/g, function (match, key) {
+        return d.hasOwnProperty(key) ? d[key] : match;
+    });
+}
+
 /**
  * Return a shallow copy of the given object;
  */
@@ -372,7 +380,13 @@ Parser.prototype.parse = function parse(inputs) {
             if (!opts[key]) {
                 opts[key] = [];
             }
-            opts[key].push(parsedVal);
+            if (type.arrayFlatten && Array.isArray(parsedVal)) {
+                for (var i = 0; i < parsedVal.length; i++) {
+                    opts[key].push(parsedVal[i]);
+                }
+            } else {
+                opts[key].push(parsedVal);
+            }
         } else {
             opts[key] = parsedVal;
         }
@@ -728,6 +742,186 @@ Parser.prototype.help = function help(config) {
 };
 
 
+/**
+ * Return a string suitable for a Bash completion file for this tool.
+ *
+ * @param args.name {String} The tool name.
+ * @param args.specExtra {String} Optional. Extra Bash code content to add
+ *      to the end of the "spec". Typically this is used to append Bash
+ *      "complete_TYPE" functions for custom option types. See
+ *      "examples/ddcompletion.js" for an example.
+ * @param args.argtypes {Array} Optional. Array of completion types for
+ *      positional args (i.e. non-options). E.g.
+ *          argtypes = ['fruit', 'veggie', 'file']
+ *      will result in completion of fruits for the first arg, veggies for the
+ *      second, and filenames for the third and subsequent positional args.
+ *      If not given, positional args will use Bash's 'default' completion.
+ *      See `specExtra` for providing Bash `complete_TYPE` functions, e.g.
+ *      `complete_fruit` and `complete_veggie` in this example.
+ */
+Parser.prototype.bashCompletion = function bashCompletion(args) {
+    assert.object(args, 'args');
+    assert.string(args.name, 'args.name');
+    assert.optionalString(args.specExtra, 'args.specExtra');
+    assert.optionalArrayOfString(args.argtypes, 'args.argtypes');
+
+    return bashCompletionFromOptions({
+        name: args.name,
+        specExtra: args.specExtra,
+        argtypes: args.argtypes,
+        options: this.options
+    });
+};
+
+
+// ---- Bash completion
+
+const BASH_COMPLETION_TEMPLATE_PATH = path.join(
+    __dirname, '../etc/dashdash.bash_completion.in');
+
+/**
+ * Return the Bash completion "spec" (the string value for the "{{spec}}"
+ * var in the "dashdash.bash_completion.in" template) for this tool.
+ *
+ * The "spec" is Bash code that defines the CLI options and subcmds for
+ * the template's completion code. It looks something like this:
+ *
+ *      local cmd_shortopts="-J ..."
+ *      local cmd_longopts="--help ..."
+ *      local cmd_optargs="-p=tritonprofile ..."
+ *
+ * @param args.options {Array} The array of dashdash option specs.
+ * @param args.context {String} Optional. A context string for the "local cmd*"
+ *      vars in the spec. By default it is the empty string. When used to
+ *      scope for completion on a *sub-command* (e.g. for "git log" on a "git"
+ *      tool), then it would have a value (e.g. "__log"). See
+ *      <http://github.com/trentm/node-cmdln> Bash completion for details.
+ * @param opts.includeHidden {Boolean} Optional. Default false. By default
+ *      hidden options and subcmds are "excluded". Here excluded means they
+ *      won't be offered as a completion, but if used, their argument type
+ *      will be completed. "Hidden" options and subcmds are ones with the
+ *      `hidden: true` attribute to exclude them from default help output.
+ * @param args.argtypes {Array} Optional. Array of completion types for
+ *      positional args (i.e. non-options). E.g.
+ *          argtypes = ['fruit', 'veggie', 'file']
+ *      will result in completion of fruits for the first arg, veggies for the
+ *      second, and filenames for the third and subsequent positional args.
+ *      If not given, positional args will use Bash's 'default' completion.
+ *      See `specExtra` for providing Bash `complete_TYPE` functions, e.g.
+ *      `complete_fruit` and `complete_veggie` in this example.
+ */
+function bashCompletionSpecFromOptions(args) {
+    assert.object(args, 'args');
+    assert.object(args.options, 'args.options');
+    assert.optionalString(args.context, 'args.context');
+    assert.optionalBool(args.includeHidden, 'args.includeHidden');
+    assert.optionalArrayOfString(args.argtypes, 'args.argtypes');
+
+    var context = args.context || '';
+    var includeHidden = (args.includeHidden === undefined
+        ? false : args.includeHidden);
+
+    var spec = [];
+    var shortopts = [];
+    var longopts = [];
+    var optargs = [];
+    (args.options || []).forEach(function (o) {
+        if (o.group) {
+            // Skip group headers.
+            return;
+        }
+
+        var optNames = o.names || [o.name];
+        var optType = getOptionType(o.type);
+        if (optType.takesArg) {
+            var completionType = o.completionType ||
+                optType.completionType || o.type;
+            optNames.forEach(function (optName) {
+                if (optName.length === 1) {
+                    if (includeHidden || !o.hidden) {
+                        shortopts.push('-' + optName);
+                    }
+                    // Include even hidden options in `optargs` so that bash
+                    // completion of its arg still works.
+                    optargs.push('-' + optName + '=' + completionType);
+                } else {
+                    if (includeHidden || !o.hidden) {
+                        longopts.push('--' + optName);
+                    }
+                    optargs.push('--' + optName + '=' + completionType);
+                }
+            });
+        } else {
+            optNames.forEach(function (optName) {
+                if (includeHidden || !o.hidden) {
+                    if (optName.length === 1) {
+                        shortopts.push('-' + optName);
+                    } else {
+                        longopts.push('--' + optName);
+                    }
+                }
+            });
+        }
+    });
+
+    spec.push(format('local cmd%s_shortopts="%s"',
+        context, shortopts.sort().join(' ')));
+    spec.push(format('local cmd%s_longopts="%s"',
+        context, longopts.sort().join(' ')));
+    spec.push(format('local cmd%s_optargs="%s"',
+        context, optargs.sort().join(' ')));
+    if (args.argtypes) {
+        spec.push(format('local cmd%s_argtypes="%s"',
+            context, args.argtypes.join(' ')));
+    }
+    return spec.join('\n');
+}
+
+
+/**
+ * Return a string suitable for a Bash completion file for this tool.
+ *
+ * @param args.name {String} The tool name.
+ * @param args.options {Array} The array of dashdash option specs.
+ * @param args.specExtra {String} Optional. Extra Bash code content to add
+ *      to the end of the "spec". Typically this is used to append Bash
+ *      "complete_TYPE" functions for custom option types. See
+ *      "examples/ddcompletion.js" for an example.
+ * @param args.argtypes {Array} Optional. Array of completion types for
+ *      positional args (i.e. non-options). E.g.
+ *          argtypes = ['fruit', 'veggie', 'file']
+ *      will result in completion of fruits for the first arg, veggies for the
+ *      second, and filenames for the third and subsequent positional args.
+ *      If not given, positional args will use Bash's 'default' completion.
+ *      See `specExtra` for providing Bash `complete_TYPE` functions, e.g.
+ *      `complete_fruit` and `complete_veggie` in this example.
+ */
+function bashCompletionFromOptions(args) {
+    assert.object(args, 'args');
+    assert.object(args.options, 'args.options');
+    assert.string(args.name, 'args.name');
+    assert.optionalString(args.specExtra, 'args.specExtra');
+    assert.optionalArrayOfString(args.argtypes, 'args.argtypes');
+
+    // Gather template data.
+    var data = {
+        name: args.name,
+        date: new Date(),
+        spec: bashCompletionSpecFromOptions({
+            options: args.options,
+            argtypes: args.argtypes
+        }),
+    };
+    if (args.specExtra) {
+        data.spec += '\n\n' + args.specExtra;
+    }
+
+    // Render template.
+    var template = fs.readFileSync(BASH_COMPLETION_TEMPLATE_PATH, 'utf8');
+    return renderTemplate(template, data);
+}
+
+
 
 // ---- exports
 
@@ -773,6 +967,7 @@ function parse(config) {
  *      - array {Boolean} Optional. Set to true if this is an 'arrayOf' type
  *        that collects multiple usages of the option in process.argv and
  *        puts results in an array.
+ *      - arrayFlatten {Boolean} Optional. XXX
  *      - default Optional. Default value for options of this type, if no
  *        default is specified in the option type usage.
  */
@@ -785,22 +980,36 @@ function addOptionType(optionType) {
     }
     assert.func(optionType.parseArg, 'optionType.parseArg');
     assert.optionalBool(optionType.array, 'optionType.array');
+    assert.optionalBool(optionType.arrayFlatten, 'optionType.arrayFlatten');
 
     optionTypes[optionType.name] = {
         takesArg: optionType.takesArg,
         helpArg: optionType.helpArg,
         parseArg: optionType.parseArg,
         array: optionType.array,
+        arrayFlatten: optionType.arrayFlatten,
         default: optionType.default
     }
 }
 
 
+function getOptionType(name) {
+    assert.string(name, 'name');
+    return optionTypes[name];
+}
+
+
 module.exports = {
     createParser: createParser,
     Parser: Parser,
     parse: parse,
     addOptionType: addOptionType,
+    getOptionType: getOptionType,
+
+    // Bash completion-related exports
+    BASH_COMPLETION_TEMPLATE_PATH: BASH_COMPLETION_TEMPLATE_PATH,
+    bashCompletionFromOptions: bashCompletionFromOptions,
+    bashCompletionSpecFromOptions: bashCompletionSpecFromOptions,
 
     // Export the parseFoo parsers because they might be useful as primitives
     // for custom option types.
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/README.md
deleted file mode 100644 (file)
index c0c3a53..0000000
+++ /dev/null
@@ -1,126 +0,0 @@
-# node-assert-plus
-
-This library is a super small wrapper over node's assert module that has two
-things: (1) the ability to disable assertions with the environment variable
-NODE_NDEBUG, and (2) some API wrappers for argument testing.  Like
-`assert.string(myArg, 'myArg')`.  As a simple example, most of my code looks
-like this:
-
-    var assert = require('assert-plus');
-
-    function fooAccount(options, callback) {
-           assert.object(options, 'options');
-               assert.number(options.id, 'options.id);
-               assert.bool(options.isManager, 'options.isManager');
-               assert.string(options.name, 'options.name');
-               assert.arrayOfString(options.email, 'options.email');
-               assert.func(callback, 'callback');
-
-        // Do stuff
-               callback(null, {});
-    }
-
-# API
-
-All methods that *aren't* part of node's core assert API are simply assumed to
-take an argument, and then a string 'name' that's not a message; `AssertionError`
-will be thrown if the assertion fails with a message like:
-
-    AssertionError: foo (string) is required
-       at test (/home/mark/work/foo/foo.js:3:9)
-       at Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)
-       at Module._compile (module.js:446:26)
-       at Object..js (module.js:464:10)
-       at Module.load (module.js:353:31)
-       at Function._load (module.js:311:12)
-       at Array.0 (module.js:484:10)
-       at EventEmitter._tickCallback (node.js:190:38)
-
-from:
-
-    function test(foo) {
-           assert.string(foo, 'foo');
-    }
-
-There you go.  You can check that arrays are of a homogenous type with `Arrayof$Type`:
-
-    function test(foo) {
-           assert.arrayOfString(foo, 'foo');
-    }
-
-You can assert IFF an argument is not `undefined` (i.e., an optional arg):
-
-    assert.optionalString(foo, 'foo');
-
-Lastly, you can opt-out of assertion checking altogether by setting the
-environment variable `NODE_NDEBUG=1`.  This is pseudo-useful if you have
-lots of assertions, and don't want to pay `typeof ()` taxes to v8 in
-production.
-
-The complete list of APIs is:
-
-* assert.bool
-* assert.buffer
-* assert.func
-* assert.number
-* assert.object
-* assert.string
-* assert.arrayOfBool
-* assert.arrayOfFunc
-* assert.arrayOfNumber
-* assert.arrayOfObject
-* assert.arrayOfString
-* assert.optionalBool
-* assert.optionalBuffer
-* assert.optionalFunc
-* assert.optionalNumber
-* assert.optionalObject
-* assert.optionalString
-* assert.optionalArrayOfBool
-* assert.optionalArrayOfFunc
-* assert.optionalArrayOfNumber
-* assert.optionalArrayOfObject
-* assert.optionalArrayOfString
-* assert.AssertionError
-* assert.fail
-* assert.ok
-* assert.equal
-* assert.notEqual
-* assert.deepEqual
-* assert.notDeepEqual
-* assert.strictEqual
-* assert.notStrictEqual
-* assert.throws
-* assert.doesNotThrow
-* assert.ifError
-
-# Installation
-
-    npm install assert-plus
-
-## License
-
-The MIT License (MIT)
-Copyright (c) 2012 Mark Cavage
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
-FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
-AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
-LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
-OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
-SOFTWARE.
-
-## Bugs
-
-See <https://github.com/mcavage/node-assert-plus/issues>.
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/assert.js
deleted file mode 100644 (file)
index ff2ba02..0000000
+++ /dev/null
@@ -1,245 +0,0 @@
-// Copyright (c) 2012, Mark Cavage. All rights reserved.
-
-var assert = require('assert');
-var Stream = require('stream').Stream;
-var util = require('util');
-
-
-
-///--- Globals
-
-var NDEBUG = process.env.NODE_NDEBUG || false;
-var UUID_REGEXP = /^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12}$/;
-
-
-
-///--- Messages
-
-var ARRAY_TYPE_REQUIRED = '%s ([%s]) required';
-var TYPE_REQUIRED = '%s (%s) is required';
-
-
-
-///--- Internal
-
-function capitalize(str) {
-        return (str.charAt(0).toUpperCase() + str.slice(1));
-}
-
-function uncapitalize(str) {
-        return (str.charAt(0).toLowerCase() + str.slice(1));
-}
-
-function _() {
-        return (util.format.apply(util, arguments));
-}
-
-
-function _assert(arg, type, name, stackFunc) {
-        if (!NDEBUG) {
-                name = name || type;
-                stackFunc = stackFunc || _assert.caller;
-                var t = typeof (arg);
-
-                if (t !== type) {
-                        throw new assert.AssertionError({
-                                message: _(TYPE_REQUIRED, name, type),
-                                actual: t,
-                                expected: type,
-                                operator: '===',
-                                stackStartFunction: stackFunc
-                        });
-                }
-        }
-}
-
-
-function _instanceof(arg, type, name, stackFunc) {
-        if (!NDEBUG) {
-                name = name || type;
-                stackFunc = stackFunc || _instanceof.caller;
-
-                if (!(arg instanceof type)) {
-                        throw new assert.AssertionError({
-                                message: _(TYPE_REQUIRED, name, type.name),
-                                actual: _getClass(arg),
-                                expected: type.name,
-                                operator: 'instanceof',
-                                stackStartFunction: stackFunc
-                        });
-                }
-        }
-}
-
-function _getClass(object) {
-        return (Object.prototype.toString.call(object).slice(8, -1));
-};
-
-
-
-///--- API
-
-function array(arr, type, name) {
-        if (!NDEBUG) {
-                name = name || type;
-
-                if (!Array.isArray(arr)) {
-                        throw new assert.AssertionError({
-                                message: _(ARRAY_TYPE_REQUIRED, name, type),
-                                actual: typeof (arr),
-                                expected: 'array',
-                                operator: 'Array.isArray',
-                                stackStartFunction: array.caller
-                        });
-                }
-
-                for (var i = 0; i < arr.length; i++) {
-                        _assert(arr[i], type, name, array);
-                }
-        }
-}
-
-
-function bool(arg, name) {
-        _assert(arg, 'boolean', name, bool);
-}
-
-
-function buffer(arg, name) {
-        if (!Buffer.isBuffer(arg)) {
-                throw new assert.AssertionError({
-                        message: _(TYPE_REQUIRED, name || '', 'Buffer'),
-                        actual: typeof (arg),
-                        expected: 'buffer',
-                        operator: 'Buffer.isBuffer',
-                        stackStartFunction: buffer
-                });
-        }
-}
-
-
-function func(arg, name) {
-        _assert(arg, 'function', name);
-}
-
-
-function number(arg, name) {
-        _assert(arg, 'number', name);
-        if (!NDEBUG && (isNaN(arg) || !isFinite(arg))) {
-                throw new assert.AssertionError({
-                        message: _(TYPE_REQUIRED, name, 'number'),
-                        actual: arg,
-                        expected: 'number',
-                        operator: 'isNaN',
-                        stackStartFunction: number
-                });
-        }
-}
-
-
-function object(arg, name) {
-        _assert(arg, 'object', name);
-}
-
-
-function stream(arg, name) {
-        _instanceof(arg, Stream, name);
-}
-
-
-function date(arg, name) {
-        _instanceof(arg, Date, name);
-}
-
-function regexp(arg, name) {
-        _instanceof(arg, RegExp, name);
-}
-
-
-function string(arg, name) {
-        _assert(arg, 'string', name);
-}
-
-
-function uuid(arg, name) {
-        string(arg, name);
-        if (!NDEBUG && !UUID_REGEXP.test(arg)) {
-                throw new assert.AssertionError({
-                        message: _(TYPE_REQUIRED, name, 'uuid'),
-                        actual: 'string',
-                        expected: 'uuid',
-                        operator: 'test',
-                        stackStartFunction: uuid
-                });
-        }
-}
-
-
-///--- Exports
-
-module.exports = {
-        bool: bool,
-        buffer: buffer,
-        date: date,
-        func: func,
-        number: number,
-        object: object,
-        regexp: regexp,
-        stream: stream,
-        string: string,
-        uuid: uuid
-};
-
-
-Object.keys(module.exports).forEach(function (k) {
-        if (k === 'buffer')
-                return;
-
-        var name = 'arrayOf' + capitalize(k);
-
-        if (k === 'bool')
-                k = 'boolean';
-        if (k === 'func')
-                k = 'function';
-        module.exports[name] = function (arg, name) {
-                array(arg, k, name);
-        };
-});
-
-Object.keys(module.exports).forEach(function (k) {
-        var _name = 'optional' + capitalize(k);
-        var s = uncapitalize(k.replace('arrayOf', ''));
-        if (s === 'bool')
-                s = 'boolean';
-        if (s === 'func')
-                s = 'function';
-
-        if (k.indexOf('arrayOf') !== -1) {
-          module.exports[_name] = function (arg, name) {
-                  if (!NDEBUG && arg !== undefined) {
-                          array(arg, s, name);
-                  }
-          };
-        } else {
-          module.exports[_name] = function (arg, name) {
-                  if (!NDEBUG && arg !== undefined) {
-                          _assert(arg, s, name);
-                  }
-          };
-        }
-});
-
-
-// Reexport built-in assertions
-Object.keys(assert).forEach(function (k) {
-        if (k === 'AssertionError') {
-                module.exports[k] = assert[k];
-                return;
-        }
-
-        module.exports[k] = function () {
-                if (!NDEBUG) {
-                        assert[k].apply(assert[k], arguments);
-                }
-        };
-});
diff --git a/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json b/deps/npm/node_modules/request/node_modules/http-signature/node_modules/sshpk/node_modules/dashdash/node_modules/assert-plus/package.json
deleted file mode 100644 (file)
index 6a34557..0000000
+++ /dev/null
@@ -1,30 +0,0 @@
-{
-  "author": {
-    "name": "Mark Cavage",
-    "email": "mcavage@gmail.com"
-  },
-  "name": "assert-plus",
-  "description": "Extra assertions on top of node's assert module",
-  "version": "0.1.5",
-  "main": "./assert.js",
-  "devDependencies": {},
-  "optionalDependencies": {},
-  "repository": {
-    "type": "git",
-    "url": "git+https://github.com/mcavage/node-assert-plus.git"
-  },
-  "engines": {
-    "node": ">=0.8"
-  },
-  "readme": "# node-assert-plus\n\nThis library is a super small wrapper over node's assert module that has two\nthings: (1) the ability to disable assertions with the environment variable\nNODE_NDEBUG, and (2) some API wrappers for argument testing.  Like\n`assert.string(myArg, 'myArg')`.  As a simple example, most of my code looks\nlike this:\n\n    var assert = require('assert-plus');\n\n    function fooAccount(options, callback) {\n\t    assert.object(options, 'options');\n\t\tassert.number(options.id, 'options.id);\n\t\tassert.bool(options.isManager, 'options.isManager');\n\t\tassert.string(options.name, 'options.name');\n\t\tassert.arrayOfString(options.email, 'options.email');\n\t\tassert.func(callback, 'callback');\n\n        // Do stuff\n\t\tcallback(null, {});\n    }\n\n# API\n\nAll methods that *aren't* part of node's core assert API are simply assumed to\ntake an argument, and then a string 'name' that's not a message; `AssertionError`\nwill be thrown if the assertion fails with a message like:\n\n    AssertionError: foo (string) is required\n\tat test (/home/mark/work/foo/foo.js:3:9)\n\tat Object.<anonymous> (/home/mark/work/foo/foo.js:15:1)\n\tat Module._compile (module.js:446:26)\n\tat Object..js (module.js:464:10)\n\tat Module.load (module.js:353:31)\n\tat Function._load (module.js:311:12)\n\tat Array.0 (module.js:484:10)\n\tat EventEmitter._tickCallback (node.js:190:38)\n\nfrom:\n\n    function test(foo) {\n\t    assert.string(foo, 'foo');\n    }\n\nThere you go.  You can check that arrays are of a homogenous type with `Arrayof$Type`:\n\n    function test(foo) {\n\t    assert.arrayOfString(foo, 'foo');\n    }\n\nYou can assert IFF an argument is not `undefined` (i.e., an optional arg):\n\n    assert.optionalString(foo, 'foo');\n\nLastly, you can opt-out of assertion checking altogether by setting the\nenvironment variable `NODE_NDEBUG=1`.  This is pseudo-useful if you have\nlots of assertions, and don't want to pay `typeof ()` taxes to v8 in\nproduction.\n\nThe complete list of APIs is:\n\n* assert.bool\n* assert.buffer\n* assert.func\n* assert.number\n* assert.object\n* assert.string\n* assert.arrayOfBool\n* assert.arrayOfFunc\n* assert.arrayOfNumber\n* assert.arrayOfObject\n* assert.arrayOfString\n* assert.optionalBool\n* assert.optionalBuffer\n* assert.optionalFunc\n* assert.optionalNumber\n* assert.optionalObject\n* assert.optionalString\n* assert.optionalArrayOfBool\n* assert.optionalArrayOfFunc\n* assert.optionalArrayOfNumber\n* assert.optionalArrayOfObject\n* assert.optionalArrayOfString\n* assert.AssertionError\n* assert.fail\n* assert.ok\n* assert.equal\n* assert.notEqual\n* assert.deepEqual\n* assert.notDeepEqual\n* assert.strictEqual\n* assert.notStrictEqual\n* assert.throws\n* assert.doesNotThrow\n* assert.ifError\n\n# Installation\n\n    npm install assert-plus\n\n## License\n\nThe MIT License (MIT)\nCopyright (c) 2012 Mark Cavage\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of\nthis software and associated documentation files (the \"Software\"), to deal in\nthe Software without restriction, including without limitation the rights to\nuse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\nthe Software, and to permit persons to whom the Software is furnished to do so,\nsubject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\nSOFTWARE.\n\n## Bugs\n\nSee <https://github.com/mcavage/node-assert-plus/issues>.\n",
-  "readmeFilename": "README.md",
-  "bugs": {
-    "url": "https://github.com/mcavage/node-assert-plus/issues"
-  },
-  "homepage": "https://github.com/mcavage/node-assert-plus#readme",
-  "dependencies": {},
-  "_id": "assert-plus@0.1.5",
-  "_shasum": "ee74009413002d84cec7219c6ac811812e723160",
-  "_resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-0.1.5.tgz",
-  "_from": "assert-plus@>=0.1.0 <0.2.0"
-}
index 4aee12e..eb2061d 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "dashdash",
   "description": "A light, featureful and explicit option parsing library.",
-  "version": "1.10.1",
+  "version": "1.12.2",
   "author": {
     "name": "Trent Mick",
     "email": "trentm@gmail.com",
@@ -13,7 +13,9 @@
     "parsing",
     "cli",
     "command",
-    "args"
+    "args",
+    "bash",
+    "completion"
   ],
   "repository": {
     "type": "git",
@@ -21,7 +23,7 @@
   },
   "main": "./lib/dashdash.js",
   "dependencies": {
-    "assert-plus": "0.1.x"
+    "assert-plus": "^0.2.0"
   },
   "devDependencies": {
     "nodeunit": "0.9.x"
     "test": "nodeunit test/*.test.js"
   },
   "license": "MIT",
-  "readme": "A light, featureful and explicit option parsing library for node.js.\n\n[Why another one? See below](#why). tl;dr: The others I've tried are one of\ntoo loosey goosey (not explicit), too big/too many deps, or ill specified.\nYMMV.\n\nFollow <a href=\"https://twitter.com/intent/user?screen_name=trentmick\" target=\"_blank\">@trentmick</a>\nfor updates to node-dashdash.\n\n# Install\n\n    npm install dashdash\n\n\n# Usage\n\n```javascript\nvar dashdash = require('dashdash');\n\n// Specify the options. Minimally `name` (or `names`) and `type`\n// must be given for each.\nvar options = [\n    {\n        // `names` or a single `name`. First element is the `opts.KEY`.\n        names: ['help', 'h'],\n        // See \"Option specs\" below for types.\n        type: 'bool',\n        help: 'Print this help and exit.'\n    }\n];\n\n// Shortcut form. As called it infers `process.argv`. See below for\n// the longer form to use methods like `.help()` on the Parser object.\nvar opts = dashdash.parse({options: options});\n\nconsole.log(\"opts:\", opts);\nconsole.log(\"args:\", opts._args);\n```\n\n\n# Longer Example\n\nA more realistic [starter script \"foo.js\"](./examples/foo.js) is as follows.\nThis also shows using `parser.help()` for formatted option help.\n\n```javascript\nvar dashdash = require('./lib/dashdash');\n\nvar options = [\n    {\n        name: 'version',\n        type: 'bool',\n        help: 'Print tool version and exit.'\n    },\n    {\n        names: ['help', 'h'],\n        type: 'bool',\n        help: 'Print this help and exit.'\n    },\n    {\n        names: ['verbose', 'v'],\n        type: 'arrayOfBool',\n        help: 'Verbose output. Use multiple times for more verbose.'\n    },\n    {\n        names: ['file', 'f'],\n        type: 'string',\n        help: 'File to process',\n        helpArg: 'FILE'\n    }\n];\n\nvar parser = dashdash.createParser({options: options});\ntry {\n    var opts = parser.parse(process.argv);\n} catch (e) {\n    console.error('foo: error: %s', e.message);\n    process.exit(1);\n}\n\nconsole.log(\"# opts:\", opts);\nconsole.log(\"# args:\", opts._args);\n\n// Use `parser.help()` for formatted options help.\nif (opts.help) {\n    var help = parser.help({includeEnv: true}).trimRight();\n    console.log('usage: node foo.js [OPTIONS]\\n'\n                + 'options:\\n'\n                + help);\n    process.exit(0);\n}\n\n// ...\n```\n\n\nSome example output from this script (foo.js):\n\n```\n$ node foo.js -h\n# opts: { help: true,\n  _order: [ { name: 'help', value: true, from: 'argv' } ],\n  _args: [] }\n# args: []\nusage: node foo.js [OPTIONS]\noptions:\n    --version             Print tool version and exit.\n    -h, --help            Print this help and exit.\n    -v, --verbose         Verbose output. Use multiple times for more verbose.\n    -f FILE, --file=FILE  File to process\n\n$ node foo.js -v\n# opts: { verbose: [ true ],\n  _order: [ { name: 'verbose', value: true, from: 'argv' } ],\n  _args: [] }\n# args: []\n\n$ node foo.js --version arg1\n# opts: { version: true,\n  _order: [ { name: 'version', value: true, from: 'argv' } ],\n  _args: [ 'arg1' ] }\n# args: [ 'arg1' ]\n\n$ node foo.js -f bar.txt\n# opts: { file: 'bar.txt',\n  _order: [ { name: 'file', value: 'bar.txt', from: 'argv' } ],\n  _args: [] }\n# args: []\n\n$ node foo.js -vvv --file=blah\n# opts: { verbose: [ true, true, true ],\n  file: 'blah',\n  _order:\n   [ { name: 'verbose', value: true, from: 'argv' },\n     { name: 'verbose', value: true, from: 'argv' },\n     { name: 'verbose', value: true, from: 'argv' },\n     { name: 'file', value: 'blah', from: 'argv' } ],\n  _args: [] }\n# args: []\n```\n\n\nSee the [\"examples\"](examples/) dir for a number of starter examples using\nsome of dashdash's features.\n\n\n# Environment variable integration\n\nIf you want to allow environment variables to specify options to your tool,\ndashdash makes this easy. We can change the 'verbose' option in the example\nabove to include an 'env' field:\n\n```javascript\n    {\n        names: ['verbose', 'v'],\n        type: 'arrayOfBool',\n        env: 'FOO_VERBOSE',         // <--- add this line\n        help: 'Verbose output. Use multiple times for more verbose.'\n    },\n```\n\nthen the **\"FOO_VERBOSE\" environment variable** can be used to set this\noption:\n\n```shell\n$ FOO_VERBOSE=1 node foo.js\n# opts: { verbose: [ true ],\n  _order: [ { name: 'verbose', value: true, from: 'env' } ],\n  _args: [] }\n# args: []\n```\n\nBoolean options will interpret the empty string as unset, '0' as false\nand anything else as true.\n\n```shell\n$ FOO_VERBOSE= node examples/foo.js                 # not set\n# opts: { _order: [], _args: [] }\n# args: []\n\n$ FOO_VERBOSE=0 node examples/foo.js                # '0' is false\n# opts: { verbose: [ false ],\n  _order: [ { key: 'verbose', value: false, from: 'env' } ],\n  _args: [] }\n# args: []\n\n$ FOO_VERBOSE=1 node examples/foo.js                # true\n# opts: { verbose: [ true ],\n  _order: [ { key: 'verbose', value: true, from: 'env' } ],\n  _args: [] }\n# args: []\n\n$ FOO_VERBOSE=boogabooga node examples/foo.js       # true\n# opts: { verbose: [ true ],\n  _order: [ { key: 'verbose', value: true, from: 'env' } ],\n  _args: [] }\n# args: []\n```\n\nNon-booleans can be used as well. Strings:\n\n```shell\n$ FOO_FILE=data.txt node examples/foo.js\n# opts: { file: 'data.txt',\n  _order: [ { key: 'file', value: 'data.txt', from: 'env' } ],\n  _args: [] }\n# args: []\n```\n\nNumbers:\n\n```shell\n$ FOO_TIMEOUT=5000 node examples/foo.js\n# opts: { timeout: 5000,\n  _order: [ { key: 'timeout', value: 5000, from: 'env' } ],\n  _args: [] }\n# args: []\n\n$ FOO_TIMEOUT=blarg node examples/foo.js\nfoo: error: arg for \"FOO_TIMEOUT\" is not a positive integer: \"blarg\"\n```\n\nWith the `includeEnv: true` config to `parser.help()` the environment\nvariable can also be included in **help output**:\n\n    usage: node foo.js [OPTIONS]\n    options:\n        --version             Print tool version and exit.\n        -h, --help            Print this help and exit.\n        -v, --verbose         Verbose output. Use multiple times for more verbose.\n                              Environment: FOO_VERBOSE=1\n        -f FILE, --file=FILE  File to process\n\n\n# Parser config\n\nParser construction (i.e. `dashdash.createParser(CONFIG)`) takes the\nfollowing fields:\n\n- `options` (Array of option specs). Required. See the\n  [Option specs](#option-specs) section below.\n\n- `interspersed` (Boolean). Optional. Default is true. If true this allows\n  interspersed arguments and options. I.e.:\n\n        node ./tool.js -v arg1 arg2 -h   # '-h' is after interspersed args\n\n  Set it to false to have '-h' **not** get parsed as an option in the above\n  example.\n\n- `allowUnknown` (Boolean).  Optional.  Default is false.  If false, this causes\n  unknown arguments to throw an error.  I.e.:\n\n        node ./tool.js -v arg1 --afe8asefksjefhas\n\n  Set it to true to treat the unknown option as a positional\n  argument.\n\n  **Caveat**: When a shortopt group, such as `-xaz` contains a mix of\n  known and unknown options, the *entire* group is passed through\n  unmolested as a positional argument.\n\n  Consider if you have a known short option `-a`, and parse the\n  following command line:\n\n        node ./tool.js -xaz\n\n  where `-x` and `-z` are unknown.  There are multiple ways to\n  interpret this:\n\n    1. `-x` takes a value: `{x: 'az'}`\n    2. `-x` and `-z` are both booleans: `{x:true,a:true,z:true}`\n\n  Since dashdash does not know what `-x` and `-z` are, it can't know\n  if you'd prefer to receive `{a:true,_args:['-x','-z']}` or\n  `{x:'az'}`, or `{_args:['-xaz']}`. Leaving the positional arg unprocessed\n  is the easiest mistake for the user to recover from.\n\n\n# Option specs\n\nExample using all fields:\n\n```javascript\n{\n    names: ['file', 'f'],       // Required (or `name`).\n    type: 'string',             // Required.\n    env: 'MYTOOL_FILE',\n    help: 'Config file to load before running \"mytool\"',\n    helpArg: 'PATH',\n    helpWrap: false,\n    default: path.resolve(process.env.HOME, '.mytoolrc')\n}\n```\n\nEach option spec in the `options` array must/can have the following fields:\n\n- `name` (String) or `names` (Array). Required. These give the option name\n  and aliases. The first name (if more than one given) is the key for the\n  parsed `opts` object.\n\n- `type` (String). Required. One of:\n\n    - bool\n    - string\n    - number\n    - integer\n    - positiveInteger\n    - date (epoch seconds, e.g. 1396031701, or ISO 8601 format\n      `YYYY-MM-DD[THH:MM:SS[.sss][Z]]`, e.g. \"2014-03-28T18:35:01.489Z\")\n    - arrayOfBool\n    - arrayOfString\n    - arrayOfNumber\n    - arrayOfInteger\n    - arrayOfPositiveInteger\n    - arrayOfDate\n\n  FWIW, these names attempt to match with asserts on\n  [assert-plus](https://github.com/mcavage/node-assert-plus).\n  You can add your own custom option types with `dashdash.addOptionType`.\n  See below.\n\n- `env` (String or Array of String). Optional. An environment variable name\n  (or names) that can be used as a fallback for this option. For example,\n  given a \"foo.js\" like this:\n\n        var options = [{names: ['dry-run', 'n'], env: 'FOO_DRY_RUN'}];\n        var opts = dashdash.parse({options: options});\n\n  Both `node foo.js --dry-run` and `FOO_DRY_RUN=1 node foo.js` would result\n  in `opts.dry_run = true`.\n\n  An environment variable is only used as a fallback, i.e. it is ignored if\n  the associated option is given in `argv`.\n\n- `help` (String). Optional. Used for `parser.help()` output.\n\n- `helpArg` (String). Optional. Used in help output as the placeholder for\n  the option argument, e.g. the \"PATH\" in:\n\n        ...\n        -f PATH, --file=PATH    File to process\n        ...\n\n- `helpWrap` (Boolean). Optional, default true. Set this to `false` to have\n  that option's `help` *not* be text wrapped in `<parser>.help()` output.\n\n- `default`. Optional. A default value used for this option, if the\n  option isn't specified in argv.\n\n- `hidden` (Boolean). Optional, default false. If true, help output will not\n  include this option.\n\n\n# Option group headings\n\nYou can add headings between option specs in the `options` array.  To do so,\nsimply add an object with only a `group` property -- the string to print as\nthe heading for the subsequent options in the array.  For example:\n\n```javascript\nvar options = [\n    {\n        group: 'Armament Options'\n    },\n    {\n        names: [ 'weapon', 'w' ],\n        type: 'string'\n    },\n    {\n        group: 'General Options'\n    },\n    {\n        names: [ 'help', 'h' ],\n        type: 'bool'\n    }\n];\n...\n```\n\nNote: You can use an empty string, `{group: ''}`, to get a blank line in help\noutput between groups of options.\n\n\n# Help config\n\nThe `parser.help(...)` function is configurable as follows:\n\n        Options:\n          Armament Options:\n        ^^  -w WEAPON, --weapon=WEAPON  Weapon with which to crush. One of: |\n       /                                sword, spear, maul                  |\n      /   General Options:                                                  |\n     /      -h, --help                  Print this help and exit.           |\n    /   ^^^^                            ^                                   |\n    \\       `-- indent                   `-- helpCol              maxCol ---'\n     `-- headingIndent\n\n- `indent` (Number or String). Default 4. Set to a number (for that many\n  spaces) or a string for the literal indent.\n- `headingIndent` (Number or String). Default half length of `indent`. Set to\n  a number (for that many spaces) or a string for the literal indent. This\n  indent applies to group heading lines, between normal option lines.\n- `nameSort` (String). Default is 'length'. By default the names are\n  sorted to put the short opts first (i.e. '-h, --help' preferred\n  to '--help, -h'). Set to 'none' to not do this sorting.\n- `maxCol` (Number). Default 80. Note that reflow is just done on whitespace\n  so a long token in the option help can overflow maxCol.\n- `helpCol` (Number). If not set a reasonable value will be determined\n  between `minHelpCol` and `maxHelpCol`.\n- `minHelpCol` (Number). Default 20.\n- `maxHelpCol` (Number). Default 40.\n- `helpWrap` (Boolean). Default true. Set to `false` to have option `help`\n  strings *not* be textwrapped to the helpCol..maxCol range.\n- `includeEnv` (Boolean). Default false. If the option has associated\n  environment variables (via the `env` option spec attribute), then\n  append mentioned of those envvars to the help string.\n- `includeDefault` (Boolean). Default false. If the option has a default value\n  (via the `default` option spec attribute, or a default on the option's type),\n  then a \"Default: VALUE\" string will be appended to the help string.\n\n\n# Custom option types\n\nDashdash includes a good starter set of option types that it will parse for\nyou. However you can add your own via:\n\n    var dashdash = require('dashdash');\n    dashdash.addOptionType({\n        name: '...',\n        takesArg: true,\n        helpArg: '...',\n        parseArg: function (option, optstr, arg) {\n            ...\n        },\n        default: ...   // optional\n    });\n\nFor example, a simple option type that accepts 'yes', 'y', 'no' or 'n' as\na boolean argument would look like:\n\n    var dashdash = require('dashdash');\n\n    function parseYesNo(option, optstr, arg) {\n        var argLower = arg.toLowerCase()\n        if (~['yes', 'y'].indexOf(argLower)) {\n            return true;\n        } else if (~['no', 'n'].indexOf(argLower)) {\n            return false;\n        } else {\n            throw new Error(format(\n                'arg for \"%s\" is not \"yes\" or \"no\": \"%s\"',\n                optstr, arg));\n        }\n    }\n\n    dashdash.addOptionType({\n        name: 'yesno'\n        takesArg: true,\n        helpArg: '<yes|no>',\n        parseArg: parseYesNo\n    });\n\n    var options = {\n        {names: ['answer', 'a'], type: 'yesno'}\n    };\n    var opts = dashdash.parse({options: options});\n\nSee \"examples/custom-option-duration.js\" for another example adding a \"duration\"\noption type. Please let me know [on twitter](https://twitter.com/trentmick)\nor [with an issue](https://github.com/trentm/node-dashdash/issues/new) if you\nwrite a generally useful one.\n\n\n\n# Why\n\nWhy another node.js option parsing lib?\n\n- `nopt` really is just for \"tools like npm\". Implicit opts (e.g. '--no-foo'\n  works for every '--foo'). Can't disable abbreviated opts. Can't do multiple\n  usages of same opt, e.g. '-vvv' (I think). Can't do grouped short opts.\n\n- `optimist` has surprise interpretation of options (at least to me).\n  Implicit opts mean ambiguities and poor error handling for fat-fingering.\n  `process.exit` calls makes it hard to use as a libary.\n\n- `optparse` Incomplete docs. Is this an attempted clone of Python's `optparse`.\n  Not clear. Some divergence. `parser.on(\"name\", ...)` API is weird.\n\n- `argparse` Dep on underscore. No thanks just for option processing.\n  `find lib | wc -l` -> `26`. Overkill.\n  Argparse is a bit different anyway. Not sure I want that.\n\n- `posix-getopt` No type validation. Though that isn't a killer. AFAIK can't\n  have a long opt without a short alias. I.e. no `getopt_long` semantics.\n  Also, no whizbang features like generated help output.\n\n- [\"commander.js\"](https://github.com/visionmedia/commander.js): I wrote\n  [a critique](http://trentm.com/2014/01/a-critique-of-commander-for-nodejs.html)\n  a while back. It seems fine, but last I checked had\n  [an outstanding bug](https://github.com/visionmedia/commander.js/pull/121)\n  that would prevent me from using it.\n\n\n# License\n\nMIT. See LICENSE.txt.\n",
-  "readmeFilename": "README.md",
+  "contributors": [
+    {
+      "name": "Trent Mick",
+      "email": "trentm@gmail.com",
+      "url": "http://trentm.com"
+    },
+    {
+      "name": "Isaac Schlueter",
+      "url": "https://github.com/isaacs"
+    },
+    {
+      "name": "Joshua M. Clulow",
+      "url": "https://github.com/jclulow"
+    },
+    {
+      "name": "Patrick Mooney",
+      "url": "https://github.com/pfmooney"
+    }
+  ],
+  "gitHead": "d4248f21da0b30bd89c88ccee9bf6eac0e59f9f6",
   "bugs": {
     "url": "https://github.com/trentm/node-dashdash/issues"
   },
-  "homepage": "https://github.com/trentm/node-dashdash#readme",
-  "_id": "dashdash@1.10.1",
-  "_shasum": "0abf1af89a8f5129a81f18c2b35b21df22622f60",
-  "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.10.1.tgz",
-  "_from": "dashdash@>=1.10.1 <2.0.0"
+  "homepage": "https://github.com/trentm/node-dashdash",
+  "_id": "dashdash@1.12.2",
+  "_shasum": "1c6f70588498d047b8cd5777b32ba85a5e25be36",
+  "_from": "dashdash@>=1.10.1 <2.0.0",
+  "_npmVersion": "1.4.28",
+  "_npmUser": {
+    "name": "trentm",
+    "email": "trentm@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "trentm",
+      "email": "trentm@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "1c6f70588498d047b8cd5777b32ba85a5e25be36",
+    "tarball": "http://registry.npmjs.org/dashdash/-/dashdash-1.12.2.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.12.2.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 32c50cb..8c7fa54 100644 (file)
   },
   "maintainers": [
     {
-      "name": "Jeremie Miller",
-      "email": "jeremie@jabber.org",
-      "url": "http://jeremie.com/"
+      "name": "quartzjer",
+      "email": "jeremie@jabber.org"
     },
     {
-      "name": "Ryan Bennett",
-      "url": "https://github.com/rynomad"
+      "name": "rynomad",
+      "email": "nomad.ry@gmail.com"
     }
   ],
   "dependencies": {
     "url": "https://github.com/quartzjer/ecc-jsbn/issues"
   },
   "homepage": "https://github.com/quartzjer/ecc-jsbn",
-  "readme": "ecc-jsbn\n========\n\nECC package based on [jsbn](https://github.com/andyperlitch/jsbn) from [Tom Wu](http://www-cs-students.stanford.edu/~tjw/).\n\nThis is a subset of the same interface as the [node compiled module](https://github.com/quartzjer/ecc), but works in the browser too.\n\nAlso uses point compression now from [https://github.com/kaielvin](https://github.com/kaielvin/jsbn-ec-point-compression).\n",
-  "readmeFilename": "README.md",
+  "gitHead": "d35a360352496721030da645e8054f07efc22487",
   "_id": "ecc-jsbn@0.1.1",
+  "scripts": {},
   "_shasum": "0fc73a9ed5f0d53c38193398523ef7e543777505",
+  "_from": "ecc-jsbn@>=0.0.1 <1.0.0",
+  "_npmVersion": "2.11.2",
+  "_nodeVersion": "0.12.6",
+  "_npmUser": {
+    "name": "quartzjer",
+    "email": "jeremie@jabber.org"
+  },
+  "dist": {
+    "shasum": "0fc73a9ed5f0d53c38193398523ef7e543777505",
+    "tarball": "http://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.1.tgz",
-  "_from": "ecc-jsbn@>=0.0.1 <1.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 93d6bd5..6d38314 100644 (file)
@@ -32,7 +32,6 @@
     "name": "Michele Bini, Ron Garret, Guy K. Kloss"
   },
   "license": "MIT",
-  "readmeFilename": "README.md",
   "dependencies": {
     "jsbn": "~0.1.0"
   },
     "sinon-chai": "^2.8.0",
     "jsdoc": "<=3.3.0"
   },
-  "readme": "Jodid25519 [![Build Status](https://secure.travis-ci.org/meganz/jodid25519.png)](https://travis-ci.org/meganz/jodid25519)\n===================================================================================================================================\n\nJavascript implementation of the Curve25519 and Ed25519 elliptic cryptography functions by Daniel J. Bernstein.\n\nFor the API, please consult the generated documentation under doc/ (you can run `make` to generate it).\n\nTo run the tests do the following on the console from the project's root directory:\n\n    $ npm install\n    $ make test\n\n\nContributors\n------------\n\nIf you are one of the contributors and want to add yourself or change the information here, please do submit a pull request.   Contributors appear in no particular order.\n\n### For the Curve25519 submodule\n\n* [Graydon Hoare](https://github.com/graydon): suggested clamping the private key by default for increased safety and uniformity with other implementations.\n* [liliakai](https://github.com/liliakai): spotted an unused argument in some of the functions\n* [RyanC](https://github.com/ryancdotorg): removed dependency of a function to the Javascript Math library\n* [Guy Kloss](https://github.com/pohutukawa): performance improvements through bit-shift operations, performance and conformance testing, documentation, compatibility with the npm package ecosystem, and more\n* [Michele Bini](https://github.com/rev22): originally wrote the Javascript implementation\n\n\nCopyright and MIT licensing\n---------------------------\n\n* Copyright (c) 2012 Ron Garret\n* Copyright (c) 2007, 2013, 2014 Michele Bini <michele.bini@gmail.com>\n* Copyright (c) 2014 Mega Limited\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is furnished\nto do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all\ncopies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n",
+  "gitHead": "a83b9fcf7fd3be4f27cd4a57817aff171c7cd918",
   "_id": "jodid25519@1.0.2",
   "_shasum": "06d4912255093419477d425633606e0e90782967",
+  "_from": "jodid25519@>=1.0.0 <2.0.0",
+  "_npmVersion": "2.14.4",
+  "_nodeVersion": "4.1.1",
+  "_npmUser": {
+    "name": "arekinath",
+    "email": "alex@cooperi.net"
+  },
+  "dist": {
+    "shasum": "06d4912255093419477d425633606e0e90782967",
+    "tarball": "http://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "arekinath",
+      "email": "alex@cooperi.net"
+    }
+  ],
   "_resolved": "https://registry.npmjs.org/jodid25519/-/jodid25519-1.0.2.tgz",
-  "_from": "jodid25519@>=1.0.0 <2.0.0"
+  "readme": "ERROR: No README data found!"
 }
index 13bae55..ffac6c2 100644 (file)
     "name": "Tom Wu"
   },
   "license": "BSD",
-  "readme": "# jsbn: javascript big number\n\n[Tom Wu's Original Website](http://www-cs-students.stanford.edu/~tjw/jsbn/)\n\nI felt compelled to put this on github and publish to npm. I haven't tested every other big integer library out there, but the few that I have tested in comparison to this one have not even come close in performance. I am aware of the `bi` module on npm, however it has been modified and I wanted to publish the original without modifications. This is jsbn and jsbn2 from Tom Wu's original website above, with the modular pattern applied to prevent global leaks and to allow for use with node.js on the server side.\n\n## usage\n\n    var BigInteger = require('jsbn');\n    \n    var a = new BigInteger('91823918239182398123');\n    alert(a.bitLength()); // 67\n\n\n## API\n\n### bi.toString()\n\nreturns the base-10 number as a string\n\n### bi.negate()\n\nreturns a new BigInteger equal to the negation of `bi`\n\n### bi.abs\n\nreturns new BI of absolute value\n\n### bi.compareTo\n\n\n\n### bi.bitLength\n\n\n\n### bi.mod\n\n\n\n### bi.modPowInt\n\n\n\n### bi.clone\n\n\n\n### bi.intValue\n\n\n\n### bi.byteValue\n\n\n\n### bi.shortValue\n\n\n\n### bi.signum\n\n\n\n### bi.toByteArray\n\n\n\n### bi.equals\n\n\n\n### bi.min\n\n\n\n### bi.max\n\n\n\n### bi.and\n\n\n\n### bi.or\n\n\n\n### bi.xor\n\n\n\n### bi.andNot\n\n\n\n### bi.not\n\n\n\n### bi.shiftLeft\n\n\n\n### bi.shiftRight\n\n\n\n### bi.getLowestSetBit\n\n\n\n### bi.bitCount\n\n\n\n### bi.testBit\n\n\n\n### bi.setBit\n\n\n\n### bi.clearBit\n\n\n\n### bi.flipBit\n\n\n\n### bi.add\n\n\n\n### bi.subtract\n\n\n\n### bi.multiply\n\n\n\n### bi.divide\n\n\n\n### bi.remainder\n\n\n\n### bi.divideAndRemainder\n\n\n\n### bi.modPow\n\n\n\n### bi.modInverse\n\n\n\n### bi.pow\n\n\n\n### bi.gcd\n\n\n\n### bi.isProbablePrime\n\n\n",
-  "readmeFilename": "README.md",
+  "gitHead": "148a967b112806e63ddeeed78ee7938eef74c84a",
   "bugs": {
     "url": "https://github.com/andyperlitch/jsbn/issues"
   },
-  "homepage": "https://github.com/andyperlitch/jsbn#readme",
+  "homepage": "https://github.com/andyperlitch/jsbn",
   "_id": "jsbn@0.1.0",
   "_shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd",
+  "_from": "jsbn@>=0.1.0 <0.2.0",
+  "_npmVersion": "2.7.4",
+  "_nodeVersion": "0.12.2",
+  "_npmUser": {
+    "name": "andyperlitch",
+    "email": "andyperlitch@gmail.com"
+  },
+  "dist": {
+    "shasum": "650987da0dd74f4ebf5a11377a2aa2d273e97dfd",
+    "tarball": "http://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "andyperlitch",
+      "email": "andyperlitch@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.0.tgz",
-  "_from": "jsbn@>=0.1.0 <0.2.0"
+  "readme": "ERROR: No README data found!"
 }
index e542126..6828239 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "tweetnacl",
-  "version": "0.13.2",
+  "version": "0.13.3",
   "description": "Port of TweetNaCl cryptographic library to JavaScript",
   "main": "nacl-fast.js",
   "directories": {
@@ -51,7 +51,7 @@
   "author": {
     "name": "TweetNaCl-js contributors"
   },
-  "license": "CC0-1.0",
+  "license": "Public domain",
   "bugs": {
     "url": "https://github.com/dchest/tweetnacl-js/issues"
   },
     "buffer": false,
     "crypto": false
   },
-  "readme": "TweetNaCl.js\n============\n\nPort of [TweetNaCl](http://tweetnacl.cr.yp.to) / [NaCl](http://nacl.cr.yp.to/)\nto JavaScript for modern browsers and Node.js. Public domain.\n\n[![Build Status](https://travis-ci.org/dchest/tweetnacl-js.svg?branch=master)\n](https://travis-ci.org/dchest/tweetnacl-js)\n\n[Demo](https://dchest.github.io/tweetnacl-js/)\n\n**:warning: Beta version. The library is stable and API is frozen, however\nit has not been independently reviewed. If you can help reviewing it, please\n[contact me](mailto:dmitry@codingrobots.com).**\n\nDocumentation\n=============\n\n* [Overview](#overview)\n* [Installation](#installation)\n* [Usage](#usage)\n  * [Public-key authenticated encryption (box)](#public-key-authenticated-encryption-box)\n  * [Secret-key authenticated encryption (secretbox)](#secret-key-authenticated-encryption-secretbox)\n  * [Scalar multiplication](#scalar-multiplication)\n  * [Signatures](#signatures)\n  * [Hashing](#hashing)\n  * [Random bytes generation](#random-bytes-generation)\n  * [Constant-time comparison](#constant-time-comparison)\n  * [Utilities](#utilities)\n* [Examples](#examples)\n* [System requirements](#system-requirements)\n* [Development and testing](#development-and-testing)\n* [Contributors](#contributors)\n* [Who uses it](#who-uses-it)\n\n\nOverview\n--------\n\nThe primary goal of this project is to produce a translation of TweetNaCl to\nJavaScript which is as close as possible to the original C implementation, plus\na thin layer of idiomatic high-level API on top of it.\n\nThere are two versions, you can use either of them:\n\n* `nacl.js` is the port of TweetNaCl with minimum differences from the\n  original + high-level API.\n\n* `nacl-fast.js` is like `nacl.js`, but with some functions replaced with\n  faster versions.\n\n\nInstallation\n------------\n\nYou can install TweetNaCl.is via a package manager:\n\n[Bower](http://bower.io):\n\n    $ bower install tweetnacl\n\n[NPM](https://www.npmjs.org/):\n\n    $ npm install tweetnacl\n\nor [download source code](https://github.com/dchest/tweetnacl-js/releases).\n\n\nUsage\n------\n\nAll API functions accept and return bytes as `Uint8Array`s.  If you need to\nencode or decode strings, use functions from `nacl.util` namespace.\n\n### Public-key authenticated encryption (box)\n\nImplements *curve25519-xsalsa20-poly1305*.\n\n#### nacl.box.keyPair()\n\nGenerates a new random key pair for box and returns it as an object with\n`publicKey` and `secretKey` members:\n\n    {\n       publicKey: ...,  // Uint8Array with 32-byte public key\n       secretKey: ...   // Uint8Array with 32-byte secret key\n    }\n\n\n#### nacl.box.keyPair.fromSecretKey(secretKey)\n\nReturns a key pair for box with public key corresponding to the given secret\nkey.\n\n#### nacl.box(message, nonce, theirPublicKey, mySecretKey)\n\nEncrypt and authenticates message using peer's public key, our secret key, and\nthe given nonce, which must be unique for each distinct message for a key pair.\n\nReturns an encrypted and authenticated message, which is\n`nacl.box.overheadLength` longer than the original message.\n\n#### nacl.box.open(box, nonce, theirPublicKey, mySecretKey)\n\nAuthenticates and decrypts the given box with peer's public key, our secret\nkey, and the given nonce.\n\nReturns the original message, or `false` if authentication fails.\n\n#### nacl.box.before(theirPublicKey, mySecretKey)\n\nReturns a precomputed shared key which can be used in `nacl.box.after` and\n`nacl.box.open.after`.\n\n#### nacl.box.after(message, nonce, sharedKey)\n\nSame as `nacl.box`, but uses a shared key precomputed with `nacl.box.before`.\n\n#### nacl.box.open.after(box, nonce, sharedKey)\n\nSame as `nacl.box.open`, but uses a shared key precomputed with `nacl.box.before`.\n\n#### nacl.box.publicKeyLength = 32\n\nLength of public key in bytes.\n\n#### nacl.box.secretKeyLength = 32\n\nLength of secret key in bytes.\n\n#### nacl.box.sharedKeyLength = 32\n\nLength of precomputed shared key in bytes.\n\n#### nacl.box.nonceLength = 24\n\nLength of nonce in bytes.\n\n#### nacl.box.overheadLength = 16\n\nLength of overhead added to box compared to original message.\n\n\n### Secret-key authenticated encryption (secretbox)\n\nImplements *xsalsa20-poly1305*.\n\n#### nacl.secretbox(message, nonce, key)\n\nEncrypt and authenticates message using the key and the nonce. The nonce must\nbe unique for each distinct message for this key.\n\nReturns an encrypted and authenticated message, which is\n`nacl.secretbox.overheadLength` longer than the original message.\n\n#### nacl.secretbox.open(box, nonce, key)\n\nAuthenticates and decrypts the given secret box using the key and the nonce.\n\nReturns the original message, or `false` if authentication fails.\n\n#### nacl.secretbox.keyLength = 32\n\nLength of key in bytes.\n\n#### nacl.secretbox.nonceLength = 24\n\nLength of nonce in bytes.\n\n#### nacl.secretbox.overheadLength = 16\n\nLength of overhead added to secret box compared to original message.\n\n\n### Scalar multiplication\n\nImplements *curve25519*.\n\n#### nacl.scalarMult(n, p)\n\nMultiplies an integer `n` by a group element `p` and returns the resulting\ngroup element.\n\n#### nacl.scalarMult.base(n)\n\nMultiplies an integer `n` by a standard group element and returns the resulting\ngroup element.\n\n#### nacl.scalarMult.scalarLength = 32\n\nLength of scalar in bytes.\n\n#### nacl.scalarMult.groupElementLength = 32\n\nLength of group element in bytes.\n\n\n### Signatures\n\nImplements [ed25519](http://ed25519.cr.yp.to).\n\n#### nacl.sign.keyPair()\n\nGenerates new random key pair for signing and returns it as an object with\n`publicKey` and `secretKey` members:\n\n    {\n       publicKey: ...,  // Uint8Array with 32-byte public key\n       secretKey: ...   // Uint8Array with 64-byte secret key\n    }\n\n#### nacl.sign.keyPair.fromSecretKey(secretKey)\n\nReturns a signing key pair with public key corresponding to the given\n64-byte secret key. The secret key must have been generated by\n`nacl.sign.keyPair` or `nacl.sign.keyPair.fromSeed`.\n\n#### nacl.sign.keyPair.fromSeed(seed)\n\nReturns a new signing key pair generated deterministically from a 32-byte seed.\nThe seed must contain enough entropy to be secure. This method is not\nrecommended for general use: instead, use `nacl.sign.keyPair` to generate a new\nkey pair from a random seed.\n\n#### nacl.sign(message, secretKey)\n\nSigns the message using the secret key and returns a signed message.\n\n#### nacl.sign.open(signedMessage, publicKey)\n\nVerifies the signed message and returns the message without signature.\n\nReturns `null` if verification failed.\n\n#### nacl.sign.detached(message, secretKey)\n\nSigns the message using the secret key and returns a signature.\n\n#### nacl.sign.detached.verify(message, signature, publicKey)\n\nVerifies the signature for the message and returns `true` if verification\nsucceeded or `false` if it failed.\n\n#### nacl.sign.publicKeyLength = 32\n\nLength of signing public key in bytes.\n\n#### nacl.sign.secretKeyLength = 64\n\nLength of signing secret key in bytes.\n\n#### nacl.sign.seedLength = 32\n\nLength of seed for `nacl.sign.keyPair.fromSeed` in bytes.\n\n#### nacl.sign.signatureLength = 64\n\nLength of signature in bytes.\n\n\n### Hashing\n\nImplements *SHA-512*.\n\n#### nacl.hash(message)\n\nReturns SHA-512 hash of the message.\n\n#### nacl.hash.hashLength = 64\n\nLength of hash in bytes.\n\n\n### Random bytes generation\n\n#### nacl.randomBytes(length)\n\nReturns a `Uint8Array` of the given length containing random bytes of\ncryptographic quality.\n\n**Implementation note**\n\nTweetNaCl.js uses the following methods to generate random bytes,\ndepending on the platform it runs on:\n\n* `window.crypto.getRandomValues` (WebCrypto standard)\n* `window.msCrypto.getRandomValues` (Internet Explorer 11)\n* `crypto.randomBytes` (Node.js)\n\nNote that browsers are required to throw `QuotaExceededError` exception if\nrequested `length` is more than 65536, so do not ask for more than 65536 bytes\nin *one call* (multiple calls to get as many bytes as you like are okay:\nbrowsers can generate infinite amount of random bytes without any bad\nconsequences).\n\nIf the platform doesn't provide a suitable PRNG, the following functions,\nwhich require random numbers, will throw exception:\n\n* `nacl.randomBytes`\n* `nacl.box.keyPair`\n* `nacl.sign.keyPair`\n\nOther functions are deterministic and will continue working.\n\nIf a platform you are targeting doesn't implement secure random number\ngenerator, but you somehow have a cryptographically-strong source of entropy\n(not `Math.random`!), and you know what you are doing, you can plug it into\nTweetNaCl.js like this:\n\n    nacl.setPRNG(function(x, n) {\n      // ... copy n random bytes into x ...\n    });\n\nNote that `nacl.setPRNG` *completely replaces* internal random byte generator\nwith the one provided.\n\n\n### Constant-time comparison\n\n#### nacl.verify(x, y)\n\nCompares `x` and `y` in constant time and returns `true` if their lengths are\nnon-zero and equal, and their contents are equal.\n\nReturns `false` if either of the arguments has zero length, or arguments have\ndifferent lengths, or their contents differ.\n\n\n### Utilities\n\nEncoding/decoding functions are provided for convenience. They are correct,\nhowever their performance and wide compatibility with uncommon runtimes is not\nsomething that is considered important compared to the simplicity and size of\nimplementation. You can use third-party libraries if you need to.\n\n#### nacl.util.decodeUTF8(string)\n\nDecodes string and returns `Uint8Array` of bytes.\n\n#### nacl.util.encodeUTF8(array)\n\nEncodes `Uint8Array` or `Array` of bytes into string.\n\n#### nacl.util.decodeBase64(string)\n\nDecodes Base-64 encoded string and returns `Uint8Array` of bytes.\n\n#### nacl.util.encodeBase64(array)\n\nEncodes `Uint8Array` or `Array` of bytes into string using Base-64 encoding.\n\n\nSystem requirements\n-------------------\n\nTweetNaCl.js supports modern browsers that have a cryptographically secure\npseudorandom number generator and typed arrays, including the latest versions\nof:\n\n* Chrome\n* Firefox\n* Safari (Mac, iOS)\n* Internet Explorer 11\n\nOther systems:\n\n* Node.js (we test on 0.10 and later)\n\n\nDevelopment and testing\n------------------------\n\nInstall NPM modules needed for development:\n\n    $ npm install\n\nTo build minified versions:\n\n    $ npm run build\n\nTests use minified version, so make sure to rebuild it every time you change\n`nacl.js` or `nacl-fast.js`.\n\n### Testing\n\nTo run tests in Node.js:\n\n    $ npm test\n\nBy default all tests described here work on `nacl.min.js`. To test other\nversions, set environment variable `NACL_SRC` to the file name you want to test.\nFor example, the following command will test fast minified version:\n\n    $ NACL_SRC=nacl-fast.min.js npm test\n\nTo run full suite of tests in Node.js, including comparing outputs of\nJavaScript port to outputs of the original C version:\n\n    $ npm run testall\n\nTo prepare tests for browsers:\n\n    $ npm run browser\n\nand then open `test/browser/test.html` (or `test/browser/test-fast.html`) to\nrun them.\n\nTo run headless browser tests with `testling`:\n\n    $ npm run testling\n\n(If you get `Error: spawn ENOENT`, install *xvfb*: `sudo apt-get install xvfb`.)\n\n### Benchmarking\n\nTo run benchmarks in Node.js:\n\n    $ npm run bench\n    $ NACL_SRC=nacl-fast.min.js npm run bench\n\nTo run benchmarks in a browser, open `test/benchmark/bench.html` (or\n`test/benchmark/bench-fast.html`).\n\n\nContributors\n------------\n\nJavaScript port:\n\n * [Dmitry Chestnykh](http://github.com/dchest) (ported xsalsa20, poly1305, curve25519)\n * [Devi Mandiri](https://github.com/devi) (ported curve25519, ed25519, sha512)\n\nOriginal authors of [NaCl](http://nacl.cr.yp.to), [TweetNaCl](http://tweetnacl.cr.yp.to)\nand [Poly1305-donna](https://github.com/floodyberry/poly1305-donna)\n(who are *not* responsible for any errors in this implementation):\n\n  * [Daniel J. Bernstein](http://cr.yp.to/djb.html)\n  * Wesley Janssen\n  * [Tanja Lange](http://hyperelliptic.org/tanja)\n  * [Peter Schwabe](http://www.cryptojedi.org/users/peter/)\n  * [Matthew Dempsky](https://github.com/mdempsky)\n  * [Andrew Moon](https://github.com/floodyberry)\n\nContributors have dedicated their work to the public domain.\n\nThis software is distributed without any warranty.\n\n\nThird-party libraries based on TweetNaCl.js\n-------------------------------------------\n\n* [forward-secrecy](https://github.com/alax/forward-secrecy) — Axolotl ratchet implementation\n* [nacl-stream](https://github.com/dchest/nacl-stream-js) - streaming encryption\n* [tweetnacl-auth-js](https://github.com/dchest/tweetnacl-auth-js) — implementation of [`crypto_auth`](http://nacl.cr.yp.to/auth.html)\n\n\nWho uses it\n-----------\n\nSome notable users of TweetNaCl.js:\n\n* [miniLock](http://minilock.io/)\n* [Stellar](https://www.stellar.org/)\n",
-  "readmeFilename": "README.md",
-  "_id": "tweetnacl@0.13.2",
-  "_shasum": "453161770469d45cd266c36404e2bc99a8fa9944",
-  "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.2.tgz",
-  "_from": "tweetnacl@>=0.13.0 <1.0.0"
+  "gitHead": "2bb422cb707fba4a5ec9654688564a4fb861b068",
+  "_id": "tweetnacl@0.13.3",
+  "_shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56",
+  "_from": "tweetnacl@>=0.13.0 <1.0.0",
+  "_npmVersion": "2.14.7",
+  "_nodeVersion": "4.2.3",
+  "_npmUser": {
+    "name": "dchest",
+    "email": "dmitry@codingrobots.com"
+  },
+  "dist": {
+    "shasum": "d628b56f3bcc3d5ae74ba9d4c1a704def5ab4b56",
+    "tarball": "http://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "dchest",
+      "email": "dmitry@codingrobots.com"
+    }
+  ],
+  "_resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.13.3.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 93dbdef..aa13666 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "sshpk",
-  "version": "1.7.1",
+  "version": "1.7.3",
   "description": "A library for finding and using SSH public keys",
   "main": "lib/index.js",
   "scripts": {
@@ -36,7 +36,8 @@
   },
   "directories": {
     "bin": "./bin",
-    "lib": "./lib"
+    "lib": "./lib",
+    "man": "./man/man1"
   },
   "homepage": "https://github.com/arekinath/node-sshpk#readme",
   "dependencies": {
   "devDependencies": {
     "tape": ">=3.5.0 <4.0.0",
     "benchmark": ">=1.0.0 <2.0.0",
-    "sinon": ">=1.17.2 <2.0.0"
+    "sinon": ">=1.17.2 <2.0.0",
+    "temp": "0.8.2"
   },
+  "man": [
+    "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-conv.1",
+    "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-sign.1",
+    "/Users/alex.wilson/dev/sshpk/man/man1/sshpk-verify.1"
+  ],
   "bin": {
-    "sshpk-conv": "bin/sshpk-conv"
+    "sshpk-conv": "bin/sshpk-conv",
+    "sshpk-sign": "bin/sshpk-sign",
+    "sshpk-verify": "bin/sshpk-verify"
+  },
+  "gitHead": "3d98bfc22bb1c09f0747244acbb408f3ca9448b5",
+  "_id": "sshpk@1.7.3",
+  "_shasum": "caa8ef95e30765d856698b7025f9f211ab65962f",
+  "_from": "sshpk@>=1.7.0 <2.0.0",
+  "_npmVersion": "2.14.9",
+  "_nodeVersion": "0.12.9",
+  "_npmUser": {
+    "name": "arekinath",
+    "email": "alex@cooperi.net"
   },
-  "readme": "sshpk\n=========\n\nParse, convert, fingerprint and use SSH keys (both public and private) in pure\nnode -- no `ssh-keygen` or other external dependencies.\n\nSupports RSA, DSA, ECDSA (nistp-\\*) and ED25519 key types, in PEM (PKCS#1, \nPKCS#8) and OpenSSH formats.\n\nThis library has been extracted from\n[`node-http-signature`](https://github.com/joyent/node-http-signature)\n(work by [Mark Cavage](https://github.com/mcavage) and\n[Dave Eddy](https://github.com/bahamas10)) and\n[`node-ssh-fingerprint`](https://github.com/bahamas10/node-ssh-fingerprint)\n(work by Dave Eddy), with additions (including ECDSA support) by\n[Alex Wilson](https://github.com/arekinath).\n\nInstall\n-------\n\n```\nnpm install sshpk\n```\n\nExamples\n--------\n\n```js\nvar sshpk = require('sshpk');\n\nvar fs = require('fs');\n\n/* Read in an OpenSSH-format public key */\nvar keyPub = fs.readFileSync('id_rsa.pub');\nvar key = sshpk.parseKey(keyPub, 'ssh');\n\n/* Get metadata about the key */\nconsole.log('type => %s', key.type);\nconsole.log('size => %d bits', key.size);\nconsole.log('comment => %s', key.comment);\n\n/* Compute key fingerprints, in new OpenSSH (>6.7) format, and old MD5 */\nconsole.log('fingerprint => %s', key.fingerprint().toString());\nconsole.log('old-style fingerprint => %s', key.fingerprint('md5').toString());\n```\n\nExample output:\n\n```\ntype => rsa\nsize => 2048 bits\ncomment => foo@foo.com\nfingerprint => SHA256:PYC9kPVC6J873CSIbfp0LwYeczP/W4ffObNCuDJ1u5w\nold-style fingerprint => a0:c8:ad:6c:32:9a:32:fa:59:cc:a9:8c:0a:0d:6e:bd\n```\n\nMore examples: converting between formats:\n\n```js\n/* Read in a PEM public key */\nvar keyPem = fs.readFileSync('id_rsa.pem');\nvar key = sshpk.parseKey(keyPem, 'pem');\n\n/* Convert to PEM PKCS#8 public key format */\nvar pemBuf = key.toBuffer('pkcs8');\n\n/* Convert to SSH public key format (and return as a string) */\nvar sshKey = key.toString('ssh');\n```\n\nSigning and verifying:\n\n```js\n/* Read in an OpenSSH/PEM *private* key */\nvar keyPriv = fs.readFileSync('id_ecdsa');\nvar key = sshpk.parsePrivateKey(keyPriv, 'pem');\n\nvar data = 'some data';\n\n/* Sign some data with the key */\nvar s = key.createSign('sha1');\ns.update(data);\nvar signature = s.sign();\n\n/* Now load the public key (could also use just key.toPublic()) */\nvar keyPub = fs.readFileSync('id_ecdsa.pub');\nkey = sshpk.parseKey(keyPub, 'ssh');\n\n/* Make a crypto.Verifier with this key */\nvar v = key.createVerify('sha1');\nv.update(data);\nvar valid = v.verify(signature);\n/* => true! */\n```\n\nMatching fingerprints with keys:\n\n```js\nvar fp = sshpk.parseFingerprint('SHA256:PYC9kPVC6J873CSIbfp0LwYeczP/W4ffObNCuDJ1u5w');\n\nvar keys = [sshpk.parseKey(...), sshpk.parseKey(...), ...];\n\nkeys.forEach(function (key) {\n\tif (fp.matches(key))\n\t\tconsole.log('found it!');\n});\n```\n\nUsage\n-----\n\n## Public keys\n\n### `parseKey(data[, format = 'auto'[, name]])`\n\nParses a key from a given data format and returns a new `Key` object.\n\nParameters\n\n- `data` -- Either a Buffer or String, containing the key\n- `format` -- String name of format to use, valid options are:\n  - `auto`: choose automatically from all below\n  - `pem`: supports both PKCS#1 and PKCS#8\n  - `ssh`: standard OpenSSH format,\n  - `pkcs1`, `pkcs8`: variants of `pem`\n  - `rfc4253`: raw OpenSSH wire format\n  - `openssh`: new post-OpenSSH 6.5 internal format, produced by \n               `ssh-keygen -o`\n- `name` -- Optional name for the key being parsed (eg. the filename that\n            was opened). Used to generate Error messages\n\n### `Key.isKey(obj)`\n\nReturns `true` if the given object is a valid `Key` object created by a version\nof `sshpk` compatible with this one.\n\nParameters\n\n- `obj` -- Object to identify\n\n### `Key#type`\n\nString, the type of key. Valid options are `rsa`, `dsa`, `ecdsa`.\n\n### `Key#size`\n\nInteger, \"size\" of the key in bits. For RSA/DSA this is the size of the modulus;\nfor ECDSA this is the bit size of the curve in use.\n\n### `Key#comment`\n\nOptional string, a key comment used by some formats (eg the `ssh` format).\n\n### `Key#curve`\n\nOnly present if `this.type === 'ecdsa'`, string containing the name of the\nnamed curve used with this key. Possible values include `nistp256`, `nistp384`\nand `nistp521`.\n\n### `Key#toBuffer([format = 'ssh'])`\n\nConvert the key into a given data format and return the serialized key as\na Buffer.\n\nParameters\n\n- `format` -- String name of format to use, for valid options see `parseKey()`\n\n### `Key#toString([format = 'ssh])`\n\nSame as `this.toBuffer(format).toString()`.\n\n### `Key#fingerprint([algorithm = 'sha256'])`\n\nCreates a new `Fingerprint` object representing this Key's fingerprint.\n\nParameters\n\n- `algorithm` -- String name of hash algorithm to use, valid options are `md5`,\n                 `sha1`, `sha256`, `sha384`, `sha512`\n\n### `Key#createVerify([hashAlgorithm])`\n\nCreates a `crypto.Verifier` specialized to use this Key (and the correct public\nkey algorithm to match it). The returned Verifier has the same API as a regular\none, except that the `verify()` function takes only the target signature as an\nargument.\n\nParameters\n\n- `hashAlgorithm` -- optional String name of hash algorithm to use, any\n                     supported by OpenSSL are valid, usually including\n                     `sha1`, `sha256`.\n\n`v.verify(signature[, format])` Parameters\n\n- `signature` -- either a Signature object, or a Buffer or String\n- `format` -- optional String, name of format to interpret given String with.\n              Not valid if `signature` is a Signature or Buffer.\n\n### `Key#createDiffieHellman()`\n### `Key#createDH()`\n\nCreates a Diffie-Hellman key exchange object initialized with this key and all\nnecessary parameters. This has the same API as a `crypto.DiffieHellman`\ninstance, except that functions take `Key` and `PrivateKey` objects as\narguments, and return them where indicated for.\n\nThis is only valid for keys belonging to a cryptosystem that supports DHE\nor a close analogue (i.e. `dsa`, `ecdsa` and `curve25519` keys). An attempt\nto call this function on other keys will yield an `Error`.\n\n## Private keys\n\n### `parsePrivateKey(data[, format = 'auto'[, name]])`\n\nParses a private key from a given data format and returns a new\n`PrivateKey` object.\n\nParameters\n\n- `data` -- Either a Buffer or String, containing the key\n- `format` -- String name of format to use, valid options are:\n  - `auto`: choose automatically from all below\n  - `pem`: supports both PKCS#1 and PKCS#8\n  - `ssh`, `openssh`: new post-OpenSSH 6.5 internal format, produced by \n                      `ssh-keygen -o`\n  - `pkcs1`, `pkcs8`: variants of `pem`\n  - `rfc4253`: raw OpenSSH wire format\n- `name` -- Optional name for the key being parsed (eg. the filename that\n            was opened). Used to generate Error messages\n\n### `PrivateKey.isPrivateKey(obj)`\n\nReturns `true` if the given object is a valid `PrivateKey` object created by a\nversion of `sshpk` compatible with this one.\n\nParameters\n\n- `obj` -- Object to identify\n\n### `PrivateKey#type`\n\nString, the type of key. Valid options are `rsa`, `dsa`, `ecdsa`.\n\n### `PrivateKey#size`\n\nInteger, \"size\" of the key in bits. For RSA/DSA this is the size of the modulus;\nfor ECDSA this is the bit size of the curve in use.\n\n### `PrivateKey#curve`\n\nOnly present if `this.type === 'ecdsa'`, string containing the name of the\nnamed curve used with this key. Possible values include `nistp256`, `nistp384`\nand `nistp521`.\n\n### `PrivateKey#toBuffer([format = 'pkcs1'])`\n\nConvert the key into a given data format and return the serialized key as\na Buffer.\n\nParameters\n\n- `format` -- String name of format to use, valid options are listed under \n              `parsePrivateKey`. Note that ED25519 keys default to `openssh`\n              format instead (as they have no `pkcs1` representation).\n\n### `PrivateKey#toString([format = 'pkcs1'])`\n\nSame as `this.toBuffer(format).toString()`.\n\n### `PrivateKey#toPublic()`\n\nExtract just the public part of this private key, and return it as a `Key`\nobject.\n\n### `PrivateKey#fingerprint([algorithm = 'sha256'])`\n\nSame as `this.toPublic().fingerprint()`.\n\n### `PrivateKey#createVerify([hashAlgorithm])`\n\nSame as `this.toPublic().createVerify()`.\n\n### `PrivateKey#createSign([hashAlgorithm])`\n\nCreates a `crypto.Sign` specialized to use this PrivateKey (and the correct\nkey algorithm to match it). The returned Signer has the same API as a regular\none, except that the `sign()` function takes no arguments, and returns a\n`Signature` object.\n\nParameters\n\n- `hashAlgorithm` -- optional String name of hash algorithm to use, any\n                     supported by OpenSSL are valid, usually including\n                     `sha1`, `sha256`.\n\n`v.sign()` Parameters\n\n- none\n\n### `PrivateKey#derive(newType)`\n\nDerives a related key of type `newType` from this key. Currently this is\nonly supported to change between `ed25519` and `curve25519` keys which are\nstored with the same private key (but usually distinct public keys in order\nto avoid degenerate keys that lead to a weak Diffie-Hellman exchange).\n\nParameters\n\n- `newType` -- String, type of key to derive, either `ed25519` or `curve25519`\n\n## Fingerprints\n\n### `parseFingerprint(fingerprint[, algorithms])`\n\nPre-parses a fingerprint, creating a `Fingerprint` object that can be used to\nquickly locate a key by using the `Fingerprint#matches` function.\n\nParameters\n\n- `fingerprint` -- String, the fingerprint value, in any supported format\n- `algorithms` -- Optional list of strings, names of hash algorithms to limit\n                  support to. If `fingerprint` uses a hash algorithm not on\n                  this list, throws `InvalidAlgorithmError`.\n\n### `Fingerprint.isFingerprint(obj)`\n\nReturns `true` if the given object is a valid `Fingerprint` object created by a\nversion of `sshpk` compatible with this one.\n\nParameters\n\n- `obj` -- Object to identify\n\n### `Fingerprint#toString([format])`\n\nReturns a fingerprint as a string, in the given format.\n\nParameters\n\n- `format` -- Optional String, format to use, valid options are `hex` and\n              `base64`. If this `Fingerprint` uses the `md5` algorithm, the\n              default format is `hex`. Otherwise, the default is `base64`.\n\n### `Fingerprint#matches(key)`\n\nVerifies whether or not this `Fingerprint` matches a given `Key`. This function\nuses double-hashing to avoid leaking timing information. Returns a boolean.\n\nParameters\n\n- `key` -- a `Key` object, the key to match this fingerprint against\n\n## Signatures\n\n### `parseSignature(signature, algorithm, format)`\n\nParses a signature in a given format, creating a `Signature` object. Useful\nfor converting between the SSH and ASN.1 (PKCS/OpenSSL) signature formats, and\nalso returned as output from `PrivateKey#createSign().sign()`.\n\nA Signature object can also be passed to a verifier produced by\n`Key#createVerify()` and it will automatically be converted internally into the\ncorrect format for verification.\n\nParameters\n\n- `signature` -- a Buffer (binary) or String (base64), data of the actual\n                 signature in the given format\n- `algorithm` -- a String, name of the algorithm to be used, possible values\n                 are `rsa`, `dsa`, `ecdsa`\n- `format` -- a String, either `asn1` or `ssh`\n\n### `Signature.isSignature(obj)`\n\nReturns `true` if the given object is a valid `Signature` object created by a\nversion of `sshpk` compatible with this one.\n\nParameters\n\n- `obj` -- Object to identify\n\n### `Signature#toBuffer([format = 'asn1'])`\n\nConverts a Signature to the given format and returns it as a Buffer.\n\nParameters\n\n- `format` -- a String, either `asn1` or `ssh`\n\n### `Signature#toString([format = 'asn1'])`\n\nSame as `this.toBuffer(format).toString('base64')`.\n\nErrors\n------\n\n### `InvalidAlgorithmError`\n\nThe specified algorithm is not valid, either because it is not supported, or\nbecause it was not included on a list of allowed algorithms.\n\nThrown by `Fingerprint.parse`, `Key#fingerprint`.\n\nProperties\n\n- `algorithm` -- the algorithm that could not be validated\n\n### `FingerprintFormatError`\n\nThe fingerprint string given could not be parsed as a supported fingerprint\nformat, or the specified fingerprint format is invalid.\n\nThrown by `Fingerprint.parse`, `Fingerprint#toString`.\n\nProperties\n\n- `fingerprint` -- if caused by a fingerprint, the string value given\n- `format` -- if caused by an invalid format specification, the string value given\n\n### `KeyParseError`\n\nThe key data given could not be parsed as a valid key.\n\nProperties\n\n- `keyName` -- `name` that was given to `Key#parse`\n- `format` -- the `format` that was trying to parse the key\n- `innerErr` -- the inner Error thrown by the format parser\n\nFriends of sshpk\n----------------\n\n * [`sshpk-agent`](https://github.com/arekinath/node-sshpk-agent) is a library\n   for speaking the `ssh-agent` protocol from node.js, which uses `sshpk`\n",
-  "readmeFilename": "README.md",
-  "_id": "sshpk@1.7.1",
-  "_shasum": "565e386c42a77e6062fbd14c0472ff21cd53398c",
-  "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.1.tgz",
-  "_from": "sshpk@>=1.7.0 <2.0.0"
+  "dist": {
+    "shasum": "caa8ef95e30765d856698b7025f9f211ab65962f",
+    "tarball": "http://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "arekinath",
+      "email": "alex@cooperi.net"
+    }
+  ],
+  "_resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.7.3.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 4c9abf0..d746308 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "http-signature",
   "description": "Reference implementation of Joyent's HTTP Signature scheme.",
-  "version": "1.1.0",
+  "version": "1.1.1",
   "license": "MIT",
   "author": {
     "name": "Joyent, Inc"
@@ -41,7 +41,7 @@
     "test": "tap test/*.js"
   },
   "dependencies": {
-    "assert-plus": "^0.1.5",
+    "assert-plus": "^0.2.0",
     "jsprim": "^1.2.2",
     "sshpk": "^1.7.0"
   },
     "node-uuid": "^1.4.1",
     "tap": "0.4.2"
   },
-  "readme": "# node-http-signature\n\nnode-http-signature is a node.js library that has client and server components\nfor Joyent's [HTTP Signature Scheme](http_signing.md).\n\n## Usage\n\nNote the example below signs a request with the same key/cert used to start an\nHTTP server. This is almost certainly not what you actually want, but is just\nused to illustrate the API calls; you will need to provide your own key\nmanagement in addition to this library.\n\n### Client\n\n```js\nvar fs = require('fs');\nvar https = require('https');\nvar httpSignature = require('http-signature');\n\nvar key = fs.readFileSync('./key.pem', 'ascii');\n\nvar options = {\n  host: 'localhost',\n  port: 8443,\n  path: '/',\n  method: 'GET',\n  headers: {}\n};\n\n// Adds a 'Date' header in, signs it, and adds the\n// 'Authorization' header in.\nvar req = https.request(options, function(res) {\n  console.log(res.statusCode);\n});\n\n\nhttpSignature.sign(req, {\n  key: key,\n  keyId: './cert.pem'\n});\n\nreq.end();\n```\n\n### Server\n\n```js\nvar fs = require('fs');\nvar https = require('https');\nvar httpSignature = require('http-signature');\n\nvar options = {\n  key: fs.readFileSync('./key.pem'),\n  cert: fs.readFileSync('./cert.pem')\n};\n\nhttps.createServer(options, function (req, res) {\n  var rc = 200;\n  var parsed = httpSignature.parseRequest(req);\n  var pub = fs.readFileSync(parsed.keyId, 'ascii');\n  if (!httpSignature.verifySignature(parsed, pub))\n    rc = 401;\n\n  res.writeHead(rc);\n  res.end();\n}).listen(8443);\n```\n\n## Installation\n\n    npm install http-signature\n\n## License\n\nMIT.\n\n## Bugs\n\nSee <https://github.com/joyent/node-http-signature/issues>.\n",
-  "readmeFilename": "README.md",
-  "_id": "http-signature@1.1.0",
-  "_shasum": "5d2d7e9b6ef49980ad5b128d8e4ef09a31c90d95",
-  "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.0.tgz",
-  "_from": "http-signature@>=1.1.0 <1.2.0"
+  "gitHead": "74d3f35e3aa436d83723c53b01e266f448e8149a",
+  "_id": "http-signature@1.1.1",
+  "_shasum": "df72e267066cd0ac67fb76adf8e134a8fbcf91bf",
+  "_from": "http-signature@>=1.1.0 <1.2.0",
+  "_npmVersion": "2.14.9",
+  "_nodeVersion": "0.12.9",
+  "_npmUser": {
+    "name": "arekinath",
+    "email": "alex@cooperi.net"
+  },
+  "dist": {
+    "shasum": "df72e267066cd0ac67fb76adf8e134a8fbcf91bf",
+    "tarball": "http://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "arekinath",
+      "email": "alex@cooperi.net"
+    },
+    {
+      "name": "mcavage",
+      "email": "mcavage@gmail.com"
+    },
+    {
+      "name": "pfmooney",
+      "email": "patrick.f.mooney@gmail.com"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.1.1.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 236bb80..861ef4f 100644 (file)
     "url": "https://github.com/hughsk/is-typedarray/issues"
   },
   "homepage": "https://github.com/hughsk/is-typedarray",
-  "readme": "# is-typedarray [![locked](http://badges.github.io/stability-badges/dist/locked.svg)](http://github.com/badges/stability-badges)\n\nDetect whether or not an object is a\n[Typed Array](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Typed_arrays).\n\n## Usage\n\n[![NPM](https://nodei.co/npm/is-typedarray.png)](https://nodei.co/npm/is-typedarray/)\n\n### isTypedArray(array)\n\nReturns `true` when array is a Typed Array, and `false` when it is not.\n\n## License\n\nMIT. See [LICENSE.md](http://github.com/hughsk/is-typedarray/blob/master/LICENSE.md) for details.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "0617cfa871686cf541af62b144f130488f44f6fe",
   "_id": "is-typedarray@1.0.0",
   "_shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a",
+  "_from": "is-typedarray@>=1.0.0 <1.1.0",
+  "_npmVersion": "2.7.5",
+  "_nodeVersion": "0.10.36",
+  "_npmUser": {
+    "name": "hughsk",
+    "email": "hughskennedy@gmail.com"
+  },
+  "dist": {
+    "shasum": "e479c80858df0c1b11ddda6940f96011fcda4a9a",
+    "tarball": "http://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "hughsk",
+      "email": "hughskennedy@gmail.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz",
-  "_from": "is-typedarray@>=1.0.0 <1.1.0"
+  "readme": "ERROR: No README data found!"
 }
diff --git a/deps/npm/node_modules/request/node_modules/isstream/.jshintrc b/deps/npm/node_modules/request/node_modules/isstream/.jshintrc
deleted file mode 100644 (file)
index c8ef3ca..0000000
+++ /dev/null
@@ -1,59 +0,0 @@
-{
-    "predef": [ ]
-  , "bitwise": false
-  , "camelcase": false
-  , "curly": false
-  , "eqeqeq": false
-  , "forin": false
-  , "immed": false
-  , "latedef": false
-  , "noarg": true
-  , "noempty": true
-  , "nonew": true
-  , "plusplus": false
-  , "quotmark": true
-  , "regexp": false
-  , "undef": true
-  , "unused": true
-  , "strict": false
-  , "trailing": true
-  , "maxlen": 120
-  , "asi": true
-  , "boss": true
-  , "debug": true
-  , "eqnull": true
-  , "esnext": true
-  , "evil": true
-  , "expr": true
-  , "funcscope": false
-  , "globalstrict": false
-  , "iterator": false
-  , "lastsemic": true
-  , "laxbreak": true
-  , "laxcomma": true
-  , "loopfunc": true
-  , "multistr": false
-  , "onecase": false
-  , "proto": false
-  , "regexdash": false
-  , "scripturl": true
-  , "smarttabs": false
-  , "shadow": false
-  , "sub": true
-  , "supernew": false
-  , "validthis": true
-  , "browser": true
-  , "couch": false
-  , "devel": false
-  , "dojo": false
-  , "mootools": false
-  , "node": true
-  , "nonstandard": true
-  , "prototypejs": false
-  , "rhino": false
-  , "worker": true
-  , "wsh": false
-  , "nomen": false
-  , "onevar": false
-  , "passfail": false
-}
\ No newline at end of file
index 87c26fe..85cb14c 100644 (file)
     "url": "https://github.com/rvagg/isstream/issues"
   },
   "homepage": "https://github.com/rvagg/isstream",
-  "readme": "# isStream\n\n[![Build Status](https://secure.travis-ci.org/rvagg/isstream.png)](http://travis-ci.org/rvagg/isstream)\n\n**Test if an object is a `Stream`**\n\n[![NPM](https://nodei.co/npm/isstream.svg)](https://nodei.co/npm/isstream/)\n\nThe missing `Stream.isStream(obj)`: determine if an object is standard Node.js `Stream`. Works for Node-core `Stream` objects (for 0.8, 0.10, 0.11, and in theory, older and newer versions) and all versions of **[readable-stream](https://github.com/isaacs/readable-stream)**.\n\n## Usage:\n\n```js\nvar isStream = require('isstream')\nvar Stream = require('stream')\n\nisStream(new Stream()) // true\n\nisStream({}) // false\n\nisStream(new Stream.Readable())    // true\nisStream(new Stream.Writable())    // true\nisStream(new Stream.Duplex())      // true\nisStream(new Stream.Transform())   // true\nisStream(new Stream.PassThrough()) // true\n```\n\n## But wait! There's more!\n\nYou can also test for `isReadable(obj)`, `isWritable(obj)` and `isDuplex(obj)` to test for implementations of Streams2 (and Streams3) base classes.\n\n```js\nvar isReadable = require('isstream').isReadable\nvar isWritable = require('isstream').isWritable\nvar isDuplex = require('isstream').isDuplex\nvar Stream = require('stream')\n\nisReadable(new Stream()) // false\nisWritable(new Stream()) // false\nisDuplex(new Stream())   // false\n\nisReadable(new Stream.Readable())    // true\nisReadable(new Stream.Writable())    // false\nisReadable(new Stream.Duplex())      // true\nisReadable(new Stream.Transform())   // true\nisReadable(new Stream.PassThrough()) // true\n\nisWritable(new Stream.Readable())    // false\nisWritable(new Stream.Writable())    // true\nisWritable(new Stream.Duplex())      // true\nisWritable(new Stream.Transform())   // true\nisWritable(new Stream.PassThrough()) // true\n\nisDuplex(new Stream.Readable())    // false\nisDuplex(new Stream.Writable())    // false\nisDuplex(new Stream.Duplex())      // true\nisDuplex(new Stream.Transform())   // true\nisDuplex(new Stream.PassThrough()) // true\n```\n\n*Reminder: when implementing your own streams, please [use **readable-stream** rather than core streams](http://r.va.gg/2014/06/why-i-dont-use-nodes-core-stream-module.html).*\n\n\n## License\n\n**isStream** is Copyright (c) 2015 Rod Vagg [@rvagg](https://twitter.com/rvagg) and licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "cd39cba6da939b4fc9110825203adc506422c3dc",
   "_id": "isstream@0.1.2",
   "_shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a",
+  "_from": "isstream@>=0.1.2 <0.2.0",
+  "_npmVersion": "2.6.1",
+  "_nodeVersion": "1.4.3",
+  "_npmUser": {
+    "name": "rvagg",
+    "email": "rod@vagg.org"
+  },
+  "maintainers": [
+    {
+      "name": "rvagg",
+      "email": "rod@vagg.org"
+    }
+  ],
+  "dist": {
+    "shasum": "47e63f7af55afa6f92e1500e690eb8b8529c099a",
+    "tarball": "http://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz",
-  "_from": "isstream@>=0.1.2 <0.2.0"
+  "readme": "ERROR: No README data found!"
 }
index f09f9d5..ccd55b0 100644 (file)
     "must": ">= 0.12 < 0.13",
     "sinon": ">= 1.12.2 < 2"
   },
-  "readme": "# json-stringify-safe\n\nLike JSON.stringify, but doesn't throw on circular references.\n\n## Usage\n\nTakes the same arguments as `JSON.stringify`.\n\n```javascript\nvar stringify = require('json-stringify-safe');\nvar circularObj = {};\ncircularObj.circularRef = circularObj;\ncircularObj.list = [ circularObj, circularObj ];\nconsole.log(stringify(circularObj, null, 2));\n```\n\nOutput:\n\n```json\n{\n  \"circularRef\": \"[Circular]\",\n  \"list\": [\n    \"[Circular]\",\n    \"[Circular]\"\n  ]\n}\n```\n\n## Details\n\n```\nstringify(obj, serializer, indent, decycler)\n```\n\nThe first three arguments are the same as to JSON.stringify.  The last\nis an argument that's only used when the object has been seen already.\n\nThe default `decycler` function returns the string `'[Circular]'`.\nIf, for example, you pass in `function(k,v){}` (return nothing) then it\nwill prune cycles.  If you pass in `function(k,v){ return {foo: 'bar'}}`,\nthen cyclical objects will always be represented as `{\"foo\":\"bar\"}` in\nthe result.\n\n```\nstringify.getSerialize(serializer, decycler)\n```\n\nReturns a serializer that can be used elsewhere.  This is the actual\nfunction that's passed to JSON.stringify.\n\n**Note** that the function returned from `getSerialize` is stateful for now, so\ndo **not** use it more than once.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "3890dceab3ad14f8701e38ca74f38276abc76de5",
   "_id": "json-stringify-safe@5.0.1",
   "_shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb",
+  "_from": "json-stringify-safe@>=5.0.1 <5.1.0",
+  "_npmVersion": "2.10.0",
+  "_nodeVersion": "2.0.1",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "isaacs@npmjs.com"
+  },
+  "dist": {
+    "shasum": "1296a2d58fd45f19a0f6ce01d65701e2c735b6eb",
+    "tarball": "http://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    },
+    {
+      "name": "moll",
+      "email": "andri@dot.ee"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz",
-  "_from": "json-stringify-safe@>=5.0.1 <5.1.0"
+  "readme": "ERROR: No README data found!"
 }
index 64241d9..61b54b4 100644 (file)
@@ -1,3 +1,9 @@
+2.1.9 / 2016-01-06
+==================
+
+  * deps: mime-db@~1.21.0
+    - Add new mime types
+
 2.1.8 / 2015-11-30
 ==================
 
index c7f8b5a..41a667a 100644 (file)
@@ -1,3 +1,22 @@
+1.21.0 / 2016-01-06
+===================
+
+  * Add `application/emergencycalldata.comment+xml`
+  * Add `application/emergencycalldata.deviceinfo+xml`
+  * Add `application/emergencycalldata.providerinfo+xml`
+  * Add `application/emergencycalldata.serviceinfo+xml`
+  * Add `application/emergencycalldata.subscriberinfo+xml`
+  * Add `application/vnd.filmit.zfc`
+  * Add `application/vnd.google-apps.document`
+  * Add `application/vnd.google-apps.presentation`
+  * Add `application/vnd.google-apps.spreadsheet`
+  * Add `application/vnd.mapbox-vector-tile`
+  * Add `application/vnd.ms-printdevicecapabilities+xml`
+  * Add `application/vnd.ms-windows.devicepairing`
+  * Add `application/vnd.ms-windows.nwprinting.oob`
+  * Add `application/vnd.tml`
+  * Add `audio/evs`
+
 1.20.0 / 2015-11-10
 ===================
 
index 164cca0..7662440 100644 (file)
@@ -52,7 +52,7 @@ Each mime type has the following properties:
     - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)
     - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)
 - `.extensions[]` - known extensions associated with this mime type.
-- `.compressible` - whether a file of this type is can be gzipped.
+- `.compressible` - whether a file of this type can be gzipped.
 - `.charset` - the default charset associated with this type, if any.
 
 If unknown, every property could be `undefined`.
index 123e7f9..412ba9e 100644 (file)
     "source": "iana",
     "compressible": false
   },
+  "application/emergencycalldata.comment+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.deviceinfo+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.providerinfo+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.serviceinfo+xml": {
+    "source": "iana"
+  },
+  "application/emergencycalldata.subscriberinfo+xml": {
+    "source": "iana"
+  },
   "application/emma+xml": {
     "source": "iana",
     "extensions": ["emma"]
   "application/vnd.ffsns": {
     "source": "iana"
   },
+  "application/vnd.filmit.zfc": {
+    "source": "iana"
+  },
   "application/vnd.fints": {
     "source": "iana"
   },
     "source": "iana",
     "extensions": ["gmx"]
   },
+  "application/vnd.google-apps.document": {
+    "compressible": false,
+    "extensions": ["gdoc"]
+  },
+  "application/vnd.google-apps.presentation": {
+    "compressible": false,
+    "extensions": ["gslides"]
+  },
+  "application/vnd.google-apps.spreadsheet": {
+    "compressible": false,
+    "extensions": ["gsheet"]
+  },
   "application/vnd.google-earth.kml+xml": {
     "source": "iana",
     "compressible": true,
     "source": "iana",
     "extensions": ["portpkg"]
   },
+  "application/vnd.mapbox-vector-tile": {
+    "source": "iana"
+  },
   "application/vnd.marlin.drm.actiontoken+xml": {
     "source": "iana"
   },
     "source": "iana",
     "extensions": ["potm"]
   },
+  "application/vnd.ms-printdevicecapabilities+xml": {
+    "source": "iana"
+  },
   "application/vnd.ms-printing.printticket+xml": {
     "source": "apache"
   },
   "application/vnd.ms-tnef": {
     "source": "iana"
   },
+  "application/vnd.ms-windows.devicepairing": {
+    "source": "iana"
+  },
+  "application/vnd.ms-windows.nwprinting.oob": {
+    "source": "iana"
+  },
   "application/vnd.ms-windows.printerpairing": {
     "source": "iana"
   },
   "application/vnd.tmd.mediaflex.api+xml": {
     "source": "iana"
   },
+  "application/vnd.tml": {
+    "source": "iana"
+  },
   "application/vnd.tmobile-livetv": {
     "source": "iana",
     "extensions": ["tmo"]
   "audio/evrcwb1": {
     "source": "iana"
   },
+  "audio/evs": {
+    "source": "iana"
+  },
   "audio/fwdred": {
     "source": "iana"
   },
index 9277428..e6c9732 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "mime-db",
   "description": "Media Type Database",
-  "version": "1.20.0",
+  "version": "1.21.0",
   "contributors": [
     {
       "name": "Douglas Christopher Wilson",
     "url": "git+https://github.com/jshttp/mime-db.git"
   },
   "devDependencies": {
-    "bluebird": "2.10.0",
+    "bluebird": "3.1.1",
     "co": "4.6.0",
     "cogent": "1.0.1",
-    "csv-parse": "1.0.0",
+    "csv-parse": "1.0.1",
     "gnode": "0.1.1",
-    "istanbul": "0.4.0",
+    "istanbul": "0.4.1",
     "mocha": "1.21.5",
-    "raw-body": "2.1.4",
+    "raw-body": "2.1.5",
     "stream-to-array": "2.2.0"
   },
   "files": [
     "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter spec --check-leaks test/",
     "update": "npm run fetch && npm run build"
   },
-  "readme": "# mime-db\n\n[![NPM Version][npm-version-image]][npm-url]\n[![NPM Downloads][npm-downloads-image]][npm-url]\n[![Node.js Version][node-image]][node-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][coveralls-image]][coveralls-url]\n\nThis is a database of all mime types.\nIt consists of a single, public JSON file and does not include any logic,\nallowing it to remain as un-opinionated as possible with an API.\nIt aggregates data from the following sources:\n\n- http://www.iana.org/assignments/media-types/media-types.xhtml\n- http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types\n- http://hg.nginx.org/nginx/raw-file/default/conf/mime.types\n\n## Installation\n\n```bash\nnpm install mime-db\n```\n\n### Database Download\n\nIf you're crazy enough to use this in the browser, you can just grab the\nJSON file using [RawGit](https://rawgit.com/). It is recommended to replace\n`master` with [a release tag](https://github.com/jshttp/mime-db/tags) as the\nJSON format may change in the future.\n\n```\nhttps://cdn.rawgit.com/jshttp/mime-db/master/db.json\n```\n\n## Usage\n\n```js\nvar db = require('mime-db');\n\n// grab data on .js files\nvar data = db['application/javascript'];\n```\n\n## Data Structure\n\nThe JSON file is a map lookup for lowercased mime types.\nEach mime type has the following properties:\n\n- `.source` - where the mime type is defined.\n    If not set, it's probably a custom media type.\n    - `apache` - [Apache common media types](http://svn.apache.org/repos/asf/httpd/httpd/trunk/docs/conf/mime.types)\n    - `iana` - [IANA-defined media types](http://www.iana.org/assignments/media-types/media-types.xhtml)\n    - `nginx` - [nginx media types](http://hg.nginx.org/nginx/raw-file/default/conf/mime.types)\n- `.extensions[]` - known extensions associated with this mime type.\n- `.compressible` - whether a file of this type is can be gzipped.\n- `.charset` - the default charset associated with this type, if any.\n\nIf unknown, every property could be `undefined`.\n\n## Contributing\n\nTo edit the database, only make PRs against `src/custom.json` or\n`src/custom-suffix.json`.\n\nTo update the build, run `npm run build`.\n\n## Adding Custom Media Types\n\nThe best way to get new media types included in this library is to register\nthem with the IANA. The community registration procedure is outlined in\n[RFC 6838 section 5](http://tools.ietf.org/html/rfc6838#section-5). Types\nregistered with the IANA are automatically pulled into this library.\n\n[npm-version-image]: https://img.shields.io/npm/v/mime-db.svg\n[npm-downloads-image]: https://img.shields.io/npm/dm/mime-db.svg\n[npm-url]: https://npmjs.org/package/mime-db\n[travis-image]: https://img.shields.io/travis/jshttp/mime-db/master.svg\n[travis-url]: https://travis-ci.org/jshttp/mime-db\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-db/master.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/mime-db?branch=master\n[node-image]: https://img.shields.io/node/v/mime-db.svg\n[node-url]: http://nodejs.org/download/\n",
-  "readmeFilename": "README.md",
+  "gitHead": "9ab92f0a912a602408a64db5741dfef6f82c597f",
   "bugs": {
     "url": "https://github.com/jshttp/mime-db/issues"
   },
-  "homepage": "https://github.com/jshttp/mime-db#readme",
-  "_id": "mime-db@1.20.0",
-  "_shasum": "496f90fd01fe0e031c8823ec3aa9450ffda18ed8",
-  "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.20.0.tgz",
-  "_from": "mime-db@>=1.20.0 <1.21.0"
+  "homepage": "https://github.com/jshttp/mime-db",
+  "_id": "mime-db@1.21.0",
+  "_shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac",
+  "_from": "mime-db@>=1.21.0 <1.22.0",
+  "_npmVersion": "1.4.28",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "maintainers": [
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "dist": {
+    "shasum": "9b5239e3353cf6eb015a00d890261027c36d4bac",
+    "tarball": "http://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.21.0.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 21477d6..ff59935 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "mime-types",
   "description": "The ultimate javascript content-type utility.",
-  "version": "2.1.8",
+  "version": "2.1.9",
   "contributors": [
     {
       "name": "Douglas Christopher Wilson",
@@ -28,7 +28,7 @@
     "url": "git+https://github.com/jshttp/mime-types.git"
   },
   "dependencies": {
-    "mime-db": "~1.20.0"
+    "mime-db": "~1.21.0"
   },
   "devDependencies": {
     "istanbul": "0.4.1",
     "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot test/test.js",
     "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot test/test.js"
   },
-  "readme": "# mime-types\n\n[![NPM Version][npm-image]][npm-url]\n[![NPM Downloads][downloads-image]][downloads-url]\n[![Node.js Version][node-version-image]][node-version-url]\n[![Build Status][travis-image]][travis-url]\n[![Test Coverage][coveralls-image]][coveralls-url]\n\nThe ultimate javascript content-type utility.\n\nSimilar to [node-mime](https://github.com/broofa/node-mime), except:\n\n- __No fallbacks.__ Instead of naively returning the first available type, `mime-types` simply returns `false`,\n  so do `var type = mime.lookup('unrecognized') || 'application/octet-stream'`.\n- No `new Mime()` business, so you could do `var lookup = require('mime-types').lookup`.\n- Additional mime types are added such as jade and stylus via [mime-db](https://github.com/jshttp/mime-db)\n- No `.define()` functionality\n\nOtherwise, the API is compatible.\n\n## Install\n\n```sh\n$ npm install mime-types\n```\n\n## Adding Types\n\nAll mime types are based on [mime-db](https://github.com/jshttp/mime-db),\nso open a PR there if you'd like to add mime types.\n\n## API\n\n```js\nvar mime = require('mime-types')\n```\n\nAll functions return `false` if input is invalid or not found.\n\n### mime.lookup(path)\n\nLookup the content-type associated with a file.\n\n```js\nmime.lookup('json')             // 'application/json'\nmime.lookup('.md')              // 'text/x-markdown'\nmime.lookup('file.html')        // 'text/html'\nmime.lookup('folder/file.js')   // 'application/javascript'\nmime.lookup('folder/.htaccess') // false\n\nmime.lookup('cats') // false\n```\n\n### mime.contentType(type)\n\nCreate a full content-type header given a content-type or extension.\n\n```js\nmime.contentType('markdown')  // 'text/x-markdown; charset=utf-8'\nmime.contentType('file.json') // 'application/json; charset=utf-8'\n\n// from a full path\nmime.contentType(path.extname('/path/to/file.json')) // 'application/json; charset=utf-8'\n```\n\n### mime.extension(type)\n\nGet the default extension for a content-type.\n\n```js\nmime.extension('application/octet-stream') // 'bin'\n```\n\n### mime.charset(type)\n\nLookup the implied default charset of a content-type.\n\n```js\nmime.charset('text/x-markdown') // 'UTF-8'\n```\n\n### var type = mime.types[extension]\n\nA map of content-types by extension.\n\n### [extensions...] = mime.extensions[type]\n\nA map of extensions by content-type.\n\n## License\n\n[MIT](LICENSE)\n\n[npm-image]: https://img.shields.io/npm/v/mime-types.svg\n[npm-url]: https://npmjs.org/package/mime-types\n[node-version-image]: https://img.shields.io/node/v/mime-types.svg\n[node-version-url]: http://nodejs.org/download/\n[travis-image]: https://img.shields.io/travis/jshttp/mime-types/master.svg\n[travis-url]: https://travis-ci.org/jshttp/mime-types\n[coveralls-image]: https://img.shields.io/coveralls/jshttp/mime-types/master.svg\n[coveralls-url]: https://coveralls.io/r/jshttp/mime-types\n[downloads-image]: https://img.shields.io/npm/dm/mime-types.svg\n[downloads-url]: https://npmjs.org/package/mime-types\n",
-  "readmeFilename": "README.md",
+  "gitHead": "329f1c77e1a77c8fac59b15038e3808e9e314d96",
   "bugs": {
     "url": "https://github.com/jshttp/mime-types/issues"
   },
-  "homepage": "https://github.com/jshttp/mime-types#readme",
-  "_id": "mime-types@2.1.8",
-  "_shasum": "faf57823de04bc7cbff4ee82c6b63946e812ae72",
-  "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.8.tgz",
-  "_from": "mime-types@>=2.1.7 <2.2.0"
+  "homepage": "https://github.com/jshttp/mime-types",
+  "_id": "mime-types@2.1.9",
+  "_shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8",
+  "_from": "mime-types@>=2.1.7 <2.2.0",
+  "_npmVersion": "1.4.28",
+  "_npmUser": {
+    "name": "dougwilson",
+    "email": "doug@somethingdoug.com"
+  },
+  "maintainers": [
+    {
+      "name": "jongleberry",
+      "email": "jonathanrichardong@gmail.com"
+    },
+    {
+      "name": "fishrock123",
+      "email": "fishrock123@rocketmail.com"
+    },
+    {
+      "name": "dougwilson",
+      "email": "doug@somethingdoug.com"
+    }
+  ],
+  "dist": {
+    "shasum": "dfb396764b5fdf75be34b1f4104bc3687fb635f8",
+    "tarball": "http://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.9.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 67dc8da..473b25a 100644 (file)
     {
       "name": "broofa",
       "email": "robert@broofa.com"
+    },
+    {
+      "name": "coolaj86",
+      "email": "coolaj86@gmail.com"
     }
   ],
   "name": "node-uuid",
   },
   "url": "http://github.com/broofa/node-uuid",
   "version": "1.4.7",
-  "readme": "# node-uuid\n\nSimple, fast generation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDS.\n\nFeatures:\n\n* Generate RFC4122 version 1 or version 4 UUIDs\n* Runs in node.js and all browsers.\n* Registered as a [ComponentJS](https://github.com/component/component) [component](https://github.com/component/component/wiki/Components) ('broofa/node-uuid').\n* Cryptographically strong random # generation\n  * `crypto.randomBytes(n)` in node.js\n  * `window.crypto.getRandomValues(ta)` in [supported browsers](https://developer.mozilla.org/en-US/docs/Web/API/RandomSource/getRandomValues#Browser_Compatibility)\n* 1.1K minified and gzip'ed  (Want something smaller?  Check this [crazy shit](https://gist.github.com/982883) out! )\n* [Annotated source code](http://broofa.github.com/node-uuid/docs/uuid.html)\n* Comes with a Command Line Interface for generating uuids on the command line\n\n## Getting Started\n\nInstall it in your browser:\n\n```html\n<script src=\"uuid.js\"></script>\n```\n\nOr in node.js:\n\n```\nnpm install node-uuid\n```\n\n```javascript\nvar uuid = require('node-uuid');\n```\n\nThen create some ids ...\n\n```javascript\n// Generate a v1 (time-based) id\nuuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n\n// Generate a v4 (random) id\nuuid.v4(); // -> '110ec58a-a0f2-4ac4-8393-c866d813b8d1'\n```\n\n## API\n\n### uuid.v1([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v1 (timestamp-based) UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n  * `node` - (Array) Node id as Array of 6 bytes (per 4.1.6). Default: Randomly generated ID.  See note 1.\n  * `clockseq` - (Number between 0 - 0x3fff) RFC clock sequence.  Default: An internally maintained clockseq is used.\n  * `msecs` - (Number | Date) Time in milliseconds since unix Epoch.  Default: The current time is used.\n  * `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.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nNotes:\n\n1. 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.)\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v1({\n  node: [0x01, 0x23, 0x45, 0x67, 0x89, 0xab],\n  clockseq: 0x1234,\n  msecs: new Date('2011-11-01').getTime(),\n  nsecs: 5678\n});   // -> \"710b962e-041c-11e1-9234-0123456789ab\"\n```\n\nExample: In-place generation of two binary IDs\n\n```javascript\n// Generate two ids in an array\nvar arr = new Array(32); // -> []\nuuid.v1(null, arr, 0);   // -> [02 a2 ce 90 14 32 11 e1 85 58 0b 48 8e 4f c1 15]\nuuid.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]\n\n// Optionally use uuid.unparse() to get stringify the ids\nuuid.unparse(buffer);    // -> '02a2ce90-1432-11e1-8558-0b488e4fc115'\nuuid.unparse(buffer, 16) // -> '02a31cb0-1432-11e1-8558-0b488e4fc115'\n```\n\n### uuid.v4([`options` [, `buffer` [, `offset`]]])\n\nGenerate and return a RFC4122 v4 UUID.\n\n* `options` - (Object) Optional uuid state to apply. Properties may include:\n\n  * `random` - (Number[16]) Array of 16 numbers (0-255) to use in place of randomly generated values\n  * `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.\n\n* `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written.\n* `offset` - (Number) Starting index in `buffer` at which to begin writing.\n\nReturns `buffer`, if specified, otherwise the string form of the UUID\n\nExample: Generate string UUID with fully-specified options\n\n```javascript\nuuid.v4({\n  random: [\n    0x10, 0x91, 0x56, 0xbe, 0xc4, 0xfb, 0xc1, 0xea,\n    0x71, 0xb4, 0xef, 0xe1, 0x67, 0x1c, 0x58, 0x36\n  ]\n});\n// -> \"109156be-c4fb-41ea-b1b4-efe1671c5836\"\n```\n\nExample: Generate two IDs in a single buffer\n\n```javascript\nvar buffer = new Array(32); // (or 'new Buffer' in node.js)\nuuid.v4(null, buffer, 0);\nuuid.v4(null, buffer, 16);\n```\n\n### uuid.parse(id[, buffer[, offset]])\n### uuid.unparse(buffer[, offset])\n\nParse and unparse UUIDs\n\n  * `id` - (String) UUID(-like) string\n  * `buffer` - (Array | Buffer) Array or buffer where UUID bytes are to be written. Default: A new Array or Buffer is used\n  * `offset` - (Number) Starting index in `buffer` at which to begin writing. Default: 0\n\nExample parsing and unparsing a UUID string\n\n```javascript\nvar bytes = uuid.parse('797ff043-11eb-11e1-80d6-510998755d10'); // -> <Buffer 79 7f f0 43 11 eb 11 e1 80 d6 51 09 98 75 5d 10>\nvar string = uuid.unparse(bytes); // -> '797ff043-11eb-11e1-80d6-510998755d10'\n```\n\n### uuid.noConflict()\n\n(Browsers only) Set `uuid` property back to it's previous value.\n\nReturns the node-uuid object.\n\nExample:\n\n```javascript\nvar myUuid = uuid.noConflict();\nmyUuid.v1(); // -> '6c84fb90-12c4-11e1-840d-7b25c5ee775a'\n```\n\n## Deprecated APIs\n\nSupport for the following v1.2 APIs is available in v1.3, but is deprecated and will be removed in the next major version.\n\n### uuid([format [, buffer [, offset]]])\n\nuuid() 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).\n\n### uuid.BufferClass\n\nThe 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.\n\n## Command Line Interface\n\nTo use the executable, it's probably best to install this library globally.\n\n`npm install -g node-uuid`\n\nUsage:\n\n```\nUSAGE: uuid [version] [options]\n\n\noptions:\n\n--help                     Display this message and exit\n```\n\n`version` must be an RFC4122 version that is supported by this library, which is currently version 1 and version 4 (denoted by \"v1\" and \"v4\", respectively). `version` defaults to version 4 when not supplied.\n\n### Examples\n\n```\n> uuid\n3a91f950-dec8-4688-ba14-5b7bbfc7a563\n```\n\n```\n> uuid v1\n9d0b43e0-7696-11e3-964b-250efa37a98e\n```\n\n```\n> uuid v4\n6790ac7c-24ac-4f98-8464-42f6d98a53ae\n```\n\n## Testing\n\nIn node.js\n\n```\nnpm test\n```\n\nIn Browser\n\n```\nopen test/test.html\n```\n\n### Benchmarking\n\nRequires node.js\n\n```\nnpm install uuid uuid-js\nnode benchmark/benchmark.js\n```\n\nFor 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)\n\nFor browser performance [checkout the JSPerf tests](http://jsperf.com/node-uuid-performance).\n\n## Release notes\n\n### 1.4.6\n\n* Properly detect node crypto and whatwg crypto\n* Workaround phantomjs/browserify bug\n* Explicit check for `window` rather implicit this-global\n* Issue warning if Math.random() is being used\n* \"use strict\";\n* A few jshint / stylistic updates (=== and such)\n\n### 1.4.0\n\n* Improved module context detection\n* Removed public RNG functions\n\n### 1.3.2\n\n* Improve tests and handling of v1() options (Issue #24)\n* Expose RNG option to allow for perf testing with different generators\n\n### 1.3.0\n\n* Support for version 1 ids, thanks to [@ctavan](https://github.com/ctavan)!\n* Support for node.js crypto API\n* De-emphasizing performance in favor of a) cryptographic quality PRNGs where available and b) more manageable code\n",
-  "readmeFilename": "README.md",
+  "gitHead": "309512573ec1c60143c257157479a20f7f1f51cd",
   "_id": "node-uuid@1.4.7",
   "_shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f",
+  "_from": "node-uuid@>=1.4.7 <1.5.0",
+  "_npmVersion": "3.3.6",
+  "_nodeVersion": "5.0.0",
+  "_npmUser": {
+    "name": "coolaj86",
+    "email": "coolaj86@gmail.com"
+  },
+  "dist": {
+    "shasum": "6da5a17668c4b3dd59623bda11cf7fa4c1f60a6f",
+    "tarball": "http://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz"
+  },
   "_resolved": "https://registry.npmjs.org/node-uuid/-/node-uuid-1.4.7.tgz",
-  "_from": "node-uuid@>=1.4.7 <1.5.0"
+  "readme": "ERROR: No README data found!"
 }
index a587541..b7fc0ac 100644 (file)
@@ -132,3 +132,4 @@ exports.rsasign = rsasign
 exports.plaintext = plaintext
 exports.sign = sign
 exports.rfc3986 = rfc3986
+exports.generateBase = generateBase
index 566bf5c..70c01e2 100644 (file)
@@ -6,7 +6,7 @@
   },
   "name": "oauth-sign",
   "description": "OAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module.",
-  "version": "0.8.0",
+  "version": "0.8.1",
   "license": "Apache-2.0",
   "repository": {
     "url": "git+https://github.com/mikeal/oauth-sign.git"
   "scripts": {
     "test": "node test.js"
   },
-  "readme": "oauth-sign\n==========\n\nOAuth 1 signing. Formerly a vendor lib in mikeal/request, now a standalone module. \n",
-  "readmeFilename": "README.md",
+  "gitHead": "9c7229a336c9face98b83f93b72cb7c80dbba08d",
   "bugs": {
     "url": "https://github.com/mikeal/oauth-sign/issues"
   },
   "homepage": "https://github.com/mikeal/oauth-sign#readme",
-  "_id": "oauth-sign@0.8.0",
-  "_shasum": "938fdc875765ba527137d8aec9d178e24debc553",
-  "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.0.tgz",
-  "_from": "oauth-sign@>=0.8.0 <0.9.0"
+  "_id": "oauth-sign@0.8.1",
+  "_shasum": "182439bdb91378bf7460e75c64ea43e6448def06",
+  "_from": "oauth-sign@>=0.8.0 <0.9.0",
+  "_npmVersion": "3.6.0",
+  "_nodeVersion": "5.5.0",
+  "_npmUser": {
+    "name": "simov",
+    "email": "simeonvelichkov@gmail.com"
+  },
+  "dist": {
+    "shasum": "182439bdb91378bf7460e75c64ea43e6448def06",
+    "tarball": "http://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "mikeal",
+      "email": "mikeal.rogers@gmail.com"
+    },
+    {
+      "name": "nylen",
+      "email": "jnylen@gmail.com"
+    },
+    {
+      "name": "simov",
+      "email": "simeonvelichkov@gmail.com"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.8.1.tgz",
+  "readme": "ERROR: No README data found!"
 }
diff --git a/deps/npm/node_modules/request/node_modules/qs/.eslintrc b/deps/npm/node_modules/request/node_modules/qs/.eslintrc
deleted file mode 100644 (file)
index d196822..0000000
+++ /dev/null
@@ -1,17 +0,0 @@
-{
-       "root": true,
-
-       "extends": "@ljharb",
-
-       "rules": {
-               "complexity": [2, 18],
-               "consistent-return": [1],
-               "max-params": [2, 8],
-               "max-statements": [2, 32],
-               "no-extra-parens": [1],
-               "no-continue": [1],
-               "no-magic-numbers": 0,
-               "no-restricted-syntax": [2, "BreakStatement", "DebuggerStatement", "ForInStatement", "LabeledStatement", "WithStatement"],
-               "operator-linebreak": 1
-       }
-}
index 335fded..63bdc12 100644 (file)
@@ -1,8 +1,69 @@
 language: node_js
-
 node_js:
-  - 0.10
-  - 4.0
-  - 4
-
+  - "5.3"
+  - "5.2"
+  - "5.1"
+  - "5.0"
+  - "4.2"
+  - "4.1"
+  - "4.0"
+  - "iojs-v3.3"
+  - "iojs-v3.2"
+  - "iojs-v3.1"
+  - "iojs-v3.0"
+  - "iojs-v2.5"
+  - "iojs-v2.4"
+  - "iojs-v2.3"
+  - "iojs-v2.2"
+  - "iojs-v2.1"
+  - "iojs-v2.0"
+  - "iojs-v1.8"
+  - "iojs-v1.7"
+  - "iojs-v1.6"
+  - "iojs-v1.5"
+  - "iojs-v1.4"
+  - "iojs-v1.3"
+  - "iojs-v1.2"
+  - "iojs-v1.1"
+  - "iojs-v1.0"
+  - "0.12"
+  - "0.11"
+  - "0.10"
+  - "0.9"
+  - "0.8"
+  - "0.6"
+  - "0.4"
+before_install:
+  - 'if [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
+  - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
+script:
+  - 'if [ "${TRAVIS_NODE_VERSION}" != "4.2" ]; then npm run tests-only ; else npm test ; fi'
 sudo: false
+matrix:
+  fast_finish: true
+  allow_failures:
+    - node_js: "5.2"
+    - node_js: "5.1"
+    - node_js: "5.0"
+    - node_js: "4.1"
+    - node_js: "4.0"
+    - node_js: "iojs-v3.2"
+    - node_js: "iojs-v3.1"
+    - node_js: "iojs-v3.0"
+    - node_js: "iojs-v2.4"
+    - node_js: "iojs-v2.3"
+    - node_js: "iojs-v2.2"
+    - node_js: "iojs-v2.1"
+    - node_js: "iojs-v2.0"
+    - node_js: "iojs-v1.7"
+    - node_js: "iojs-v1.6"
+    - node_js: "iojs-v1.5"
+    - node_js: "iojs-v1.4"
+    - node_js: "iojs-v1.3"
+    - node_js: "iojs-v1.2"
+    - node_js: "iojs-v1.1"
+    - node_js: "iojs-v1.0"
+    - node_js: "0.11"
+    - node_js: "0.9"
+    - node_js: "0.6"
+    - node_js: "0.4"
index e43b1ac..2df5e9d 100644 (file)
+## [**6.0.2**](https://github.com/ljharb/qs/issues?milestone=33&state=closed)
+- Revert ES6 requirement and restore support for node down to v0.8.
 
-## [**5.1.0**](https://github.com/hapijs/qs/issues?milestone=29&state=open)
-- [**#117**](https://github.com/hapijs/qs/issues/117) make URI encoding stringified results optional
-- [**#106**](https://github.com/hapijs/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify
+## [**6.0.1**](https://github.com/ljharb/qs/issues?milestone=32&state=closed)
+- [**#127**](https://github.com/ljharb/qs/pull/127) Fix engines definition in package.json
 
-## [**5.0.0**](https://github.com/hapijs/qs/issues?milestone=28&state=closed)
-- [**#114**](https://github.com/hapijs/qs/issues/114) default allowDots to false
-- [**#100**](https://github.com/hapijs/qs/issues/100) include dist to npm
+## [**6.0.0**](https://github.com/ljharb/qs/issues?milestone=31&state=closed)
+- [**#124**](https://github.com/ljharb/qs/issues/124) Use ES6 and drop support for node < v4
 
-## [**4.0.0**](https://github.com/hapijs/qs/issues?milestone=26&state=closed)
-- [**#98**](https://github.com/hapijs/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional
+## [**5.2.0**](https://github.com/ljharb/qs/issues?milestone=30&state=closed)
+- [**#64**](https://github.com/ljharb/qs/issues/64) Add option to sort object keys in the query string
 
-## [**3.1.0**](https://github.com/hapijs/qs/issues?milestone=24&state=closed)
-- [**#89**](https://github.com/hapijs/qs/issues/89) Add option to disable "Transform dot notation to bracket notation"
+## [**5.1.0**](https://github.com/ljharb/qs/issues?milestone=29&state=closed)
+- [**#117**](https://github.com/ljharb/qs/issues/117) make URI encoding stringified results optional
+- [**#106**](https://github.com/ljharb/qs/issues/106) Add flag `skipNulls` to optionally skip null values in stringify
 
-## [**3.0.0**](https://github.com/hapijs/qs/issues?milestone=23&state=closed)
-- [**#80**](https://github.com/hapijs/qs/issues/80) qs.parse silently drops properties
-- [**#77**](https://github.com/hapijs/qs/issues/77) Perf boost
-- [**#60**](https://github.com/hapijs/qs/issues/60) Add explicit option to disable array parsing
-- [**#74**](https://github.com/hapijs/qs/issues/74) Bad parse when turning array into object
-- [**#81**](https://github.com/hapijs/qs/issues/81) Add a `filter` option
-- [**#68**](https://github.com/hapijs/qs/issues/68) Fixed issue with recursion and passing strings into objects.
-- [**#66**](https://github.com/hapijs/qs/issues/66) Add mixed array and object dot notation support Closes: #47
-- [**#76**](https://github.com/hapijs/qs/issues/76) RFC 3986
-- [**#85**](https://github.com/hapijs/qs/issues/85) No equal sign
-- [**#84**](https://github.com/hapijs/qs/issues/84) update license attribute
+## [**5.0.0**](https://github.com/ljharb/qs/issues?milestone=28&state=closed)
+- [**#114**](https://github.com/ljharb/qs/issues/114) default allowDots to false
+- [**#100**](https://github.com/ljharb/qs/issues/100) include dist to npm
 
-## [**2.4.1**](https://github.com/hapijs/qs/issues?milestone=20&state=closed)
-- [**#73**](https://github.com/hapijs/qs/issues/73) Property 'hasOwnProperty' of object #<Object> is not a function
+## [**4.0.0**](https://github.com/ljharb/qs/issues?milestone=26&state=closed)
+- [**#98**](https://github.com/ljharb/qs/issues/98) make returning plain objects and allowing prototype overwriting properties optional
 
-## [**2.4.0**](https://github.com/hapijs/qs/issues?milestone=19&state=closed)
-- [**#70**](https://github.com/hapijs/qs/issues/70) Add arrayFormat option
+## [**3.1.0**](https://github.com/ljharb/qs/issues?milestone=24&state=closed)
+- [**#89**](https://github.com/ljharb/qs/issues/89) Add option to disable "Transform dot notation to bracket notation"
 
-## [**2.3.3**](https://github.com/hapijs/qs/issues?milestone=18&state=closed)
-- [**#59**](https://github.com/hapijs/qs/issues/59) make sure array indexes are >= 0, closes #57
-- [**#58**](https://github.com/hapijs/qs/issues/58) make qs usable for browser loader
+## [**3.0.0**](https://github.com/ljharb/qs/issues?milestone=23&state=closed)
+- [**#80**](https://github.com/ljharb/qs/issues/80) qs.parse silently drops properties
+- [**#77**](https://github.com/ljharb/qs/issues/77) Perf boost
+- [**#60**](https://github.com/ljharb/qs/issues/60) Add explicit option to disable array parsing
+- [**#74**](https://github.com/ljharb/qs/issues/74) Bad parse when turning array into object
+- [**#81**](https://github.com/ljharb/qs/issues/81) Add a `filter` option
+- [**#68**](https://github.com/ljharb/qs/issues/68) Fixed issue with recursion and passing strings into objects.
+- [**#66**](https://github.com/ljharb/qs/issues/66) Add mixed array and object dot notation support Closes: #47
+- [**#76**](https://github.com/ljharb/qs/issues/76) RFC 3986
+- [**#85**](https://github.com/ljharb/qs/issues/85) No equal sign
+- [**#84**](https://github.com/ljharb/qs/issues/84) update license attribute
 
-## [**2.3.2**](https://github.com/hapijs/qs/issues?milestone=17&state=closed)
-- [**#55**](https://github.com/hapijs/qs/issues/55) allow merging a string into an object
+## [**2.4.1**](https://github.com/ljharb/qs/issues?milestone=20&state=closed)
+- [**#73**](https://github.com/ljharb/qs/issues/73) Property 'hasOwnProperty' of object #<Object> is not a function
 
-## [**2.3.1**](https://github.com/hapijs/qs/issues?milestone=16&state=closed)
-- [**#52**](https://github.com/hapijs/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError".
+## [**2.4.0**](https://github.com/ljharb/qs/issues?milestone=19&state=closed)
+- [**#70**](https://github.com/ljharb/qs/issues/70) Add arrayFormat option
 
-## [**2.3.0**](https://github.com/hapijs/qs/issues?milestone=15&state=closed)
-- [**#50**](https://github.com/hapijs/qs/issues/50) add option to omit array indices, closes #46
+## [**2.3.3**](https://github.com/ljharb/qs/issues?milestone=18&state=closed)
+- [**#59**](https://github.com/ljharb/qs/issues/59) make sure array indexes are >= 0, closes #57
+- [**#58**](https://github.com/ljharb/qs/issues/58) make qs usable for browser loader
 
-## [**2.2.5**](https://github.com/hapijs/qs/issues?milestone=14&state=closed)
-- [**#39**](https://github.com/hapijs/qs/issues/39) Is there an alternative to Buffer.isBuffer?
-- [**#49**](https://github.com/hapijs/qs/issues/49) refactor utils.merge, fixes #45
-- [**#41**](https://github.com/hapijs/qs/issues/41) avoid browserifying Buffer, for #39
+## [**2.3.2**](https://github.com/ljharb/qs/issues?milestone=17&state=closed)
+- [**#55**](https://github.com/ljharb/qs/issues/55) allow merging a string into an object
 
-## [**2.2.4**](https://github.com/hapijs/qs/issues?milestone=13&state=closed)
-- [**#38**](https://github.com/hapijs/qs/issues/38) how to handle object keys beginning with a number
+## [**2.3.1**](https://github.com/ljharb/qs/issues?milestone=16&state=closed)
+- [**#52**](https://github.com/ljharb/qs/issues/52) Return "undefined" and "false" instead of throwing "TypeError".
 
-## [**2.2.3**](https://github.com/hapijs/qs/issues?milestone=12&state=closed)
-- [**#37**](https://github.com/hapijs/qs/issues/37) parser discards first empty value in array
-- [**#36**](https://github.com/hapijs/qs/issues/36) Update to lab 4.x
+## [**2.3.0**](https://github.com/ljharb/qs/issues?milestone=15&state=closed)
+- [**#50**](https://github.com/ljharb/qs/issues/50) add option to omit array indices, closes #46
 
-## [**2.2.2**](https://github.com/hapijs/qs/issues?milestone=11&state=closed)
-- [**#33**](https://github.com/hapijs/qs/issues/33) Error when plain object in a value
-- [**#34**](https://github.com/hapijs/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
-- [**#24**](https://github.com/hapijs/qs/issues/24) Changelog? Semver?
+## [**2.2.5**](https://github.com/ljharb/qs/issues?milestone=14&state=closed)
+- [**#39**](https://github.com/ljharb/qs/issues/39) Is there an alternative to Buffer.isBuffer?
+- [**#49**](https://github.com/ljharb/qs/issues/49) refactor utils.merge, fixes #45
+- [**#41**](https://github.com/ljharb/qs/issues/41) avoid browserifying Buffer, for #39
 
-## [**2.2.1**](https://github.com/hapijs/qs/issues?milestone=10&state=closed)
-- [**#32**](https://github.com/hapijs/qs/issues/32) account for circular references properly, closes #31
-- [**#31**](https://github.com/hapijs/qs/issues/31) qs.parse stackoverflow on circular objects
+## [**2.2.4**](https://github.com/ljharb/qs/issues?milestone=13&state=closed)
+- [**#38**](https://github.com/ljharb/qs/issues/38) how to handle object keys beginning with a number
 
-## [**2.2.0**](https://github.com/hapijs/qs/issues?milestone=9&state=closed)
-- [**#26**](https://github.com/hapijs/qs/issues/26) Don't use Buffer global if it's not present
-- [**#30**](https://github.com/hapijs/qs/issues/30) Bug when merging non-object values into arrays
-- [**#29**](https://github.com/hapijs/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
-- [**#23**](https://github.com/hapijs/qs/issues/23) Ability to not limit parameters?
+## [**2.2.3**](https://github.com/ljharb/qs/issues?milestone=12&state=closed)
+- [**#37**](https://github.com/ljharb/qs/issues/37) parser discards first empty value in array
+- [**#36**](https://github.com/ljharb/qs/issues/36) Update to lab 4.x
 
-## [**2.1.0**](https://github.com/hapijs/qs/issues?milestone=8&state=closed)
-- [**#22**](https://github.com/hapijs/qs/issues/22) Enable using a RegExp as delimiter
+## [**2.2.2**](https://github.com/ljharb/qs/issues?milestone=11&state=closed)
+- [**#33**](https://github.com/ljharb/qs/issues/33) Error when plain object in a value
+- [**#34**](https://github.com/ljharb/qs/issues/34) use Object.prototype.hasOwnProperty.call instead of obj.hasOwnProperty
+- [**#24**](https://github.com/ljharb/qs/issues/24) Changelog? Semver?
 
-## [**2.0.0**](https://github.com/hapijs/qs/issues?milestone=7&state=closed)
-- [**#18**](https://github.com/hapijs/qs/issues/18) Why is there arrayLimit?
-- [**#20**](https://github.com/hapijs/qs/issues/20) Configurable parametersLimit
-- [**#21**](https://github.com/hapijs/qs/issues/21) make all limits optional, for #18, for #20
+## [**2.2.1**](https://github.com/ljharb/qs/issues?milestone=10&state=closed)
+- [**#32**](https://github.com/ljharb/qs/issues/32) account for circular references properly, closes #31
+- [**#31**](https://github.com/ljharb/qs/issues/31) qs.parse stackoverflow on circular objects
 
-## [**1.2.2**](https://github.com/hapijs/qs/issues?milestone=6&state=closed)
-- [**#19**](https://github.com/hapijs/qs/issues/19) Don't overwrite null values
+## [**2.2.0**](https://github.com/ljharb/qs/issues?milestone=9&state=closed)
+- [**#26**](https://github.com/ljharb/qs/issues/26) Don't use Buffer global if it's not present
+- [**#30**](https://github.com/ljharb/qs/issues/30) Bug when merging non-object values into arrays
+- [**#29**](https://github.com/ljharb/qs/issues/29) Don't call Utils.clone at the top of Utils.merge
+- [**#23**](https://github.com/ljharb/qs/issues/23) Ability to not limit parameters?
 
-## [**1.2.1**](https://github.com/hapijs/qs/issues?milestone=5&state=closed)
-- [**#16**](https://github.com/hapijs/qs/issues/16) ignore non-string delimiters
-- [**#15**](https://github.com/hapijs/qs/issues/15) Close code block
+## [**2.1.0**](https://github.com/ljharb/qs/issues?milestone=8&state=closed)
+- [**#22**](https://github.com/ljharb/qs/issues/22) Enable using a RegExp as delimiter
 
-## [**1.2.0**](https://github.com/hapijs/qs/issues?milestone=4&state=closed)
-- [**#12**](https://github.com/hapijs/qs/issues/12) Add optional delim argument
-- [**#13**](https://github.com/hapijs/qs/issues/13) fix #11: flattened keys in array are now correctly parsed
+## [**2.0.0**](https://github.com/ljharb/qs/issues?milestone=7&state=closed)
+- [**#18**](https://github.com/ljharb/qs/issues/18) Why is there arrayLimit?
+- [**#20**](https://github.com/ljharb/qs/issues/20) Configurable parametersLimit
+- [**#21**](https://github.com/ljharb/qs/issues/21) make all limits optional, for #18, for #20
 
-## [**1.1.0**](https://github.com/hapijs/qs/issues?milestone=3&state=closed)
-- [**#7**](https://github.com/hapijs/qs/issues/7) Empty values of a POST array disappear after being submitted
-- [**#9**](https://github.com/hapijs/qs/issues/9) Should not omit equals signs (=) when value is null
-- [**#6**](https://github.com/hapijs/qs/issues/6) Minor grammar fix in README
+## [**1.2.2**](https://github.com/ljharb/qs/issues?milestone=6&state=closed)
+- [**#19**](https://github.com/ljharb/qs/issues/19) Don't overwrite null values
 
-## [**1.0.2**](https://github.com/hapijs/qs/issues?milestone=2&state=closed)
-- [**#5**](https://github.com/hapijs/qs/issues/5) array holes incorrectly copied into object on large index
+## [**1.2.1**](https://github.com/ljharb/qs/issues?milestone=5&state=closed)
+- [**#16**](https://github.com/ljharb/qs/issues/16) ignore non-string delimiters
+- [**#15**](https://github.com/ljharb/qs/issues/15) Close code block
+
+## [**1.2.0**](https://github.com/ljharb/qs/issues?milestone=4&state=closed)
+- [**#12**](https://github.com/ljharb/qs/issues/12) Add optional delim argument
+- [**#13**](https://github.com/ljharb/qs/issues/13) fix #11: flattened keys in array are now correctly parsed
+
+## [**1.1.0**](https://github.com/ljharb/qs/issues?milestone=3&state=closed)
+- [**#7**](https://github.com/ljharb/qs/issues/7) Empty values of a POST array disappear after being submitted
+- [**#9**](https://github.com/ljharb/qs/issues/9) Should not omit equals signs (=) when value is null
+- [**#6**](https://github.com/ljharb/qs/issues/6) Minor grammar fix in README
+
+## [**1.0.2**](https://github.com/ljharb/qs/issues?milestone=2&state=closed)
+- [**#5**](https://github.com/ljharb/qs/issues/5) array holes incorrectly copied into object on large index
index 3c61db3..335eafb 100644 (file)
@@ -2,76 +2,82 @@
 
 A querystring parsing and stringifying library with some added security.
 
-[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs)
+[![Build Status](https://api.travis-ci.org/ljharb/qs.svg)](http://travis-ci.org/ljharb/qs)
 
-Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
+Lead Maintainer: [Jordan Harband](https://github.com/ljharb)
 
 The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).
 
 ## Usage
 
 ```javascript
-var Qs = require('qs');
+var qs = require('qs');
+var assert = require('assert');
 
-var obj = Qs.parse('a=c');    // { a: 'c' }
-var str = Qs.stringify(obj);  // 'a=c'
+var obj = qs.parse('a=c');
+assert.deepEqual(obj, { a: 'c' });
+
+var str = qs.stringify(obj);
+assert.equal(str, 'a=c');
 ```
 
 ### Parsing Objects
 
+[](#preventEval)
 ```javascript
-Qs.parse(string, [options]);
+qs.parse(string, [options]);
 ```
 
 **qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.
 For example, the string `'foo[bar]=baz'` converts to:
 
 ```javascript
-{
+assert.deepEqual(qs.parse('foo[bar]=baz'), {
   foo: {
     bar: 'baz'
   }
-}
+});
 ```
 
 When using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like:
 
 ```javascript
-Qs.parse('a.hasOwnProperty=b', { plainObjects: true });
-// { a: { hasOwnProperty: 'b' } }
+var plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true });
+assert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } });
 ```
 
 By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.
 
 ```javascript
-Qs.parse('a.hasOwnProperty=b', { allowPrototypes: true });
-// { a: { hasOwnProperty: 'b' } }
+var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true });
+assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } });
 ```
 
 URI encoded strings work too:
 
 ```javascript
-Qs.parse('a%5Bb%5D=c');
-// { a: { b: 'c' } }
+assert.deepEqual(qs.parse('a%5Bb%5D=c'), {
+  a: { b: 'c' }
+});
 ```
 
 You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:
 
 ```javascript
-{
+assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), {
   foo: {
     bar: {
       baz: 'foobarbaz'
     }
   }
-}
+});
 ```
 
 By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like
 `'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:
 
 ```javascript
-{
+var expected = {
   a: {
     b: {
       c: {
@@ -85,14 +91,16 @@ By default, when nesting objects **qs** will only parse up to 5 children deep. T
       }
     }
   }
-}
+};
+var string = 'a[b][c][d][e][f][g][h][i]=j';
+assert.deepEqual(qs.parse(string), expected);
 ```
 
-This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`:
+This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`:
 
 ```javascript
-Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
-// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }
+var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
+assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } });
 ```
 
 The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.
@@ -100,29 +108,29 @@ The depth limit helps mitigate abuse when **qs** is used to parse user input, an
 For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:
 
 ```javascript
-Qs.parse('a=b&c=d', { parameterLimit: 1 });
-// { a: 'b' }
+var limited = qs.parse('a=b&c=d', { parameterLimit: 1 });
+assert.deepEqual(limited, { a: 'b' });
 ```
 
 An optional delimiter can also be passed:
 
 ```javascript
-Qs.parse('a=b;c=d', { delimiter: ';' });
-// { a: 'b', c: 'd' }
+var delimited = qs.parse('a=b;c=d', { delimiter: ';' });
+assert.deepEqual(delimited, { a: 'b', c: 'd' });
 ```
 
 Delimiters can be a regular expression too:
 
 ```javascript
-Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
-// { a: 'b', c: 'd', e: 'f' }
+var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
+assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' });
 ```
 
 Option `allowDots` can be used to enable dot notation:
 
 ```javascript
-Qs.parse('a.b=c', { allowDots: true });
-// { a: { b: 'c' } }
+var withDots = qs.parse('a.b=c', { allowDots: true });
+assert.deepEqual(withDots, { a: { b: 'c' } });
 ```
 
 ### Parsing Arrays
@@ -130,15 +138,15 @@ Qs.parse('a.b=c', { allowDots: true });
 **qs** can also parse arrays using a similar `[]` notation:
 
 ```javascript
-Qs.parse('a[]=b&a[]=c');
-// { a: ['b', 'c'] }
+var withArray = qs.parse('a[]=b&a[]=c');
+assert.deepEqual(withArray, { a: ['b', 'c'] });
 ```
 
 You may specify an index as well:
 
 ```javascript
-Qs.parse('a[1]=c&a[0]=b');
-// { a: ['b', 'c'] }
+var withIndexes = qs.parse('a[1]=c&a[0]=b');
+assert.deepEqual(withIndexes, { a: ['b', 'c'] });
 ```
 
 Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number
@@ -146,75 +154,75 @@ to create an array. When creating arrays with specific indices, **qs** will comp
 their order:
 
 ```javascript
-Qs.parse('a[1]=b&a[15]=c');
-// { a: ['b', 'c'] }
+var noSparse = qs.parse('a[1]=b&a[15]=c');
+assert.deepEqual(noSparse, { a: ['b', 'c'] });
 ```
 
 Note that an empty string is also a value, and will be preserved:
 
 ```javascript
-Qs.parse('a[]=&a[]=b');
-// { a: ['', 'b'] }
-Qs.parse('a[0]=b&a[1]=&a[2]=c');
-// { a: ['b', '', 'c'] }
+var withEmptyString = qs.parse('a[]=&a[]=b');
+assert.deepEqual(withEmptyString, { a: ['', 'b'] });
+
+var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');
+assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });
 ```
 
 **qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
 instead be converted to an object with the index as the key:
 
 ```javascript
-Qs.parse('a[100]=b');
-// { a: { '100': 'b' } }
+var withMaxIndex = qs.parse('a[100]=b');
+assert.deepEqual(withMaxIndex, { a: { '100': 'b' } });
 ```
 
 This limit can be overridden by passing an `arrayLimit` option:
 
 ```javascript
-Qs.parse('a[1]=b', { arrayLimit: 0 });
-// { a: { '1': 'b' } }
+var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });
+assert.deepEqual(withArrayLimit, { a: { '1': 'b' } });
 ```
 
 To disable array parsing entirely, set `parseArrays` to `false`.
 
 ```javascript
-Qs.parse('a[]=b', { parseArrays: false });
-// { a: { '0': 'b' } }
+var noParsingArrays = qs.parse('a[]=b', { parseArrays: false });
+assert.deepEqual(noParsingArrays, { a: { '0': 'b' } });
 ```
 
 If you mix notations, **qs** will merge the two items into an object:
 
 ```javascript
-Qs.parse('a[0]=b&a[b]=c');
-// { a: { '0': 'b', b: 'c' } }
+var mixedNotation = qs.parse('a[0]=b&a[b]=c');
+assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });
 ```
 
 You can also create arrays of objects:
 
 ```javascript
-Qs.parse('a[][b]=c');
-// { a: [{ b: 'c' }] }
+var arraysOfObjects = qs.parse('a[][b]=c');
+assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });
 ```
 
 ### Stringifying
 
+[](#preventEval)
 ```javascript
-Qs.stringify(object, [options]);
+qs.stringify(object, [options]);
 ```
 
 When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect:
 
 ```javascript
-Qs.stringify({ a: 'b' });
-// 'a=b'
-Qs.stringify({ a: { b: 'c' } });
-// 'a%5Bb%5D=c'
+assert.equal(qs.stringify({ a: 'b' }), 'a=b');
+assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
 ```
 
 This encoding can be disabled by setting the `encode` option to `false`:
 
 ```javascript
-Qs.stringify({ a: { b: 'c' } }, { encode: false });
-// 'a[b]=c'
+var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false });
+assert.equal(unencoded, 'a[b]=c');
 ```
 
 Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.
@@ -222,47 +230,44 @@ Examples beyond this point will be shown as though the output is not URI encoded
 When arrays are stringified, by default they are given explicit indices:
 
 ```javascript
-Qs.stringify({ a: ['b', 'c', 'd'] });
+qs.stringify({ a: ['b', 'c', 'd'] });
 // 'a[0]=b&a[1]=c&a[2]=d'
 ```
 
 You may override this by setting the `indices` option to `false`:
 
 ```javascript
-Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
+qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
 // 'a=b&a=c&a=d'
 ```
 
 You may use the `arrayFormat` option to specify the format of the output array
 
 ```javascript
-Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
+qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
 // 'a[0]=b&a[1]=c'
-Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
+qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
 // 'a[]=b&a[]=c'
-Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
+qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
 // 'a=b&a=c'
 ```
 
 Empty strings and null values will omit the value, but the equals sign (=) remains in place:
 
 ```javascript
-Qs.stringify({ a: '' });
-// 'a='
+assert.equal(qs.stringify({ a: '' }), 'a=');
 ```
 
 Properties that are set to `undefined` will be omitted entirely:
 
 ```javascript
-Qs.stringify({ a: null, b: undefined });
-// 'a='
+assert.equal(qs.stringify({ a: null, b: undefined }), 'a=');
 ```
 
 The delimiter may be overridden with stringify as well:
 
 ```javascript
-Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' });
-// 'a=b;c=d'
+assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
 ```
 
 Finally, you can use the `filter` option to restrict which keys will be included in the stringified output.
@@ -283,11 +288,11 @@ function filterFunc(prefix, value) {
   }
   return value;
 }
-Qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc })
+qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc });
 // 'a=b&c=d&e[f]=123&e[g][0]=4'
-Qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] })
+qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] });
 // 'a=b&e=f'
-Qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] })
+qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] });
 // 'a[0]=b&a[2]=d'
 ```
 
@@ -296,36 +301,35 @@ Qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] })
 By default, `null` values are treated like empty strings:
 
 ```javascript
-Qs.stringify({ a: null, b: '' });
-// 'a=&b='
+var withNull = qs.stringify({ a: null, b: '' });
+assert.equal(withNull, 'a=&b=');
 ```
 
 Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings.
 
 ```javascript
-Qs.parse('a&b=')
-// { a: '', b: '' }
+var equalsInsensitive = qs.parse('a&b=');
+assert.deepEqual(equalsInsensitive, { a: '', b: '' });
 ```
 
 To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null`
 values have no `=` sign:
 
 ```javascript
-Qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
-// 'a&b='
+var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
+assert.equal(strictNull, 'a&b=');
 ```
 
 To parse values without `=` back to `null` use the `strictNullHandling` flag:
 
 ```javascript
-Qs.parse('a&b=', { strictNullHandling: true });
-// { a: null, b: '' }
-
+var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true });
+assert.deepEqual(parsedStrictNull, { a: null, b: '' });
 ```
 
 To completely skip rendering keys with `null` values, use the `skipNulls` flag:
 
 ```javascript
-qs.stringify({ a: 'b', c: null}, { skipNulls: true })
-// 'a=b'
+var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true });
+assert.equal(nullsSkipped, 'a=b');
 ```
index 3c61db3..335eafb 100644 (file)
@@ -2,76 +2,82 @@
 
 A querystring parsing and stringifying library with some added security.
 
-[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs)
+[![Build Status](https://api.travis-ci.org/ljharb/qs.svg)](http://travis-ci.org/ljharb/qs)
 
-Lead Maintainer: [Nathan LaFreniere](https://github.com/nlf)
+Lead Maintainer: [Jordan Harband](https://github.com/ljharb)
 
 The **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).
 
 ## Usage
 
 ```javascript
-var Qs = require('qs');
+var qs = require('qs');
+var assert = require('assert');
 
-var obj = Qs.parse('a=c');    // { a: 'c' }
-var str = Qs.stringify(obj);  // 'a=c'
+var obj = qs.parse('a=c');
+assert.deepEqual(obj, { a: 'c' });
+
+var str = qs.stringify(obj);
+assert.equal(str, 'a=c');
 ```
 
 ### Parsing Objects
 
+[](#preventEval)
 ```javascript
-Qs.parse(string, [options]);
+qs.parse(string, [options]);
 ```
 
 **qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.
 For example, the string `'foo[bar]=baz'` converts to:
 
 ```javascript
-{
+assert.deepEqual(qs.parse('foo[bar]=baz'), {
   foo: {
     bar: 'baz'
   }
-}
+});
 ```
 
 When using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like:
 
 ```javascript
-Qs.parse('a.hasOwnProperty=b', { plainObjects: true });
-// { a: { hasOwnProperty: 'b' } }
+var plainObject = qs.parse('a[hasOwnProperty]=b', { plainObjects: true });
+assert.deepEqual(plainObject, { a: { hasOwnProperty: 'b' } });
 ```
 
 By default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.
 
 ```javascript
-Qs.parse('a.hasOwnProperty=b', { allowPrototypes: true });
-// { a: { hasOwnProperty: 'b' } }
+var protoObject = qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true });
+assert.deepEqual(protoObject, { a: { hasOwnProperty: 'b' } });
 ```
 
 URI encoded strings work too:
 
 ```javascript
-Qs.parse('a%5Bb%5D=c');
-// { a: { b: 'c' } }
+assert.deepEqual(qs.parse('a%5Bb%5D=c'), {
+  a: { b: 'c' }
+});
 ```
 
 You can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:
 
 ```javascript
-{
+assert.deepEqual(qs.parse('foo[bar][baz]=foobarbaz'), {
   foo: {
     bar: {
       baz: 'foobarbaz'
     }
   }
-}
+});
 ```
 
 By default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like
 `'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:
 
 ```javascript
-{
+var expected = {
   a: {
     b: {
       c: {
@@ -85,14 +91,16 @@ By default, when nesting objects **qs** will only parse up to 5 children deep. T
       }
     }
   }
-}
+};
+var string = 'a[b][c][d][e][f][g][h][i]=j';
+assert.deepEqual(qs.parse(string), expected);
 ```
 
-This depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`:
+This depth can be overridden by passing a `depth` option to `qs.parse(string, [options])`:
 
 ```javascript
-Qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
-// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }
+var deep = qs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });
+assert.deepEqual(deep, { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } });
 ```
 
 The depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.
@@ -100,29 +108,29 @@ The depth limit helps mitigate abuse when **qs** is used to parse user input, an
 For similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:
 
 ```javascript
-Qs.parse('a=b&c=d', { parameterLimit: 1 });
-// { a: 'b' }
+var limited = qs.parse('a=b&c=d', { parameterLimit: 1 });
+assert.deepEqual(limited, { a: 'b' });
 ```
 
 An optional delimiter can also be passed:
 
 ```javascript
-Qs.parse('a=b;c=d', { delimiter: ';' });
-// { a: 'b', c: 'd' }
+var delimited = qs.parse('a=b;c=d', { delimiter: ';' });
+assert.deepEqual(delimited, { a: 'b', c: 'd' });
 ```
 
 Delimiters can be a regular expression too:
 
 ```javascript
-Qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
-// { a: 'b', c: 'd', e: 'f' }
+var regexed = qs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });
+assert.deepEqual(regexed, { a: 'b', c: 'd', e: 'f' });
 ```
 
 Option `allowDots` can be used to enable dot notation:
 
 ```javascript
-Qs.parse('a.b=c', { allowDots: true });
-// { a: { b: 'c' } }
+var withDots = qs.parse('a.b=c', { allowDots: true });
+assert.deepEqual(withDots, { a: { b: 'c' } });
 ```
 
 ### Parsing Arrays
@@ -130,15 +138,15 @@ Qs.parse('a.b=c', { allowDots: true });
 **qs** can also parse arrays using a similar `[]` notation:
 
 ```javascript
-Qs.parse('a[]=b&a[]=c');
-// { a: ['b', 'c'] }
+var withArray = qs.parse('a[]=b&a[]=c');
+assert.deepEqual(withArray, { a: ['b', 'c'] });
 ```
 
 You may specify an index as well:
 
 ```javascript
-Qs.parse('a[1]=c&a[0]=b');
-// { a: ['b', 'c'] }
+var withIndexes = qs.parse('a[1]=c&a[0]=b');
+assert.deepEqual(withIndexes, { a: ['b', 'c'] });
 ```
 
 Note that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number
@@ -146,75 +154,75 @@ to create an array. When creating arrays with specific indices, **qs** will comp
 their order:
 
 ```javascript
-Qs.parse('a[1]=b&a[15]=c');
-// { a: ['b', 'c'] }
+var noSparse = qs.parse('a[1]=b&a[15]=c');
+assert.deepEqual(noSparse, { a: ['b', 'c'] });
 ```
 
 Note that an empty string is also a value, and will be preserved:
 
 ```javascript
-Qs.parse('a[]=&a[]=b');
-// { a: ['', 'b'] }
-Qs.parse('a[0]=b&a[1]=&a[2]=c');
-// { a: ['b', '', 'c'] }
+var withEmptyString = qs.parse('a[]=&a[]=b');
+assert.deepEqual(withEmptyString, { a: ['', 'b'] });
+
+var withIndexedEmptyString = qs.parse('a[0]=b&a[1]=&a[2]=c');
+assert.deepEqual(withIndexedEmptyString, { a: ['b', '', 'c'] });
 ```
 
 **qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will
 instead be converted to an object with the index as the key:
 
 ```javascript
-Qs.parse('a[100]=b');
-// { a: { '100': 'b' } }
+var withMaxIndex = qs.parse('a[100]=b');
+assert.deepEqual(withMaxIndex, { a: { '100': 'b' } });
 ```
 
 This limit can be overridden by passing an `arrayLimit` option:
 
 ```javascript
-Qs.parse('a[1]=b', { arrayLimit: 0 });
-// { a: { '1': 'b' } }
+var withArrayLimit = qs.parse('a[1]=b', { arrayLimit: 0 });
+assert.deepEqual(withArrayLimit, { a: { '1': 'b' } });
 ```
 
 To disable array parsing entirely, set `parseArrays` to `false`.
 
 ```javascript
-Qs.parse('a[]=b', { parseArrays: false });
-// { a: { '0': 'b' } }
+var noParsingArrays = qs.parse('a[]=b', { parseArrays: false });
+assert.deepEqual(noParsingArrays, { a: { '0': 'b' } });
 ```
 
 If you mix notations, **qs** will merge the two items into an object:
 
 ```javascript
-Qs.parse('a[0]=b&a[b]=c');
-// { a: { '0': 'b', b: 'c' } }
+var mixedNotation = qs.parse('a[0]=b&a[b]=c');
+assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });
 ```
 
 You can also create arrays of objects:
 
 ```javascript
-Qs.parse('a[][b]=c');
-// { a: [{ b: 'c' }] }
+var arraysOfObjects = qs.parse('a[][b]=c');
+assert.deepEqual(arraysOfObjects, { a: [{ b: 'c' }] });
 ```
 
 ### Stringifying
 
+[](#preventEval)
 ```javascript
-Qs.stringify(object, [options]);
+qs.stringify(object, [options]);
 ```
 
 When stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect:
 
 ```javascript
-Qs.stringify({ a: 'b' });
-// 'a=b'
-Qs.stringify({ a: { b: 'c' } });
-// 'a%5Bb%5D=c'
+assert.equal(qs.stringify({ a: 'b' }), 'a=b');
+assert.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
 ```
 
 This encoding can be disabled by setting the `encode` option to `false`:
 
 ```javascript
-Qs.stringify({ a: { b: 'c' } }, { encode: false });
-// 'a[b]=c'
+var unencoded = qs.stringify({ a: { b: 'c' } }, { encode: false });
+assert.equal(unencoded, 'a[b]=c');
 ```
 
 Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.
@@ -222,47 +230,44 @@ Examples beyond this point will be shown as though the output is not URI encoded
 When arrays are stringified, by default they are given explicit indices:
 
 ```javascript
-Qs.stringify({ a: ['b', 'c', 'd'] });
+qs.stringify({ a: ['b', 'c', 'd'] });
 // 'a[0]=b&a[1]=c&a[2]=d'
 ```
 
 You may override this by setting the `indices` option to `false`:
 
 ```javascript
-Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
+qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });
 // 'a=b&a=c&a=d'
 ```
 
 You may use the `arrayFormat` option to specify the format of the output array
 
 ```javascript
-Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
+qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })
 // 'a[0]=b&a[1]=c'
-Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
+qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })
 // 'a[]=b&a[]=c'
-Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
+qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })
 // 'a=b&a=c'
 ```
 
 Empty strings and null values will omit the value, but the equals sign (=) remains in place:
 
 ```javascript
-Qs.stringify({ a: '' });
-// 'a='
+assert.equal(qs.stringify({ a: '' }), 'a=');
 ```
 
 Properties that are set to `undefined` will be omitted entirely:
 
 ```javascript
-Qs.stringify({ a: null, b: undefined });
-// 'a='
+assert.equal(qs.stringify({ a: null, b: undefined }), 'a=');
 ```
 
 The delimiter may be overridden with stringify as well:
 
 ```javascript
-Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' });
-// 'a=b;c=d'
+assert.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
 ```
 
 Finally, you can use the `filter` option to restrict which keys will be included in the stringified output.
@@ -283,11 +288,11 @@ function filterFunc(prefix, value) {
   }
   return value;
 }
-Qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc })
+qs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc });
 // 'a=b&c=d&e[f]=123&e[g][0]=4'
-Qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] })
+qs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] });
 // 'a=b&e=f'
-Qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] })
+qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] });
 // 'a[0]=b&a[2]=d'
 ```
 
@@ -296,36 +301,35 @@ Qs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] })
 By default, `null` values are treated like empty strings:
 
 ```javascript
-Qs.stringify({ a: null, b: '' });
-// 'a=&b='
+var withNull = qs.stringify({ a: null, b: '' });
+assert.equal(withNull, 'a=&b=');
 ```
 
 Parsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings.
 
 ```javascript
-Qs.parse('a&b=')
-// { a: '', b: '' }
+var equalsInsensitive = qs.parse('a&b=');
+assert.deepEqual(equalsInsensitive, { a: '', b: '' });
 ```
 
 To distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null`
 values have no `=` sign:
 
 ```javascript
-Qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
-// 'a&b='
+var strictNull = qs.stringify({ a: null, b: '' }, { strictNullHandling: true });
+assert.equal(strictNull, 'a&b=');
 ```
 
 To parse values without `=` back to `null` use the `strictNullHandling` flag:
 
 ```javascript
-Qs.parse('a&b=', { strictNullHandling: true });
-// { a: null, b: '' }
-
+var parsedStrictNull = qs.parse('a&b=', { strictNullHandling: true });
+assert.deepEqual(parsedStrictNull, { a: null, b: '' });
 ```
 
 To completely skip rendering keys with `null` values, use the `skipNulls` flag:
 
 ```javascript
-qs.stringify({ a: 'b', c: null}, { skipNulls: true })
-// 'a=b'
+var nullsSkipped = qs.stringify({ a: 'b', c: null}, { skipNulls: true });
+assert.equal(nullsSkipped, 'a=b');
 ```
index 53a70d0..8b21420 100644 (file)
@@ -1,7 +1,7 @@
 {
   "name": "qs",
   "main": "dist/qs.js",
-  "version": "5.1.0",
+  "version": "5.2.0",
   "homepage": "https://github.com/hapijs/qs",
   "authors": [
     "Nathan LaFreniere <quitlahok@gmail.com>"
index 1a1f72c..fca856a 100644 (file)
@@ -2,7 +2,7 @@
   "name": "qs",
   "repository": "hapijs/qs",
   "description": "query-string parser / stringifier with nesting support",
-  "version": "5.1.0",
+  "version": "5.2.0",
   "keywords": ["querystring", "query", "parser"],
   "main": "lib/index.js",
   "scripts": [
index b72e976..68433d4 100644 (file)
@@ -1,28 +1,19 @@
 (function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.Qs = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
-// Load modules
+'use strict';
 
 var Stringify = require('./stringify');
 var Parse = require('./parse');
 
-
-// Declare internals
-
-var internals = {};
-
-
 module.exports = {
     stringify: Stringify,
     parse: Parse
 };
 
 },{"./parse":2,"./stringify":3}],2:[function(require,module,exports){
-// Load modules
+'use strict';
 
 var Utils = require('./utils');
 
-
-// Declare internals
-
 var internals = {
     delimiter: '&',
     depth: 5,
@@ -34,13 +25,11 @@ var internals = {
     allowDots: false
 };
 
-
 internals.parseValues = function (str, options) {
-
     var obj = {};
     var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
 
-    for (var i = 0, il = parts.length; i < il; ++i) {
+    for (var i = 0; i < parts.length; ++i) {
         var part = parts[i];
         var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
 
@@ -50,16 +39,14 @@ internals.parseValues = function (str, options) {
             if (options.strictNullHandling) {
                 obj[Utils.decode(part)] = null;
             }
-        }
-        else {
+        } else {
             var key = Utils.decode(part.slice(0, pos));
             var val = Utils.decode(part.slice(pos + 1));
 
-            if (!Object.prototype.hasOwnProperty.call(obj, key)) {
-                obj[key] = val;
-            }
-            else {
+            if (Object.prototype.hasOwnProperty.call(obj, key)) {
                 obj[key] = [].concat(obj[key]).concat(val);
+            } else {
+                obj[key] = val;
             }
         }
     }
@@ -67,9 +54,7 @@ internals.parseValues = function (str, options) {
     return obj;
 };
 
-
 internals.parseObject = function (chain, val, options) {
-
     if (!chain.length) {
         return val;
     }
@@ -80,23 +65,20 @@ internals.parseObject = function (chain, val, options) {
     if (root === '[]') {
         obj = [];
         obj = obj.concat(internals.parseObject(chain, val, options));
-    }
-    else {
+    } else {
         obj = options.plainObjects ? Object.create(null) : {};
         var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
         var index = parseInt(cleanRoot, 10);
-        var indexString = '' + index;
-        if (!isNaN(index) &&
+        if (
+            !isNaN(index) &&
             root !== cleanRoot &&
-            indexString === cleanRoot &&
+            String(index) === cleanRoot &&
             index >= 0 &&
-            (options.parseArrays &&
-             index <= options.arrayLimit)) {
-
+            (options.parseArrays && index <= options.arrayLimit)
+        ) {
             obj = [];
             obj[index] = internals.parseObject(chain, val, options);
-        }
-        else {
+        } else {
             obj[cleanRoot] = internals.parseObject(chain, val, options);
         }
     }
@@ -104,18 +86,13 @@ internals.parseObject = function (chain, val, options) {
     return obj;
 };
 
-
-internals.parseKeys = function (key, val, options) {
-
-    if (!key) {
+internals.parseKeys = function (givenKey, val, options) {
+    if (!givenKey) {
         return;
     }
 
     // Transform dot notation to bracket notation
-
-    if (options.allowDots) {
-        key = key.replace(/\.([^\.\[]+)/g, '[$1]');
-    }
+    var key = options.allowDots ? givenKey.replace(/\.([^\.\[]+)/g, '[$1]') : givenKey;
 
     // The regex chunks
 
@@ -132,9 +109,7 @@ internals.parseKeys = function (key, val, options) {
     if (segment[1]) {
         // If we aren't using plain objects, optionally prefix keys
         // that would overwrite object prototype properties
-        if (!options.plainObjects &&
-            Object.prototype.hasOwnProperty(segment[1])) {
-
+        if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1])) {
             if (!options.allowPrototypes) {
                 return;
             }
@@ -147,11 +122,8 @@ internals.parseKeys = function (key, val, options) {
 
     var i = 0;
     while ((segment = child.exec(key)) !== null && i < options.depth) {
-
-        ++i;
-        if (!options.plainObjects &&
-            Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
-
+        i += 1;
+        if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
             if (!options.allowPrototypes) {
                 continue;
             }
@@ -168,10 +140,8 @@ internals.parseKeys = function (key, val, options) {
     return internals.parseObject(keys, val, options);
 };
 
-
-module.exports = function (str, options) {
-
-    options = options || {};
+module.exports = function (str, opts) {
+    var options = opts || {};
     options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter;
     options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
     options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
@@ -182,10 +152,11 @@ module.exports = function (str, options) {
     options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
     options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
 
-    if (str === '' ||
+    if (
+        str === '' ||
         str === null ||
-        typeof str === 'undefined') {
-
+        typeof str === 'undefined'
+    ) {
         return options.plainObjects ? Object.create(null) : {};
     }
 
@@ -195,7 +166,7 @@ module.exports = function (str, options) {
     // Iterate over the keys and setup the new object
 
     var keys = Object.keys(tempObj);
-    for (var i = 0, il = keys.length; i < il; ++i) {
+    for (var i = 0; i < keys.length; ++i) {
         var key = keys[i];
         var newObj = internals.parseKeys(key, tempObj[key], options);
         obj = Utils.merge(obj, newObj, options);
@@ -205,26 +176,20 @@ module.exports = function (str, options) {
 };
 
 },{"./utils":4}],3:[function(require,module,exports){
-// Load modules
+'use strict';
 
 var Utils = require('./utils');
 
-
-// Declare internals
-
 var internals = {
     delimiter: '&',
     arrayPrefixGenerators: {
-        brackets: function (prefix, key) {
-
+        brackets: function (prefix) {
             return prefix + '[]';
         },
         indices: function (prefix, key) {
-
             return prefix + '[' + key + ']';
         },
-        repeat: function (prefix, key) {
-
+        repeat: function (prefix) {
             return prefix;
         }
     },
@@ -233,19 +198,15 @@ var internals = {
     encode: true
 };
 
-
-internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter) {
-
+internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
+    var obj = object;
     if (typeof filter === 'function') {
         obj = filter(prefix, obj);
-    }
-    else if (Utils.isBuffer(obj)) {
-        obj = obj.toString();
-    }
-    else if (obj instanceof Date) {
+    } else if (Utils.isBuffer(obj)) {
+        obj = String(obj);
+    } else if (obj instanceof Date) {
         obj = obj.toISOString();
-    }
-    else if (obj === null) {
+    } else if (obj === null) {
         if (strictNullHandling) {
             return encode ? Utils.encode(prefix) : prefix;
         }
@@ -253,10 +214,7 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand
         obj = '';
     }
 
-    if (typeof obj === 'string' ||
-        typeof obj === 'number' ||
-        typeof obj === 'boolean') {
-
+    if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') {
         if (encode) {
             return [Utils.encode(prefix) + '=' + Utils.encode(obj)];
         }
@@ -269,20 +227,24 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand
         return values;
     }
 
-    var objKeys = Array.isArray(filter) ? filter : Object.keys(obj);
-    for (var i = 0, il = objKeys.length; i < il; ++i) {
-        var key = objKeys[i];
+    var objKeys;
+    if (Array.isArray(filter)) {
+        objKeys = filter;
+    } else {
+        var keys = Object.keys(obj);
+        objKeys = sort ? keys.sort(sort) : keys;
+    }
 
-        if (skipNulls &&
-            obj[key] === null) {
+    for (var i = 0; i < objKeys.length; ++i) {
+        var key = objKeys[i];
 
+        if (skipNulls && obj[key] === null) {
             continue;
         }
 
         if (Array.isArray(obj)) {
             values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
-        }
-        else {
+        } else {
             values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
         }
     }
@@ -290,40 +252,35 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand
     return values;
 };
 
-
-module.exports = function (obj, options) {
-
-    options = options || {};
+module.exports = function (object, opts) {
+    var obj = object;
+    var options = opts || {};
     var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter;
     var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
     var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
     var encode = typeof options.encode === 'boolean' ? options.encode : internals.encode;
+    var sort = typeof options.sort === 'function' ? options.sort : null;
     var objKeys;
     var filter;
     if (typeof options.filter === 'function') {
         filter = options.filter;
         obj = filter('', obj);
-    }
-    else if (Array.isArray(options.filter)) {
+    } else if (Array.isArray(options.filter)) {
         objKeys = filter = options.filter;
     }
 
     var keys = [];
 
-    if (typeof obj !== 'object' ||
-        obj === null) {
-
+    if (typeof obj !== 'object' || obj === null) {
         return '';
     }
 
     var arrayFormat;
     if (options.arrayFormat in internals.arrayPrefixGenerators) {
         arrayFormat = options.arrayFormat;
-    }
-    else if ('indices' in options) {
+    } else if ('indices' in options) {
         arrayFormat = options.indices ? 'indices' : 'repeat';
-    }
-    else {
+    } else {
         arrayFormat = 'indices';
     }
 
@@ -333,40 +290,39 @@ module.exports = function (obj, options) {
         objKeys = Object.keys(obj);
     }
 
-    for (var i = 0, il = objKeys.length; i < il; ++i) {
-        var key = objKeys[i];
+    if (sort) {
+        objKeys.sort(sort);
+    }
 
-        if (skipNulls &&
-            obj[key] === null) {
+    for (var i = 0; i < objKeys.length; ++i) {
+        var key = objKeys[i];
 
+        if (skipNulls && obj[key] === null) {
             continue;
         }
 
-        keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
+        keys = keys.concat(internals.stringify(obj[key], key, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort));
     }
 
     return keys.join(delimiter);
 };
 
 },{"./utils":4}],4:[function(require,module,exports){
-// Load modules
-
+'use strict';
 
-// Declare internals
-
-var internals = {};
-internals.hexTable = new Array(256);
-for (var h = 0; h < 256; ++h) {
-    internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase();
-}
+var hexTable = (function () {
+    var array = new Array(256);
+    for (var i = 0; i < 256; ++i) {
+        array[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
+    }
 
+    return array;
+}());
 
 exports.arrayToObject = function (source, options) {
-
     var obj = options.plainObjects ? Object.create(null) : {};
-    for (var i = 0, il = source.length; i < il; ++i) {
+    for (var i = 0; i < source.length; ++i) {
         if (typeof source[i] !== 'undefined') {
-
             obj[i] = source[i];
         }
     }
@@ -374,9 +330,7 @@ exports.arrayToObject = function (source, options) {
     return obj;
 };
 
-
 exports.merge = function (target, source, options) {
-
     if (!source) {
         return target;
     }
@@ -384,47 +338,37 @@ exports.merge = function (target, source, options) {
     if (typeof source !== 'object') {
         if (Array.isArray(target)) {
             target.push(source);
-        }
-        else if (typeof target === 'object') {
+        } else if (typeof target === 'object') {
             target[source] = true;
-        }
-        else {
-            target = [target, source];
+        } else {
+            return [target, source];
         }
 
         return target;
     }
 
     if (typeof target !== 'object') {
-        target = [target].concat(source);
-        return target;
+        return [target].concat(source);
     }
 
-    if (Array.isArray(target) &&
-        !Array.isArray(source)) {
-
-        target = exports.arrayToObject(target, options);
+    var mergeTarget = target;
+    if (Array.isArray(target) && !Array.isArray(source)) {
+        mergeTarget = exports.arrayToObject(target, options);
     }
 
-    var keys = Object.keys(source);
-    for (var k = 0, kl = keys.length; k < kl; ++k) {
-        var key = keys[k];
+       return Object.keys(source).reduce(function (acc, key) {
         var value = source[key];
 
-        if (!Object.prototype.hasOwnProperty.call(target, key)) {
-            target[key] = value;
+        if (Object.prototype.hasOwnProperty.call(acc, key)) {
+            acc[key] = exports.merge(acc[key], value, options);
+        } else {
+            acc[key] = value;
         }
-        else {
-            target[key] = exports.merge(target[key], value, options);
-        }
-    }
-
-    return target;
+               return acc;
+    }, mergeTarget);
 };
 
-
 exports.decode = function (str) {
-
     try {
         return decodeURIComponent(str.replace(/\+/g, ' '));
     } catch (e) {
@@ -433,65 +377,60 @@ exports.decode = function (str) {
 };
 
 exports.encode = function (str) {
-
     // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
     // It has been adapted here for stricter adherence to RFC 3986
     if (str.length === 0) {
         return str;
     }
 
-    if (typeof str !== 'string') {
-        str = '' + str;
-    }
+    var string = typeof str === 'string' ? str : String(str);
 
     var out = '';
-    for (var i = 0, il = str.length; i < il; ++i) {
-        var c = str.charCodeAt(i);
+    for (var i = 0; i < string.length; ++i) {
+        var c = string.charCodeAt(i);
 
-        if (c === 0x2D || // -
+        if (
+            c === 0x2D || // -
             c === 0x2E || // .
             c === 0x5F || // _
             c === 0x7E || // ~
             (c >= 0x30 && c <= 0x39) || // 0-9
             (c >= 0x41 && c <= 0x5A) || // a-z
-            (c >= 0x61 && c <= 0x7A)) { // A-Z
-
-            out += str[i];
+            (c >= 0x61 && c <= 0x7A) // A-Z
+        ) {
+            out += string.charAt(i);
             continue;
         }
 
         if (c < 0x80) {
-            out += internals.hexTable[c];
+            out = out + hexTable[c];
             continue;
         }
 
         if (c < 0x800) {
-            out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)];
+            out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
             continue;
         }
 
         if (c < 0xD800 || c >= 0xE000) {
-            out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
+            out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
             continue;
         }
 
-        ++i;
-        c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF));
-        out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
+        i += 1;
+        c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
+        out += (hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
     }
 
     return out;
 };
 
-exports.compact = function (obj, refs) {
-
-    if (typeof obj !== 'object' ||
-        obj === null) {
-
+exports.compact = function (obj, references) {
+    if (typeof obj !== 'object' || obj === null) {
         return obj;
     }
 
-    refs = refs || [];
+    var refs = references || [];
     var lookup = refs.indexOf(obj);
     if (lookup !== -1) {
         return refs[lookup];
@@ -502,7 +441,7 @@ exports.compact = function (obj, refs) {
     if (Array.isArray(obj)) {
         var compacted = [];
 
-        for (var i = 0, il = obj.length; i < il; ++i) {
+        for (var i = 0; i < obj.length; ++i) {
             if (typeof obj[i] !== 'undefined') {
                 compacted.push(obj[i]);
             }
@@ -512,32 +451,24 @@ exports.compact = function (obj, refs) {
     }
 
     var keys = Object.keys(obj);
-    for (i = 0, il = keys.length; i < il; ++i) {
-        var key = keys[i];
+    for (var j = 0; j < keys.length; ++j) {
+        var key = keys[j];
         obj[key] = exports.compact(obj[key], refs);
     }
 
     return obj;
 };
 
-
 exports.isRegExp = function (obj) {
-
     return Object.prototype.toString.call(obj) === '[object RegExp]';
 };
 
-
 exports.isBuffer = function (obj) {
-
-    if (obj === null ||
-        typeof obj === 'undefined') {
-
+    if (obj === null || typeof obj === 'undefined') {
         return false;
     }
 
-    return !!(obj.constructor &&
-              obj.constructor.isBuffer &&
-              obj.constructor.isBuffer(obj));
+    return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
 };
 
 },{}]},{},[1])(1)
old mode 100644 (file)
new mode 100755 (executable)
index 0e09493..1901959
@@ -1,14 +1,8 @@
-// Load modules
+'use strict';
 
 var Stringify = require('./stringify');
 var Parse = require('./parse');
 
-
-// Declare internals
-
-var internals = {};
-
-
 module.exports = {
     stringify: Stringify,
     parse: Parse
old mode 100644 (file)
new mode 100755 (executable)
index 4a2137e..9b6cbd2
@@ -1,10 +1,7 @@
-// Load modules
+'use strict';
 
 var Utils = require('./utils');
 
-
-// Declare internals
-
 var internals = {
     delimiter: '&',
     depth: 5,
@@ -16,13 +13,11 @@ var internals = {
     allowDots: false
 };
 
-
 internals.parseValues = function (str, options) {
-
     var obj = {};
     var parts = str.split(options.delimiter, options.parameterLimit === Infinity ? undefined : options.parameterLimit);
 
-    for (var i = 0, il = parts.length; i < il; ++i) {
+    for (var i = 0; i < parts.length; ++i) {
         var part = parts[i];
         var pos = part.indexOf(']=') === -1 ? part.indexOf('=') : part.indexOf(']=') + 1;
 
@@ -32,16 +27,14 @@ internals.parseValues = function (str, options) {
             if (options.strictNullHandling) {
                 obj[Utils.decode(part)] = null;
             }
-        }
-        else {
+        } else {
             var key = Utils.decode(part.slice(0, pos));
             var val = Utils.decode(part.slice(pos + 1));
 
-            if (!Object.prototype.hasOwnProperty.call(obj, key)) {
-                obj[key] = val;
-            }
-            else {
+            if (Object.prototype.hasOwnProperty.call(obj, key)) {
                 obj[key] = [].concat(obj[key]).concat(val);
+            } else {
+                obj[key] = val;
             }
         }
     }
@@ -49,9 +42,7 @@ internals.parseValues = function (str, options) {
     return obj;
 };
 
-
 internals.parseObject = function (chain, val, options) {
-
     if (!chain.length) {
         return val;
     }
@@ -62,23 +53,20 @@ internals.parseObject = function (chain, val, options) {
     if (root === '[]') {
         obj = [];
         obj = obj.concat(internals.parseObject(chain, val, options));
-    }
-    else {
+    } else {
         obj = options.plainObjects ? Object.create(null) : {};
         var cleanRoot = root[0] === '[' && root[root.length - 1] === ']' ? root.slice(1, root.length - 1) : root;
         var index = parseInt(cleanRoot, 10);
-        var indexString = '' + index;
-        if (!isNaN(index) &&
+        if (
+            !isNaN(index) &&
             root !== cleanRoot &&
-            indexString === cleanRoot &&
+            String(index) === cleanRoot &&
             index >= 0 &&
-            (options.parseArrays &&
-             index <= options.arrayLimit)) {
-
+            (options.parseArrays && index <= options.arrayLimit)
+        ) {
             obj = [];
             obj[index] = internals.parseObject(chain, val, options);
-        }
-        else {
+        } else {
             obj[cleanRoot] = internals.parseObject(chain, val, options);
         }
     }
@@ -86,18 +74,13 @@ internals.parseObject = function (chain, val, options) {
     return obj;
 };
 
-
-internals.parseKeys = function (key, val, options) {
-
-    if (!key) {
+internals.parseKeys = function (givenKey, val, options) {
+    if (!givenKey) {
         return;
     }
 
     // Transform dot notation to bracket notation
-
-    if (options.allowDots) {
-        key = key.replace(/\.([^\.\[]+)/g, '[$1]');
-    }
+    var key = options.allowDots ? givenKey.replace(/\.([^\.\[]+)/g, '[$1]') : givenKey;
 
     // The regex chunks
 
@@ -114,9 +97,7 @@ internals.parseKeys = function (key, val, options) {
     if (segment[1]) {
         // If we aren't using plain objects, optionally prefix keys
         // that would overwrite object prototype properties
-        if (!options.plainObjects &&
-            Object.prototype.hasOwnProperty(segment[1])) {
-
+        if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1])) {
             if (!options.allowPrototypes) {
                 return;
             }
@@ -129,11 +110,8 @@ internals.parseKeys = function (key, val, options) {
 
     var i = 0;
     while ((segment = child.exec(key)) !== null && i < options.depth) {
-
-        ++i;
-        if (!options.plainObjects &&
-            Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
-
+        i += 1;
+        if (!options.plainObjects && Object.prototype.hasOwnProperty(segment[1].replace(/\[|\]/g, ''))) {
             if (!options.allowPrototypes) {
                 continue;
             }
@@ -150,10 +128,8 @@ internals.parseKeys = function (key, val, options) {
     return internals.parseObject(keys, val, options);
 };
 
-
-module.exports = function (str, options) {
-
-    options = options || {};
+module.exports = function (str, opts) {
+    var options = opts || {};
     options.delimiter = typeof options.delimiter === 'string' || Utils.isRegExp(options.delimiter) ? options.delimiter : internals.delimiter;
     options.depth = typeof options.depth === 'number' ? options.depth : internals.depth;
     options.arrayLimit = typeof options.arrayLimit === 'number' ? options.arrayLimit : internals.arrayLimit;
@@ -164,10 +140,11 @@ module.exports = function (str, options) {
     options.parameterLimit = typeof options.parameterLimit === 'number' ? options.parameterLimit : internals.parameterLimit;
     options.strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
 
-    if (str === '' ||
+    if (
+        str === '' ||
         str === null ||
-        typeof str === 'undefined') {
-
+        typeof str === 'undefined'
+    ) {
         return options.plainObjects ? Object.create(null) : {};
     }
 
@@ -177,7 +154,7 @@ module.exports = function (str, options) {
     // Iterate over the keys and setup the new object
 
     var keys = Object.keys(tempObj);
-    for (var i = 0, il = keys.length; i < il; ++i) {
+    for (var i = 0; i < keys.length; ++i) {
         var key = keys[i];
         var newObj = internals.parseKeys(key, tempObj[key], options);
         obj = Utils.merge(obj, newObj, options);
old mode 100644 (file)
new mode 100755 (executable)
index d05aa87..e7b669d
@@ -1,23 +1,17 @@
-// Load modules
+'use strict';
 
 var Utils = require('./utils');
 
-
-// Declare internals
-
 var internals = {
     delimiter: '&',
     arrayPrefixGenerators: {
-        brackets: function (prefix, key) {
-
+        brackets: function (prefix) {
             return prefix + '[]';
         },
         indices: function (prefix, key) {
-
             return prefix + '[' + key + ']';
         },
-        repeat: function (prefix, key) {
-
+        repeat: function (prefix) {
             return prefix;
         }
     },
@@ -26,19 +20,15 @@ var internals = {
     encode: true
 };
 
-
-internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
-
+internals.stringify = function (object, prefix, generateArrayPrefix, strictNullHandling, skipNulls, encode, filter, sort) {
+    var obj = object;
     if (typeof filter === 'function') {
         obj = filter(prefix, obj);
-    }
-    else if (Utils.isBuffer(obj)) {
-        obj = obj.toString();
-    }
-    else if (obj instanceof Date) {
+    } else if (Utils.isBuffer(obj)) {
+        obj = String(obj);
+    } else if (obj instanceof Date) {
         obj = obj.toISOString();
-    }
-    else if (obj === null) {
+    } else if (obj === null) {
         if (strictNullHandling) {
             return encode ? Utils.encode(prefix) : prefix;
         }
@@ -46,10 +36,7 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand
         obj = '';
     }
 
-    if (typeof obj === 'string' ||
-        typeof obj === 'number' ||
-        typeof obj === 'boolean') {
-
+    if (typeof obj === 'string' || typeof obj === 'number' || typeof obj === 'boolean') {
         if (encode) {
             return [Utils.encode(prefix) + '=' + Utils.encode(obj)];
         }
@@ -70,19 +57,16 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand
         objKeys = sort ? keys.sort(sort) : keys;
     }
 
-    for (var i = 0, il = objKeys.length; i < il; ++i) {
+    for (var i = 0; i < objKeys.length; ++i) {
         var key = objKeys[i];
 
-        if (skipNulls &&
-            obj[key] === null) {
-
+        if (skipNulls && obj[key] === null) {
             continue;
         }
 
         if (Array.isArray(obj)) {
             values = values.concat(internals.stringify(obj[key], generateArrayPrefix(prefix, key), generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
-        }
-        else {
+        } else {
             values = values.concat(internals.stringify(obj[key], prefix + '[' + key + ']', generateArrayPrefix, strictNullHandling, skipNulls, encode, filter));
         }
     }
@@ -90,10 +74,9 @@ internals.stringify = function (obj, prefix, generateArrayPrefix, strictNullHand
     return values;
 };
 
-
-module.exports = function (obj, options) {
-
-    options = options || {};
+module.exports = function (object, opts) {
+    var obj = object;
+    var options = opts || {};
     var delimiter = typeof options.delimiter === 'undefined' ? internals.delimiter : options.delimiter;
     var strictNullHandling = typeof options.strictNullHandling === 'boolean' ? options.strictNullHandling : internals.strictNullHandling;
     var skipNulls = typeof options.skipNulls === 'boolean' ? options.skipNulls : internals.skipNulls;
@@ -104,27 +87,22 @@ module.exports = function (obj, options) {
     if (typeof options.filter === 'function') {
         filter = options.filter;
         obj = filter('', obj);
-    }
-    else if (Array.isArray(options.filter)) {
+    } else if (Array.isArray(options.filter)) {
         objKeys = filter = options.filter;
     }
 
     var keys = [];
 
-    if (typeof obj !== 'object' ||
-        obj === null) {
-
+    if (typeof obj !== 'object' || obj === null) {
         return '';
     }
 
     var arrayFormat;
     if (options.arrayFormat in internals.arrayPrefixGenerators) {
         arrayFormat = options.arrayFormat;
-    }
-    else if ('indices' in options) {
+    } else if ('indices' in options) {
         arrayFormat = options.indices ? 'indices' : 'repeat';
-    }
-    else {
+    } else {
         arrayFormat = 'indices';
     }
 
@@ -138,12 +116,10 @@ module.exports = function (obj, options) {
         objKeys.sort(sort);
     }
 
-    for (var i = 0, il = objKeys.length; i < il; ++i) {
+    for (var i = 0; i < objKeys.length; ++i) {
         var key = objKeys[i];
 
-        if (skipNulls &&
-            obj[key] === null) {
-
+        if (skipNulls && obj[key] === null) {
             continue;
         }
 
old mode 100644 (file)
new mode 100755 (executable)
index 88f3147..5d43356
@@ -1,21 +1,18 @@
-// Load modules
+'use strict';
 
+var hexTable = (function () {
+    var array = new Array(256);
+    for (var i = 0; i < 256; ++i) {
+        array[i] = '%' + ((i < 16 ? '0' : '') + i.toString(16)).toUpperCase();
+    }
 
-// Declare internals
-
-var internals = {};
-internals.hexTable = new Array(256);
-for (var h = 0; h < 256; ++h) {
-    internals.hexTable[h] = '%' + ((h < 16 ? '0' : '') + h.toString(16)).toUpperCase();
-}
-
+    return array;
+}());
 
 exports.arrayToObject = function (source, options) {
-
     var obj = options.plainObjects ? Object.create(null) : {};
-    for (var i = 0, il = source.length; i < il; ++i) {
+    for (var i = 0; i < source.length; ++i) {
         if (typeof source[i] !== 'undefined') {
-
             obj[i] = source[i];
         }
     }
@@ -23,9 +20,7 @@ exports.arrayToObject = function (source, options) {
     return obj;
 };
 
-
 exports.merge = function (target, source, options) {
-
     if (!source) {
         return target;
     }
@@ -33,47 +28,37 @@ exports.merge = function (target, source, options) {
     if (typeof source !== 'object') {
         if (Array.isArray(target)) {
             target.push(source);
-        }
-        else if (typeof target === 'object') {
+        } else if (typeof target === 'object') {
             target[source] = true;
-        }
-        else {
-            target = [target, source];
+        } else {
+            return [target, source];
         }
 
         return target;
     }
 
     if (typeof target !== 'object') {
-        target = [target].concat(source);
-        return target;
+        return [target].concat(source);
     }
 
-    if (Array.isArray(target) &&
-        !Array.isArray(source)) {
-
-        target = exports.arrayToObject(target, options);
+    var mergeTarget = target;
+    if (Array.isArray(target) && !Array.isArray(source)) {
+        mergeTarget = exports.arrayToObject(target, options);
     }
 
-    var keys = Object.keys(source);
-    for (var k = 0, kl = keys.length; k < kl; ++k) {
-        var key = keys[k];
+       return Object.keys(source).reduce(function (acc, key) {
         var value = source[key];
 
-        if (!Object.prototype.hasOwnProperty.call(target, key)) {
-            target[key] = value;
-        }
-        else {
-            target[key] = exports.merge(target[key], value, options);
+        if (Object.prototype.hasOwnProperty.call(acc, key)) {
+            acc[key] = exports.merge(acc[key], value, options);
+        } else {
+            acc[key] = value;
         }
-    }
-
-    return target;
+               return acc;
+    }, mergeTarget);
 };
 
-
 exports.decode = function (str) {
-
     try {
         return decodeURIComponent(str.replace(/\+/g, ' '));
     } catch (e) {
@@ -82,65 +67,60 @@ exports.decode = function (str) {
 };
 
 exports.encode = function (str) {
-
     // This code was originally written by Brian White (mscdex) for the io.js core querystring library.
     // It has been adapted here for stricter adherence to RFC 3986
     if (str.length === 0) {
         return str;
     }
 
-    if (typeof str !== 'string') {
-        str = '' + str;
-    }
+    var string = typeof str === 'string' ? str : String(str);
 
     var out = '';
-    for (var i = 0, il = str.length; i < il; ++i) {
-        var c = str.charCodeAt(i);
+    for (var i = 0; i < string.length; ++i) {
+        var c = string.charCodeAt(i);
 
-        if (c === 0x2D || // -
+        if (
+            c === 0x2D || // -
             c === 0x2E || // .
             c === 0x5F || // _
             c === 0x7E || // ~
             (c >= 0x30 && c <= 0x39) || // 0-9
             (c >= 0x41 && c <= 0x5A) || // a-z
-            (c >= 0x61 && c <= 0x7A)) { // A-Z
-
-            out += str[i];
+            (c >= 0x61 && c <= 0x7A) // A-Z
+        ) {
+            out += string.charAt(i);
             continue;
         }
 
         if (c < 0x80) {
-            out += internals.hexTable[c];
+            out = out + hexTable[c];
             continue;
         }
 
         if (c < 0x800) {
-            out += internals.hexTable[0xC0 | (c >> 6)] + internals.hexTable[0x80 | (c & 0x3F)];
+            out = out + (hexTable[0xC0 | (c >> 6)] + hexTable[0x80 | (c & 0x3F)]);
             continue;
         }
 
         if (c < 0xD800 || c >= 0xE000) {
-            out += internals.hexTable[0xE0 | (c >> 12)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
+            out = out + (hexTable[0xE0 | (c >> 12)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
             continue;
         }
 
-        ++i;
-        c = 0x10000 + (((c & 0x3FF) << 10) | (str.charCodeAt(i) & 0x3FF));
-        out += internals.hexTable[0xF0 | (c >> 18)] + internals.hexTable[0x80 | ((c >> 12) & 0x3F)] + internals.hexTable[0x80 | ((c >> 6) & 0x3F)] + internals.hexTable[0x80 | (c & 0x3F)];
+        i += 1;
+        c = 0x10000 + (((c & 0x3FF) << 10) | (string.charCodeAt(i) & 0x3FF));
+        out += (hexTable[0xF0 | (c >> 18)] + hexTable[0x80 | ((c >> 12) & 0x3F)] + hexTable[0x80 | ((c >> 6) & 0x3F)] + hexTable[0x80 | (c & 0x3F)]);
     }
 
     return out;
 };
 
-exports.compact = function (obj, refs) {
-
-    if (typeof obj !== 'object' ||
-        obj === null) {
-
+exports.compact = function (obj, references) {
+    if (typeof obj !== 'object' || obj === null) {
         return obj;
     }
 
-    refs = refs || [];
+    var refs = references || [];
     var lookup = refs.indexOf(obj);
     if (lookup !== -1) {
         return refs[lookup];
@@ -151,7 +131,7 @@ exports.compact = function (obj, refs) {
     if (Array.isArray(obj)) {
         var compacted = [];
 
-        for (var i = 0, il = obj.length; i < il; ++i) {
+        for (var i = 0; i < obj.length; ++i) {
             if (typeof obj[i] !== 'undefined') {
                 compacted.push(obj[i]);
             }
@@ -161,30 +141,22 @@ exports.compact = function (obj, refs) {
     }
 
     var keys = Object.keys(obj);
-    for (i = 0, il = keys.length; i < il; ++i) {
-        var key = keys[i];
+    for (var j = 0; j < keys.length; ++j) {
+        var key = keys[j];
         obj[key] = exports.compact(obj[key], refs);
     }
 
     return obj;
 };
 
-
 exports.isRegExp = function (obj) {
-
     return Object.prototype.toString.call(obj) === '[object RegExp]';
 };
 
-
 exports.isBuffer = function (obj) {
-
-    if (obj === null ||
-        typeof obj === 'undefined') {
-
+    if (obj === null || typeof obj === 'undefined') {
         return false;
     }
 
-    return !!(obj.constructor &&
-              obj.constructor.isBuffer &&
-              obj.constructor.isBuffer(obj));
+    return !!(obj.constructor && obj.constructor.isBuffer && obj.constructor.isBuffer(obj));
 };
index 2ca59cd..285b2b1 100644 (file)
@@ -1,38 +1,79 @@
 {
   "name": "qs",
   "description": "A querystring parser that supports nesting and arrays, with a depth limit",
-  "homepage": "https://github.com/hapijs/qs",
-  "version": "5.2.0",
+  "homepage": "https://github.com/ljharb/qs",
+  "version": "6.0.2",
   "repository": {
     "type": "git",
-    "url": "git+https://github.com/hapijs/qs.git"
+    "url": "git+https://github.com/ljharb/qs.git"
   },
   "main": "lib/index.js",
+  "contributors": [
+    {
+      "name": "Jordan Harband",
+      "email": "ljharb@gmail.com",
+      "url": "http://ljharb.codes"
+    }
+  ],
   "keywords": [
     "querystring",
     "qs"
   ],
-  "engines": ">=0.10.40",
+  "engines": {
+    "node": ">=0.6"
+  },
   "dependencies": {},
   "devDependencies": {
-    "browserify": "^10.2.1",
-    "code": "1.x.x",
-    "lab": "5.x.x"
+    "browserify": "^12.0.1",
+    "tape": "^4.3.0",
+    "covert": "^1.1.0",
+    "mkdirp": "^0.5.1",
+    "eslint": "^1.10.3",
+    "@ljharb/eslint-config": "^1.6.1",
+    "parallelshell": "^2.0.0",
+    "evalmd": "^0.0.16"
   },
   "scripts": {
-    "test": "lab -a code -t 100 -L",
-    "test-tap": "lab -a code -r tap -o tests.tap",
-    "test-cov-html": "lab -a code -r html -o coverage.html",
-    "dist": "browserify --standalone Qs lib/index.js > dist/qs.js"
+    "test": "parallelshell 'npm run readme' 'npm run lint' 'npm run coverage'",
+    "tests-only": "node test",
+    "readme": "evalmd README.md",
+    "lint": "eslint lib/*.js text/*.js",
+    "coverage": "covert test",
+    "dist": "mkdirp dist && browserify --standalone Qs lib/index.js > dist/qs.js",
+    "prepublish": "npm run dist"
   },
   "license": "BSD-3-Clause",
-  "readme": "# qs\n\nA querystring parsing and stringifying library with some added security.\n\n[![Build Status](https://secure.travis-ci.org/hapijs/qs.svg)](http://travis-ci.org/hapijs/qs)\n\nLead Maintainer: [Nathan LaFreniere](https://github.com/nlf)\n\nThe **qs** module was originally created and maintained by [TJ Holowaychuk](https://github.com/visionmedia/node-querystring).\n\n## Usage\n\n```javascript\nvar Qs = require('qs');\n\nvar obj = Qs.parse('a=c');    // { a: 'c' }\nvar str = Qs.stringify(obj);  // 'a=c'\n```\n\n### Parsing Objects\n\n```javascript\nQs.parse(string, [options]);\n```\n\n**qs** allows you to create nested objects within your query strings, by surrounding the name of sub-keys with square brackets `[]`.\nFor example, the string `'foo[bar]=baz'` converts to:\n\n```javascript\n{\n  foo: {\n    bar: 'baz'\n  }\n}\n```\n\nWhen using the `plainObjects` option the parsed value is returned as a plain object, created via `Object.create(null)` and as such you should be aware that prototype methods will not exist on it and a user may set those names to whatever value they like:\n\n```javascript\nQs.parse('a.hasOwnProperty=b', { plainObjects: true });\n// { a: { hasOwnProperty: 'b' } }\n```\n\nBy default parameters that would overwrite properties on the object prototype are ignored, if you wish to keep the data from those fields either use `plainObjects` as mentioned above, or set `allowPrototypes` to `true` which will allow user input to overwrite those properties. *WARNING* It is generally a bad idea to enable this option as it can cause problems when attempting to use the properties that have been overwritten. Always be careful with this option.\n\n```javascript\nQs.parse('a.hasOwnProperty=b', { allowPrototypes: true });\n// { a: { hasOwnProperty: 'b' } }\n```\n\nURI encoded strings work too:\n\n```javascript\nQs.parse('a%5Bb%5D=c');\n// { a: { b: 'c' } }\n```\n\nYou can also nest your objects, like `'foo[bar][baz]=foobarbaz'`:\n\n```javascript\n{\n  foo: {\n    bar: {\n      baz: 'foobarbaz'\n    }\n  }\n}\n```\n\nBy default, when nesting objects **qs** will only parse up to 5 children deep. This means if you attempt to parse a string like\n`'a[b][c][d][e][f][g][h][i]=j'` your resulting object will be:\n\n```javascript\n{\n  a: {\n    b: {\n      c: {\n        d: {\n          e: {\n            f: {\n              '[g][h][i]': 'j'\n            }\n          }\n        }\n      }\n    }\n  }\n}\n```\n\nThis depth can be overridden by passing a `depth` option to `Qs.parse(string, [options])`:\n\n```javascript\nQs.parse('a[b][c][d][e][f][g][h][i]=j', { depth: 1 });\n// { a: { b: { '[c][d][e][f][g][h][i]': 'j' } } }\n```\n\nThe depth limit helps mitigate abuse when **qs** is used to parse user input, and it is recommended to keep it a reasonably small number.\n\nFor similar reasons, by default **qs** will only parse up to 1000 parameters. This can be overridden by passing a `parameterLimit` option:\n\n```javascript\nQs.parse('a=b&c=d', { parameterLimit: 1 });\n// { a: 'b' }\n```\n\nAn optional delimiter can also be passed:\n\n```javascript\nQs.parse('a=b;c=d', { delimiter: ';' });\n// { a: 'b', c: 'd' }\n```\n\nDelimiters can be a regular expression too:\n\n```javascript\nQs.parse('a=b;c=d,e=f', { delimiter: /[;,]/ });\n// { a: 'b', c: 'd', e: 'f' }\n```\n\nOption `allowDots` can be used to enable dot notation:\n\n```javascript\nQs.parse('a.b=c', { allowDots: true });\n// { a: { b: 'c' } }\n```\n\n### Parsing Arrays\n\n**qs** can also parse arrays using a similar `[]` notation:\n\n```javascript\nQs.parse('a[]=b&a[]=c');\n// { a: ['b', 'c'] }\n```\n\nYou may specify an index as well:\n\n```javascript\nQs.parse('a[1]=c&a[0]=b');\n// { a: ['b', 'c'] }\n```\n\nNote that the only difference between an index in an array and a key in an object is that the value between the brackets must be a number\nto create an array. When creating arrays with specific indices, **qs** will compact a sparse array to only the existing values preserving\ntheir order:\n\n```javascript\nQs.parse('a[1]=b&a[15]=c');\n// { a: ['b', 'c'] }\n```\n\nNote that an empty string is also a value, and will be preserved:\n\n```javascript\nQs.parse('a[]=&a[]=b');\n// { a: ['', 'b'] }\nQs.parse('a[0]=b&a[1]=&a[2]=c');\n// { a: ['b', '', 'c'] }\n```\n\n**qs** will also limit specifying indices in an array to a maximum index of `20`. Any array members with an index of greater than `20` will\ninstead be converted to an object with the index as the key:\n\n```javascript\nQs.parse('a[100]=b');\n// { a: { '100': 'b' } }\n```\n\nThis limit can be overridden by passing an `arrayLimit` option:\n\n```javascript\nQs.parse('a[1]=b', { arrayLimit: 0 });\n// { a: { '1': 'b' } }\n```\n\nTo disable array parsing entirely, set `parseArrays` to `false`.\n\n```javascript\nQs.parse('a[]=b', { parseArrays: false });\n// { a: { '0': 'b' } }\n```\n\nIf you mix notations, **qs** will merge the two items into an object:\n\n```javascript\nQs.parse('a[0]=b&a[b]=c');\n// { a: { '0': 'b', b: 'c' } }\n```\n\nYou can also create arrays of objects:\n\n```javascript\nQs.parse('a[][b]=c');\n// { a: [{ b: 'c' }] }\n```\n\n### Stringifying\n\n```javascript\nQs.stringify(object, [options]);\n```\n\nWhen stringifying, **qs** by default URI encodes output. Objects are stringified as you would expect:\n\n```javascript\nQs.stringify({ a: 'b' });\n// 'a=b'\nQs.stringify({ a: { b: 'c' } });\n// 'a%5Bb%5D=c'\n```\n\nThis encoding can be disabled by setting the `encode` option to `false`:\n\n```javascript\nQs.stringify({ a: { b: 'c' } }, { encode: false });\n// 'a[b]=c'\n```\n\nExamples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage.\n\nWhen arrays are stringified, by default they are given explicit indices:\n\n```javascript\nQs.stringify({ a: ['b', 'c', 'd'] });\n// 'a[0]=b&a[1]=c&a[2]=d'\n```\n\nYou may override this by setting the `indices` option to `false`:\n\n```javascript\nQs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });\n// 'a=b&a=c&a=d'\n```\n\nYou may use the `arrayFormat` option to specify the format of the output array\n\n```javascript\nQs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })\n// 'a[0]=b&a[1]=c'\nQs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })\n// 'a[]=b&a[]=c'\nQs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })\n// 'a=b&a=c'\n```\n\nEmpty strings and null values will omit the value, but the equals sign (=) remains in place:\n\n```javascript\nQs.stringify({ a: '' });\n// 'a='\n```\n\nProperties that are set to `undefined` will be omitted entirely:\n\n```javascript\nQs.stringify({ a: null, b: undefined });\n// 'a='\n```\n\nThe delimiter may be overridden with stringify as well:\n\n```javascript\nQs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' });\n// 'a=b;c=d'\n```\n\nFinally, you can use the `filter` option to restrict which keys will be included in the stringified output.\nIf you pass a function, it will be called for each key to obtain the replacement value. Otherwise, if you\npass an array, it will be used to select properties and array indices for stringification:\n\n```javascript\nfunction filterFunc(prefix, value) {\n  if (prefix == 'b') {\n    // Return an `undefined` value to omit a property.\n    return;\n  }\n  if (prefix == 'e[f]') {\n    return value.getTime();\n  }\n  if (prefix == 'e[g][0]') {\n    return value * 2;\n  }\n  return value;\n}\nQs.stringify({ a: 'b', c: 'd', e: { f: new Date(123), g: [2] } }, { filter: filterFunc })\n// 'a=b&c=d&e[f]=123&e[g][0]=4'\nQs.stringify({ a: 'b', c: 'd', e: 'f' }, { filter: ['a', 'e'] })\n// 'a=b&e=f'\nQs.stringify({ a: ['b', 'c', 'd'], e: 'f' }, { filter: ['a', 0, 2] })\n// 'a[0]=b&a[2]=d'\n```\n\n### Handling of `null` values\n\nBy default, `null` values are treated like empty strings:\n\n```javascript\nQs.stringify({ a: null, b: '' });\n// 'a=&b='\n```\n\nParsing does not distinguish between parameters with and without equal signs. Both are converted to empty strings.\n\n```javascript\nQs.parse('a&b=')\n// { a: '', b: '' }\n```\n\nTo distinguish between `null` values and empty strings use the `strictNullHandling` flag. In the result string the `null`\nvalues have no `=` sign:\n\n```javascript\nQs.stringify({ a: null, b: '' }, { strictNullHandling: true });\n// 'a&b='\n```\n\nTo parse values without `=` back to `null` use the `strictNullHandling` flag:\n\n```javascript\nQs.parse('a&b=', { strictNullHandling: true });\n// { a: null, b: '' }\n\n```\n\nTo completely skip rendering keys with `null` values, use the `skipNulls` flag:\n\n```javascript\nqs.stringify({ a: 'b', c: null}, { skipNulls: true })\n// 'a=b'\n```\n",
-  "readmeFilename": "README.md",
+  "gitHead": "47dfbd6740b3cc1593847825701c8aa136f636e3",
   "bugs": {
-    "url": "https://github.com/hapijs/qs/issues"
+    "url": "https://github.com/ljharb/qs/issues"
+  },
+  "_id": "qs@6.0.2",
+  "_shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd",
+  "_from": "qs@>=6.0.2 <6.1.0",
+  "_npmVersion": "3.3.12",
+  "_nodeVersion": "5.4.1",
+  "_npmUser": {
+    "name": "ljharb",
+    "email": "ljharb@gmail.com"
   },
-  "_id": "qs@5.2.0",
-  "_shasum": "a9f31142af468cb72b25b30136ba2456834916be",
-  "_resolved": "https://registry.npmjs.org/qs/-/qs-5.2.0.tgz",
-  "_from": "qs@>=5.2.0 <5.3.0"
+  "dist": {
+    "shasum": "88c68d590e8ed56c76c79f352c17b982466abfcd",
+    "tarball": "http://registry.npmjs.org/qs/-/qs-6.0.2.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "hueniverse",
+      "email": "eran@hammer.io"
+    },
+    {
+      "name": "ljharb",
+      "email": "ljharb@gmail.com"
+    },
+    {
+      "name": "nlf",
+      "email": "quitlahok@gmail.com"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/qs/-/qs-6.0.2.tgz"
 }
diff --git a/deps/npm/node_modules/request/node_modules/qs/test/index.js b/deps/npm/node_modules/request/node_modules/qs/test/index.js
new file mode 100644 (file)
index 0000000..b6a7d95
--- /dev/null
@@ -0,0 +1,5 @@
+require('./parse');
+
+require('./stringify');
+
+require('./utils');
old mode 100644 (file)
new mode 100755 (executable)
index 679f197..5665d07
-/* eslint no-extend-native:0 */
-// Load modules
-
-var Code = require('code');
-var Lab = require('lab');
-var Qs = require('../');
-
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var expect = Code.expect;
-var describe = lab.experiment;
-var it = lab.test;
-
-
-describe('parse()', function () {
-
-    it('parses a simple string', function (done) {
-
-        expect(Qs.parse('0=foo')).to.deep.equal({ '0': 'foo' });
-        expect(Qs.parse('foo=c++')).to.deep.equal({ foo: 'c  ' });
-        expect(Qs.parse('a[>=]=23')).to.deep.equal({ a: { '>=': '23' } });
-        expect(Qs.parse('a[<=>]==23')).to.deep.equal({ a: { '<=>': '=23' } });
-        expect(Qs.parse('a[==]=23')).to.deep.equal({ a: { '==': '23' } });
-        expect(Qs.parse('foo', { strictNullHandling: true })).to.deep.equal({ foo: null });
-        expect(Qs.parse('foo' )).to.deep.equal({ foo: '' });
-        expect(Qs.parse('foo=')).to.deep.equal({ foo: '' });
-        expect(Qs.parse('foo=bar')).to.deep.equal({ foo: 'bar' });
-        expect(Qs.parse(' foo = bar = baz ')).to.deep.equal({ ' foo ': ' bar = baz ' });
-        expect(Qs.parse('foo=bar=baz')).to.deep.equal({ foo: 'bar=baz' });
-        expect(Qs.parse('foo=bar&bar=baz')).to.deep.equal({ foo: 'bar', bar: 'baz' });
-        expect(Qs.parse('foo2=bar2&baz2=')).to.deep.equal({ foo2: 'bar2', baz2: '' });
-        expect(Qs.parse('foo=bar&baz', { strictNullHandling: true })).to.deep.equal({ foo: 'bar', baz: null });
-        expect(Qs.parse('foo=bar&baz')).to.deep.equal({ foo: 'bar', baz: '' });
-        expect(Qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World')).to.deep.equal({
+'use strict';
+
+var test = require('tape');
+var qs = require('../');
+
+test('parse()', function (t) {
+    t.test('parses a simple string', function (st) {
+        st.deepEqual(qs.parse('0=foo'), { '0': 'foo' });
+        st.deepEqual(qs.parse('foo=c++'), { foo: 'c  ' });
+        st.deepEqual(qs.parse('a[>=]=23'), { a: { '>=': '23' } });
+        st.deepEqual(qs.parse('a[<=>]==23'), { a: { '<=>': '=23' } });
+        st.deepEqual(qs.parse('a[==]=23'), { a: { '==': '23' } });
+        st.deepEqual(qs.parse('foo', { strictNullHandling: true }), { foo: null });
+        st.deepEqual(qs.parse('foo'), { foo: '' });
+        st.deepEqual(qs.parse('foo='), { foo: '' });
+        st.deepEqual(qs.parse('foo=bar'), { foo: 'bar' });
+        st.deepEqual(qs.parse(' foo = bar = baz '), { ' foo ': ' bar = baz ' });
+        st.deepEqual(qs.parse('foo=bar=baz'), { foo: 'bar=baz' });
+        st.deepEqual(qs.parse('foo=bar&bar=baz'), { foo: 'bar', bar: 'baz' });
+        st.deepEqual(qs.parse('foo2=bar2&baz2='), { foo2: 'bar2', baz2: '' });
+        st.deepEqual(qs.parse('foo=bar&baz', { strictNullHandling: true }), { foo: 'bar', baz: null });
+        st.deepEqual(qs.parse('foo=bar&baz'), { foo: 'bar', baz: '' });
+        st.deepEqual(qs.parse('cht=p3&chd=t:60,40&chs=250x100&chl=Hello|World'), {
             cht: 'p3',
             chd: 't:60,40',
             chs: '250x100',
             chl: 'Hello|World'
         });
-        done();
+        st.end();
     });
 
-    it('allows enabling dot notation', function (done) {
-
-        expect(Qs.parse('a.b=c')).to.deep.equal({ 'a.b': 'c' });
-        expect(Qs.parse('a.b=c', { allowDots: true })).to.deep.equal({ a: { b: 'c' } });
-        done();
+    t.test('allows enabling dot notation', function (st) {
+        st.deepEqual(qs.parse('a.b=c'), { 'a.b': 'c' });
+        st.deepEqual(qs.parse('a.b=c', { allowDots: true }), { a: { b: 'c' } });
+        st.end();
     });
 
-    it('parses a single nested string', function (done) {
+    t.deepEqual(qs.parse('a[b]=c'), { a: { b: 'c' } }, 'parses a single nested string');
+    t.deepEqual(qs.parse('a[b][c]=d'), { a: { b: { c: 'd' } } }, 'parses a double nested string');
+    t.deepEqual(
+        qs.parse('a[b][c][d][e][f][g][h]=i'),
+        { a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } },
+        'defaults to a depth of 5'
+    );
 
-        expect(Qs.parse('a[b]=c')).to.deep.equal({ a: { b: 'c' } });
-        done();
+    t.test('only parses one level when depth = 1', function (st) {
+        st.deepEqual(qs.parse('a[b][c]=d', { depth: 1 }), { a: { b: { '[c]': 'd' } } });
+        st.deepEqual(qs.parse('a[b][c][d]=e', { depth: 1 }), { a: { b: { '[c][d]': 'e' } } });
+        st.end();
     });
 
-    it('parses a double nested string', function (done) {
+    t.deepEqual(qs.parse('a=b&a=c'), { a: ['b', 'c'] }, 'parses a simple array');
 
-        expect(Qs.parse('a[b][c]=d')).to.deep.equal({ a: { b: { c: 'd' } } });
-        done();
+    t.test('parses an explicit array', function (st) {
+        st.deepEqual(qs.parse('a[]=b'), { a: ['b'] });
+        st.deepEqual(qs.parse('a[]=b&a[]=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[]=b&a[]=c&a[]=d'), { a: ['b', 'c', 'd'] });
+        st.end();
     });
 
-    it('defaults to a depth of 5', function (done) {
-
-        expect(Qs.parse('a[b][c][d][e][f][g][h]=i')).to.deep.equal({ a: { b: { c: { d: { e: { f: { '[g][h]': 'i' } } } } } } });
-        done();
+    t.test('parses a mix of simple and explicit arrays', function (st) {
+        st.deepEqual(qs.parse('a=b&a[]=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[]=b&a=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[0]=b&a=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a=b&a[0]=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[1]=b&a=c'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a=b&a[1]=c'), { a: ['b', 'c'] });
+        st.end();
     });
 
-    it('only parses one level when depth = 1', function (done) {
-
-        expect(Qs.parse('a[b][c]=d', { depth: 1 })).to.deep.equal({ a: { b: { '[c]': 'd' } } });
-        expect(Qs.parse('a[b][c][d]=e', { depth: 1 })).to.deep.equal({ a: { b: { '[c][d]': 'e' } } });
-        done();
+    t.test('parses a nested array', function (st) {
+        st.deepEqual(qs.parse('a[b][]=c&a[b][]=d'), { a: { b: ['c', 'd'] } });
+        st.deepEqual(qs.parse('a[>=]=25'), { a: { '>=': '25' } });
+        st.end();
     });
 
-    it('parses a simple array', function (done) {
-
-        expect(Qs.parse('a=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
-        done();
+    t.test('allows to specify array indices', function (st) {
+        st.deepEqual(qs.parse('a[1]=c&a[0]=b&a[2]=d'), { a: ['b', 'c', 'd'] });
+        st.deepEqual(qs.parse('a[1]=c&a[0]=b'), { a: ['b', 'c'] });
+        st.deepEqual(qs.parse('a[1]=c'), { a: ['c'] });
+        st.end();
     });
 
-    it('parses an explicit array', function (done) {
-
-        expect(Qs.parse('a[]=b')).to.deep.equal({ a: ['b'] });
-        expect(Qs.parse('a[]=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] });
-        expect(Qs.parse('a[]=b&a[]=c&a[]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
-        done();
+    t.test('limits specific array indices to 20', function (st) {
+        st.deepEqual(qs.parse('a[20]=a'), { a: ['a'] });
+        st.deepEqual(qs.parse('a[21]=a'), { a: { '21': 'a' } });
+        st.end();
     });
 
-    it('parses a mix of simple and explicit arrays', function (done) {
+    t.deepEqual(qs.parse('a[12b]=c'), { a: { '12b': 'c' } }, 'supports keys that begin with a number');
 
-        expect(Qs.parse('a=b&a[]=c')).to.deep.equal({ a: ['b', 'c'] });
-        expect(Qs.parse('a[]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
-        expect(Qs.parse('a[0]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
-        expect(Qs.parse('a=b&a[0]=c')).to.deep.equal({ a: ['b', 'c'] });
-        expect(Qs.parse('a[1]=b&a=c')).to.deep.equal({ a: ['b', 'c'] });
-        expect(Qs.parse('a=b&a[1]=c')).to.deep.equal({ a: ['b', 'c'] });
-        done();
+    t.test('supports encoded = signs', function (st) {
+        st.deepEqual(qs.parse('he%3Dllo=th%3Dere'), { 'he=llo': 'th=ere' });
+        st.end();
     });
 
-    it('parses a nested array', function (done) {
-
-        expect(Qs.parse('a[b][]=c&a[b][]=d')).to.deep.equal({ a: { b: ['c', 'd'] } });
-        expect(Qs.parse('a[>=]=25')).to.deep.equal({ a: { '>=': '25' } });
-        done();
-    });
-
-    it('allows to specify array indices', function (done) {
-
-        expect(Qs.parse('a[1]=c&a[0]=b&a[2]=d')).to.deep.equal({ a: ['b', 'c', 'd'] });
-        expect(Qs.parse('a[1]=c&a[0]=b')).to.deep.equal({ a: ['b', 'c'] });
-        expect(Qs.parse('a[1]=c')).to.deep.equal({ a: ['c'] });
-        done();
-    });
-
-    it('limits specific array indices to 20', function (done) {
-
-        expect(Qs.parse('a[20]=a')).to.deep.equal({ a: ['a'] });
-        expect(Qs.parse('a[21]=a')).to.deep.equal({ a: { '21': 'a' } });
-        done();
-    });
-
-    it('supports keys that begin with a number', function (done) {
-
-        expect(Qs.parse('a[12b]=c')).to.deep.equal({ a: { '12b': 'c' } });
-        done();
-    });
-
-    it('supports encoded = signs', function (done) {
-
-        expect(Qs.parse('he%3Dllo=th%3Dere')).to.deep.equal({ 'he=llo': 'th=ere' });
-        done();
-    });
-
-    it('is ok with url encoded strings', function (done) {
-
-        expect(Qs.parse('a[b%20c]=d')).to.deep.equal({ a: { 'b c': 'd' } });
-        expect(Qs.parse('a[b]=c%20d')).to.deep.equal({ a: { b: 'c d' } });
-        done();
-    });
-
-    it('allows brackets in the value', function (done) {
-
-        expect(Qs.parse('pets=["tobi"]')).to.deep.equal({ pets: '["tobi"]' });
-        expect(Qs.parse('operators=[">=", "<="]')).to.deep.equal({ operators: '[">=", "<="]' });
-        done();
+    t.test('is ok with url encoded strings', function (st) {
+        st.deepEqual(qs.parse('a[b%20c]=d'), { a: { 'b c': 'd' } });
+        st.deepEqual(qs.parse('a[b]=c%20d'), { a: { b: 'c d' } });
+        st.end();
     });
 
-    it('allows empty values', function (done) {
-
-        expect(Qs.parse('')).to.deep.equal({});
-        expect(Qs.parse(null)).to.deep.equal({});
-        expect(Qs.parse(undefined)).to.deep.equal({});
-        done();
+    t.test('allows brackets in the value', function (st) {
+        st.deepEqual(qs.parse('pets=["tobi"]'), { pets: '["tobi"]' });
+        st.deepEqual(qs.parse('operators=[">=", "<="]'), { operators: '[">=", "<="]' });
+        st.end();
     });
 
-    it('transforms arrays to objects', function (done) {
-
-        expect(Qs.parse('foo[0]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
-        expect(Qs.parse('foo[bad]=baz&foo[0]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
-        expect(Qs.parse('foo[bad]=baz&foo[]=bar')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
-        expect(Qs.parse('foo[]=bar&foo[bad]=baz')).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
-        expect(Qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo')).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
-        expect(Qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb')).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
-        expect(Qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c')).to.deep.equal({ a: { '0': 'b', t: 'u', c: true } });
-        expect(Qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y')).to.deep.equal({ a: { '0': 'b', '1': 'c', x: 'y' } });
-        done();
+    t.test('allows empty values', function (st) {
+        st.deepEqual(qs.parse(''), {});
+        st.deepEqual(qs.parse(null), {});
+        st.deepEqual(qs.parse(undefined), {});
+        st.end();
     });
 
-    it('transforms arrays to objects (dot notation)', function (done) {
-
-        expect(Qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });
-        expect(Qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true })).to.deep.equal({ foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });
-        expect(Qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true })).to.deep.equal({ foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });
-        expect(Qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15'], bar: '2' }] });
-        expect(Qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true })).to.deep.equal({ foo: [{ baz: ['15', '16'], bar: '2' }] });
-        expect(Qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
-        expect(Qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar' } });
-        expect(Qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true })).to.deep.equal({ foo: { '0': 'bar', bad: 'baz' } });
-        expect(Qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true })).to.deep.equal({ foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
-        expect(Qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true })).to.deep.equal({ foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
-        done();
+    t.test('transforms arrays to objects', function (st) {
+        st.deepEqual(qs.parse('foo[0]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } });
+        st.deepEqual(qs.parse('foo[bad]=baz&foo[0]=bar'), { foo: { bad: 'baz', '0': 'bar' } });
+        st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar'), { foo: { bad: 'baz', '0': 'bar' } });
+        st.deepEqual(qs.parse('foo[]=bar&foo[bad]=baz'), { foo: { '0': 'bar', bad: 'baz' } });
+        st.deepEqual(qs.parse('foo[bad]=baz&foo[]=bar&foo[]=foo'), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
+        st.deepEqual(qs.parse('foo[0][a]=a&foo[0][b]=b&foo[1][a]=aa&foo[1][b]=bb'), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
+        st.deepEqual(qs.parse('a[]=b&a[t]=u&a[hasOwnProperty]=c'), { a: { '0': 'b', t: 'u', c: true } });
+        st.deepEqual(qs.parse('a[]=b&a[hasOwnProperty]=c&a[x]=y'), { a: { '0': 'b', '1': 'c', x: 'y' } });
+        st.end();
     });
 
-    it('can add keys to objects', function (done) {
-
-        expect(Qs.parse('a[b]=c&a=d')).to.deep.equal({ a: { b: 'c', d: true } });
-        done();
+    t.test('transforms arrays to objects (dot notation)', function (st) {
+        st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: 'baz' } });
+        st.deepEqual(qs.parse('foo[0].baz=bar&fool.bad.boo=baz', { allowDots: true }), { foo: [{ baz: 'bar' }], fool: { bad: { boo: 'baz' } } });
+        st.deepEqual(qs.parse('foo[0][0].baz=bar&fool.bad=baz', { allowDots: true }), { foo: [[{ baz: 'bar' }]], fool: { bad: 'baz' } });
+        st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15'], bar: '2' }] });
+        st.deepEqual(qs.parse('foo[0].baz[0]=15&foo[0].baz[1]=16&foo[0].bar=2', { allowDots: true }), { foo: [{ baz: ['15', '16'], bar: '2' }] });
+        st.deepEqual(qs.parse('foo.bad=baz&foo[0]=bar', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar' } });
+        st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar' } });
+        st.deepEqual(qs.parse('foo[]=bar&foo.bad=baz', { allowDots: true }), { foo: { '0': 'bar', bad: 'baz' } });
+        st.deepEqual(qs.parse('foo.bad=baz&foo[]=bar&foo[]=foo', { allowDots: true }), { foo: { bad: 'baz', '0': 'bar', '1': 'foo' } });
+        st.deepEqual(qs.parse('foo[0].a=a&foo[0].b=b&foo[1].a=aa&foo[1].b=bb', { allowDots: true }), { foo: [{ a: 'a', b: 'b' }, { a: 'aa', b: 'bb' }] });
+        st.end();
     });
 
-    it('correctly prunes undefined values when converting an array to an object', function (done) {
+    t.deepEqual(qs.parse('a[b]=c&a=d'), { a: { b: 'c', d: true } }, 'can add keys to objects');
 
-        expect(Qs.parse('a[2]=b&a[99999999]=c')).to.deep.equal({ a: { '2': 'b', '99999999': 'c' } });
-        done();
+    t.test('correctly prunes undefined values when converting an array to an object', function (st) {
+        st.deepEqual(qs.parse('a[2]=b&a[99999999]=c'), { a: { '2': 'b', '99999999': 'c' } });
+        st.end();
     });
 
-    it('supports malformed uri characters', function (done) {
-
-        expect(Qs.parse('{%:%}', { strictNullHandling: true })).to.deep.equal({ '{%:%}': null });
-        expect(Qs.parse('{%:%}=')).to.deep.equal({ '{%:%}': '' });
-        expect(Qs.parse('foo=%:%}')).to.deep.equal({ foo: '%:%}' });
-        done();
+    t.test('supports malformed uri characters', function (st) {
+        st.deepEqual(qs.parse('{%:%}', { strictNullHandling: true }), { '{%:%}': null });
+        st.deepEqual(qs.parse('{%:%}='), { '{%:%}': '' });
+        st.deepEqual(qs.parse('foo=%:%}'), { foo: '%:%}' });
+        st.end();
     });
 
-    it('doesn\'t produce empty keys', function (done) {
-
-        expect(Qs.parse('_r=1&')).to.deep.equal({ '_r': '1' });
-        done();
+    t.test('doesn\'t produce empty keys', function (st) {
+        st.deepEqual(qs.parse('_r=1&'), { '_r': '1' });
+        st.end();
     });
 
-    it('cannot access Object prototype', function (done) {
-
-        Qs.parse('constructor[prototype][bad]=bad');
-        Qs.parse('bad[constructor][prototype][bad]=bad');
-        expect(typeof Object.prototype.bad).to.equal('undefined');
-        done();
+    t.test('cannot access Object prototype', function (st) {
+        qs.parse('constructor[prototype][bad]=bad');
+        qs.parse('bad[constructor][prototype][bad]=bad');
+        st.equal(typeof Object.prototype.bad, 'undefined');
+        st.end();
     });
 
-    it('parses arrays of objects', function (done) {
-
-        expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
-        expect(Qs.parse('a[0][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
-        done();
+    t.test('parses arrays of objects', function (st) {
+        st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
+        st.deepEqual(qs.parse('a[0][b]=c'), { a: [{ b: 'c' }] });
+        st.end();
     });
 
-    it('allows for empty strings in arrays', function (done) {
-
-        expect(Qs.parse('a[]=b&a[]=&a[]=c')).to.deep.equal({ a: ['b', '', 'c'] });
-        expect(Qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true })).to.deep.equal({ a: ['b', null, 'c', ''] });
-        expect(Qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true })).to.deep.equal({ a: ['b', '', 'c', null] });
-        expect(Qs.parse('a[]=&a[]=b&a[]=c')).to.deep.equal({ a: ['', 'b', 'c'] });
-        done();
+    t.test('allows for empty strings in arrays', function (st) {
+        st.deepEqual(qs.parse('a[]=b&a[]=&a[]=c'), { a: ['b', '', 'c'] });
+        st.deepEqual(qs.parse('a[0]=b&a[1]&a[2]=c&a[19]=', { strictNullHandling: true }), { a: ['b', null, 'c', ''] });
+        st.deepEqual(qs.parse('a[0]=b&a[1]=&a[2]=c&a[19]', { strictNullHandling: true }), { a: ['b', '', 'c', null] });
+        st.deepEqual(qs.parse('a[]=&a[]=b&a[]=c'), { a: ['', 'b', 'c'] });
+        st.end();
     });
 
-    it('compacts sparse arrays', function (done) {
-
-        expect(Qs.parse('a[10]=1&a[2]=2')).to.deep.equal({ a: ['2', '1'] });
-        done();
+    t.test('compacts sparse arrays', function (st) {
+        st.deepEqual(qs.parse('a[10]=1&a[2]=2'), { a: ['2', '1'] });
+        st.end();
     });
 
-    it('parses semi-parsed strings', function (done) {
-
-        expect(Qs.parse({ 'a[b]': 'c' })).to.deep.equal({ a: { b: 'c' } });
-        expect(Qs.parse({ 'a[b]': 'c', 'a[d]': 'e' })).to.deep.equal({ a: { b: 'c', d: 'e' } });
-        done();
+    t.test('parses semi-parsed strings', function (st) {
+        st.deepEqual(qs.parse({ 'a[b]': 'c' }), { a: { b: 'c' } });
+        st.deepEqual(qs.parse({ 'a[b]': 'c', 'a[d]': 'e' }), { a: { b: 'c', d: 'e' } });
+        st.end();
     });
 
-    it('parses buffers correctly', function (done) {
-
+    t.test('parses buffers correctly', function (st) {
         var b = new Buffer('test');
-        expect(Qs.parse({ a: b })).to.deep.equal({ a: b });
-        done();
+        st.deepEqual(qs.parse({ a: b }), { a: b });
+        st.end();
     });
 
-    it('continues parsing when no parent is found', function (done) {
-
-        expect(Qs.parse('[]=&a=b')).to.deep.equal({ '0': '', a: 'b' });
-        expect(Qs.parse('[]&a=b', { strictNullHandling: true })).to.deep.equal({ '0': null, a: 'b' });
-        expect(Qs.parse('[foo]=bar')).to.deep.equal({ foo: 'bar' });
-        done();
+    t.test('continues parsing when no parent is found', function (st) {
+        st.deepEqual(qs.parse('[]=&a=b'), { '0': '', a: 'b' });
+        st.deepEqual(qs.parse('[]&a=b', { strictNullHandling: true }), { '0': null, a: 'b' });
+        st.deepEqual(qs.parse('[foo]=bar'), { foo: 'bar' });
+        st.end();
     });
 
-    it('does not error when parsing a very long array', function (done) {
-
+    t.test('does not error when parsing a very long array', function (st) {
         var str = 'a[]=a';
         while (Buffer.byteLength(str) < 128 * 1024) {
-            str += '&' + str;
+            str = str + '&' + str;
         }
 
-        expect(function () {
+        st.doesNotThrow(function () { qs.parse(str); });
 
-            Qs.parse(str);
-        }).to.not.throw();
-
-        done();
+        st.end();
     });
 
-    it('should not throw when a native prototype has an enumerable property', { parallel: false }, function (done) {
-
+    t.test('should not throw when a native prototype has an enumerable property', { parallel: false }, function (st) {
         Object.prototype.crash = '';
         Array.prototype.crash = '';
-        expect(Qs.parse.bind(null, 'a=b')).to.not.throw();
-        expect(Qs.parse('a=b')).to.deep.equal({ a: 'b' });
-        expect(Qs.parse.bind(null, 'a[][b]=c')).to.not.throw();
-        expect(Qs.parse('a[][b]=c')).to.deep.equal({ a: [{ b: 'c' }] });
+        st.doesNotThrow(qs.parse.bind(null, 'a=b'));
+        st.deepEqual(qs.parse('a=b'), { a: 'b' });
+        st.doesNotThrow(qs.parse.bind(null, 'a[][b]=c'));
+        st.deepEqual(qs.parse('a[][b]=c'), { a: [{ b: 'c' }] });
         delete Object.prototype.crash;
         delete Array.prototype.crash;
-        done();
+        st.end();
     });
 
-    it('parses a string with an alternative string delimiter', function (done) {
-
-        expect(Qs.parse('a=b;c=d', { delimiter: ';' })).to.deep.equal({ a: 'b', c: 'd' });
-        done();
+    t.test('parses a string with an alternative string delimiter', function (st) {
+        st.deepEqual(qs.parse('a=b;c=d', { delimiter: ';' }), { a: 'b', c: 'd' });
+        st.end();
     });
 
-    it('parses a string with an alternative RegExp delimiter', function (done) {
-
-        expect(Qs.parse('a=b; c=d', { delimiter: /[;,] */ })).to.deep.equal({ a: 'b', c: 'd' });
-        done();
+    t.test('parses a string with an alternative RegExp delimiter', function (st) {
+        st.deepEqual(qs.parse('a=b; c=d', { delimiter: /[;,] */ }), { a: 'b', c: 'd' });
+        st.end();
     });
 
-    it('does not use non-splittable objects as delimiters', function (done) {
-
-        expect(Qs.parse('a=b&c=d', { delimiter: true })).to.deep.equal({ a: 'b', c: 'd' });
-        done();
+    t.test('does not use non-splittable objects as delimiters', function (st) {
+        st.deepEqual(qs.parse('a=b&c=d', { delimiter: true }), { a: 'b', c: 'd' });
+        st.end();
     });
 
-    it('allows overriding parameter limit', function (done) {
-
-        expect(Qs.parse('a=b&c=d', { parameterLimit: 1 })).to.deep.equal({ a: 'b' });
-        done();
+    t.test('allows overriding parameter limit', function (st) {
+        st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: 1 }), { a: 'b' });
+        st.end();
     });
 
-    it('allows setting the parameter limit to Infinity', function (done) {
-
-        expect(Qs.parse('a=b&c=d', { parameterLimit: Infinity })).to.deep.equal({ a: 'b', c: 'd' });
-        done();
+    t.test('allows setting the parameter limit to Infinity', function (st) {
+        st.deepEqual(qs.parse('a=b&c=d', { parameterLimit: Infinity }), { a: 'b', c: 'd' });
+        st.end();
     });
 
-    it('allows overriding array limit', function (done) {
-
-        expect(Qs.parse('a[0]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '0': 'b' } });
-        expect(Qs.parse('a[-1]=b', { arrayLimit: -1 })).to.deep.equal({ a: { '-1': 'b' } });
-        expect(Qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 })).to.deep.equal({ a: { '0': 'b', '1': 'c' } });
-        done();
+    t.test('allows overriding array limit', function (st) {
+        st.deepEqual(qs.parse('a[0]=b', { arrayLimit: -1 }), { a: { '0': 'b' } });
+        st.deepEqual(qs.parse('a[-1]=b', { arrayLimit: -1 }), { a: { '-1': 'b' } });
+        st.deepEqual(qs.parse('a[0]=b&a[1]=c', { arrayLimit: 0 }), { a: { '0': 'b', '1': 'c' } });
+        st.end();
     });
 
-    it('allows disabling array parsing', function (done) {
-
-        expect(Qs.parse('a[0]=b&a[1]=c', { parseArrays: false })).to.deep.equal({ a: { '0': 'b', '1': 'c' } });
-        done();
+    t.test('allows disabling array parsing', function (st) {
+        st.deepEqual(qs.parse('a[0]=b&a[1]=c', { parseArrays: false }), { a: { '0': 'b', '1': 'c' } });
+        st.end();
     });
 
-    it('parses an object', function (done) {
-
+    t.test('parses an object', function (st) {
         var input = {
             'user[name]': { 'pop[bob]': 3 },
             'user[email]': null
         };
 
         var expected = {
-            'user': {
-                'name': { 'pop[bob]': 3 },
-                'email': null
+            user: {
+                name: { 'pop[bob]': 3 },
+                email: null
             }
         };
 
-        var result = Qs.parse(input);
+        var result = qs.parse(input);
 
-        expect(result).to.deep.equal(expected);
-        done();
+        st.deepEqual(result, expected);
+        st.end();
     });
 
-    it('parses an object in dot notation', function (done) {
-
+    t.test('parses an object in dot notation', function (st) {
         var input = {
             'user.name': { 'pop[bob]': 3 },
             'user.email.': null
         };
 
         var expected = {
-            'user': {
-                'name': { 'pop[bob]': 3 },
-                'email': null
+            user: {
+                name: { 'pop[bob]': 3 },
+                email: null
             }
         };
 
-        var result = Qs.parse(input, { allowDots: true });
+        var result = qs.parse(input, { allowDots: true });
 
-        expect(result).to.deep.equal(expected);
-        done();
+        st.deepEqual(result, expected);
+        st.end();
     });
 
-    it('parses an object and not child values', function (done) {
-
+    t.test('parses an object and not child values', function (st) {
         var input = {
             'user[name]': { 'pop[bob]': { 'test': 3 } },
             'user[email]': null
         };
 
         var expected = {
-            'user': {
-                'name': { 'pop[bob]': { 'test': 3 } },
-                'email': null
+            user: {
+                name: { 'pop[bob]': { 'test': 3 } },
+                email: null
             }
         };
 
-        var result = Qs.parse(input);
+        var result = qs.parse(input);
 
-        expect(result).to.deep.equal(expected);
-        done();
+        st.deepEqual(result, expected);
+        st.end();
     });
 
-    it('does not blow up when Buffer global is missing', function (done) {
-
+    t.test('does not blow up when Buffer global is missing', function (st) {
         var tempBuffer = global.Buffer;
         delete global.Buffer;
-        var result = Qs.parse('a=b&c=d');
+        var result = qs.parse('a=b&c=d');
         global.Buffer = tempBuffer;
-        expect(result).to.deep.equal({ a: 'b', c: 'd' });
-        done();
+        st.deepEqual(result, { a: 'b', c: 'd' });
+        st.end();
     });
 
-    it('does not crash when parsing circular references', function (done) {
-
+    t.test('does not crash when parsing circular references', function (st) {
         var a = {};
         a.b = a;
 
         var parsed;
 
-        expect(function () {
-
-            parsed = Qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });
-        }).to.not.throw();
+        st.doesNotThrow(function () {
+            parsed = qs.parse({ 'foo[bar]': 'baz', 'foo[baz]': a });
+        });
 
-        expect(parsed).to.contain('foo');
-        expect(parsed.foo).to.contain('bar', 'baz');
-        expect(parsed.foo.bar).to.equal('baz');
-        expect(parsed.foo.baz).to.deep.equal(a);
-        done();
+        st.equal('foo' in parsed, true, 'parsed has "foo" property');
+        st.equal('bar' in parsed.foo, true);
+        st.equal('baz' in parsed.foo, true);
+        st.equal(parsed.foo.bar, 'baz');
+        st.deepEqual(parsed.foo.baz, a);
+        st.end();
     });
 
-    it('parses plain objects correctly', function (done) {
-
+    t.test('parses plain objects correctly', function (st) {
         var a = Object.create(null);
         a.b = 'c';
 
-        expect(Qs.parse(a)).to.deep.equal({ b: 'c' });
-        var result = Qs.parse({ a: a });
-        expect(result).to.contain('a');
-        expect(result.a).to.deep.equal(a);
-        done();
+        st.deepEqual(qs.parse(a), { b: 'c' });
+        var result = qs.parse({ a: a });
+        st.equal('a' in result, true, 'result has "a" property');
+        st.deepEqual(result.a, a);
+        st.end();
     });
 
-    it('parses dates correctly', function (done) {
-
+    t.test('parses dates correctly', function (st) {
         var now = new Date();
-        expect(Qs.parse({ a: now })).to.deep.equal({ a: now });
-        done();
+        st.deepEqual(qs.parse({ a: now }), { a: now });
+        st.end();
     });
 
-    it('parses regular expressions correctly', function (done) {
-
+    t.test('parses regular expressions correctly', function (st) {
         var re = /^test$/;
-        expect(Qs.parse({ a: re })).to.deep.equal({ a: re });
-        done();
+        st.deepEqual(qs.parse({ a: re }), { a: re });
+        st.end();
     });
 
-    it('can allow overwriting prototype properties', function (done) {
-
-        expect(Qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true })).to.deep.equal({ a: { hasOwnProperty: 'b' } }, { prototype: false });
-        expect(Qs.parse('hasOwnProperty=b', { allowPrototypes: true })).to.deep.equal({ hasOwnProperty: 'b' }, { prototype: false });
-        done();
+    t.test('can allow overwriting prototype properties', function (st) {
+        st.deepEqual(qs.parse('a[hasOwnProperty]=b', { allowPrototypes: true }), { a: { hasOwnProperty: 'b' } }, { prototype: false });
+        st.deepEqual(qs.parse('hasOwnProperty=b', { allowPrototypes: true }), { hasOwnProperty: 'b' }, { prototype: false });
+        st.end();
     });
 
-    it('can return plain objects', function (done) {
-
+    t.test('can return plain objects', function (st) {
         var expected = Object.create(null);
         expected.a = Object.create(null);
         expected.a.b = 'c';
         expected.a.hasOwnProperty = 'd';
-        expect(Qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true })).to.deep.equal(expected);
-        expect(Qs.parse(null, { plainObjects: true })).to.deep.equal(Object.create(null));
+        st.deepEqual(qs.parse('a[b]=c&a[hasOwnProperty]=d', { plainObjects: true }), expected);
+        st.deepEqual(qs.parse(null, { plainObjects: true }), Object.create(null));
         var expectedArray = Object.create(null);
         expectedArray.a = Object.create(null);
         expectedArray.a['0'] = 'b';
         expectedArray.a.c = 'd';
-        expect(Qs.parse('a[]=b&a[c]=d', { plainObjects: true })).to.deep.equal(expectedArray);
-        done();
+        st.deepEqual(qs.parse('a[]=b&a[c]=d', { plainObjects: true }), expectedArray);
+        st.end();
     });
 });
old mode 100644 (file)
new mode 100755 (executable)
index 53139ff..88d22f2
-/* eslint no-extend-native:0 */
-// Load modules
+'use strict';
 
-var Code = require('code');
-var Lab = require('lab');
-var Qs = require('../');
+var test = require('tape');
+var qs = require('../');
 
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var expect = Code.expect;
-var describe = lab.experiment;
-var it = lab.test;
-
-
-describe('stringify()', function () {
-
-    it('stringifies a querystring object', function (done) {
-
-        expect(Qs.stringify({ a: 'b' })).to.equal('a=b');
-        expect(Qs.stringify({ a: 1 })).to.equal('a=1');
-        expect(Qs.stringify({ a: 1, b: 2 })).to.equal('a=1&b=2');
-        expect(Qs.stringify({ a: 'A_Z' })).to.equal('a=A_Z');
-        expect(Qs.stringify({ a: '€' })).to.equal('a=%E2%82%AC');
-        expect(Qs.stringify({ a: '' })).to.equal('a=%EE%80%80');
-        expect(Qs.stringify({ a: 'א' })).to.equal('a=%D7%90');
-        expect(Qs.stringify({ a: '𐐷' })).to.equal('a=%F0%90%90%B7');
-        done();
+test('stringify()', function (t) {
+    t.test('stringifies a querystring object', function (st) {
+        st.equal(qs.stringify({ a: 'b' }), 'a=b');
+        st.equal(qs.stringify({ a: 1 }), 'a=1');
+        st.equal(qs.stringify({ a: 1, b: 2 }), 'a=1&b=2');
+        st.equal(qs.stringify({ a: 'A_Z' }), 'a=A_Z');
+        st.equal(qs.stringify({ a: '€' }), 'a=%E2%82%AC');
+        st.equal(qs.stringify({ a: '' }), 'a=%EE%80%80');
+        st.equal(qs.stringify({ a: 'א' }), 'a=%D7%90');
+        st.equal(qs.stringify({ a: '𐐷' }), 'a=%F0%90%90%B7');
+        st.end();
     });
 
-    it('stringifies a nested object', function (done) {
-
-        expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
-        expect(Qs.stringify({ a: { b: { c: { d: 'e' } } } })).to.equal('a%5Bb%5D%5Bc%5D%5Bd%5D=e');
-        done();
+    t.test('stringifies a nested object', function (st) {
+        st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
+        st.equal(qs.stringify({ a: { b: { c: { d: 'e' } } } }), 'a%5Bb%5D%5Bc%5D%5Bd%5D=e');
+        st.end();
     });
 
-    it('stringifies an array value', function (done) {
-
-        expect(Qs.stringify({ a: ['b', 'c', 'd'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d');
-        done();
+    t.test('stringifies an array value', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c', 'd'] }), 'a%5B0%5D=b&a%5B1%5D=c&a%5B2%5D=d');
+        st.end();
     });
 
-    it('omits nulls when asked', function (done) {
-
-        expect(Qs.stringify({ a: 'b', c: null }, { skipNulls: true })).to.equal('a=b');
-        done();
+    t.test('omits nulls when asked', function (st) {
+        st.equal(qs.stringify({ a: 'b', c: null }, { skipNulls: true }), 'a=b');
+        st.end();
     });
 
 
-    it('omits nested nulls when asked', function (done) {
-
-        expect(Qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true })).to.equal('a%5Bb%5D=c');
-        done();
+    t.test('omits nested nulls when asked', function (st) {
+        st.equal(qs.stringify({ a: { b: 'c', d: null } }, { skipNulls: true }), 'a%5Bb%5D=c');
+        st.end();
     });
 
-    it('omits array indices when asked', function (done) {
-
-        expect(Qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false })).to.equal('a=b&a=c&a=d');
-        done();
+    t.test('omits array indices when asked', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false }), 'a=b&a=c&a=d');
+        st.end();
     });
 
-    it('stringifies a nested array value', function (done) {
-
-        expect(Qs.stringify({ a: { b: ['c', 'd'] } })).to.equal('a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
-        done();
+    t.test('stringifies a nested array value', function (st) {
+        st.equal(qs.stringify({ a: { b: ['c', 'd'] } }), 'a%5Bb%5D%5B0%5D=c&a%5Bb%5D%5B1%5D=d');
+        st.end();
     });
 
-    it('stringifies an object inside an array', function (done) {
-
-        expect(Qs.stringify({ a: [{ b: 'c' }] })).to.equal('a%5B0%5D%5Bb%5D=c');
-        expect(Qs.stringify({ a: [{ b: { c: [1] } }] })).to.equal('a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1');
-        done();
+    t.test('stringifies an object inside an array', function (st) {
+        st.equal(qs.stringify({ a: [{ b: 'c' }] }), 'a%5B0%5D%5Bb%5D=c');
+        st.equal(qs.stringify({ a: [{ b: { c: [1] } }] }), 'a%5B0%5D%5Bb%5D%5Bc%5D%5B0%5D=1');
+        st.end();
     });
 
-    it('does not omit object keys when indices = false', function (done) {
-
-        expect(Qs.stringify({ a: [{ b: 'c' }] }, { indices: false })).to.equal('a%5Bb%5D=c');
-        done();
+    t.test('does not omit object keys when indices = false', function (st) {
+        st.equal(qs.stringify({ a: [{ b: 'c' }] }, { indices: false }), 'a%5Bb%5D=c');
+        st.end();
     });
 
-    it('uses indices notation for arrays when indices=true', function (done) {
-
-        expect(Qs.stringify({ a: ['b', 'c'] }, { indices: true })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
-        done();
+    t.test('uses indices notation for arrays when indices=true', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }, { indices: true }), 'a%5B0%5D=b&a%5B1%5D=c');
+        st.end();
     });
 
-    it('uses indices notation for arrays when no arrayFormat is specified', function (done) {
-
-        expect(Qs.stringify({ a: ['b', 'c'] })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
-        done();
+    t.test('uses indices notation for arrays when no arrayFormat is specified', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }), 'a%5B0%5D=b&a%5B1%5D=c');
+        st.end();
     });
 
-    it('uses indices notation for arrays when no arrayFormat=indices', function (done) {
-
-        expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' })).to.equal('a%5B0%5D=b&a%5B1%5D=c');
-        done();
+    t.test('uses indices notation for arrays when no arrayFormat=indices', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'indices' }), 'a%5B0%5D=b&a%5B1%5D=c');
+        st.end();
     });
 
-    it('uses repeat notation for arrays when no arrayFormat=repeat', function (done) {
-
-        expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' })).to.equal('a=b&a=c');
-        done();
+    t.test('uses repeat notation for arrays when no arrayFormat=repeat', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'repeat' }), 'a=b&a=c');
+        st.end();
     });
 
-    it('uses brackets notation for arrays when no arrayFormat=brackets', function (done) {
-
-        expect(Qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' })).to.equal('a%5B%5D=b&a%5B%5D=c');
-        done();
+    t.test('uses brackets notation for arrays when no arrayFormat=brackets', function (st) {
+        st.equal(qs.stringify({ a: ['b', 'c'] }, { arrayFormat: 'brackets' }), 'a%5B%5D=b&a%5B%5D=c');
+        st.end();
     });
 
-    it('stringifies a complicated object', function (done) {
-
-        expect(Qs.stringify({ a: { b: 'c', d: 'e' } })).to.equal('a%5Bb%5D=c&a%5Bd%5D=e');
-        done();
+    t.test('stringifies a complicated object', function (st) {
+        st.equal(qs.stringify({ a: { b: 'c', d: 'e' } }), 'a%5Bb%5D=c&a%5Bd%5D=e');
+        st.end();
     });
 
-    it('stringifies an empty value', function (done) {
-
-        expect(Qs.stringify({ a: '' })).to.equal('a=');
-        expect(Qs.stringify({ a: null }, { strictNullHandling: true })).to.equal('a');
+    t.test('stringifies an empty value', function (st) {
+        st.equal(qs.stringify({ a: '' }), 'a=');
+        st.equal(qs.stringify({ a: null }, { strictNullHandling: true }), 'a');
 
-        expect(Qs.stringify({ a: '', b: '' })).to.equal('a=&b=');
-        expect(Qs.stringify({ a: null, b: '' }, { strictNullHandling: true })).to.equal('a&b=');
+        st.equal(qs.stringify({ a: '', b: '' }), 'a=&b=');
+        st.equal(qs.stringify({ a: null, b: '' }, { strictNullHandling: true }), 'a&b=');
 
-        expect(Qs.stringify({ a: { b: '' } })).to.equal('a%5Bb%5D=');
-        expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: true })).to.equal('a%5Bb%5D');
-        expect(Qs.stringify({ a: { b: null } }, { strictNullHandling: false })).to.equal('a%5Bb%5D=');
+        st.equal(qs.stringify({ a: { b: '' } }), 'a%5Bb%5D=');
+        st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: true }), 'a%5Bb%5D');
+        st.equal(qs.stringify({ a: { b: null } }, { strictNullHandling: false }), 'a%5Bb%5D=');
 
-        done();
+        st.end();
     });
 
-    it('stringifies an empty object', function (done) {
-
+    t.test('stringifies an empty object', function (st) {
         var obj = Object.create(null);
         obj.a = 'b';
-        expect(Qs.stringify(obj)).to.equal('a=b');
-        done();
+        st.equal(qs.stringify(obj), 'a=b');
+        st.end();
     });
 
-    it('returns an empty string for invalid input', function (done) {
-
-        expect(Qs.stringify(undefined)).to.equal('');
-        expect(Qs.stringify(false)).to.equal('');
-        expect(Qs.stringify(null)).to.equal('');
-        expect(Qs.stringify('')).to.equal('');
-        done();
+    t.test('returns an empty string for invalid input', function (st) {
+        st.equal(qs.stringify(undefined), '');
+        st.equal(qs.stringify(false), '');
+        st.equal(qs.stringify(null), '');
+        st.equal(qs.stringify(''), '');
+        st.end();
     });
 
-    it('stringifies an object with an empty object as a child', function (done) {
-
+    t.test('stringifies an object with an empty object as a child', function (st) {
         var obj = {
             a: Object.create(null)
         };
 
         obj.a.b = 'c';
-        expect(Qs.stringify(obj)).to.equal('a%5Bb%5D=c');
-        done();
+        st.equal(qs.stringify(obj), 'a%5Bb%5D=c');
+        st.end();
     });
 
-    it('drops keys with a value of undefined', function (done) {
+    t.test('drops keys with a value of undefined', function (st) {
+        st.equal(qs.stringify({ a: undefined }), '');
 
-        expect(Qs.stringify({ a: undefined })).to.equal('');
-
-        expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true })).to.equal('a%5Bc%5D');
-        expect(Qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false })).to.equal('a%5Bc%5D=');
-        expect(Qs.stringify({ a: { b: undefined, c: '' } })).to.equal('a%5Bc%5D=');
-        done();
+        st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: true }), 'a%5Bc%5D');
+        st.equal(qs.stringify({ a: { b: undefined, c: null } }, { strictNullHandling: false }), 'a%5Bc%5D=');
+        st.equal(qs.stringify({ a: { b: undefined, c: '' } }), 'a%5Bc%5D=');
+        st.end();
     });
 
-    it('url encodes values', function (done) {
-
-        expect(Qs.stringify({ a: 'b c' })).to.equal('a=b%20c');
-        done();
+    t.test('url encodes values', function (st) {
+        st.equal(qs.stringify({ a: 'b c' }), 'a=b%20c');
+        st.end();
     });
 
-    it('stringifies a date', function (done) {
-
+    t.test('stringifies a date', function (st) {
         var now = new Date();
         var str = 'a=' + encodeURIComponent(now.toISOString());
-        expect(Qs.stringify({ a: now })).to.equal(str);
-        done();
+        st.equal(qs.stringify({ a: now }), str);
+        st.end();
     });
 
-    it('stringifies the weird object from qs', function (done) {
-
-        expect(Qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' })).to.equal('my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F');
-        done();
+    t.test('stringifies the weird object from qs', function (st) {
+        st.equal(qs.stringify({ 'my weird field': '~q1!2"\'w$5&7/z8)?' }), 'my%20weird%20field=~q1%212%22%27w%245%267%2Fz8%29%3F');
+        st.end();
     });
 
-    it('skips properties that are part of the object prototype', function (done) {
-
+    t.test('skips properties that are part of the object prototype', function (st) {
         Object.prototype.crash = 'test';
-        expect(Qs.stringify({ a: 'b' })).to.equal('a=b');
-        expect(Qs.stringify({ a: { b: 'c' } })).to.equal('a%5Bb%5D=c');
+        st.equal(qs.stringify({ a: 'b' }), 'a=b');
+        st.equal(qs.stringify({ a: { b: 'c' } }), 'a%5Bb%5D=c');
         delete Object.prototype.crash;
-        done();
+        st.end();
     });
 
-    it('stringifies boolean values', function (done) {
-
-        expect(Qs.stringify({ a: true })).to.equal('a=true');
-        expect(Qs.stringify({ a: { b: true } })).to.equal('a%5Bb%5D=true');
-        expect(Qs.stringify({ b: false })).to.equal('b=false');
-        expect(Qs.stringify({ b: { c: false } })).to.equal('b%5Bc%5D=false');
-        done();
+    t.test('stringifies boolean values', function (st) {
+        st.equal(qs.stringify({ a: true }), 'a=true');
+        st.equal(qs.stringify({ a: { b: true } }), 'a%5Bb%5D=true');
+        st.equal(qs.stringify({ b: false }), 'b=false');
+        st.equal(qs.stringify({ b: { c: false } }), 'b%5Bc%5D=false');
+        st.end();
     });
 
-    it('stringifies buffer values', function (done) {
-
-        expect(Qs.stringify({ a: new Buffer('test') })).to.equal('a=test');
-        expect(Qs.stringify({ a: { b: new Buffer('test') } })).to.equal('a%5Bb%5D=test');
-        done();
+    t.test('stringifies buffer values', function (st) {
+        st.equal(qs.stringify({ a: new Buffer('test') }), 'a=test');
+        st.equal(qs.stringify({ a: { b: new Buffer('test') } }), 'a%5Bb%5D=test');
+        st.end();
     });
 
-    it('stringifies an object using an alternative delimiter', function (done) {
-
-        expect(Qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' })).to.equal('a=b;c=d');
-        done();
+    t.test('stringifies an object using an alternative delimiter', function (st) {
+        st.equal(qs.stringify({ a: 'b', c: 'd' }, { delimiter: ';' }), 'a=b;c=d');
+        st.end();
     });
 
-    it('doesn\'t blow up when Buffer global is missing', function (done) {
-
+    t.test('doesn\'t blow up when Buffer global is missing', function (st) {
         var tempBuffer = global.Buffer;
         delete global.Buffer;
-        var result = Qs.stringify({ a: 'b', c: 'd' });
+        var result = qs.stringify({ a: 'b', c: 'd' });
         global.Buffer = tempBuffer;
-        expect(result).to.equal('a=b&c=d');
-        done();
+        st.equal(result, 'a=b&c=d');
+        st.end();
     });
 
-    it('selects properties when filter=array', function (done) {
-
-        expect(Qs.stringify({ a: 'b' }, { filter: ['a'] })).to.equal('a=b');
-        expect(Qs.stringify({ a: 1 }, { filter: [] })).to.equal('');
-        expect(Qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] })).to.equal('a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3');
-        done();
-
+    t.test('selects properties when filter=array', function (st) {
+        st.equal(qs.stringify({ a: 'b' }, { filter: ['a'] }), 'a=b');
+        st.equal(qs.stringify({ a: 1 }, { filter: [] }), '');
+        st.equal(qs.stringify({ a: { b: [1, 2, 3, 4], c: 'd' }, c: 'f' }, { filter: ['a', 'b', 0, 2] }), 'a%5Bb%5D%5B0%5D=1&a%5Bb%5D%5B2%5D=3');
+        st.end();
     });
 
-    it('supports custom representations when filter=function', function (done) {
-
+    t.test('supports custom representations when filter=function', function (st) {
         var calls = 0;
         var obj = { a: 'b', c: 'd', e: { f: new Date(1257894000000) } };
         var filterFunc = function (prefix, value) {
-
             calls++;
             if (calls === 1) {
-                expect(prefix).to.be.empty();
-                expect(value).to.equal(obj);
-            }
-            else if (prefix === 'c') {
+                st.equal(prefix, '', 'prefix is empty');
+                st.equal(value, obj);
+            } else if (prefix === 'c') {
                 return;
-            }
-            else if (value instanceof Date) {
-                expect(prefix).to.equal('e[f]');
+            } else if (value instanceof Date) {
+                st.equal(prefix, 'e[f]');
                 return value.getTime();
             }
             return value;
         };
 
-        expect(Qs.stringify(obj, { filter: filterFunc })).to.equal('a=b&e%5Bf%5D=1257894000000');
-        expect(calls).to.equal(5);
-        done();
-
+        st.equal(qs.stringify(obj, { filter: filterFunc }), 'a=b&e%5Bf%5D=1257894000000');
+        st.equal(calls, 5);
+        st.end();
     });
 
-    it('can disable uri encoding', function (done) {
-
-        expect(Qs.stringify({ a: 'b' }, { encode: false })).to.equal('a=b');
-        expect(Qs.stringify({ a: { b: 'c' } }, { encode: false })).to.equal('a[b]=c');
-        expect(Qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false })).to.equal('a=b&c');
-        done();
+    t.test('can disable uri encoding', function (st) {
+        st.equal(qs.stringify({ a: 'b' }, { encode: false }), 'a=b');
+        st.equal(qs.stringify({ a: { b: 'c' } }, { encode: false }), 'a[b]=c');
+        st.equal(qs.stringify({ a: 'b', c: null }, { strictNullHandling: true, encode: false }), 'a=b&c');
+        st.end();
     });
 
-    it('can sort the keys', function (done) {
-
-        var sort = function alphabeticalSort (a, b) {
-
-            return a.localeCompare(b);
-        };
-
-        expect(Qs.stringify({ a: 'c', z: 'y', b : 'f' }, { sort : sort })).to.equal('a=c&b=f&z=y');
-        expect(Qs.stringify({ a: 'c', z: { j: 'a', i:'b' }, b : 'f' }, { sort : sort })).to.equal('a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
-        done();
+    t.test('can sort the keys', function (st) {
+        var sort = function (a, b) { return a.localeCompare(b); };
+        st.equal(qs.stringify({ a: 'c', z: 'y', b: 'f' }, { sort: sort }), 'a=c&b=f&z=y');
+        st.equal(qs.stringify({ a: 'c', z: { j: 'a', i: 'b' }, b: 'f' }, { sort: sort }), 'a=c&b=f&z%5Bi%5D=b&z%5Bj%5D=a');
+        st.end();
     });
 });
old mode 100644 (file)
new mode 100755 (executable)
index a9a6b52..4a8d824
@@ -1,28 +1,9 @@
-// Load modules
+'use strict';
 
-var Code = require('code');
-var Lab = require('lab');
-var Utils = require('../lib/utils');
+var test = require('tape');
+var utils = require('../lib/utils');
 
-
-// Declare internals
-
-var internals = {};
-
-
-// Test shortcuts
-
-var lab = exports.lab = Lab.script();
-var expect = Code.expect;
-var describe = lab.experiment;
-var it = lab.test;
-
-
-describe('merge()', function () {
-
-    it('can merge two objects with the same key', function (done) {
-
-        expect(Utils.merge({ a: 'b' }, { a: 'c' })).to.deep.equal({ a: ['b', 'c'] });
-        done();
-    });
+test('merge()', function (t) {
+    t.deepEqual(utils.merge({ a: 'b' }, { a: 'c' }), { a: ['b', 'c'] }, 'merges two objects with the same key');
+    t.end();
 });
index 9d84645..39474ba 100644 (file)
     "url": "git+https://github.com/mhart/StringStream.git"
   },
   "license": "MIT",
-  "readme": "# Decode streams into strings The Right Way(tm)\n\n```javascript\nvar fs   = require('fs')\nvar zlib = require('zlib')\nvar strs = require('stringstream')\n\nvar utf8Stream = fs.createReadStream('massiveLogFile.gz')\n  .pipe(zlib.createGunzip())\n  .pipe(strs('utf8'))\n```\n\nNo need to deal with `setEncoding()` weirdness, just compose streams\nlike they were supposed to be!\n\nHandles input and output encoding:\n\n```javascript\n// Stream from utf8 to hex to base64... Why not, ay.\nvar hex64Stream = fs.createReadStream('myFile')\n  .pipe(strs('utf8', 'hex'))\n  .pipe(strs('hex', 'base64'))\n```\n\nAlso deals with `base64` output correctly by aligning each emitted data\nchunk so that there are no dangling `=` characters:\n\n```javascript\nvar stream = fs.createReadStream('myFile').pipe(strs('base64'))\n\nvar base64Str = ''\n\nstream.on('data', function(data) { base64Str += data })\nstream.on('end', function() {\n  console.log('My base64 encoded file is: ' + base64Str) // Wouldn't work with setEncoding()\n  console.log('Original file is: ' + new Buffer(base64Str, 'base64'))\n})\n```\n",
-  "readmeFilename": "README.md",
+  "gitHead": "1efe3bf507bf3a1161f8473908b60e881d41422b",
   "bugs": {
     "url": "https://github.com/mhart/StringStream/issues"
   },
   "homepage": "https://github.com/mhart/StringStream#readme",
   "_id": "stringstream@0.0.5",
+  "scripts": {},
   "_shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878",
+  "_from": "stringstream@>=0.0.4 <0.1.0",
+  "_npmVersion": "2.14.8",
+  "_nodeVersion": "4.2.1",
+  "_npmUser": {
+    "name": "hichaelmart",
+    "email": "michael.hart.au@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "hichaelmart",
+      "email": "michael.hart.au@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "4e484cd4de5a0bbbee18e46307710a8a81621878",
+    "tarball": "http://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz"
+  },
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/stringstream/-/stringstream-0.0.5.tgz",
-  "_from": "stringstream@>=0.0.4 <0.1.0"
+  "readme": "ERROR: No README data found!"
 }
index 8b90d88..5fd5510 100644 (file)
     "async": "^1.4.2",
     "vows": "^0.8.1"
   },
-  "readme": "[RFC6265](https://tools.ietf.org/html/rfc6265) Cookies and CookieJar for Node.js\n\n[![Build Status](https://travis-ci.org/SalesforceEng/tough-cookie.png?branch=master)](https://travis-ci.org/SalesforceEng/tough-cookie)\n\n[![NPM Stats](https://nodei.co/npm/tough-cookie.png?downloads=true&stars=true)](https://npmjs.org/package/tough-cookie)\n![NPM Downloads](https://nodei.co/npm-dl/tough-cookie.png?months=9)\n\n# Synopsis\n\n``` javascript\nvar tough = require('tough-cookie');\nvar Cookie = tough.Cookie;\nvar cookie = Cookie.parse(header);\ncookie.value = 'somethingdifferent';\nheader = cookie.toString();\n\nvar cookiejar = new tough.CookieJar();\ncookiejar.setCookie(cookie, 'http://currentdomain.example.com/path', cb);\n// ...\ncookiejar.getCookies('http://example.com/otherpath',function(err,cookies) {\n  res.headers['cookie'] = cookies.join('; ');\n});\n```\n\n# Installation\n\nIt's _so_ easy!\n\n`npm install tough-cookie`\n\nWhy the name?  NPM modules `cookie`, `cookies` and `cookiejar` were already taken.\n\n# API\n\n## tough\n\nFunctions on the module you get from `require('tough-cookie')`.  All can be used as pure functions and don't need to be \"bound\".\n\n**Note**: prior to 1.0.x, several of these functions took a `strict` parameter. This has since been removed from the API as it was no longer necessary.\n\n### `parseDate(string)`\n\nParse a cookie date string into a `Date`.  Parses according to RFC6265 Section 5.1.1, not `Date.parse()`.\n\n### `formatDate(date)`\n\nFormat a Date into a RFC1123 string (the RFC6265-recommended format).\n\n### `canonicalDomain(str)`\n\nTransforms a domain-name into a canonical domain-name.  The canonical domain-name is a trimmed, lowercased, stripped-of-leading-dot and optionally punycode-encoded domain-name (Section 5.1.2 of RFC6265).  For the most part, this function is idempotent (can be run again on its output without ill effects).\n\n### `domainMatch(str,domStr[,canonicalize=true])`\n\nAnswers \"does this real domain match the domain in a cookie?\".  The `str` is the \"current\" domain-name and the `domStr` is the \"cookie\" domain-name.  Matches according to RFC6265 Section 5.1.3, but it helps to think of it as a \"suffix match\".\n\nThe `canonicalize` parameter will run the other two paramters through `canonicalDomain` or not.\n\n### `defaultPath(path)`\n\nGiven a current request/response path, gives the Path apropriate for storing in a cookie.  This is basically the \"directory\" of a \"file\" in the path, but is specified by Section 5.1.4 of the RFC.\n\nThe `path` parameter MUST be _only_ the pathname part of a URI (i.e. excludes the hostname, query, fragment, etc.).  This is the `.pathname` property of node's `uri.parse()` output.\n\n### `pathMatch(reqPath,cookiePath)`\n\nAnswers \"does the request-path path-match a given cookie-path?\" as per RFC6265 Section 5.1.4.  Returns a boolean.\n\nThis is essentially a prefix-match where `cookiePath` is a prefix of `reqPath`.\n\n### `parse(cookieString[, options])`\n\nalias for `Cookie.parse(cookieString[, options])`\n\n### `fromJSON(string)`\n\nalias for `Cookie.fromJSON(string)`\n\n### `getPublicSuffix(hostname)`\n\nReturns the public suffix of this hostname.  The public suffix is the shortest domain-name upon which a cookie can be set.  Returns `null` if the hostname cannot have cookies set for it.\n\nFor example: `www.example.com` and `www.subdomain.example.com` both have public suffix `example.com`.\n\nFor further information, see http://publicsuffix.org/.  This module derives its list from that site.\n\n### `cookieCompare(a,b)`\n\nFor use with `.sort()`, sorts a list of cookies into the recommended order given in the RFC (Section 5.4 step 2). The sort algorithm is, in order of precedence:\n\n* Longest `.path`\n* oldest `.creation` (which has a 1ms precision, same as `Date`)\n* lowest `.creationIndex` (to get beyond the 1ms precision)\n\n``` javascript\nvar cookies = [ /* unsorted array of Cookie objects */ ];\ncookies = cookies.sort(cookieCompare);\n```\n\n**Note**: Since JavaScript's `Date` is limited to a 1ms precision, cookies within the same milisecond are entirely possible. This is especially true when using the `now` option to `.setCookie()`. The `.creationIndex` property is a per-process global counter, assigned during construction with `new Cookie()`. This preserves the spirit of the RFC sorting: older cookies go first. This works great for `MemoryCookieStore`, since `Set-Cookie` headers are parsed in order, but may not be so great for distributed systems. Sophisticated `Store`s may wish to set this to some other _logical clock_ such that if cookies A and B are created in the same millisecond, but cookie A is created before cookie B, then `A.creationIndex < B.creationIndex`. If you want to alter the global counter, which you probably _shouldn't_ do, it's stored in `Cookie.cookiesCreated`.\n\n### `permuteDomain(domain)`\n\nGenerates a list of all possible domains that `domainMatch()` the parameter.  May be handy for implementing cookie stores.\n\n### `permutePath(path)`\n\nGenerates a list of all possible paths that `pathMatch()` the parameter.  May be handy for implementing cookie stores.\n\n\n## Cookie\n\nExported via `tough.Cookie`.\n\n### `Cookie.parse(cookieString[, options])`\n\nParses a single Cookie or Set-Cookie HTTP header into a `Cookie` object.  Returns `undefined` if the string can't be parsed.\n\nThe options parameter is not required and currently has only one property:\n\n  * _loose_ - boolean - if `true` enable parsing of key-less cookies like `=abc` and `=`, which are not RFC-compliant.\n\nIf options is not an object, it is ignored, which means you can use `Array#map` with it.\n\nHere's how to process the Set-Cookie header(s) on a node HTTP/HTTPS response:\n\n``` javascript\nif (res.headers['set-cookie'] instanceof Array)\n  cookies = res.headers['set-cookie'].map(Cookie.parse);\nelse\n  cookies = [Cookie.parse(res.headers['set-cookie'])];\n```\n\n### Properties\n\nCookie object properties:\n\n  * _key_ - string - the name or key of the cookie (default \"\")\n  * _value_ - string - the value of the cookie (default \"\")\n  * _expires_ - `Date` - if set, the `Expires=` attribute of the cookie (defaults to the string `\"Infinity\"`). See `setExpires()`\n  * _maxAge_ - seconds - if set, the `Max-Age=` attribute _in seconds_ of the cookie.  May also be set to strings `\"Infinity\"` and `\"-Infinity\"` for non-expiry and immediate-expiry, respectively.  See `setMaxAge()`\n  * _domain_ - string - the `Domain=` attribute of the cookie\n  * _path_ - string - the `Path=` of the cookie\n  * _secure_ - boolean - the `Secure` cookie flag\n  * _httpOnly_ - boolean - the `HttpOnly` cookie flag\n  * _extensions_ - `Array` - any unrecognized cookie attributes as strings (even if equal-signs inside)\n  * _creation_ - `Date` - when this cookie was constructed\n  * _creationIndex_ - number - set at construction, used to provide greater sort precision (please see `cookieCompare(a,b)` for a full explanation)\n\nAfter a cookie has been passed through `CookieJar.setCookie()` it will have the following additional attributes:\n\n  * _hostOnly_ - boolean - is this a host-only cookie (i.e. no Domain field was set, but was instead implied)\n  * _pathIsDefault_ - boolean - if true, there was no Path field on the cookie and `defaultPath()` was used to derive one.\n  * _creation_ - `Date` - **modified** from construction to when the cookie was added to the jar\n  * _lastAccessed_ - `Date` - last time the cookie got accessed. Will affect cookie cleaning once implemented.  Using `cookiejar.getCookies(...)` will update this attribute.\n\n### `Cookie([{properties}])`\n\nReceives an options object that can contain any of the above Cookie properties, uses the default for unspecified properties.\n\n### `.toString()`\n\nencode to a Set-Cookie header value.  The Expires cookie field is set using `formatDate()`, but is omitted entirely if `.expires` is `Infinity`.\n\n### `.cookieString()`\n\nencode to a Cookie header value (i.e. the `.key` and `.value` properties joined with '=').\n\n### `.setExpires(String)`\n\nsets the expiry based on a date-string passed through `parseDate()`.  If parseDate returns `null` (i.e. can't parse this date string), `.expires` is set to `\"Infinity\"` (a string) is set.\n\n### `.setMaxAge(number)`\n\nsets the maxAge in seconds.  Coerces `-Infinity` to `\"-Infinity\"` and `Infinity` to `\"Infinity\"` so it JSON serializes correctly.\n\n### `.expiryTime([now=Date.now()])`\n\n### `.expiryDate([now=Date.now()])`\n\nexpiryTime() Computes the absolute unix-epoch milliseconds that this cookie expires. expiryDate() works similarly, except it returns a `Date` object.  Note that in both cases the `now` parameter should be milliseconds.\n\nMax-Age takes precedence over Expires (as per the RFC). The `.creation` attribute -- or, by default, the `now` paramter -- is used to offset the `.maxAge` attribute.\n\nIf Expires (`.expires`) is set, that's returned.\n\nOtherwise, `expiryTime()` returns `Infinity` and `expiryDate()` returns a `Date` object for \"Tue, 19 Jan 2038 03:14:07 GMT\" (latest date that can be expressed by a 32-bit `time_t`; the common limit for most user-agents).\n\n### `.TTL([now=Date.now()])`\n\ncompute the TTL relative to `now` (milliseconds).  The same precedence rules as for `expiryTime`/`expiryDate` apply.\n\nThe \"number\" `Infinity` is returned for cookies without an explicit expiry and `0` is returned if the cookie is expired.  Otherwise a time-to-live in milliseconds is returned.\n\n### `.canonicalizedDoman()`\n\n### `.cdomain()`\n\nreturn the canonicalized `.domain` field.  This is lower-cased and punycode (RFC3490) encoded if the domain has any non-ASCII characters.\n\n### `.toJSON()`\n\nFor convenience in using `JSON.serialize(cookie)`. Returns a plain-old `Object` that can be JSON-serialized.\n\nAny `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are exported in ISO format (`.toISOString()`).\n\n**NOTE**: Custom `Cookie` properties will be discarded. In tough-cookie 1.x, since there was no `.toJSON` method explicitly defined, all enumerable properties were captured. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array.\n\n### `Cookie.fromJSON(strOrObj)`\n\nDoes the reverse of `cookie.toJSON()`. If passed a string, will `JSON.parse()` that first.\n\nAny `Date` properties (i.e., `.expires`, `.creation`, and `.lastAccessed`) are parsed via `Date.parse()`, not the tough-cookie `parseDate`, since it's JavaScript/JSON-y timestamps being handled at this layer.\n\nReturns `null` upon JSON parsing error.\n\n### `.clone()`\n\nDoes a deep clone of this cookie, exactly implemented as `Cookie.fromJSON(cookie.toJSON())`.\n\n### `.validate()`\n\nStatus: *IN PROGRESS*. Works for a few things, but is by no means comprehensive.\n\nvalidates cookie attributes for semantic correctness.  Useful for \"lint\" checking any Set-Cookie headers you generate.  For now, it returns a boolean, but eventually could return a reason string -- you can future-proof with this construct:\n\n``` javascript\nif (cookie.validate() === true) {\n  // it's tasty\n} else {\n  // yuck!\n}\n```\n\n\n## CookieJar\n\nExported via `tough.CookieJar`.\n\n### `CookieJar([store],[options])`\n\nSimply use `new CookieJar()`.  If you'd like to use a custom store, pass that to the constructor otherwise a `MemoryCookieStore` will be created and used.\n\nThe `options` object can be omitted and can have the following properties:\n\n  * _rejectPublicSuffixes_ - boolean - default `true` - reject cookies with domains like \"com\" and \"co.uk\"\n  * _looseMode_ - boolean - default `false` - accept malformed cookies like `bar` and `=bar`, which have an implied empty name.\n    This is not in the standard, but is used sometimes on the web and is accepted by (most) browsers.\n\nSince eventually this module would like to support database/remote/etc. CookieJars, continuation passing style is used for CookieJar methods.\n\n### `.setCookie(cookieOrString, currentUrl, [{options},] cb(err,cookie))`\n\nAttempt to set the cookie in the cookie jar.  If the operation fails, an error will be given to the callback `cb`, otherwise the cookie is passed through.  The cookie will have updated `.creation`, `.lastAccessed` and `.hostOnly` properties.\n\nThe `options` object can be omitted and can have the following properties:\n\n  * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API.  Affects HttpOnly cookies.\n  * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API.  If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n  * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n  * _ignoreError_ - boolean - default `false` - silently ignore things like parse errors and invalid domains.  `Store` errors aren't ignored by this option.\n\nAs per the RFC, the `.hostOnly` property is set if there was no \"Domain=\" parameter in the cookie string (or `.domain` was null on the Cookie object).  The `.domain` property is set to the fully-qualified hostname of `currentUrl` in this case.  Matching this cookie requires an exact hostname match (not a `domainMatch` as per usual).\n\n### `.setCookieSync(cookieOrString, currentUrl, [{options}])`\n\nSynchronous version of `setCookie`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n### `.getCookies(currentUrl, [{options},] cb(err,cookies))`\n\nRetrieve the list of cookies that can be sent in a Cookie header for the current url.\n\nIf an error is encountered, that's passed as `err` to the callback, otherwise an `Array` of `Cookie` objects is passed.  The array is sorted with `cookieCompare()` unless the `{sort:false}` option is given.\n\nThe `options` object can be omitted and can have the following properties:\n\n  * _http_ - boolean - default `true` - indicates if this is an HTTP or non-HTTP API.  Affects HttpOnly cookies.\n  * _secure_ - boolean - autodetect from url - indicates if this is a \"Secure\" API.  If the currentUrl starts with `https:` or `wss:` then this is defaulted to `true`, otherwise `false`.\n  * _now_ - Date - default `new Date()` - what to use for the creation/access time of cookies\n  * _expire_ - boolean - default `true` - perform expiry-time checking of cookies and asynchronously remove expired cookies from the store.  Using `false` will return expired cookies and **not** remove them from the store (which is useful for replaying Set-Cookie headers, potentially).\n  * _allPaths_ - boolean - default `false` - if `true`, do not scope cookies by path. The default uses RFC-compliant path scoping. **Note**: may not be supported by the underlying store (the default `MemoryCookieStore` supports it).\n\nThe `.lastAccessed` property of the returned cookies will have been updated.\n\n### `.getCookiesSync(currentUrl, [{options}])`\n\nSynchronous version of `getCookies`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n### `.getCookieString(...)`\n\nAccepts the same options as `.getCookies()` but passes a string suitable for a Cookie header rather than an array to the callback.  Simply maps the `Cookie` array via `.cookieString()`.\n\n### `.getCookieStringSync(...)`\n\nSynchronous version of `getCookieString`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n### `.getSetCookieStrings(...)`\n\nReturns an array of strings suitable for **Set-Cookie** headers. Accepts the same options as `.getCookies()`.  Simply maps the cookie array via `.toString()`.\n\n### `.getSetCookieStringsSync(...)`\n\nSynchronous version of `getSetCookieStrings`; only works with synchronous stores (e.g. the default `MemoryCookieStore`).\n\n### `.serialize(cb(err,serializedObject))`\n\nSerialize the Jar if the underlying store supports `.getAllCookies`.\n\n**NOTE**: Custom `Cookie` properties will be discarded. If you want a property to be serialized, add the property name to the `Cookie.serializableProperties` Array.\n\nSee [Serialization Format].\n\n### `.serializeSync()`\n\nSync version of .serialize\n\n### `.toJSON()`\n\nAlias of .serializeSync() for the convenience of `JSON.stringify(cookiejar)`.\n\n### `CookieJar.deserialize(serialized, [store], cb(err,object))`\n\nA new Jar is created and the serialized Cookies are added to the underlying store. Each `Cookie` is added via `store.putCookie` in the order in which they appear in the serialization.\n\nThe `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created.\n\nAs a convenience, if `serialized` is a string, it is passed through `JSON.parse` first. If that throws an error, this is passed to the callback.\n\n### `CookieJar.deserializeSync(serialized, [store])`\n\nSync version of `.deserialize`.  _Note_ that the `store` must be synchronous for this to work.\n\n### `CookieJar.fromJSON(string)`\n\nAlias of `.deserializeSync` to provide consistency with `Cookie.fromJSON()`.\n\n### `.clone([store,]cb(err,newJar))`\n\nProduces a deep clone of this jar. Modifications to the original won't affect the clone, and vice versa.\n\nThe `store` argument is optional, but should be an instance of `Store`. By default, a new instance of `MemoryCookieStore` is created. Transferring between store types is supported so long as the source implements `.getAllCookies()` and the destination implements `.putCookie()`.\n\n### `.cloneSync([store])`\n\nSynchronous version of `.clone`, returning a new `CookieJar` instance.\n\nThe `store` argument is optional, but must be a _synchronous_ `Store` instance if specified. If not passed, a new instance of `MemoryCookieStore` is used.\n\nThe _source_ and _destination_ must both be synchronous `Store`s. If one or both stores are asynchronous, use `.clone` instead. Recall that `MemoryCookieStore` supports both synchronous and asynchronous API calls.\n\n## Store\n\nBase class for CookieJar stores. Available as `tough.Store`.\n\n## Store API\n\nThe storage model for each `CookieJar` instance can be replaced with a custom implementation.  The default is `MemoryCookieStore` which can be found in the `lib/memstore.js` file.  The API uses continuation-passing-style to allow for asynchronous stores.\n\nStores should inherit from the base `Store` class, which is available as `require('tough-cookie').Store`.\n\nStores are asynchronous by default, but if `store.synchronous` is set to `true`, then the `*Sync` methods on the of the containing `CookieJar` can be used (however, the continuation-passing style\n\nAll `domain` parameters will have been normalized before calling.\n\nThe Cookie store must have all of the following methods.\n\n### `store.findCookie(domain, path, key, cb(err,cookie))`\n\nRetrieve a cookie with the given domain, path and key (a.k.a. name).  The RFC maintains that exactly one of these cookies should exist in a store.  If the store is using versioning, this means that the latest/newest such cookie should be returned.\n\nCallback takes an error and the resulting `Cookie` object.  If no cookie is found then `null` MUST be passed instead (i.e. not an error).\n\n### `store.findCookies(domain, path, cb(err,cookies))`\n\nLocates cookies matching the given domain and path.  This is most often called in the context of `cookiejar.getCookies()` above.\n\nIf no cookies are found, the callback MUST be passed an empty array.\n\nThe resulting list will be checked for applicability to the current request according to the RFC (domain-match, path-match, http-only-flag, secure-flag, expiry, etc.), so it's OK to use an optimistic search algorithm when implementing this method.  However, the search algorithm used SHOULD try to find cookies that `domainMatch()` the domain and `pathMatch()` the path in order to limit the amount of checking that needs to be done.\n\nAs of version 0.9.12, the `allPaths` option to `cookiejar.getCookies()` above will cause the path here to be `null`.  If the path is `null`, path-matching MUST NOT be performed (i.e. domain-matching only).\n\n### `store.putCookie(cookie, cb(err))`\n\nAdds a new cookie to the store.  The implementation SHOULD replace any existing cookie with the same `.domain`, `.path`, and `.key` properties -- depending on the nature of the implementation, it's possible that between the call to `fetchCookie` and `putCookie` that a duplicate `putCookie` can occur.\n\nThe `cookie` object MUST NOT be modified; the caller will have already updated the `.creation` and `.lastAccessed` properties.\n\nPass an error if the cookie cannot be stored.\n\n### `store.updateCookie(oldCookie, newCookie, cb(err))`\n\nUpdate an existing cookie.  The implementation MUST update the `.value` for a cookie with the same `domain`, `.path` and `.key`.  The implementation SHOULD check that the old value in the store is equivalent to `oldCookie` - how the conflict is resolved is up to the store.\n\nThe `.lastAccessed` property will always be different between the two objects (to the precision possible via JavaScript's clock).  Both `.creation` and `.creationIndex` are guaranteed to be the same.  Stores MAY ignore or defer the `.lastAccessed` change at the cost of affecting how cookies are selected for automatic deletion (e.g., least-recently-used, which is up to the store to implement).\n\nStores may wish to optimize changing the `.value` of the cookie in the store versus storing a new cookie.  If the implementation doesn't define this method a stub that calls `putCookie(newCookie,cb)` will be added to the store object.\n\nThe `newCookie` and `oldCookie` objects MUST NOT be modified.\n\nPass an error if the newCookie cannot be stored.\n\n### `store.removeCookie(domain, path, key, cb(err))`\n\nRemove a cookie from the store (see notes on `findCookie` about the uniqueness constraint).\n\nThe implementation MUST NOT pass an error if the cookie doesn't exist; only pass an error due to the failure to remove an existing cookie.\n\n### `store.removeCookies(domain, path, cb(err))`\n\nRemoves matching cookies from the store.  The `path` parameter is optional, and if missing means all paths in a domain should be removed.\n\nPass an error ONLY if removing any existing cookies failed.\n\n### `store.getAllCookies(cb(err, cookies))`\n\nProduces an `Array` of all cookies during `jar.serialize()`. The items in the array can be true `Cookie` objects or generic `Object`s with the [Serialization Format] data structure.\n\nCookies SHOULD be returned in creation order to preserve sorting via `compareCookies()`. For reference, `MemoryCookieStore` will sort by `.creationIndex` since it uses true `Cookie` objects internally. If you don't return the cookies in creation order, they'll still be sorted by creation time, but this only has a precision of 1ms.  See `compareCookies` for more detail.\n\nPass an error if retrieval fails.\n\n## MemoryCookieStore\n\nInherits from `Store`.\n\nA just-in-memory CookieJar synchronous store implementation, used by default. Despite being a synchronous implementation, it's usable with both the synchronous and asynchronous forms of the `CookieJar` API.\n\n# Serialization Format\n\n**NOTE**: if you want to have custom `Cookie` properties serialized, add the property name to `Cookie.serializableProperties`.\n\n```js\n  {\n    // The version of tough-cookie that serialized this jar.\n    version: 'tough-cookie@1.x.y',\n\n    // add the store type, to make humans happy:\n    storeType: 'MemoryCookieStore',\n\n    // CookieJar configuration:\n    rejectPublicSuffixes: true,\n    // ... future items go here\n\n    // Gets filled from jar.store.getAllCookies():\n    cookies: [\n      {\n        key: 'string',\n        value: 'string',\n        // ...\n        /* other Cookie.serializableProperties go here */\n      }\n    ]\n  }\n```\n\n# Copyright and License\n\n(tl;dr: BSD-3-Clause with some MPL/2.0)\n\n```text\n Copyright (c) 2015, Salesforce.com, Inc.\n All rights reserved.\n\n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions are met:\n\n 1. Redistributions of source code must retain the above copyright notice,\n this list of conditions and the following disclaimer.\n\n 2. Redistributions in binary form must reproduce the above copyright notice,\n this list of conditions and the following disclaimer in the documentation\n and/or other materials provided with the distribution.\n\n 3. Neither the name of Salesforce.com nor the names of its contributors may\n be used to endorse or promote products derived from this software without\n specific prior written permission.\n\n THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\"\n AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE\n IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE\n LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS\n INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN\n CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)\n ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE\n POSSIBILITY OF SUCH DAMAGE.\n```\n\nPortions may be licensed under different licenses (in particular `public_suffix_list.dat` is MPL/2.0); please read that file and the LICENSE file for full details.\n",
-  "readmeFilename": "README.md",
+  "gitHead": "f1055655ea56c85bd384aaf7d5b740b916700b6f",
   "_id": "tough-cookie@2.2.1",
   "_shasum": "3b0516b799e70e8164436a1446e7e5877fda118e",
+  "_from": "tough-cookie@>=2.2.0 <2.3.0",
+  "_npmVersion": "2.11.2",
+  "_nodeVersion": "0.12.5",
+  "_npmUser": {
+    "name": "jstash",
+    "email": "jstash@gmail.com"
+  },
+  "dist": {
+    "shasum": "3b0516b799e70e8164436a1446e7e5877fda118e",
+    "tarball": "http://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "jstash",
+      "email": "jeremy@goinstant.com"
+    },
+    {
+      "name": "goinstant",
+      "email": "services@goinstant.com"
+    }
+  ],
+  "directories": {},
   "_resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.2.1.tgz",
-  "_from": "tough-cookie@>=2.2.0 <2.3.0"
+  "readme": "ERROR: No README data found!"
 }
diff --git a/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc b/deps/npm/node_modules/request/node_modules/tunnel-agent/.jshintrc
deleted file mode 100644 (file)
index 4c1c8d4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-{
-  "node": true,
-  "asi": true,
-  "laxcomma": true
-}
index d8040a1..f365be7 100644 (file)
@@ -7,7 +7,7 @@
     "util",
     "utility"
   ],
-  "version": "2.67.0",
+  "version": "2.69.0",
   "author": {
     "name": "Mikeal Rogers",
     "email": "mikeal.rogers@gmail.com"
   },
   "main": "index.js",
   "dependencies": {
+    "aws-sign2": "~0.6.0",
+    "aws4": "^1.2.1",
     "bl": "~1.0.0",
     "caseless": "~0.11.0",
+    "combined-stream": "~1.0.5",
     "extend": "~3.0.0",
     "forever-agent": "~0.6.1",
     "form-data": "~1.0.0-rc3",
+    "har-validator": "~2.0.6",
+    "hawk": "~3.1.0",
+    "http-signature": "~1.1.0",
+    "is-typedarray": "~1.0.0",
+    "isstream": "~0.1.2",
     "json-stringify-safe": "~5.0.1",
     "mime-types": "~2.1.7",
     "node-uuid": "~1.4.7",
-    "qs": "~5.2.0",
-    "tunnel-agent": "~0.4.1",
-    "tough-cookie": "~2.2.0",
-    "http-signature": "~1.1.0",
     "oauth-sign": "~0.8.0",
-    "hawk": "~3.1.0",
-    "aws-sign2": "~0.6.0",
+    "qs": "~6.0.2",
     "stringstream": "~0.0.4",
-    "combined-stream": "~1.0.5",
-    "isstream": "~0.1.2",
-    "is-typedarray": "~1.0.0",
-    "har-validator": "~2.0.2"
+    "tough-cookie": "~2.2.0",
+    "tunnel-agent": "~0.4.1"
   },
   "scripts": {
     "test": "npm run lint && npm run test-ci && npm run test-browser",
     "lint": "eslint lib/ *.js tests/ && echo Lint passed."
   },
   "devDependencies": {
+    "bluebird": "^3.0.2",
+    "browserify": "^13.0.0",
     "browserify-istanbul": "^0.1.5",
-    "browserify": "^12.0.1",
-    "buffer-equal": "^0.0.1",
+    "buffer-equal": "^1.0.0",
     "codecov.io": "^0.1.6",
     "coveralls": "^2.11.4",
-    "eslint": "1.9.0",
+    "eslint": "1.10.3",
     "function-bind": "^1.0.2",
     "istanbul": "^0.4.0",
-    "karma-browserify": "^4.4.0",
     "karma": "^0.13.10",
+    "karma-browserify": "^4.4.0",
     "karma-cli": "^0.1.1",
     "karma-coverage": "^0.5.3",
     "karma-phantomjs-launcher": "^0.1.4",
     "rimraf": "^2.2.8",
     "server-destroy": "^1.0.1",
     "tape": "^4.2.0",
-    "taper": "^0.4.0",
-    "bluebird": "^3.0.2"
+    "taper": "^0.4.0"
   },
-  "readme": "\n# Request - Simplified HTTP client\n\n[![npm package](https://nodei.co/npm/request.png?downloads=true&downloadRank=true&stars=true)](https://nodei.co/npm/request/)\n\n[![Build status](https://img.shields.io/travis/request/request.svg?style=flat-square)](https://travis-ci.org/request/request)\n[![Coverage](https://img.shields.io/codecov/c/github/request/request.svg?style=flat-square)](https://codecov.io/github/request/request?branch=master)\n[![Coverage](https://img.shields.io/coveralls/request/request.svg?style=flat-square)](https://coveralls.io/r/request/request)\n[![Dependency Status](https://img.shields.io/david/request/request.svg?style=flat-square)](https://david-dm.org/request/request)\n[![Gitter](https://img.shields.io/badge/gitter-join_chat-blue.svg?style=flat-square)](https://gitter.im/request/request?utm_source=badge)\n\n\n## Super simple to use\n\nRequest is designed to be the simplest way possible to make http calls. It supports HTTPS and follows redirects by default.\n\n```js\nvar request = require('request');\nrequest('http://www.google.com', function (error, response, body) {\n  if (!error && response.statusCode == 200) {\n    console.log(body) // Show the HTML for the Google homepage.\n  }\n})\n```\n\n\n## Table of contents\n\n- [Streaming](#streaming)\n- [Forms](#forms)\n- [HTTP Authentication](#http-authentication)\n- [Custom HTTP Headers](#custom-http-headers)\n- [OAuth Signing](#oauth-signing)\n- [Proxies](#proxies)\n- [Unix Domain Sockets](#unix-domain-sockets)\n- [TLS/SSL Protocol](#tlsssl-protocol)\n- [Support for HAR 1.2](#support-for-har-12)\n- [**All Available Options**](#requestoptions-callback)\n\nRequest also offers [convenience methods](#convenience-methods) like\n`request.defaults` and `request.post`, and there are\nlots of [usage examples](#examples) and several\n[debugging techniques](#debugging).\n\n\n---\n\n\n## Streaming\n\nYou can stream any response to a file stream.\n\n```js\nrequest('http://google.com/doodle.png').pipe(fs.createWriteStream('doodle.png'))\n```\n\nYou can also stream a file to a PUT or POST request. This method will also check the file extension against a mapping of file extensions to content-types (in this case `application/json`) and use the proper `content-type` in the PUT request (if the headers don’t already provide one).\n\n```js\nfs.createReadStream('file.json').pipe(request.put('http://mysite.com/obj.json'))\n```\n\nRequest can also `pipe` to itself. When doing so, `content-type` and `content-length` are preserved in the PUT headers.\n\n```js\nrequest.get('http://google.com/img.png').pipe(request.put('http://mysite.com/img.png'))\n```\n\nRequest emits a \"response\" event when a response is received. The `response` argument will be an instance of [http.IncomingMessage](http://nodejs.org/api/http.html#http_http_incomingmessage).\n\n```js\nrequest\n  .get('http://google.com/img.png')\n  .on('response', function(response) {\n    console.log(response.statusCode) // 200\n    console.log(response.headers['content-type']) // 'image/png'\n  })\n  .pipe(request.put('http://mysite.com/img.png'))\n```\n\nTo easily handle errors when streaming requests, listen to the `error` event before piping:\n\n```js\nrequest\n  .get('http://mysite.com/doodle.png')\n  .on('error', function(err) {\n    console.log(err)\n  })\n  .pipe(fs.createWriteStream('doodle.png'))\n```\n\nNow let’s get fancy.\n\n```js\nhttp.createServer(function (req, resp) {\n  if (req.url === '/doodle.png') {\n    if (req.method === 'PUT') {\n      req.pipe(request.put('http://mysite.com/doodle.png'))\n    } else if (req.method === 'GET' || req.method === 'HEAD') {\n      request.get('http://mysite.com/doodle.png').pipe(resp)\n    }\n  }\n})\n```\n\nYou can also `pipe()` from `http.ServerRequest` instances, as well as to `http.ServerResponse` instances. The HTTP method, headers, and entity-body data will be sent. Which means that, if you don't really care about security, you can do:\n\n```js\nhttp.createServer(function (req, resp) {\n  if (req.url === '/doodle.png') {\n    var x = request('http://mysite.com/doodle.png')\n    req.pipe(x)\n    x.pipe(resp)\n  }\n})\n```\n\nAnd since `pipe()` returns the destination stream in ≥ Node 0.5.x you can do one line proxying. :)\n\n```js\nreq.pipe(request('http://mysite.com/doodle.png')).pipe(resp)\n```\n\nAlso, none of this new functionality conflicts with requests previous features, it just expands them.\n\n```js\nvar r = request.defaults({'proxy':'http://localproxy.com'})\n\nhttp.createServer(function (req, resp) {\n  if (req.url === '/doodle.png') {\n    r.get('http://google.com/doodle.png').pipe(resp)\n  }\n})\n```\n\nYou can still use intermediate proxies, the requests will still follow HTTP forwards, etc.\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## Forms\n\n`request` supports `application/x-www-form-urlencoded` and `multipart/form-data` form uploads. For `multipart/related` refer to the `multipart` API.\n\n\n#### application/x-www-form-urlencoded (URL-Encoded Forms)\n\nURL-encoded forms are simple.\n\n```js\nrequest.post('http://service.com/upload', {form:{key:'value'}})\n// or\nrequest.post('http://service.com/upload').form({key:'value'})\n// or\nrequest.post({url:'http://service.com/upload', form: {key:'value'}}, function(err,httpResponse,body){ /* ... */ })\n```\n\n\n#### multipart/form-data (Multipart Form Uploads)\n\nFor `multipart/form-data` we use the [form-data](https://github.com/form-data/form-data) library by [@felixge](https://github.com/felixge). For the most cases, you can pass your upload form data via the `formData` option.\n\n\n```js\nvar formData = {\n  // Pass a simple key-value pair\n  my_field: 'my_value',\n  // Pass data via Buffers\n  my_buffer: new Buffer([1, 2, 3]),\n  // Pass data via Streams\n  my_file: fs.createReadStream(__dirname + '/unicycle.jpg'),\n  // Pass multiple values /w an Array\n  attachments: [\n    fs.createReadStream(__dirname + '/attachment1.jpg'),\n    fs.createReadStream(__dirname + '/attachment2.jpg')\n  ],\n  // Pass optional meta-data with an 'options' object with style: {value: DATA, options: OPTIONS}\n  // Use case: for some types of streams, you'll need to provide \"file\"-related information manually.\n  // See the `form-data` README for more information about options: https://github.com/form-data/form-data\n  custom_file: {\n    value:  fs.createReadStream('/dev/urandom'),\n    options: {\n      filename: 'topsecret.jpg',\n      contentType: 'image/jpg'\n    }\n  }\n};\nrequest.post({url:'http://service.com/upload', formData: formData}, function optionalCallback(err, httpResponse, body) {\n  if (err) {\n    return console.error('upload failed:', err);\n  }\n  console.log('Upload successful!  Server responded with:', body);\n});\n```\n\nFor advanced cases, you can access the form-data object itself via `r.form()`. This can be modified until the request is fired on the next cycle of the event-loop. (Note that this calling `form()` will clear the currently set form data for that request.)\n\n```js\n// NOTE: Advanced use-case, for normal use see 'formData' usage above\nvar r = request.post('http://service.com/upload', function optionalCallback(err, httpResponse, body) {...})\nvar form = r.form();\nform.append('my_field', 'my_value');\nform.append('my_buffer', new Buffer([1, 2, 3]));\nform.append('custom_file', fs.createReadStream(__dirname + '/unicycle.jpg'), {filename: 'unicycle.jpg'});\n```\nSee the [form-data README](https://github.com/form-data/form-data) for more information & examples.\n\n\n#### multipart/related\n\nSome variations in different HTTP implementations require a newline/CRLF before, after, or both before and after the boundary of a `multipart/related` request (using the multipart option). This has been observed in the .NET WebAPI version 4.0. You can turn on a boundary preambleCRLF or postamble by passing them as `true` to your request options.\n\n```js\n  request({\n    method: 'PUT',\n    preambleCRLF: true,\n    postambleCRLF: true,\n    uri: 'http://service.com/upload',\n    multipart: [\n      {\n        'content-type': 'application/json',\n        body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n      },\n      { body: 'I am an attachment' },\n      { body: fs.createReadStream('image.png') }\n    ],\n    // alternatively pass an object containing additional options\n    multipart: {\n      chunked: false,\n      data: [\n        {\n          'content-type': 'application/json',\n          body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n        },\n        { body: 'I am an attachment' }\n      ]\n    }\n  },\n  function (error, response, body) {\n    if (error) {\n      return console.error('upload failed:', error);\n    }\n    console.log('Upload successful!  Server responded with:', body);\n  })\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## HTTP Authentication\n\n```js\nrequest.get('http://some.server.com/').auth('username', 'password', false);\n// or\nrequest.get('http://some.server.com/', {\n  'auth': {\n    'user': 'username',\n    'pass': 'password',\n    'sendImmediately': false\n  }\n});\n// or\nrequest.get('http://some.server.com/').auth(null, null, true, 'bearerToken');\n// or\nrequest.get('http://some.server.com/', {\n  'auth': {\n    'bearer': 'bearerToken'\n  }\n});\n```\n\nIf passed as an option, `auth` should be a hash containing values:\n\n- `user` || `username`\n- `pass` || `password`\n- `sendImmediately` (optional)\n- `bearer` (optional)\n\nThe method form takes parameters\n`auth(username, password, sendImmediately, bearer)`.\n\n`sendImmediately` defaults to `true`, which causes a basic or bearer\nauthentication header to be sent.  If `sendImmediately` is `false`, then\n`request` will retry with a proper authentication header after receiving a\n`401` response from the server (which must contain a `WWW-Authenticate` header\nindicating the required authentication method).\n\nNote that you can also specify basic authentication using the URL itself, as\ndetailed in [RFC 1738](http://www.ietf.org/rfc/rfc1738.txt).  Simply pass the\n`user:password` before the host with an `@` sign:\n\n```js\nvar username = 'username',\n    password = 'password',\n    url = 'http://' + username + ':' + password + '@some.server.com';\n\nrequest({url: url}, function (error, response, body) {\n   // Do more stuff with 'body' here\n});\n```\n\nDigest authentication is supported, but it only works with `sendImmediately`\nset to `false`; otherwise `request` will send basic authentication on the\ninitial request, which will probably cause the request to fail.\n\nBearer authentication is supported, and is activated when the `bearer` value is\navailable. The value may be either a `String` or a `Function` returning a\n`String`. Using a function to supply the bearer token is particularly useful if\nused in conjunction with `defaults` to allow a single function to supply the\nlast known token at the time of sending a request, or to compute one on the fly.\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## Custom HTTP Headers\n\nHTTP Headers, such as `User-Agent`, can be set in the `options` object.\nIn the example below, we call the github API to find out the number\nof stars and forks for the request repository. This requires a\ncustom `User-Agent` header as well as https.\n\n```js\nvar request = require('request');\n\nvar options = {\n  url: 'https://api.github.com/repos/request/request',\n  headers: {\n    'User-Agent': 'request'\n  }\n};\n\nfunction callback(error, response, body) {\n  if (!error && response.statusCode == 200) {\n    var info = JSON.parse(body);\n    console.log(info.stargazers_count + \" Stars\");\n    console.log(info.forks_count + \" Forks\");\n  }\n}\n\nrequest(options, callback);\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## OAuth Signing\n\n[OAuth version 1.0](https://tools.ietf.org/html/rfc5849) is supported.  The\ndefault signing algorithm is\n[HMAC-SHA1](https://tools.ietf.org/html/rfc5849#section-3.4.2):\n\n```js\n// OAuth1.0 - 3-legged server side flow (Twitter example)\n// step 1\nvar qs = require('querystring')\n  , oauth =\n    { callback: 'http://mysite.com/callback/'\n    , consumer_key: CONSUMER_KEY\n    , consumer_secret: CONSUMER_SECRET\n    }\n  , url = 'https://api.twitter.com/oauth/request_token'\n  ;\nrequest.post({url:url, oauth:oauth}, function (e, r, body) {\n  // Ideally, you would take the body in the response\n  // and construct a URL that a user clicks on (like a sign in button).\n  // The verifier is only available in the response after a user has\n  // verified with twitter that they are authorizing your app.\n\n  // step 2\n  var req_data = qs.parse(body)\n  var uri = 'https://api.twitter.com/oauth/authenticate'\n    + '?' + qs.stringify({oauth_token: req_data.oauth_token})\n  // redirect the user to the authorize uri\n\n  // step 3\n  // after the user is redirected back to your server\n  var auth_data = qs.parse(body)\n    , oauth =\n      { consumer_key: CONSUMER_KEY\n      , consumer_secret: CONSUMER_SECRET\n      , token: auth_data.oauth_token\n      , token_secret: req_data.oauth_token_secret\n      , verifier: auth_data.oauth_verifier\n      }\n    , url = 'https://api.twitter.com/oauth/access_token'\n    ;\n  request.post({url:url, oauth:oauth}, function (e, r, body) {\n    // ready to make signed requests on behalf of the user\n    var perm_data = qs.parse(body)\n      , oauth =\n        { consumer_key: CONSUMER_KEY\n        , consumer_secret: CONSUMER_SECRET\n        , token: perm_data.oauth_token\n        , token_secret: perm_data.oauth_token_secret\n        }\n      , url = 'https://api.twitter.com/1.1/users/show.json'\n      , qs =\n        { screen_name: perm_data.screen_name\n        , user_id: perm_data.user_id\n        }\n      ;\n    request.get({url:url, oauth:oauth, qs:qs, json:true}, function (e, r, user) {\n      console.log(user)\n    })\n  })\n})\n```\n\nFor [RSA-SHA1 signing](https://tools.ietf.org/html/rfc5849#section-3.4.3), make\nthe following changes to the OAuth options object:\n* Pass `signature_method : 'RSA-SHA1'`\n* Instead of `consumer_secret`, specify a `private_key` string in\n  [PEM format](http://how2ssl.com/articles/working_with_pem_files/)\n\nFor [PLAINTEXT signing](http://oauth.net/core/1.0/#anchor22), make\nthe following changes to the OAuth options object:\n* Pass `signature_method : 'PLAINTEXT'`\n\nTo send OAuth parameters via query params or in a post body as described in The\n[Consumer Request Parameters](http://oauth.net/core/1.0/#consumer_req_param)\nsection of the oauth1 spec:\n* Pass `transport_method : 'query'` or `transport_method : 'body'` in the OAuth\n  options object.\n* `transport_method` defaults to `'header'`\n\nTo use [Request Body Hash](https://oauth.googlecode.com/svn/spec/ext/body_hash/1.0/oauth-bodyhash.html) you can either\n* Manually generate the body hash and pass it as a string `body_hash: '...'`\n* Automatically generate the body hash by passing `body_hash: true`\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## Proxies\n\nIf you specify a `proxy` option, then the request (and any subsequent\nredirects) will be sent via a connection to the proxy server.\n\nIf your endpoint is an `https` url, and you are using a proxy, then\nrequest will send a `CONNECT` request to the proxy server *first*, and\nthen use the supplied connection to connect to the endpoint.\n\nThat is, first it will make a request like:\n\n```\nHTTP/1.1 CONNECT endpoint-server.com:80\nHost: proxy-server.com\nUser-Agent: whatever user agent you specify\n```\n\nand then the proxy server make a TCP connection to `endpoint-server`\non port `80`, and return a response that looks like:\n\n```\nHTTP/1.1 200 OK\n```\n\nAt this point, the connection is left open, and the client is\ncommunicating directly with the `endpoint-server.com` machine.\n\nSee [the wikipedia page on HTTP Tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel)\nfor more information.\n\nBy default, when proxying `http` traffic, request will simply make a\nstandard proxied `http` request.  This is done by making the `url`\nsection of the initial line of the request a fully qualified url to\nthe endpoint.\n\nFor example, it will make a single request that looks like:\n\n```\nHTTP/1.1 GET http://endpoint-server.com/some-url\nHost: proxy-server.com\nOther-Headers: all go here\n\nrequest body or whatever\n```\n\nBecause a pure \"http over http\" tunnel offers no additional security\nor other features, it is generally simpler to go with a\nstraightforward HTTP proxy in this case.  However, if you would like\nto force a tunneling proxy, you may set the `tunnel` option to `true`.\n\nYou can also make a standard proxied `http` request by explicitly setting\n`tunnel : false`, but **note that this will allow the proxy to see the traffic\nto/from the destination server**.\n\nIf you are using a tunneling proxy, you may set the\n`proxyHeaderWhiteList` to share certain headers with the proxy.\n\nYou can also set the `proxyHeaderExclusiveList` to share certain\nheaders only with the proxy and not with destination host.\n\nBy default, this set is:\n\n```\naccept\naccept-charset\naccept-encoding\naccept-language\naccept-ranges\ncache-control\ncontent-encoding\ncontent-language\ncontent-length\ncontent-location\ncontent-md5\ncontent-range\ncontent-type\nconnection\ndate\nexpect\nmax-forwards\npragma\nproxy-authorization\nreferer\nte\ntransfer-encoding\nuser-agent\nvia\n```\n\nNote that, when using a tunneling proxy, the `proxy-authorization`\nheader and any headers from custom `proxyHeaderExclusiveList` are\n*never* sent to the endpoint server, but only to the proxy server.\n\n\n### Controlling proxy behaviour using environment variables\n\nThe following environment variables are respected by `request`:\n\n * `HTTP_PROXY` / `http_proxy`\n * `HTTPS_PROXY` / `https_proxy`\n * `NO_PROXY` / `no_proxy`\n\nWhen `HTTP_PROXY` / `http_proxy` are set, they will be used to proxy non-SSL requests that do not have an explicit `proxy` configuration option present. Similarly, `HTTPS_PROXY` / `https_proxy` will be respected for SSL requests that do not have an explicit `proxy` configuration option. It is valid to define a proxy in one of the environment variables, but then override it for a specific request, using the `proxy` configuration option. Furthermore, the `proxy` configuration option can be explicitly set to false / null to opt out of proxying altogether for that request.\n\n`request` is also aware of the `NO_PROXY`/`no_proxy` environment variables. These variables provide a granular way to opt out of proxying, on a per-host basis. It should contain a comma separated list of hosts to opt out of proxying. It is also possible to opt of proxying when a particular destination port is used. Finally, the variable may be set to `*` to opt out of the implicit proxy configuration of the other environment variables.\n\nHere's some examples of valid `no_proxy` values:\n\n * `google.com` - don't proxy HTTP/HTTPS requests to Google.\n * `google.com:443` - don't proxy HTTPS requests to Google, but *do* proxy HTTP requests to Google.\n * `google.com:443, yahoo.com:80` - don't proxy HTTPS requests to Google, and don't proxy HTTP requests to Yahoo!\n * `*` - ignore `https_proxy`/`http_proxy` environment variables altogether.\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## UNIX Domain Sockets\n\n`request` supports making requests to [UNIX Domain Sockets](https://en.wikipedia.org/wiki/Unix_domain_socket). To make one, use the following URL scheme:\n\n```js\n/* Pattern */ 'http://unix:SOCKET:PATH'\n/* Example */ request.get('http://unix:/absolute/path/to/unix.socket:/request/path')\n```\n\nNote: The `SOCKET` path is assumed to be absolute to the root of the host file system.\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## TLS/SSL Protocol\n\nTLS/SSL Protocol options, such as `cert`, `key` and `passphrase`, can be\nset directly in `options` object, in the `agentOptions` property of the `options` object, or even in `https.globalAgent.options`. Keep in mind that, although `agentOptions` allows for a slightly wider range of configurations, the recommended way is via `options` object directly, as using `agentOptions` or `https.globalAgent.options` would not be applied in the same way in proxied environments (as data travels through a TLS connection instead of an http/https agent).\n\n```js\nvar fs = require('fs')\n    , path = require('path')\n    , certFile = path.resolve(__dirname, 'ssl/client.crt')\n    , keyFile = path.resolve(__dirname, 'ssl/client.key')\n    , caFile = path.resolve(__dirname, 'ssl/ca.cert.pem')\n    , request = require('request');\n\nvar options = {\n    url: 'https://api.some-server.com/',\n    cert: fs.readFileSync(certFile),\n    key: fs.readFileSync(keyFile),\n    passphrase: 'password',\n    ca: fs.readFileSync(caFile)\n    }\n};\n\nrequest.get(options);\n```\n\n### Using `options.agentOptions`\n\nIn the example below, we call an API requires client side SSL certificate\n(in PEM format) with passphrase protected private key (in PEM format) and disable the SSLv3 protocol:\n\n```js\nvar fs = require('fs')\n    , path = require('path')\n    , certFile = path.resolve(__dirname, 'ssl/client.crt')\n    , keyFile = path.resolve(__dirname, 'ssl/client.key')\n    , request = require('request');\n\nvar options = {\n    url: 'https://api.some-server.com/',\n    agentOptions: {\n        cert: fs.readFileSync(certFile),\n        key: fs.readFileSync(keyFile),\n        // Or use `pfx` property replacing `cert` and `key` when using private key, certificate and CA certs in PFX or PKCS12 format:\n        // pfx: fs.readFileSync(pfxFilePath),\n        passphrase: 'password',\n        securityOptions: 'SSL_OP_NO_SSLv3'\n    }\n};\n\nrequest.get(options);\n```\n\nIt is able to force using SSLv3 only by specifying `secureProtocol`:\n\n```js\nrequest.get({\n    url: 'https://api.some-server.com/',\n    agentOptions: {\n        secureProtocol: 'SSLv3_method'\n    }\n});\n```\n\nIt is possible to accept other certificates than those signed by generally allowed Certificate Authorities (CAs).\nThis can be useful, for example,  when using self-signed certificates.\nTo require a different root certificate, you can specify the signing CA by adding the contents of the CA's certificate file to the `agentOptions`.\nThe certificate the domain presents must be signed by the root certificate specified:\n\n```js\nrequest.get({\n    url: 'https://api.some-server.com/',\n    agentOptions: {\n        ca: fs.readFileSync('ca.cert.pem')\n    }\n});\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n## Support for HAR 1.2\n\nThe `options.har` property will override the values: `url`, `method`, `qs`, `headers`, `form`, `formData`, `body`, `json`, as well as construct multipart data and read files from disk when `request.postData.params[].fileName` is present without a matching `value`.\n\na validation step will check if the HAR Request format matches the latest spec (v1.2) and will skip parsing if not matching.\n\n```js\n  var request = require('request')\n  request({\n    // will be ignored\n    method: 'GET',\n    uri: 'http://www.google.com',\n\n    // HTTP Archive Request Object\n    har: {\n      url: 'http://www.mockbin.com/har',\n      method: 'POST',\n      headers: [\n        {\n          name: 'content-type',\n          value: 'application/x-www-form-urlencoded'\n        }\n      ],\n      postData: {\n        mimeType: 'application/x-www-form-urlencoded',\n        params: [\n          {\n            name: 'foo',\n            value: 'bar'\n          },\n          {\n            name: 'hello',\n            value: 'world'\n          }\n        ]\n      }\n    }\n  })\n\n  // a POST request will be sent to http://www.mockbin.com\n  // with body an application/x-www-form-urlencoded body:\n  // foo=bar&hello=world\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n## request(options, callback)\n\nThe first argument can be either a `url` or an `options` object. The only required option is `uri`; all others are optional.\n\n- `uri` || `url` - fully qualified uri or a parsed url object from `url.parse()`\n- `baseUrl` - fully qualified uri string used as the base url. Most useful with `request.defaults`, for example when you want to do many requests to the same domain.  If `baseUrl` is `https://example.com/api/`, then requesting `/end/point?test=true` will fetch `https://example.com/api/end/point?test=true`. When `baseUrl` is given, `uri` must also be a string.\n- `method` - http method (default: `\"GET\"`)\n- `headers` - http headers (default: `{}`)\n\n---\n\n- `qs` - object containing querystring values to be appended to the `uri`\n- `qsParseOptions` - object containing options to pass to the [qs.parse](https://github.com/hapijs/qs#parsing-objects) method. Alternatively pass options to the [querystring.parse](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_parse_str_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}`\n- `qsStringifyOptions` - object containing options to pass to the [qs.stringify](https://github.com/hapijs/qs#stringifying) method. Alternatively pass options to the  [querystring.stringify](https://nodejs.org/docs/v0.12.0/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options) method using this format `{sep:';', eq:':', options:{}}`. For example, to change the way arrays are converted to query strings using the `qs` module pass the `arrayFormat` option with one of `indices|brackets|repeat`\n- `useQuerystring` - If true, use `querystring` to stringify and parse\n  querystrings, otherwise use `qs` (default: `false`).  Set this option to\n  `true` if you need arrays to be serialized as `foo=bar&foo=baz` instead of the\n  default `foo[0]=bar&foo[1]=baz`.\n\n---\n\n- `body` - entity body for PATCH, POST and PUT requests. Must be a `Buffer` or `String`, unless `json` is `true`. If `json` is `true`, then `body` must be a JSON-serializable object.\n- `form` - when passed an object or a querystring, this sets `body` to a querystring representation of value, and adds `Content-type: application/x-www-form-urlencoded` header. When passed no options, a `FormData` instance is returned (and is piped to request). See \"Forms\" section above.\n- `formData` - Data to pass for a `multipart/form-data` request. See\n  [Forms](#forms) section above.\n- `multipart` - array of objects which contain their own headers and `body`\n  attributes. Sends a `multipart/related` request. See [Forms](#forms) section\n  above.\n  - Alternatively you can pass in an object `{chunked: false, data: []}` where\n    `chunked` is used to specify whether the request is sent in\n    [chunked transfer encoding](https://en.wikipedia.org/wiki/Chunked_transfer_encoding)\n    In non-chunked requests, data items with body streams are not allowed.\n- `preambleCRLF` - append a newline/CRLF before the boundary of your `multipart/form-data` request.\n- `postambleCRLF` - append a newline/CRLF at the end of the boundary of your `multipart/form-data` request.\n- `json` - sets `body` to JSON representation of value and adds `Content-type: application/json` header.  Additionally, parses the response body as JSON.\n- `jsonReviver` - a [reviver function](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse) that will be passed to `JSON.parse()` when parsing a JSON response body.\n\n---\n\n- `auth` - A hash containing values `user` || `username`, `pass` || `password`, and `sendImmediately` (optional).  See documentation above.\n- `oauth` - Options for OAuth HMAC-SHA1 signing. See documentation above.\n- `hawk` - Options for [Hawk signing](https://github.com/hueniverse/hawk). The `credentials` key must contain the necessary signing info, [see hawk docs for details](https://github.com/hueniverse/hawk#usage-example).\n- `aws` - `object` containing AWS signing information. Should have the properties `key`, `secret`. Also requires the property `bucket`, unless you’re specifying your `bucket` as part of the path, or the request doesn’t use a bucket (i.e. GET Services)\n- `httpSignature` - Options for the [HTTP Signature Scheme](https://github.com/joyent/node-http-signature/blob/master/http_signing.md) using [Joyent's library](https://github.com/joyent/node-http-signature). The `keyId` and `key` properties must be specified. See the docs for other options.\n\n---\n\n- `followRedirect` - follow HTTP 3xx responses as redirects (default: `true`). This property can also be implemented as function which gets `response` object as a single argument and should return `true` if redirects should continue or `false` otherwise.\n- `followAllRedirects` - follow non-GET HTTP 3xx responses as redirects (default: `false`)\n- `maxRedirects` - the maximum number of redirects to follow (default: `10`)\n- `removeRefererHeader` - removes the referer header when a redirect happens (default: `false`). **Note:** if true, referer header set in the initial request is preserved during redirect chain.\n\n---\n\n- `encoding` - Encoding to be used on `setEncoding` of response data. If `null`, the `body` is returned as a `Buffer`. Anything else **(including the default value of `undefined`)** will be passed as the [encoding](http://nodejs.org/api/buffer.html#buffer_buffer) parameter to `toString()` (meaning this is effectively `utf8` by default). (**Note:** if you expect binary data, you should set `encoding: null`.)\n- `gzip` - If `true`, add an `Accept-Encoding` header to request compressed content encodings from the server (if not already present) and decode supported content encodings in the response.  **Note:** Automatic decoding of the response content is performed on the body data returned through `request` (both through the `request` stream and passed to the callback function) but is not performed on the `response` stream (available from the `response` event) which is the unmodified `http.IncomingMessage` object which may contain compressed data. See example below.\n- `jar` - If `true`, remember cookies for future use (or define your custom cookie jar; see examples section)\n\n---\n\n- `agent` - `http(s).Agent` instance to use\n- `agentClass` - alternatively specify your agent's class name\n- `agentOptions` - and pass its options. **Note:** for HTTPS see [tls API doc for TLS/SSL options](http://nodejs.org/api/tls.html#tls_tls_connect_options_callback) and the [documentation above](#using-optionsagentoptions).\n- `forever` - set to `true` to use the [forever-agent](https://github.com/request/forever-agent) **Note:** Defaults to `http(s).Agent({keepAlive:true})` in node 0.12+\n- `pool` - An object describing which agents to use for the request. If this option is omitted the request will use the global agent (as long as your options allow for it). Otherwise, request will search the pool for your custom agent. If no custom agent is found, a new agent will be created and added to the pool. **Note:** `pool` is used only when the `agent` option is not specified.\n  - A `maxSockets` property can also be provided on the `pool` object to set the max number of sockets for all agents created (ex: `pool: {maxSockets: Infinity}`).\n  - Note that if you are sending multiple requests in a loop and creating\n    multiple new `pool` objects, `maxSockets` will not work as intended.  To\n    work around this, either use [`request.defaults`](#requestdefaultsoptions)\n    with your pool options or create the pool object with the `maxSockets`\n    property outside of the loop.\n- `timeout` - Integer containing the number of milliseconds to wait for a\nserver to send response headers (and start the response body) before aborting\nthe request. Note that if the underlying TCP connection cannot be established,\nthe OS-wide TCP connection timeout will overrule the `timeout` option ([the\ndefault in Linux can be anywhere from 20-120 seconds][linux-timeout]).\n\n[linux-timeout]: http://www.sekuda.com/overriding_the_default_linux_kernel_20_second_tcp_socket_connect_timeout\n\n---\n\n- `localAddress` - Local interface to bind for network connections.\n- `proxy` - An HTTP proxy to be used. Supports proxy Auth with Basic Auth, identical to support for the `url` parameter (by embedding the auth info in the `uri`)\n- `strictSSL` - If `true`, requires SSL certificates be valid. **Note:** to use your own certificate authority, you need to specify an agent that was created with that CA as an option.\n- `tunnel` - controls the behavior of\n  [HTTP `CONNECT` tunneling](https://en.wikipedia.org/wiki/HTTP_tunnel#HTTP_CONNECT_tunneling)\n  as follows:\n   - `undefined` (default) - `true` if the destination is `https`, `false` otherwise\n   - `true` - always tunnel to the destination by making a `CONNECT` request to\n     the proxy\n   - `false` - request the destination as a `GET` request.\n- `proxyHeaderWhiteList` - A whitelist of headers to send to a\n  tunneling proxy.\n- `proxyHeaderExclusiveList` - A whitelist of headers to send\n  exclusively to a tunneling proxy and not to destination.\n\n---\n\n- `time` - If `true`, the request-response cycle (including all redirects) is timed at millisecond resolution, and the result provided on the response's `elapsedTime` property.\n- `har` - A [HAR 1.2 Request Object](http://www.softwareishard.com/blog/har-12-spec/#request), will be processed from HAR format into options overwriting matching values *(see the [HAR 1.2 section](#support-for-har-1.2) for details)*\n\nThe callback argument gets 3 arguments:\n\n1. An `error` when applicable (usually from [`http.ClientRequest`](http://nodejs.org/api/http.html#http_class_http_clientrequest) object)\n2. An [`http.IncomingMessage`](http://nodejs.org/api/http.html#http_http_incomingmessage) object\n3. The third is the `response` body (`String` or `Buffer`, or JSON object if the `json` option is supplied)\n\n[back to top](#table-of-contents)\n\n\n---\n\n## Convenience methods\n\nThere are also shorthand methods for different HTTP METHODs and some other conveniences.\n\n\n### request.defaults(options)\n\nThis method **returns a wrapper** around the normal request API that defaults\nto whatever options you pass to it.\n\n**Note:** `request.defaults()` **does not** modify the global request API;\ninstead, it **returns a wrapper** that has your default settings applied to it.\n\n**Note:** You can call `.defaults()` on the wrapper that is returned from\n`request.defaults` to add/override defaults that were previously defaulted.\n\nFor example:\n```js\n//requests using baseRequest() will set the 'x-token' header\nvar baseRequest = request.defaults({\n  headers: {'x-token': 'my-token'}\n})\n\n//requests using specialRequest() will include the 'x-token' header set in\n//baseRequest and will also include the 'special' header\nvar specialRequest = baseRequest.defaults({\n  headers: {special: 'special value'}\n})\n```\n\n### request.put\n\nSame as `request()`, but defaults to `method: \"PUT\"`.\n\n```js\nrequest.put(url)\n```\n\n### request.patch\n\nSame as `request()`, but defaults to `method: \"PATCH\"`.\n\n```js\nrequest.patch(url)\n```\n\n### request.post\n\nSame as `request()`, but defaults to `method: \"POST\"`.\n\n```js\nrequest.post(url)\n```\n\n### request.head\n\nSame as `request()`, but defaults to `method: \"HEAD\"`.\n\n```js\nrequest.head(url)\n```\n\n### request.del\n\nSame as `request()`, but defaults to `method: \"DELETE\"`.\n\n```js\nrequest.del(url)\n```\n\n### request.get\n\nSame as `request()` (for uniformity).\n\n```js\nrequest.get(url)\n```\n### request.cookie\n\nFunction that creates a new cookie.\n\n```js\nrequest.cookie('key1=value1')\n```\n### request.jar()\n\nFunction that creates a new cookie jar.\n\n```js\nrequest.jar()\n```\n\n[back to top](#table-of-contents)\n\n\n---\n\n\n## Debugging\n\nThere are at least three ways to debug the operation of `request`:\n\n1. Launch the node process like `NODE_DEBUG=request node script.js`\n   (`lib,request,otherlib` works too).\n\n2. Set `require('request').debug = true` at any time (this does the same thing\n   as #1).\n\n3. Use the [request-debug module](https://github.com/request/request-debug) to\n   view request and response headers and bodies.\n\n[back to top](#table-of-contents)\n\n\n---\n\n## Timeouts\n\nMost requests to external servers should have a timeout attached, in case the\nserver is not responding in a timely manner. Without a timeout, your code may\nhave a socket open/consume resources for minutes or more.\n\nThere are two main types of timeouts: **connection timeouts** and **read\ntimeouts**. A connect timeout occurs if the timeout is hit while your client is\nattempting to establish a connection to a remote machine (corresponding to the\n[connect() call][connect] on the socket). A read timeout occurs any time the\nserver is too slow to send back a part of the response.\n\nThese two situations have widely different implications for what went wrong\nwith the request, so it's useful to be able to distinguish them. You can detect\ntimeout errors by checking `err.code` for an 'ETIMEDOUT' value. Further, you\ncan detect whether the timeout was a connection timeout by checking if the\n`err.connect` property is set to `true`.\n\n```js\nrequest.get('http://10.255.255.1', {timeout: 1500}, function(err) {\n    console.log(err.code === 'ETIMEDOUT');\n    // Set to `true` if the timeout was a connection timeout, `false` or\n    // `undefined` otherwise.\n    console.log(err.connect === true);\n    process.exit(0);\n});\n```\n\n[connect]: http://linux.die.net/man/2/connect\n\n## Examples:\n\n```js\n  var request = require('request')\n    , rand = Math.floor(Math.random()*100000000).toString()\n    ;\n  request(\n    { method: 'PUT'\n    , uri: 'http://mikeal.iriscouch.com/testjs/' + rand\n    , multipart:\n      [ { 'content-type': 'application/json'\n        ,  body: JSON.stringify({foo: 'bar', _attachments: {'message.txt': {follows: true, length: 18, 'content_type': 'text/plain' }}})\n        }\n      , { body: 'I am an attachment' }\n      ]\n    }\n  , function (error, response, body) {\n      if(response.statusCode == 201){\n        console.log('document saved as: http://mikeal.iriscouch.com/testjs/'+ rand)\n      } else {\n        console.log('error: '+ response.statusCode)\n        console.log(body)\n      }\n    }\n  )\n```\n\nFor backwards-compatibility, response compression is not supported by default.\nTo accept gzip-compressed responses, set the `gzip` option to `true`.  Note\nthat the body data passed through `request` is automatically decompressed\nwhile the response object is unmodified and will contain compressed data if\nthe server sent a compressed response.\n\n```js\n  var request = require('request')\n  request(\n    { method: 'GET'\n    , uri: 'http://www.google.com'\n    , gzip: true\n    }\n  , function (error, response, body) {\n      // body is the decompressed response body\n      console.log('server encoded the data as: ' + (response.headers['content-encoding'] || 'identity'))\n      console.log('the decoded data is: ' + body)\n    }\n  ).on('data', function(data) {\n    // decompressed data as it is received\n    console.log('decoded chunk: ' + data)\n  })\n  .on('response', function(response) {\n    // unmodified http.IncomingMessage object\n    response.on('data', function(data) {\n      // compressed data as it is received\n      console.log('received ' + data.length + ' bytes of compressed data')\n    })\n  })\n```\n\nCookies are disabled by default (else, they would be used in subsequent requests). To enable cookies, set `jar` to `true` (either in `defaults` or `options`).\n\n```js\nvar request = request.defaults({jar: true})\nrequest('http://www.google.com', function () {\n  request('http://images.google.com')\n})\n```\n\nTo use a custom cookie jar (instead of `request`’s global cookie jar), set `jar` to an instance of `request.jar()` (either in `defaults` or `options`)\n\n```js\nvar j = request.jar()\nvar request = request.defaults({jar:j})\nrequest('http://www.google.com', function () {\n  request('http://images.google.com')\n})\n```\n\nOR\n\n```js\nvar j = request.jar();\nvar cookie = request.cookie('key1=value1');\nvar url = 'http://www.google.com';\nj.setCookie(cookie, url);\nrequest({url: url, jar: j}, function () {\n  request('http://images.google.com')\n})\n```\n\nTo use a custom cookie store (such as a\n[`FileCookieStore`](https://github.com/mitsuru/tough-cookie-filestore)\nwhich supports saving to and restoring from JSON files), pass it as a parameter\nto `request.jar()`:\n\n```js\nvar FileCookieStore = require('tough-cookie-filestore');\n// NOTE - currently the 'cookies.json' file must already exist!\nvar j = request.jar(new FileCookieStore('cookies.json'));\nrequest = request.defaults({ jar : j })\nrequest('http://www.google.com', function() {\n  request('http://images.google.com')\n})\n```\n\nThe cookie store must be a\n[`tough-cookie`](https://github.com/SalesforceEng/tough-cookie)\nstore and it must support synchronous operations; see the\n[`CookieStore` API docs](https://github.com/SalesforceEng/tough-cookie#cookiestore-api)\nfor details.\n\nTo inspect your cookie jar after a request:\n\n```js\nvar j = request.jar()\nrequest({url: 'http://www.google.com', jar: j}, function () {\n  var cookie_string = j.getCookieString(url); // \"key1=value1; key2=value2; ...\"\n  var cookies = j.getCookies(url);\n  // [{key: 'key1', value: 'value1', domain: \"www.google.com\", ...}, ...]\n})\n```\n\n[back to top](#table-of-contents)\n",
-  "readmeFilename": "README.md",
+  "gitHead": "1c2fb40c74efb4f706f350a78dbd5e58fe913af3",
   "homepage": "https://github.com/request/request#readme",
-  "_id": "request@2.67.0",
-  "_shasum": "8af74780e2bf11ea0ae9aa965c11f11afd272742",
-  "_resolved": "https://registry.npmjs.org/request/-/request-2.67.0.tgz",
-  "_from": "request@>=2.67.0 <2.68.0"
+  "_id": "request@2.69.0",
+  "_shasum": "cf91d2e000752b1217155c005241911991a2346a",
+  "_from": "request@2.69.0",
+  "_npmVersion": "2.14.4",
+  "_nodeVersion": "4.1.2",
+  "_npmUser": {
+    "name": "mikeal",
+    "email": "mikeal.rogers@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "mikeal",
+      "email": "mikeal.rogers@gmail.com"
+    },
+    {
+      "name": "nylen",
+      "email": "jnylen@gmail.com"
+    },
+    {
+      "name": "fredkschott",
+      "email": "fkschott@gmail.com"
+    },
+    {
+      "name": "simov",
+      "email": "simeonvelichkov@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "cf91d2e000752b1217155c005241911991a2346a",
+    "tarball": "http://registry.npmjs.org/request/-/request-2.69.0.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/request/-/request-2.69.0.tgz"
 }
index 19c1b92..441db80 100644 (file)
@@ -8,13 +8,14 @@ var http = require('http')
   , zlib = require('zlib')
   , bl = require('bl')
   , hawk = require('hawk')
-  , aws = require('aws-sign2')
+  , aws2 = require('aws-sign2')
   , httpSignature = require('http-signature')
   , mime = require('mime-types')
   , stringstream = require('stringstream')
   , caseless = require('caseless')
   , ForeverAgent = require('forever-agent')
   , FormData = require('form-data')
+  , extend = require('extend')
   , isTypedArray = require('is-typedarray').strict
   , helpers = require('./lib/helpers')
   , cookies = require('./lib/cookies')
@@ -123,7 +124,7 @@ function Request (options) {
   var reserved = Object.keys(Request.prototype)
   var nonReserved = filterForNonReserved(reserved, options)
 
-  util._extend(self, nonReserved)
+  extend(self, nonReserved)
   options = filterOutReservedFunctions(reserved, options)
 
   self.readable = true
@@ -579,7 +580,7 @@ Request.prototype.init = function (options) {
       // Before ending the request, we had to compute the length of the whole form, asyncly
       self.setHeader(self._form.getHeaders(), true)
       self._form.getLength(function (err, length) {
-        if (!err) {
+        if (!err && !isNaN(length)) {
           self.setHeader('content-length', length)
         }
         end()
@@ -1044,7 +1045,7 @@ Request.prototype.abort = function () {
     self.req.abort()
   }
   else if (self.response) {
-    self.response.abort()
+    self.response.destroy()
   }
 
   self.emit('abort')
@@ -1228,29 +1229,52 @@ Request.prototype.aws = function (opts, now) {
     self._aws = opts
     return self
   }
-  var date = new Date()
-  self.setHeader('date', date.toUTCString())
-  var auth =
-    { key: opts.key
-    , secret: opts.secret
-    , verb: self.method.toUpperCase()
-    , date: date
-    , contentType: self.getHeader('content-type') || ''
-    , md5: self.getHeader('content-md5') || ''
-    , amazonHeaders: aws.canonicalizeHeaders(self.headers)
+
+  if (opts.sign_version == 4 || opts.sign_version == '4') {
+    var aws4 = require('aws4')
+    // use aws4
+    var options = {
+      host: self.uri.host,
+      path: self.uri.path,
+      method: self.method,
+      headers: {
+        'content-type': self.getHeader('content-type') || ''
+      },
+      body: self.body
+    }
+    var signRes = aws4.sign(options, {
+      accessKeyId: opts.key,
+      secretAccessKey: opts.secret
+    })
+    self.setHeader('authorization', signRes.headers.Authorization)
+    self.setHeader('x-amz-date', signRes.headers['X-Amz-Date'])
+  }
+  else {
+    // default: use aws-sign2
+    var date = new Date()
+    self.setHeader('date', date.toUTCString())
+    var auth =
+      { key: opts.key
+      , secret: opts.secret
+      , verb: self.method.toUpperCase()
+      , date: date
+      , contentType: self.getHeader('content-type') || ''
+      , md5: self.getHeader('content-md5') || ''
+      , amazonHeaders: aws2.canonicalizeHeaders(self.headers)
+      }
+    var path = self.uri.path
+    if (opts.bucket && path) {
+      auth.resource = '/' + opts.bucket + path
+    } else if (opts.bucket && !path) {
+      auth.resource = '/' + opts.bucket
+    } else if (!opts.bucket && path) {
+      auth.resource = path
+    } else if (!opts.bucket && !path) {
+      auth.resource = '/'
     }
-  var path = self.uri.path
-  if (opts.bucket && path) {
-    auth.resource = '/' + opts.bucket + path
-  } else if (opts.bucket && !path) {
-    auth.resource = '/' + opts.bucket
-  } else if (!opts.bucket && path) {
-    auth.resource = path
-  } else if (!opts.bucket && !path) {
-    auth.resource = '/'
-  }
-  auth.resource = aws.canonicalizeResource(auth.resource)
-  self.setHeader('authorization', aws.authorization(auth))
+    auth.resource = aws2.canonicalizeResource(auth.resource)
+    self.setHeader('authorization', aws2.authorization(auth))
+  }
 
   return self
 }
index 09d9c8a..26e50a3 100644 (file)
@@ -57,8 +57,10 @@ var operation = retry.operation({
 
 ### retry.operation([options])
 
-Creates a new `RetryOperation` object. See the `retry.timeouts()` function
-below for available `options`.
+Creates a new `RetryOperation` object. `options` is the same as `retry.timeouts()`'s `options`, with two additions:
+
+* `forever`: Whether to retry forever, defaults to `false`.
+* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`.
 
 ### retry.timeouts([options])
 
@@ -126,11 +128,19 @@ retry.wrap(obj, {retries: 3}, ['method1', 'method2']);
 ```
 The `options` object can take any options that the usual call to `retry.operation` can take.
 
-### new RetryOperation(timeouts)
+### new RetryOperation(timeouts, [options])
 
 Creates a new `RetryOperation` where `timeouts` is an array where each value is
 a timeout given in milliseconds.
 
+Available options:
+* `forever`: Whether to retry forever, defaults to `false`.
+* `unref`: Wether to [unref](https://nodejs.org/api/timers.html#timers_unref) the setTimeout's, defaults to `false`.
+
+If `forever` is true, the following changes happen:
+* `RetryOperation.errors()` will only output an array of one item: the last error.
+* `RetryOperation` will repeatedly use the last item in the `timeouts` array.
+
 #### retryOperation.errors()
 
 Returns an array of all errors that have been passed to
@@ -157,11 +167,11 @@ Whenever your retry operation takes longer than `timeout` to execute, the timeou
 
 #### retryOperation.try(fn)
 
-This is an alias for `retryOperation.attempt(fn)`. This is deprecated.
+This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead.
 
 #### retryOperation.start(fn)
 
-This is an alias for `retryOperation.attempt(fn)`. This is deprecated.
+This is an alias for `retryOperation.attempt(fn)`. This is deprecated. Please use `retryOperation.attempt(fn)` instead.
 
 #### retryOperation.retry(error)
 
@@ -180,13 +190,15 @@ Returns an int representing the number of attempts it took to call `fn` before i
 retry is licensed under the MIT license.
 
 
-#Changelog
+# Changelog
+
+0.8.0 Implementing retry.wrap.
 
-0.7.0 Some bugfixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13).
+0.7.0 Some bug fixes and made retry.createTimeout() public. Fixed issues [#10](https://github.com/tim-kos/node-retry/issues/10), [#12](https://github.com/tim-kos/node-retry/issues/12), and [#13](https://github.com/tim-kos/node-retry/issues/13).
 
-0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in miliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called.
+0.6.0 Introduced optional timeOps parameter for the attempt() function which is an object having a property timeout in milliseconds and a property cb callback function. Whenever your retry operation takes longer than timeout to execute, the timeout callback function cb is called.
 
-0.5.0 Some minor refactorings.
+0.5.0 Some minor refactoring.
 
 0.4.0 Changed retryOperation.try() to retryOperation.attempt(). Deprecated the aliases start() and try() for it.
 
index 9468565..02ab147 100644 (file)
@@ -1,10 +1,11 @@
 var RetryOperation = require('./retry_operation');
 
 exports.operation = function(options) {
-  var retryForever = false;
-  if (options && options.forever === true) retryForever = true;
   var timeouts = exports.timeouts(options);
-  return new RetryOperation(timeouts, retryForever);
+  return new RetryOperation(timeouts, {
+      forever: options && options.forever,
+      unref: options && options.unref
+  });
 };
 
 exports.timeouts = function(options) {
index 52b8955..ad96efb 100644 (file)
@@ -1,5 +1,11 @@
-function RetryOperation(timeouts, retryForever) {
+function RetryOperation(timeouts, options) {
+  // Compatibility for the old (timeouts, retryForever) signature
+  if (typeof options === 'boolean') {
+    options = { forever: options };
+  }
+
   this._timeouts = timeouts;
+  this._options = options || {};
   this._fn = null;
   this._errors = [];
   this._attempts = 1;
@@ -7,7 +13,7 @@ function RetryOperation(timeouts, retryForever) {
   this._operationTimeoutCb = null;
   this._timeout = null;
 
-  if (!!retryForever) {
+  if (this._options.forever) {
     this._cachedTimeouts = this._timeouts.slice(0);
   }
 }
@@ -37,18 +43,26 @@ RetryOperation.prototype.retry = function(err) {
   }
 
   var self = this;
-  setTimeout(function() {
+  var timer = setTimeout(function() {
     self._attempts++;
 
     if (self._operationTimeoutCb) {
       self._timeout = setTimeout(function() {
         self._operationTimeoutCb(self._attempts);
       }, self._operationTimeout);
+
+      if (this._options.unref) {
+          self._timeout.unref();
+      }
     }
 
     self._fn(self._attempts);
   }, timeout);
 
+  if (this._options.unref) {
+      timer.unref();
+  }
+
   return true;
 };
 
index 75b9680..c8fc00f 100644 (file)
@@ -7,7 +7,7 @@
   "name": "retry",
   "description": "Abstraction for exponential and custom retry strategies for failed operations.",
   "license": "MIT",
-  "version": "0.8.0",
+  "version": "0.9.0",
   "homepage": "https://github.com/tim-kos/node-retry",
   "repository": {
     "type": "git",
     "fake": "0.2.0",
     "far": "0.0.1"
   },
-  "gitHead": "9446e803d6a41ae08732a4a215ae5bf1ff1ccfdd",
+  "gitHead": "1b621cf499ef7647d005e3650006b93a8dbeb986",
   "bugs": {
     "url": "https://github.com/tim-kos/node-retry/issues"
   },
-  "_id": "retry@0.8.0",
+  "_id": "retry@0.9.0",
   "scripts": {},
-  "_shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f",
-  "_from": "retry@0.8.0",
+  "_shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d",
+  "_from": "retry@0.9.0",
   "_npmVersion": "2.1.7",
-  "_nodeVersion": "0.10.33",
+  "_nodeVersion": "4.2.1",
   "_npmUser": {
     "name": "tim-kos",
     "email": "tim@debuggable.com"
@@ -46,8 +46,8 @@
     }
   ],
   "dist": {
-    "shasum": "2367628dc0edb247b1eab649dc53ac8628ac2d5f",
-    "tarball": "http://registry.npmjs.org/retry/-/retry-0.8.0.tgz"
+    "shasum": "6f697e50a0e4ddc8c8f7fb547a9b60dead43678d",
+    "tarball": "http://registry.npmjs.org/retry/-/retry-0.9.0.tgz"
   },
-  "_resolved": "https://registry.npmjs.org/retry/-/retry-0.8.0.tgz"
+  "_resolved": "https://registry.npmjs.org/retry/-/retry-0.9.0.tgz"
 }
index de7c4bb..423b8cf 100644 (file)
@@ -27,6 +27,64 @@ errors are handled for you:
   async case, rimraf will gradually back off with timeouts up to
   `opts.emfileWait` ms, which defaults to 1000.
 
+## options
+
+* unlink, chmod, stat, lstat, rmdir, readdir,
+  unlinkSync, chmodSync, statSync, lstatSync, rmdirSync, readdirSync
+
+    In order to use a custom file system library, you can override
+    specific fs functions on the options object.
+
+    If any of these functions are present on the options object, then
+    the supplied function will be used instead of the default fs
+    method.
+
+    Sync methods are only relevant for `rimraf.sync()`, of course.
+
+    For example:
+
+    ```javascript
+    var myCustomFS = require('some-custom-fs')
+
+    rimraf('some-thing', myCustomFS, callback)
+    ```
+
+* maxBusyTries
+
+    If an `EBUSY`, `ENOTEMPTY`, or `EPERM` error code is encountered
+    on Windows systems, then rimraf will retry with a linear backoff
+    wait of 100ms longer on each try.  The default maxBusyTries is 3.
+
+    Only relevant for async usage.
+
+* emfileWait
+
+    If an `EMFILE` error is encountered, then rimraf will retry
+    repeatedly with a linear backoff of 1ms longer on each try, until
+    the timeout counter hits this max.  The default limit is 1000.
+
+    If you repeatedly encounter `EMFILE` errors, then consider using
+    [graceful-fs](http://npm.im/graceful-fs) in your program.
+
+    Only relevant for async usage.
+
+* glob
+
+    Set to `false` to disable [glob](http://npm.im/glob) pattern
+    matching.
+
+    Set to an object to pass options to the glob module.  The default
+    glob options are `{ nosort: true, silent: true }`.
+
+    Glob version 6 is used in this module.
+
+    Relevant for both sync and async usage.
+
+* disableGlob
+
+    Set to any non-falsey value to disable globbing entirely.
+    (Equivalent to setting `glob: false`.)
+
 ## rimraf.sync
 
 It can remove stuff synchronously, too.  But that's not so good.  Use
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/LICENSE b/deps/npm/node_modules/rimraf/node_modules/glob/LICENSE
new file mode 100644 (file)
index 0000000..19129e3
--- /dev/null
@@ -0,0 +1,15 @@
+The ISC License
+
+Copyright (c) Isaac Z. Schlueter and Contributors
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted, provided that the above
+copyright notice and this permission notice appear in all copies.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
+WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
+ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
+ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR
+IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/README.md b/deps/npm/node_modules/rimraf/node_modules/glob/README.md
new file mode 100644 (file)
index 0000000..6960483
--- /dev/null
@@ -0,0 +1,359 @@
+# Glob
+
+Match files using the patterns the shell uses, like stars and stuff.
+
+[![Build Status](https://travis-ci.org/isaacs/node-glob.svg?branch=master)](https://travis-ci.org/isaacs/node-glob/) [![Build Status](https://ci.appveyor.com/api/projects/status/kd7f3yftf7unxlsx?svg=true)](https://ci.appveyor.com/project/isaacs/node-glob) [![Coverage Status](https://coveralls.io/repos/isaacs/node-glob/badge.svg?branch=master&service=github)](https://coveralls.io/github/isaacs/node-glob?branch=master)
+
+This is a glob implementation in JavaScript.  It uses the `minimatch`
+library to do its matching.
+
+![](oh-my-glob.gif)
+
+## Usage
+
+```javascript
+var glob = require("glob")
+
+// options is optional
+glob("**/*.js", options, function (er, files) {
+  // files is an array of filenames.
+  // If the `nonull` option is set, and nothing
+  // was found, then files is ["**/*.js"]
+  // er is an error object or null.
+})
+```
+
+## Glob Primer
+
+"Globs" are the patterns you type when you do stuff like `ls *.js` on
+the command line, or put `build/*` in a `.gitignore` file.
+
+Before parsing the path part patterns, braced sections are expanded
+into a set.  Braced sections start with `{` and end with `}`, with any
+number of comma-delimited sections within.  Braced sections may contain
+slash characters, so `a{/b/c,bcd}` would expand into `a/b/c` and `abcd`.
+
+The following characters have special magic meaning when used in a
+path portion:
+
+* `*` Matches 0 or more characters in a single path portion
+* `?` Matches 1 character
+* `[...]` Matches a range of characters, similar to a RegExp range.
+  If the first character of the range is `!` or `^` then it matches
+  any character not in the range.
+* `!(pattern|pattern|pattern)` Matches anything that does not match
+  any of the patterns provided.
+* `?(pattern|pattern|pattern)` Matches zero or one occurrence of the
+  patterns provided.
+* `+(pattern|pattern|pattern)` Matches one or more occurrences of the
+  patterns provided.
+* `*(a|b|c)` Matches zero or more occurrences of the patterns provided
+* `@(pattern|pat*|pat?erN)` Matches exactly one of the patterns
+  provided
+* `**` If a "globstar" is alone in a path portion, then it matches
+  zero or more directories and subdirectories searching for matches.
+  It does not crawl symlinked directories.
+
+### Dots
+
+If a file or directory path portion has a `.` as the first character,
+then it will not match any glob pattern unless that pattern's
+corresponding path part also has a `.` as its first character.
+
+For example, the pattern `a/.*/c` would match the file at `a/.b/c`.
+However the pattern `a/*/c` would not, because `*` does not start with
+a dot character.
+
+You can make glob treat dots as normal characters by setting
+`dot:true` in the options.
+
+### Basename Matching
+
+If you set `matchBase:true` in the options, and the pattern has no
+slashes in it, then it will seek for any file anywhere in the tree
+with a matching basename.  For example, `*.js` would match
+`test/simple/basic.js`.
+
+### Empty Sets
+
+If no matching files are found, then an empty array is returned.  This
+differs from the shell, where the pattern itself is returned.  For
+example:
+
+    $ echo a*s*d*f
+    a*s*d*f
+
+To get the bash-style behavior, set the `nonull:true` in the options.
+
+### See Also:
+
+* `man sh`
+* `man bash` (Search for "Pattern Matching")
+* `man 3 fnmatch`
+* `man 5 gitignore`
+* [minimatch documentation](https://github.com/isaacs/minimatch)
+
+## glob.hasMagic(pattern, [options])
+
+Returns `true` if there are any special characters in the pattern, and
+`false` otherwise.
+
+Note that the options affect the results.  If `noext:true` is set in
+the options object, then `+(a|b)` will not be considered a magic
+pattern.  If the pattern has a brace expansion, like `a/{b/c,x/y}`
+then that is considered magical, unless `nobrace:true` is set in the
+options.
+
+## glob(pattern, [options], cb)
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* `cb` `{Function}`
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Perform an asynchronous glob search.
+
+## glob.sync(pattern, [options])
+
+* `pattern` `{String}` Pattern to be matched
+* `options` `{Object}`
+* return: `{Array<String>}` filenames found matching the pattern
+
+Perform a synchronous glob search.
+
+## Class: glob.Glob
+
+Create a Glob object by instantiating the `glob.Glob` class.
+
+```javascript
+var Glob = require("glob").Glob
+var mg = new Glob(pattern, options, cb)
+```
+
+It's an EventEmitter, and starts walking the filesystem to find matches
+immediately.
+
+### new glob.Glob(pattern, [options], [cb])
+
+* `pattern` `{String}` pattern to search for
+* `options` `{Object}`
+* `cb` `{Function}` Called when an error occurs, or matches are found
+  * `err` `{Error | null}`
+  * `matches` `{Array<String>}` filenames found matching the pattern
+
+Note that if the `sync` flag is set in the options, then matches will
+be immediately available on the `g.found` member.
+
+### Properties
+
+* `minimatch` The minimatch object that the glob uses.
+* `options` The options object passed in.
+* `aborted` Boolean which is set to true when calling `abort()`.  There
+  is no way at this time to continue a glob search after aborting, but
+  you can re-use the statCache to avoid having to duplicate syscalls.
+* `cache` Convenience object.  Each field has the following possible
+  values:
+  * `false` - Path does not exist
+  * `true` - Path exists
+  * `'FILE'` - Path exists, and is not a directory
+  * `'DIR'` - Path exists, and is a directory
+  * `[file, entries, ...]` - Path exists, is a directory, and the
+    array value is the results of `fs.readdir`
+* `statCache` Cache of `fs.stat` results, to prevent statting the same
+  path multiple times.
+* `symlinks` A record of which paths are symbolic links, which is
+  relevant in resolving `**` patterns.
+* `realpathCache` An optional object which is passed to `fs.realpath`
+  to minimize unnecessary syscalls.  It is stored on the instantiated
+  Glob object, and may be re-used.
+
+### Events
+
+* `end` When the matching is finished, this is emitted with all the
+  matches found.  If the `nonull` option is set, and no match was found,
+  then the `matches` list contains the original pattern.  The matches
+  are sorted, unless the `nosort` flag is set.
+* `match` Every time a match is found, this is emitted with the specific
+  thing that matched. It is not deduplicated or resolved to a realpath.
+* `error` Emitted when an unexpected error is encountered, or whenever
+  any fs error occurs if `options.strict` is set.
+* `abort` When `abort()` is called, this event is raised.
+
+### Methods
+
+* `pause` Temporarily stop the search
+* `resume` Resume the search
+* `abort` Stop the search forever
+
+### Options
+
+All the options that can be passed to Minimatch can also be passed to
+Glob to change pattern matching behavior.  Also, some have been added,
+or have glob-specific ramifications.
+
+All options are false by default, unless otherwise noted.
+
+All options are added to the Glob object, as well.
+
+If you are running many `glob` operations, you can pass a Glob object
+as the `options` argument to a subsequent operation to shortcut some
+`stat` and `readdir` calls.  At the very least, you may pass in shared
+`symlinks`, `statCache`, `realpathCache`, and `cache` options, so that
+parallel glob operations will be sped up by sharing information about
+the filesystem.
+
+* `cwd` The current working directory in which to search.  Defaults
+  to `process.cwd()`.
+* `root` The place where patterns starting with `/` will be mounted
+  onto.  Defaults to `path.resolve(options.cwd, "/")` (`/` on Unix
+  systems, and `C:\` or some such on Windows.)
+* `dot` Include `.dot` files in normal matches and `globstar` matches.
+  Note that an explicit dot in a portion of the pattern will always
+  match dot files.
+* `nomount` By default, a pattern starting with a forward-slash will be
+  "mounted" onto the root setting, so that a valid filesystem path is
+  returned.  Set this flag to disable that behavior.
+* `mark` Add a `/` character to directory matches.  Note that this
+  requires additional stat calls.
+* `nosort` Don't sort the results.
+* `stat` Set to true to stat *all* results.  This reduces performance
+  somewhat, and is completely unnecessary, unless `readdir` is presumed
+  to be an untrustworthy indicator of file existence.
+* `silent` When an unusual error is encountered when attempting to
+  read a directory, a warning will be printed to stderr.  Set the
+  `silent` option to true to suppress these warnings.
+* `strict` When an unusual error is encountered when attempting to
+  read a directory, the process will just continue on in search of
+  other matches.  Set the `strict` option to raise an error in these
+  cases.
+* `cache` See `cache` property above.  Pass in a previously generated
+  cache object to save some fs calls.
+* `statCache` A cache of results of filesystem information, to prevent
+  unnecessary stat calls.  While it should not normally be necessary
+  to set this, you may pass the statCache from one glob() call to the
+  options object of another, if you know that the filesystem will not
+  change between calls.  (See "Race Conditions" below.)
+* `symlinks` A cache of known symbolic links.  You may pass in a
+  previously generated `symlinks` object to save `lstat` calls when
+  resolving `**` matches.
+* `sync` DEPRECATED: use `glob.sync(pattern, opts)` instead.
+* `nounique` In some cases, brace-expanded patterns can result in the
+  same file showing up multiple times in the result set.  By default,
+  this implementation prevents duplicates in the result set.  Set this
+  flag to disable that behavior.
+* `nonull` Set to never return an empty set, instead returning a set
+  containing the pattern itself.  This is the default in glob(3).
+* `debug` Set to enable debug logging in minimatch and glob.
+* `nobrace` Do not expand `{a,b}` and `{1..3}` brace sets.
+* `noglobstar` Do not match `**` against multiple filenames.  (Ie,
+  treat it as a normal `*` instead.)
+* `noext` Do not match `+(a|b)` "extglob" patterns.
+* `nocase` Perform a case-insensitive match.  Note: on
+  case-insensitive filesystems, non-magic patterns will match by
+  default, since `stat` and `readdir` will not raise errors.
+* `matchBase` Perform a basename-only match if the pattern does not
+  contain any slash characters.  That is, `*.js` would be treated as
+  equivalent to `**/*.js`, matching all js files in all directories.
+* `nodir` Do not match directories, only files.  (Note: to match
+  *only* directories, simply put a `/` at the end of the pattern.)
+* `ignore` Add a pattern or an array of glob patterns to exclude matches.
+  Note: `ignore` patterns are *always* in `dot:true` mode, regardless
+  of any other settings.
+* `follow` Follow symlinked directories when expanding `**` patterns.
+  Note that this can result in a lot of duplicate references in the
+  presence of cyclic links.
+* `realpath` Set to true to call `fs.realpath` on all of the results.
+  In the case of a symlink that cannot be resolved, the full absolute
+  path to the matched entry is returned (though it will usually be a
+  broken symlink)
+
+## Comparisons to other fnmatch/glob implementations
+
+While strict compliance with the existing standards is a worthwhile
+goal, some discrepancies exist between node-glob and other
+implementations, and are intentional.
+
+The double-star character `**` is supported by default, unless the
+`noglobstar` flag is set.  This is supported in the manner of bsdglob
+and bash 4.3, where `**` only has special significance if it is the only
+thing in a path part.  That is, `a/**/b` will match `a/x/y/b`, but
+`a/**b` will not.
+
+Note that symlinked directories are not crawled as part of a `**`,
+though their contents may match against subsequent portions of the
+pattern.  This prevents infinite loops and duplicates and the like.
+
+If an escaped pattern has no matches, and the `nonull` flag is set,
+then glob returns the pattern as-provided, rather than
+interpreting the character escapes.  For example,
+`glob.match([], "\\*a\\?")` will return `"\\*a\\?"` rather than
+`"*a?"`.  This is akin to setting the `nullglob` option in bash, except
+that it does not resolve escaped pattern characters.
+
+If brace expansion is not disabled, then it is performed before any
+other interpretation of the glob pattern.  Thus, a pattern like
+`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded
+**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are
+checked for validity.  Since those two are valid, matching proceeds.
+
+### Comments and Negation
+
+Previously, this module let you mark a pattern as a "comment" if it
+started with a `#` character, or a "negated" pattern if it started
+with a `!` character.
+
+These options were deprecated in version 5, and removed in version 6.
+
+To specify things that should not match, use the `ignore` option.
+
+## Windows
+
+**Please only use forward-slashes in glob expressions.**
+
+Though windows uses either `/` or `\` as its path separator, only `/`
+characters are used by this glob implementation.  You must use
+forward-slashes **only** in glob expressions.  Back-slashes will always
+be interpreted as escape characters, not path separators.
+
+Results from absolute patterns such as `/foo/*` are mounted onto the
+root setting using `path.join`.  On windows, this will by default result
+in `/foo/*` matching `C:\foo\bar.txt`.
+
+## Race Conditions
+
+Glob searching, by its very nature, is susceptible to race conditions,
+since it relies on directory walking and such.
+
+As a result, it is possible that a file that exists when glob looks for
+it may have been deleted or modified by the time it returns the result.
+
+As part of its internal implementation, this program caches all stat
+and readdir calls that it makes, in order to cut down on system
+overhead.  However, this also makes it even more susceptible to races,
+especially if the cache or statCache objects are reused between glob
+calls.
+
+Users are thus advised not to use a glob result as a guarantee of
+filesystem state in the face of rapid changes.  For the vast majority
+of operations, this is never a problem.
+
+## Contributing
+
+Any change to behavior (including bugfixes) must come with a test.
+
+Patches that fail tests or reduce performance will be rejected.
+
+```
+# to run tests
+npm test
+
+# to re-generate test fixtures
+npm run test-regen
+
+# to benchmark against bash/zsh
+npm run bench
+
+# to profile javascript
+npm run prof
+```
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/common.js b/deps/npm/node_modules/rimraf/node_modules/glob/common.js
new file mode 100644 (file)
index 0000000..c9127eb
--- /dev/null
@@ -0,0 +1,226 @@
+exports.alphasort = alphasort
+exports.alphasorti = alphasorti
+exports.setopts = setopts
+exports.ownProp = ownProp
+exports.makeAbs = makeAbs
+exports.finish = finish
+exports.mark = mark
+exports.isIgnored = isIgnored
+exports.childrenIgnored = childrenIgnored
+
+function ownProp (obj, field) {
+  return Object.prototype.hasOwnProperty.call(obj, field)
+}
+
+var path = require("path")
+var minimatch = require("minimatch")
+var isAbsolute = require("path-is-absolute")
+var Minimatch = minimatch.Minimatch
+
+function alphasorti (a, b) {
+  return a.toLowerCase().localeCompare(b.toLowerCase())
+}
+
+function alphasort (a, b) {
+  return a.localeCompare(b)
+}
+
+function setupIgnores (self, options) {
+  self.ignore = options.ignore || []
+
+  if (!Array.isArray(self.ignore))
+    self.ignore = [self.ignore]
+
+  if (self.ignore.length) {
+    self.ignore = self.ignore.map(ignoreMap)
+  }
+}
+
+// ignore patterns are always in dot:true mode.
+function ignoreMap (pattern) {
+  var gmatcher = null
+  if (pattern.slice(-3) === '/**') {
+    var gpattern = pattern.replace(/(\/\*\*)+$/, '')
+    gmatcher = new Minimatch(gpattern, { dot: true })
+  }
+
+  return {
+    matcher: new Minimatch(pattern, { dot: true }),
+    gmatcher: gmatcher
+  }
+}
+
+function setopts (self, pattern, options) {
+  if (!options)
+    options = {}
+
+  // base-matching: just use globstar for that.
+  if (options.matchBase && -1 === pattern.indexOf("/")) {
+    if (options.noglobstar) {
+      throw new Error("base matching requires globstar")
+    }
+    pattern = "**/" + pattern
+  }
+
+  self.silent = !!options.silent
+  self.pattern = pattern
+  self.strict = options.strict !== false
+  self.realpath = !!options.realpath
+  self.realpathCache = options.realpathCache || Object.create(null)
+  self.follow = !!options.follow
+  self.dot = !!options.dot
+  self.mark = !!options.mark
+  self.nodir = !!options.nodir
+  if (self.nodir)
+    self.mark = true
+  self.sync = !!options.sync
+  self.nounique = !!options.nounique
+  self.nonull = !!options.nonull
+  self.nosort = !!options.nosort
+  self.nocase = !!options.nocase
+  self.stat = !!options.stat
+  self.noprocess = !!options.noprocess
+
+  self.maxLength = options.maxLength || Infinity
+  self.cache = options.cache || Object.create(null)
+  self.statCache = options.statCache || Object.create(null)
+  self.symlinks = options.symlinks || Object.create(null)
+
+  setupIgnores(self, options)
+
+  self.changedCwd = false
+  var cwd = process.cwd()
+  if (!ownProp(options, "cwd"))
+    self.cwd = cwd
+  else {
+    self.cwd = options.cwd
+    self.changedCwd = path.resolve(options.cwd) !== cwd
+  }
+
+  self.root = options.root || path.resolve(self.cwd, "/")
+  self.root = path.resolve(self.root)
+  if (process.platform === "win32")
+    self.root = self.root.replace(/\\/g, "/")
+
+  self.nomount = !!options.nomount
+
+  // disable comments and negation in Minimatch.
+  // Note that they are not supported in Glob itself anyway.
+  options.nonegate = true
+  options.nocomment = true
+
+  self.minimatch = new Minimatch(pattern, options)
+  self.options = self.minimatch.options
+}
+
+function finish (self) {
+  var nou = self.nounique
+  var all = nou ? [] : Object.create(null)
+
+  for (var i = 0, l = self.matches.length; i < l; i ++) {
+    var matches = self.matches[i]
+    if (!matches || Object.keys(matches).length === 0) {
+      if (self.nonull) {
+        // do like the shell, and spit out the literal glob
+        var literal = self.minimatch.globSet[i]
+        if (nou)
+          all.push(literal)
+        else
+          all[literal] = true
+      }
+    } else {
+      // had matches
+      var m = Object.keys(matches)
+      if (nou)
+        all.push.apply(all, m)
+      else
+        m.forEach(function (m) {
+          all[m] = true
+        })
+    }
+  }
+
+  if (!nou)
+    all = Object.keys(all)
+
+  if (!self.nosort)
+    all = all.sort(self.nocase ? alphasorti : alphasort)
+
+  // at *some* point we statted all of these
+  if (self.mark) {
+    for (var i = 0; i < all.length; i++) {
+      all[i] = self._mark(all[i])
+    }
+    if (self.nodir) {
+      all = all.filter(function (e) {
+        return !(/\/$/.test(e))
+      })
+    }
+  }
+
+  if (self.ignore.length)
+    all = all.filter(function(m) {
+      return !isIgnored(self, m)
+    })
+
+  self.found = all
+}
+
+function mark (self, p) {
+  var abs = makeAbs(self, p)
+  var c = self.cache[abs]
+  var m = p
+  if (c) {
+    var isDir = c === 'DIR' || Array.isArray(c)
+    var slash = p.slice(-1) === '/'
+
+    if (isDir && !slash)
+      m += '/'
+    else if (!isDir && slash)
+      m = m.slice(0, -1)
+
+    if (m !== p) {
+      var mabs = makeAbs(self, m)
+      self.statCache[mabs] = self.statCache[abs]
+      self.cache[mabs] = self.cache[abs]
+    }
+  }
+
+  return m
+}
+
+// lotta situps...
+function makeAbs (self, f) {
+  var abs = f
+  if (f.charAt(0) === '/') {
+    abs = path.join(self.root, f)
+  } else if (isAbsolute(f) || f === '') {
+    abs = f
+  } else if (self.changedCwd) {
+    abs = path.resolve(self.cwd, f)
+  } else {
+    abs = path.resolve(f)
+  }
+  return abs
+}
+
+
+// Return true, if pattern ends with globstar '**', for the accompanying parent directory.
+// Ex:- If node_modules/** is the pattern, add 'node_modules' to ignore list along with it's contents
+function isIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return item.matcher.match(path) || !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
+
+function childrenIgnored (self, path) {
+  if (!self.ignore.length)
+    return false
+
+  return self.ignore.some(function(item) {
+    return !!(item.gmatcher && item.gmatcher.match(path))
+  })
+}
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/glob.js b/deps/npm/node_modules/rimraf/node_modules/glob/glob.js
new file mode 100644 (file)
index 0000000..a62da27
--- /dev/null
@@ -0,0 +1,765 @@
+// Approach:
+//
+// 1. Get the minimatch set
+// 2. For each pattern in the set, PROCESS(pattern, false)
+// 3. Store matches per-set, then uniq them
+//
+// PROCESS(pattern, inGlobStar)
+// Get the first [n] items from pattern that are all strings
+// Join these together.  This is PREFIX.
+//   If there is no more remaining, then stat(PREFIX) and
+//   add to matches if it succeeds.  END.
+//
+// If inGlobStar and PREFIX is symlink and points to dir
+//   set ENTRIES = []
+// else readdir(PREFIX) as ENTRIES
+//   If fail, END
+//
+// with ENTRIES
+//   If pattern[n] is GLOBSTAR
+//     // handle the case where the globstar match is empty
+//     // by pruning it out, and testing the resulting pattern
+//     PROCESS(pattern[0..n] + pattern[n+1 .. $], false)
+//     // handle other cases.
+//     for ENTRY in ENTRIES (not dotfiles)
+//       // attach globstar + tail onto the entry
+//       // Mark that this entry is a globstar match
+//       PROCESS(pattern[0..n] + ENTRY + pattern[n .. $], true)
+//
+//   else // not globstar
+//     for ENTRY in ENTRIES (not dotfiles, unless pattern[n] is dot)
+//       Test ENTRY against pattern[n]
+//       If fails, continue
+//       If passes, PROCESS(pattern[0..n] + item + pattern[n+1 .. $])
+//
+// Caveat:
+//   Cache all stats and readdirs results to minimize syscall.  Since all
+//   we ever care about is existence and directory-ness, we can just keep
+//   `true` for files, and [children,...] for directories, or `false` for
+//   things that don't exist.
+
+module.exports = glob
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var inherits = require('inherits')
+var EE = require('events').EventEmitter
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var globSync = require('./sync.js')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var inflight = require('inflight')
+var util = require('util')
+var childrenIgnored = common.childrenIgnored
+var isIgnored = common.isIgnored
+
+var once = require('once')
+
+function glob (pattern, options, cb) {
+  if (typeof options === 'function') cb = options, options = {}
+  if (!options) options = {}
+
+  if (options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return globSync(pattern, options)
+  }
+
+  return new Glob(pattern, options, cb)
+}
+
+glob.sync = globSync
+var GlobSync = glob.GlobSync = globSync.GlobSync
+
+// old api surface
+glob.glob = glob
+
+function extend (origin, add) {
+  if (add === null || typeof add !== 'object') {
+    return origin
+  }
+
+  var keys = Object.keys(add)
+  var i = keys.length
+  while (i--) {
+    origin[keys[i]] = add[keys[i]]
+  }
+  return origin
+}
+
+glob.hasMagic = function (pattern, options_) {
+  var options = extend({}, options_)
+  options.noprocess = true
+
+  var g = new Glob(pattern, options)
+  var set = g.minimatch.set
+  if (set.length > 1)
+    return true
+
+  for (var j = 0; j < set[0].length; j++) {
+    if (typeof set[0][j] !== 'string')
+      return true
+  }
+
+  return false
+}
+
+glob.Glob = Glob
+inherits(Glob, EE)
+function Glob (pattern, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = null
+  }
+
+  if (options && options.sync) {
+    if (cb)
+      throw new TypeError('callback provided to sync glob')
+    return new GlobSync(pattern, options)
+  }
+
+  if (!(this instanceof Glob))
+    return new Glob(pattern, options, cb)
+
+  setopts(this, pattern, options)
+  this._didRealPath = false
+
+  // process each pattern in the minimatch set
+  var n = this.minimatch.set.length
+
+  // The matches are stored as {<filename>: true,...} so that
+  // duplicates are automagically pruned.
+  // Later, we do an Object.keys() on these.
+  // Keep them as a list so we can fill in when nonull is set.
+  this.matches = new Array(n)
+
+  if (typeof cb === 'function') {
+    cb = once(cb)
+    this.on('error', cb)
+    this.on('end', function (matches) {
+      cb(null, matches)
+    })
+  }
+
+  var self = this
+  var n = this.minimatch.set.length
+  this._processing = 0
+  this.matches = new Array(n)
+
+  this._emitQueue = []
+  this._processQueue = []
+  this.paused = false
+
+  if (this.noprocess)
+    return this
+
+  if (n === 0)
+    return done()
+
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false, done)
+  }
+
+  function done () {
+    --self._processing
+    if (self._processing <= 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._finish = function () {
+  assert(this instanceof Glob)
+  if (this.aborted)
+    return
+
+  if (this.realpath && !this._didRealpath)
+    return this._realpath()
+
+  common.finish(this)
+  this.emit('end', this.found)
+}
+
+Glob.prototype._realpath = function () {
+  if (this._didRealpath)
+    return
+
+  this._didRealpath = true
+
+  var n = this.matches.length
+  if (n === 0)
+    return this._finish()
+
+  var self = this
+  for (var i = 0; i < this.matches.length; i++)
+    this._realpathSet(i, next)
+
+  function next () {
+    if (--n === 0)
+      self._finish()
+  }
+}
+
+Glob.prototype._realpathSet = function (index, cb) {
+  var matchset = this.matches[index]
+  if (!matchset)
+    return cb()
+
+  var found = Object.keys(matchset)
+  var self = this
+  var n = found.length
+
+  if (n === 0)
+    return cb()
+
+  var set = this.matches[index] = Object.create(null)
+  found.forEach(function (p, i) {
+    // If there's a problem with the stat, then it means that
+    // one or more of the links in the realpath couldn't be
+    // resolved.  just return the abs value in that case.
+    p = self._makeAbs(p)
+    fs.realpath(p, self.realpathCache, function (er, real) {
+      if (!er)
+        set[real] = true
+      else if (er.syscall === 'stat')
+        set[p] = true
+      else
+        self.emit('error', er) // srsly wtf right here
+
+      if (--n === 0) {
+        self.matches[index] = set
+        cb()
+      }
+    })
+  })
+}
+
+Glob.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+Glob.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
+
+Glob.prototype.abort = function () {
+  this.aborted = true
+  this.emit('abort')
+}
+
+Glob.prototype.pause = function () {
+  if (!this.paused) {
+    this.paused = true
+    this.emit('pause')
+  }
+}
+
+Glob.prototype.resume = function () {
+  if (this.paused) {
+    this.emit('resume')
+    this.paused = false
+    if (this._emitQueue.length) {
+      var eq = this._emitQueue.slice(0)
+      this._emitQueue.length = 0
+      for (var i = 0; i < eq.length; i ++) {
+        var e = eq[i]
+        this._emitMatch(e[0], e[1])
+      }
+    }
+    if (this._processQueue.length) {
+      var pq = this._processQueue.slice(0)
+      this._processQueue.length = 0
+      for (var i = 0; i < pq.length; i ++) {
+        var p = pq[i]
+        this._processing--
+        this._process(p[0], p[1], p[2], p[3])
+      }
+    }
+  }
+}
+
+Glob.prototype._process = function (pattern, index, inGlobStar, cb) {
+  assert(this instanceof Glob)
+  assert(typeof cb === 'function')
+
+  if (this.aborted)
+    return
+
+  this._processing++
+  if (this.paused) {
+    this._processQueue.push([pattern, index, inGlobStar, cb])
+    return
+  }
+
+  //console.error('PROCESS %d', this._processing, pattern)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // see if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index, cb)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip _processing
+  if (childrenIgnored(this, read))
+    return cb()
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar, cb)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar, cb)
+}
+
+Glob.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    return self._processReaddir2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+Glob.prototype._processReaddir2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return cb()
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  //console.error('prd2', prefix, entries, remain[0]._glob, matchedEntries)
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return cb()
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this._emitMatch(index, e)
+    }
+    // This was the last one, and no stats were needed
+    return cb()
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix) {
+      if (prefix !== '/')
+        e = prefix + '/' + e
+      else
+        e = prefix + e
+    }
+    this._process([e].concat(remain), index, inGlobStar, cb)
+  }
+  cb()
+}
+
+Glob.prototype._emitMatch = function (index, e) {
+  if (this.aborted)
+    return
+
+  if (this.matches[index][e])
+    return
+
+  if (isIgnored(this, e))
+    return
+
+  if (this.paused) {
+    this._emitQueue.push([index, e])
+    return
+  }
+
+  var abs = this._makeAbs(e)
+
+  if (this.nodir) {
+    var c = this.cache[abs]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  if (this.mark)
+    e = this._mark(e)
+
+  this.matches[index][e] = true
+
+  var st = this.statCache[abs]
+  if (st)
+    this.emit('stat', e, st)
+
+  this.emit('match', e)
+}
+
+Glob.prototype._readdirInGlobStar = function (abs, cb) {
+  if (this.aborted)
+    return
+
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false, cb)
+
+  var lstatkey = 'lstat\0' + abs
+  var self = this
+  var lstatcb = inflight(lstatkey, lstatcb_)
+
+  if (lstatcb)
+    fs.lstat(abs, lstatcb)
+
+  function lstatcb_ (er, lstat) {
+    if (er)
+      return cb()
+
+    var isSym = lstat.isSymbolicLink()
+    self.symlinks[abs] = isSym
+
+    // If it's not a symlink or a dir, then it's definitely a regular file.
+    // don't bother doing a readdir in that case.
+    if (!isSym && !lstat.isDirectory()) {
+      self.cache[abs] = 'FILE'
+      cb()
+    } else
+      self._readdir(abs, false, cb)
+  }
+}
+
+Glob.prototype._readdir = function (abs, inGlobStar, cb) {
+  if (this.aborted)
+    return
+
+  cb = inflight('readdir\0'+abs+'\0'+inGlobStar, cb)
+  if (!cb)
+    return
+
+  //console.error('RD %j %j', +inGlobStar, abs)
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs, cb)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return cb()
+
+    if (Array.isArray(c))
+      return cb(null, c)
+  }
+
+  var self = this
+  fs.readdir(abs, readdirCb(this, abs, cb))
+}
+
+function readdirCb (self, abs, cb) {
+  return function (er, entries) {
+    if (er)
+      self._readdirError(abs, er, cb)
+    else
+      self._readdirEntries(abs, entries, cb)
+  }
+}
+
+Glob.prototype._readdirEntries = function (abs, entries, cb) {
+  if (this.aborted)
+    return
+
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+  return cb(null, entries)
+}
+
+Glob.prototype._readdirError = function (f, er, cb) {
+  if (this.aborted)
+    return
+
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      this.cache[this._makeAbs(f)] = 'FILE'
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict) {
+        this.emit('error', er)
+        // If the error is handled, then we abort
+        // if not, we threw out of here
+        this.abort()
+      }
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+
+  return cb()
+}
+
+Glob.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar, cb) {
+  var self = this
+  this._readdir(abs, inGlobStar, function (er, entries) {
+    self._processGlobStar2(prefix, read, abs, remain, index, inGlobStar, entries, cb)
+  })
+}
+
+
+Glob.prototype._processGlobStar2 = function (prefix, read, abs, remain, index, inGlobStar, entries, cb) {
+  //console.error('pgs2', prefix, remain[0], entries)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return cb()
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false, cb)
+
+  var isSym = this.symlinks[abs]
+  var len = entries.length
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return cb()
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true, cb)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true, cb)
+  }
+
+  cb()
+}
+
+Glob.prototype._processSimple = function (prefix, index, cb) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var self = this
+  this._stat(prefix, function (er, exists) {
+    self._processSimple2(prefix, index, er, exists, cb)
+  })
+}
+Glob.prototype._processSimple2 = function (prefix, index, er, exists, cb) {
+
+  //console.error('ps2', prefix, exists)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return cb()
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this._emitMatch(index, prefix)
+  cb()
+}
+
+// Returns either 'DIR', 'FILE', or false
+Glob.prototype._stat = function (f, cb) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return cb()
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return cb(null, c)
+
+    if (needDir && c === 'FILE')
+      return cb()
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (stat !== undefined) {
+    if (stat === false)
+      return cb(null, stat)
+    else {
+      var type = stat.isDirectory() ? 'DIR' : 'FILE'
+      if (needDir && type === 'FILE')
+        return cb()
+      else
+        return cb(null, type, stat)
+    }
+  }
+
+  var self = this
+  var statcb = inflight('stat\0' + abs, lstatcb_)
+  if (statcb)
+    fs.lstat(abs, statcb)
+
+  function lstatcb_ (er, lstat) {
+    if (lstat && lstat.isSymbolicLink()) {
+      // If it's a symlink, then treat it as the target, unless
+      // the target does not exist, then treat it as a file.
+      return fs.stat(abs, function (er, stat) {
+        if (er)
+          self._stat2(f, abs, null, lstat, cb)
+        else
+          self._stat2(f, abs, er, stat, cb)
+      })
+    } else {
+      self._stat2(f, abs, er, lstat, cb)
+    }
+  }
+}
+
+Glob.prototype._stat2 = function (f, abs, er, stat, cb) {
+  if (er) {
+    this.statCache[abs] = false
+    return cb()
+  }
+
+  var needDir = f.slice(-1) === '/'
+  this.statCache[abs] = stat
+
+  if (abs.slice(-1) === '/' && !stat.isDirectory())
+    return cb(null, false, stat)
+
+  var c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c !== 'DIR')
+    return cb()
+
+  return cb(null, c, stat)
+}
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js b/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js
new file mode 100644 (file)
index 0000000..19f103f
--- /dev/null
@@ -0,0 +1,20 @@
+'use strict';
+
+function posix(path) {
+       return path.charAt(0) === '/';
+};
+
+function win32(path) {
+       // https://github.com/joyent/node/blob/b3fcc245fb25539909ef1d5eaa01dbf92e168633/lib/path.js#L56
+       var splitDeviceRe = /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?([\\\/])?([\s\S]*?)$/;
+       var result = splitDeviceRe.exec(path);
+       var device = result[1] || '';
+       var isUnc = !!device && device.charAt(1) !== ':';
+
+       // UNC paths are always absolute
+       return !!result[2] || isUnc;
+};
+
+module.exports = process.platform === 'win32' ? win32 : posix;
+module.exports.posix = posix;
+module.exports.win32 = win32;
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/license b/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/license
new file mode 100644 (file)
index 0000000..654d0bf
--- /dev/null
@@ -0,0 +1,21 @@
+The MIT License (MIT)
+
+Copyright (c) Sindre Sorhus <sindresorhus@gmail.com> (sindresorhus.com)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in
+all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
+THE SOFTWARE.
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json b/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json
new file mode 100644 (file)
index 0000000..3937263
--- /dev/null
@@ -0,0 +1,70 @@
+{
+  "name": "path-is-absolute",
+  "version": "1.0.0",
+  "description": "Node.js 0.12 path.isAbsolute() ponyfill",
+  "license": "MIT",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/sindresorhus/path-is-absolute.git"
+  },
+  "author": {
+    "name": "Sindre Sorhus",
+    "email": "sindresorhus@gmail.com",
+    "url": "sindresorhus.com"
+  },
+  "engines": {
+    "node": ">=0.10.0"
+  },
+  "scripts": {
+    "test": "node test.js"
+  },
+  "files": [
+    "index.js"
+  ],
+  "keywords": [
+    "path",
+    "paths",
+    "file",
+    "dir",
+    "absolute",
+    "isabsolute",
+    "is-absolute",
+    "built-in",
+    "util",
+    "utils",
+    "core",
+    "ponyfill",
+    "polyfill",
+    "shim",
+    "is",
+    "detect",
+    "check"
+  ],
+  "gitHead": "7a76a0c9f2263192beedbe0a820e4d0baee5b7a1",
+  "bugs": {
+    "url": "https://github.com/sindresorhus/path-is-absolute/issues"
+  },
+  "homepage": "https://github.com/sindresorhus/path-is-absolute",
+  "_id": "path-is-absolute@1.0.0",
+  "_shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+  "_from": "path-is-absolute@>=1.0.0 <2.0.0",
+  "_npmVersion": "2.5.1",
+  "_nodeVersion": "0.12.0",
+  "_npmUser": {
+    "name": "sindresorhus",
+    "email": "sindresorhus@gmail.com"
+  },
+  "maintainers": [
+    {
+      "name": "sindresorhus",
+      "email": "sindresorhus@gmail.com"
+    }
+  ],
+  "dist": {
+    "shasum": "263dada66ab3f2fb10bf7f9d24dd8f3e570ef912",
+    "tarball": "http://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz"
+  },
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz",
+  "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md b/deps/npm/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md
new file mode 100644 (file)
index 0000000..cdf94f4
--- /dev/null
@@ -0,0 +1,51 @@
+# path-is-absolute [![Build Status](https://travis-ci.org/sindresorhus/path-is-absolute.svg?branch=master)](https://travis-ci.org/sindresorhus/path-is-absolute)
+
+> Node.js 0.12 [`path.isAbsolute()`](http://nodejs.org/api/path.html#path_path_isabsolute_path) ponyfill
+
+> Ponyfill: A polyfill that doesn't overwrite the native method
+
+
+## Install
+
+```
+$ npm install --save path-is-absolute
+```
+
+
+## Usage
+
+```js
+var pathIsAbsolute = require('path-is-absolute');
+
+// Linux
+pathIsAbsolute('/home/foo');
+//=> true
+
+// Windows
+pathIsAbsolute('C:/Users/');
+//=> true
+
+// Any OS
+pathIsAbsolute.posix('/home/foo');
+//=> true
+```
+
+
+## API
+
+See the [`path.isAbsolute()` docs](http://nodejs.org/api/path.html#path_path_isabsolute_path).
+
+### pathIsAbsolute(path)
+
+### pathIsAbsolute.posix(path)
+
+The Posix specific version.
+
+### pathIsAbsolute.win32(path)
+
+The Windows specific version.
+
+
+## License
+
+MIT © [Sindre Sorhus](http://sindresorhus.com)
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/package.json b/deps/npm/node_modules/rimraf/node_modules/glob/package.json
new file mode 100644 (file)
index 0000000..54709b6
--- /dev/null
@@ -0,0 +1,73 @@
+{
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "name": "glob",
+  "description": "a little globber",
+  "version": "6.0.4",
+  "repository": {
+    "type": "git",
+    "url": "git://github.com/isaacs/node-glob.git"
+  },
+  "main": "glob.js",
+  "files": [
+    "glob.js",
+    "sync.js",
+    "common.js"
+  ],
+  "engines": {
+    "node": "*"
+  },
+  "dependencies": {
+    "inflight": "^1.0.4",
+    "inherits": "2",
+    "minimatch": "2 || 3",
+    "once": "^1.3.0",
+    "path-is-absolute": "^1.0.0"
+  },
+  "devDependencies": {
+    "mkdirp": "0",
+    "rimraf": "^2.2.8",
+    "tap": "^5.0.0",
+    "tick": "0.0.6"
+  },
+  "scripts": {
+    "prepublish": "npm run benchclean",
+    "profclean": "rm -f v8.log profile.txt",
+    "test": "tap test/*.js --cov",
+    "test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js",
+    "bench": "bash benchmark.sh",
+    "prof": "bash prof.sh && cat profile.txt",
+    "benchclean": "node benchclean.js"
+  },
+  "license": "ISC",
+  "gitHead": "3bd419c538737e56fda7e21c21ff52ca0c198df6",
+  "bugs": {
+    "url": "https://github.com/isaacs/node-glob/issues"
+  },
+  "homepage": "https://github.com/isaacs/node-glob#readme",
+  "_id": "glob@6.0.4",
+  "_shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+  "_from": "glob@>=6.0.1 <7.0.0",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "dist": {
+    "shasum": "0f08860f6a155127b2fadd4f9ce24b1aab6e4d22",
+    "tarball": "http://registry.npmjs.org/glob/-/glob-6.0.4.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz",
+  "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/rimraf/node_modules/glob/sync.js b/deps/npm/node_modules/rimraf/node_modules/glob/sync.js
new file mode 100644 (file)
index 0000000..09883d2
--- /dev/null
@@ -0,0 +1,460 @@
+module.exports = globSync
+globSync.GlobSync = GlobSync
+
+var fs = require('fs')
+var minimatch = require('minimatch')
+var Minimatch = minimatch.Minimatch
+var Glob = require('./glob.js').Glob
+var util = require('util')
+var path = require('path')
+var assert = require('assert')
+var isAbsolute = require('path-is-absolute')
+var common = require('./common.js')
+var alphasort = common.alphasort
+var alphasorti = common.alphasorti
+var setopts = common.setopts
+var ownProp = common.ownProp
+var childrenIgnored = common.childrenIgnored
+
+function globSync (pattern, options) {
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  return new GlobSync(pattern, options).found
+}
+
+function GlobSync (pattern, options) {
+  if (!pattern)
+    throw new Error('must provide pattern')
+
+  if (typeof options === 'function' || arguments.length === 3)
+    throw new TypeError('callback provided to sync glob\n'+
+                        'See: https://github.com/isaacs/node-glob/issues/167')
+
+  if (!(this instanceof GlobSync))
+    return new GlobSync(pattern, options)
+
+  setopts(this, pattern, options)
+
+  if (this.noprocess)
+    return this
+
+  var n = this.minimatch.set.length
+  this.matches = new Array(n)
+  for (var i = 0; i < n; i ++) {
+    this._process(this.minimatch.set[i], i, false)
+  }
+  this._finish()
+}
+
+GlobSync.prototype._finish = function () {
+  assert(this instanceof GlobSync)
+  if (this.realpath) {
+    var self = this
+    this.matches.forEach(function (matchset, index) {
+      var set = self.matches[index] = Object.create(null)
+      for (var p in matchset) {
+        try {
+          p = self._makeAbs(p)
+          var real = fs.realpathSync(p, self.realpathCache)
+          set[real] = true
+        } catch (er) {
+          if (er.syscall === 'stat')
+            set[self._makeAbs(p)] = true
+          else
+            throw er
+        }
+      }
+    })
+  }
+  common.finish(this)
+}
+
+
+GlobSync.prototype._process = function (pattern, index, inGlobStar) {
+  assert(this instanceof GlobSync)
+
+  // Get the first [n] parts of pattern that are all strings.
+  var n = 0
+  while (typeof pattern[n] === 'string') {
+    n ++
+  }
+  // now n is the index of the first one that is *not* a string.
+
+  // See if there's anything else
+  var prefix
+  switch (n) {
+    // if not, then this is rather simple
+    case pattern.length:
+      this._processSimple(pattern.join('/'), index)
+      return
+
+    case 0:
+      // pattern *starts* with some non-trivial item.
+      // going to readdir(cwd), but not include the prefix in matches.
+      prefix = null
+      break
+
+    default:
+      // pattern has some string bits in the front.
+      // whatever it starts with, whether that's 'absolute' like /foo/bar,
+      // or 'relative' like '../baz'
+      prefix = pattern.slice(0, n).join('/')
+      break
+  }
+
+  var remain = pattern.slice(n)
+
+  // get the list of entries.
+  var read
+  if (prefix === null)
+    read = '.'
+  else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
+    if (!prefix || !isAbsolute(prefix))
+      prefix = '/' + prefix
+    read = prefix
+  } else
+    read = prefix
+
+  var abs = this._makeAbs(read)
+
+  //if ignored, skip processing
+  if (childrenIgnored(this, read))
+    return
+
+  var isGlobStar = remain[0] === minimatch.GLOBSTAR
+  if (isGlobStar)
+    this._processGlobStar(prefix, read, abs, remain, index, inGlobStar)
+  else
+    this._processReaddir(prefix, read, abs, remain, index, inGlobStar)
+}
+
+
+GlobSync.prototype._processReaddir = function (prefix, read, abs, remain, index, inGlobStar) {
+  var entries = this._readdir(abs, inGlobStar)
+
+  // if the abs isn't a dir, then nothing can match!
+  if (!entries)
+    return
+
+  // It will only match dot entries if it starts with a dot, or if
+  // dot is set.  Stuff like @(.foo|.bar) isn't allowed.
+  var pn = remain[0]
+  var negate = !!this.minimatch.negate
+  var rawGlob = pn._glob
+  var dotOk = this.dot || rawGlob.charAt(0) === '.'
+
+  var matchedEntries = []
+  for (var i = 0; i < entries.length; i++) {
+    var e = entries[i]
+    if (e.charAt(0) !== '.' || dotOk) {
+      var m
+      if (negate && !prefix) {
+        m = !e.match(pn)
+      } else {
+        m = e.match(pn)
+      }
+      if (m)
+        matchedEntries.push(e)
+    }
+  }
+
+  var len = matchedEntries.length
+  // If there are no matched entries, then nothing matches.
+  if (len === 0)
+    return
+
+  // if this is the last remaining pattern bit, then no need for
+  // an additional stat *unless* the user has specified mark or
+  // stat explicitly.  We know they exist, since readdir returned
+  // them.
+
+  if (remain.length === 1 && !this.mark && !this.stat) {
+    if (!this.matches[index])
+      this.matches[index] = Object.create(null)
+
+    for (var i = 0; i < len; i ++) {
+      var e = matchedEntries[i]
+      if (prefix) {
+        if (prefix.slice(-1) !== '/')
+          e = prefix + '/' + e
+        else
+          e = prefix + e
+      }
+
+      if (e.charAt(0) === '/' && !this.nomount) {
+        e = path.join(this.root, e)
+      }
+      this.matches[index][e] = true
+    }
+    // This was the last one, and no stats were needed
+    return
+  }
+
+  // now test all matched entries as stand-ins for that part
+  // of the pattern.
+  remain.shift()
+  for (var i = 0; i < len; i ++) {
+    var e = matchedEntries[i]
+    var newPattern
+    if (prefix)
+      newPattern = [prefix, e]
+    else
+      newPattern = [e]
+    this._process(newPattern.concat(remain), index, inGlobStar)
+  }
+}
+
+
+GlobSync.prototype._emitMatch = function (index, e) {
+  var abs = this._makeAbs(e)
+  if (this.mark)
+    e = this._mark(e)
+
+  if (this.matches[index][e])
+    return
+
+  if (this.nodir) {
+    var c = this.cache[this._makeAbs(e)]
+    if (c === 'DIR' || Array.isArray(c))
+      return
+  }
+
+  this.matches[index][e] = true
+  if (this.stat)
+    this._stat(e)
+}
+
+
+GlobSync.prototype._readdirInGlobStar = function (abs) {
+  // follow all symlinked directories forever
+  // just proceed as if this is a non-globstar situation
+  if (this.follow)
+    return this._readdir(abs, false)
+
+  var entries
+  var lstat
+  var stat
+  try {
+    lstat = fs.lstatSync(abs)
+  } catch (er) {
+    // lstat failed, doesn't exist
+    return null
+  }
+
+  var isSym = lstat.isSymbolicLink()
+  this.symlinks[abs] = isSym
+
+  // If it's not a symlink or a dir, then it's definitely a regular file.
+  // don't bother doing a readdir in that case.
+  if (!isSym && !lstat.isDirectory())
+    this.cache[abs] = 'FILE'
+  else
+    entries = this._readdir(abs, false)
+
+  return entries
+}
+
+GlobSync.prototype._readdir = function (abs, inGlobStar) {
+  var entries
+
+  if (inGlobStar && !ownProp(this.symlinks, abs))
+    return this._readdirInGlobStar(abs)
+
+  if (ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+    if (!c || c === 'FILE')
+      return null
+
+    if (Array.isArray(c))
+      return c
+  }
+
+  try {
+    return this._readdirEntries(abs, fs.readdirSync(abs))
+  } catch (er) {
+    this._readdirError(abs, er)
+    return null
+  }
+}
+
+GlobSync.prototype._readdirEntries = function (abs, entries) {
+  // if we haven't asked to stat everything, then just
+  // assume that everything in there exists, so we can avoid
+  // having to stat it a second time.
+  if (!this.mark && !this.stat) {
+    for (var i = 0; i < entries.length; i ++) {
+      var e = entries[i]
+      if (abs === '/')
+        e = abs + e
+      else
+        e = abs + '/' + e
+      this.cache[e] = true
+    }
+  }
+
+  this.cache[abs] = entries
+
+  // mark and cache dir-ness
+  return entries
+}
+
+GlobSync.prototype._readdirError = function (f, er) {
+  // handle errors, and cache the information
+  switch (er.code) {
+    case 'ENOTSUP': // https://github.com/isaacs/node-glob/issues/205
+    case 'ENOTDIR': // totally normal. means it *does* exist.
+      this.cache[this._makeAbs(f)] = 'FILE'
+      break
+
+    case 'ENOENT': // not terribly unusual
+    case 'ELOOP':
+    case 'ENAMETOOLONG':
+    case 'UNKNOWN':
+      this.cache[this._makeAbs(f)] = false
+      break
+
+    default: // some unusual error.  Treat as failure.
+      this.cache[this._makeAbs(f)] = false
+      if (this.strict)
+        throw er
+      if (!this.silent)
+        console.error('glob error', er)
+      break
+  }
+}
+
+GlobSync.prototype._processGlobStar = function (prefix, read, abs, remain, index, inGlobStar) {
+
+  var entries = this._readdir(abs, inGlobStar)
+
+  // no entries means not a dir, so it can never have matches
+  // foo.txt/** doesn't match foo.txt
+  if (!entries)
+    return
+
+  // test without the globstar, and with every child both below
+  // and replacing the globstar.
+  var remainWithoutGlobStar = remain.slice(1)
+  var gspref = prefix ? [ prefix ] : []
+  var noGlobStar = gspref.concat(remainWithoutGlobStar)
+
+  // the noGlobStar pattern exits the inGlobStar state
+  this._process(noGlobStar, index, false)
+
+  var len = entries.length
+  var isSym = this.symlinks[abs]
+
+  // If it's a symlink, and we're in a globstar, then stop
+  if (isSym && inGlobStar)
+    return
+
+  for (var i = 0; i < len; i++) {
+    var e = entries[i]
+    if (e.charAt(0) === '.' && !this.dot)
+      continue
+
+    // these two cases enter the inGlobStar state
+    var instead = gspref.concat(entries[i], remainWithoutGlobStar)
+    this._process(instead, index, true)
+
+    var below = gspref.concat(entries[i], remain)
+    this._process(below, index, true)
+  }
+}
+
+GlobSync.prototype._processSimple = function (prefix, index) {
+  // XXX review this.  Shouldn't it be doing the mounting etc
+  // before doing stat?  kinda weird?
+  var exists = this._stat(prefix)
+
+  if (!this.matches[index])
+    this.matches[index] = Object.create(null)
+
+  // If it doesn't exist, then just mark the lack of results
+  if (!exists)
+    return
+
+  if (prefix && isAbsolute(prefix) && !this.nomount) {
+    var trail = /[\/\\]$/.test(prefix)
+    if (prefix.charAt(0) === '/') {
+      prefix = path.join(this.root, prefix)
+    } else {
+      prefix = path.resolve(this.root, prefix)
+      if (trail)
+        prefix += '/'
+    }
+  }
+
+  if (process.platform === 'win32')
+    prefix = prefix.replace(/\\/g, '/')
+
+  // Mark this as a match
+  this.matches[index][prefix] = true
+}
+
+// Returns either 'DIR', 'FILE', or false
+GlobSync.prototype._stat = function (f) {
+  var abs = this._makeAbs(f)
+  var needDir = f.slice(-1) === '/'
+
+  if (f.length > this.maxLength)
+    return false
+
+  if (!this.stat && ownProp(this.cache, abs)) {
+    var c = this.cache[abs]
+
+    if (Array.isArray(c))
+      c = 'DIR'
+
+    // It exists, but maybe not how we need it
+    if (!needDir || c === 'DIR')
+      return c
+
+    if (needDir && c === 'FILE')
+      return false
+
+    // otherwise we have to stat, because maybe c=true
+    // if we know it exists, but not what it is.
+  }
+
+  var exists
+  var stat = this.statCache[abs]
+  if (!stat) {
+    var lstat
+    try {
+      lstat = fs.lstatSync(abs)
+    } catch (er) {
+      return false
+    }
+
+    if (lstat.isSymbolicLink()) {
+      try {
+        stat = fs.statSync(abs)
+      } catch (er) {
+        stat = lstat
+      }
+    } else {
+      stat = lstat
+    }
+  }
+
+  this.statCache[abs] = stat
+
+  var c = stat.isDirectory() ? 'DIR' : 'FILE'
+  this.cache[abs] = this.cache[abs] || c
+
+  if (needDir && c !== 'DIR')
+    return false
+
+  return c
+}
+
+GlobSync.prototype._mark = function (p) {
+  return common.mark(this, p)
+}
+
+GlobSync.prototype._makeAbs = function (f) {
+  return common.makeAbs(this, f)
+}
index d06b57d..1140ff8 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "rimraf",
-  "version": "2.4.4",
+  "version": "2.5.1",
   "main": "rimraf.js",
   "description": "A deep deletion module for node (like `rm -rf`)",
   "author": {
@@ -20,7 +20,7 @@
     "rimraf": "./bin.js"
   },
   "dependencies": {
-    "glob": "^5.0.14"
+    "glob": "^6.0.1"
   },
   "files": [
     "LICENSE",
   ],
   "devDependencies": {
     "mkdirp": "^0.5.1",
-    "tap": "^1.3.1"
+    "tap": "^5.1.1"
   },
-  "readme": "[![Build Status](https://travis-ci.org/isaacs/rimraf.svg?branch=master)](https://travis-ci.org/isaacs/rimraf) [![Dependency Status](https://david-dm.org/isaacs/rimraf.svg)](https://david-dm.org/isaacs/rimraf) [![devDependency Status](https://david-dm.org/isaacs/rimraf/dev-status.svg)](https://david-dm.org/isaacs/rimraf#info=devDependencies)\n\nThe [UNIX command](http://en.wikipedia.org/wiki/Rm_(Unix)) `rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, [opts], callback)`\n\nThe first parameter will be interpreted as a globbing pattern for files. If you\nwant to disable globbing you can do so with `opts.disableGlob` (defaults to\n`false`). This might be handy, for instance, if you have filenames that contain\nglobbing wildcard characters.\n\nThe callback will be called with an error if there is one.  Certain\nerrors are handled for you:\n\n* Windows: `EBUSY` and `ENOTEMPTY` - rimraf will back off a maximum of\n  `opts.maxBusyTries` times before giving up, adding 100ms of wait\n  between each attempt.  The default `maxBusyTries` is 3.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n  successfully, since your desired outcome is already the case.\n* `EMFILE` - Since `readdir` requires opening a file descriptor, it's\n  possible to hit `EMFILE` if too many file descriptors are in use.\n  In the sync case, there's nothing to be done for this.  But in the\n  async case, rimraf will gradually back off with timeouts up to\n  `opts.emfileWait` ms, which defaults to 1000.\n\n## rimraf.sync\n\nIt can remove stuff synchronously, too.  But that's not so good.  Use\nthe async API.  It's better.\n\n## CLI\n\nIf installed with `npm install rimraf -g` it can be used as a global\ncommand `rimraf <path> [<path> ...]` which is useful for cross platform support.\n\n## mkdirp\n\nIf you need to create a directory recursively, check out\n[mkdirp](https://github.com/substack/node-mkdirp).\n",
-  "readmeFilename": "README.md",
+  "gitHead": "979f7a3aa061d2262f9e1b41c6e4afd66c71d1d5",
   "bugs": {
     "url": "https://github.com/isaacs/rimraf/issues"
   },
   "homepage": "https://github.com/isaacs/rimraf#readme",
-  "_id": "rimraf@2.4.4",
-  "_shasum": "b528ce2ebe0e6d89fb03b265de11d61da0dbcf82",
-  "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.4.4.tgz",
-  "_from": "rimraf@>=2.4.4 <2.5.0"
+  "_id": "rimraf@2.5.1",
+  "_shasum": "52e1e946f3f9b9b0d5d8988ba3191aaf2a2dbd43",
+  "_from": "rimraf@2.5.1",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "dist": {
+    "shasum": "52e1e946f3f9b9b0d5d8988ba3191aaf2a2dbd43",
+    "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.5.1.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "directories": {},
+  "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.1.tgz",
+  "readme": "ERROR: No README data found!"
 }
index 7771b53..c01d13b 100644 (file)
@@ -6,10 +6,8 @@ var path = require("path")
 var fs = require("fs")
 var glob = require("glob")
 
-var globOpts = {
+var defaultGlobOpts = {
   nosort: true,
-  nocomment: true,
-  nonegate: true,
   silent: true
 }
 
@@ -35,7 +33,11 @@ function defaults (options) {
 
   options.maxBusyTries = options.maxBusyTries || 3
   options.emfileWait = options.emfileWait || 1000
+  if (options.glob === false) {
+    options.disableGlob = true
+  }
   options.disableGlob = options.disableGlob || false
+  options.glob = options.glob || defaultGlobOpts
 }
 
 function rimraf (p, options, cb) {
@@ -63,7 +65,7 @@ function rimraf (p, options, cb) {
     if (!er)
       return afterGlob(null, [p])
 
-    glob(p, globOpts, afterGlob)
+    glob(p, options.glob, afterGlob)
   })
 
   function next (er) {
@@ -270,7 +272,7 @@ function rimrafSync (p, options) {
       fs.lstatSync(p)
       results = [p]
     } catch (er) {
-      results = glob.sync(p, globOpts)
+      results = glob.sync(p, options.glob)
     }
   }
 
index 7e10134..abc55f6 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "spdx-license-ids",
-  "version": "1.1.0",
+  "version": "1.2.0",
   "description": "A list of SPDX license identifiers",
   "repository": {
     "type": "git",
     "stringify-object": "^2.2.0",
     "tape": "^4.0.0"
   },
-  "gitHead": "769b83e3335426bd45f70b58b194b79e1d6c0583",
+  "gitHead": "f74a7a16ca05540e0e97f1bbb61da07829b5d9ab",
   "bugs": {
     "url": "https://github.com/shinnn/spdx-license-ids/issues"
   },
   "homepage": "https://github.com/shinnn/spdx-license-ids#readme",
-  "_id": "spdx-license-ids@1.1.0",
-  "_shasum": "28694acdf39fe27de45143fff81f21f6c66d44ac",
-  "_from": "spdx-license-ids@1.1.0",
-  "_npmVersion": "3.3.8",
-  "_nodeVersion": "4.2.1",
+  "_id": "spdx-license-ids@1.2.0",
+  "_shasum": "b549dd0f63dcb745a17e2ea3a07402e0e332d1e2",
+  "_from": "spdx-license-ids@1.2.0",
+  "_npmVersion": "3.5.2",
+  "_nodeVersion": "5.4.0",
   "_npmUser": {
     "name": "shinnn",
     "email": "snnskwtnb@gmail.com"
   },
+  "dist": {
+    "shasum": "b549dd0f63dcb745a17e2ea3a07402e0e332d1e2",
+    "tarball": "http://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.0.tgz"
+  },
   "maintainers": [
     {
       "name": "shinnn",
       "email": "snnskwtnb@gmail.com"
     }
   ],
-  "dist": {
-    "shasum": "28694acdf39fe27de45143fff81f21f6c66d44ac",
-    "tarball": "http://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.1.0.tgz"
-  },
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.1.0.tgz",
+  "_resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-1.2.0.tgz",
   "readme": "ERROR: No README data found!"
 }
index 6aa3ec4..8d23a65 100644 (file)
   "CrystalStacker",
   "CUA-OPL-1.0",
   "Cube",
+  "curl",
   "D-FSL-1.0",
   "diffmark",
   "WTFPL",
   "iMatix",
   "Imlib2",
   "IJG",
+  "Info-ZIP",
   "Intel-ACPI",
   "Intel",
   "Interbase-1.0",
   "ISC",
   "JasPer-2.0",
   "JSON",
-  "LPPL-1.3a",
   "LPPL-1.0",
   "LPPL-1.1",
   "LPPL-1.2",
+  "LPPL-1.3a",
   "LPPL-1.3c",
   "Latex2e",
   "BSD-3-Clause-LBNL",
   "OCLC-2.0",
   "ODbL-1.0",
   "PDDL-1.0",
+  "OCCT-PL",
   "OGTSL",
   "OLDAP-2.2.2",
   "OLDAP-1.1",
   "zlib-acknowledgement",
   "ZPL-1.1",
   "ZPL-2.0",
-  "ZPL-2.1"
+  "ZPL-2.1",
+  "eCos-2.0",
+  "GPL-2.0-with-autoconf-exception",
+  "GPL-2.0-with-bison-exception",
+  "GPL-2.0-with-classpath-exception",
+  "GPL-2.0-with-font-exception",
+  "GPL-2.0-with-GCC-exception",
+  "GPL-3.0-with-autoconf-exception",
+  "GPL-3.0-with-GCC-exception",
+  "StandardML-NJ",
+  "WXwindows"
 ]
diff --git a/deps/npm/node_modules/which/.npmignore b/deps/npm/node_modules/which/.npmignore
new file mode 100644 (file)
index 0000000..0ac606f
--- /dev/null
@@ -0,0 +1,3 @@
+.nyc_output/
+coverage/
+node_modules/
index 3d6b920..7f679d5 100644 (file)
@@ -29,6 +29,14 @@ which('node', { path: someOtherPath }, function (er, resolved) {
 })
 ```
 
+## CLI USAGE
+
+Same as the BSD `which(1)` binary.
+
+```
+usage: which [-as] program ...
+```
+
 ## OPTIONS
 
 You may pass an options object as the second argument.
diff --git a/deps/npm/node_modules/which/node_modules/isexe/.npmignore b/deps/npm/node_modules/which/node_modules/isexe/.npmignore
new file mode 100644 (file)
index 0000000..c1cb757
--- /dev/null
@@ -0,0 +1,2 @@
+.nyc_output/
+coverage/
diff --git a/deps/npm/node_modules/which/node_modules/isexe/README.md b/deps/npm/node_modules/which/node_modules/isexe/README.md
new file mode 100644 (file)
index 0000000..30995ad
--- /dev/null
@@ -0,0 +1,51 @@
+# isexe
+
+Minimal module to check if a file is executable.
+
+Uses `fs.access` if available, and tests against the `PATHEXT`
+environment variable on Windows.
+
+## USAGE
+
+```javascript
+var isexe = require('isexe')
+isexe('some-file-name', function (err, isExe) {
+  if (err) {
+    console.error('probably file does not exist or something', err)
+  } else if (isExe) {
+    console.error('this thing can be run')
+  } else {
+    console.error('cannot be run')
+  }
+})
+
+// same thing but synchronous, throws errors
+var isExe = isexe.sync('some-file-name')
+
+// treat errors as just "not executable"
+isexe('maybe-missing-file', { ignoreErrors: true }, callback)
+var isExe = isexe.sync('maybe-missing-file', { ignoreErrors: true })
+```
+
+## API
+
+### `isexe(path, [options], [callback])`
+
+Check if the path is executable.  If no callback provided, and a
+global `Promise` object is available, then a Promise will be returned.
+
+Will raise whatever errors may be raised by `fs.access` or `fs.stat`,
+unless `options.ignoreErrors` is set to true.
+
+### `isexe.sync(path, [options])`
+
+Same as `isexe` but returns the value and throws any errors raised.
+
+### Options
+
+* `ignoreErrors` Treat all errors as "no, this is not executable", but
+  don't raise them.
+* `uid` Number to use as the user id when using the `mode` approach.
+* `gid` Number to use as the group id when using the `mode` approach.
+* `pathExt` List of path extensions to use instead of `PATHEXT`
+  environment variable on Windows.
diff --git a/deps/npm/node_modules/which/node_modules/isexe/access.js b/deps/npm/node_modules/which/node_modules/isexe/access.js
new file mode 100644 (file)
index 0000000..e67b28b
--- /dev/null
@@ -0,0 +1,15 @@
+module.exports = isexe
+isexe.sync = sync
+
+var fs = require('fs')
+
+function isexe (path, _, cb) {
+  fs.access(path, fs.X_OK, function (er) {
+    cb(er, !er)
+  })
+}
+
+function sync (path, _) {
+  fs.accessSync(path, fs.X_OK)
+  return true
+}
diff --git a/deps/npm/node_modules/which/node_modules/isexe/index.js b/deps/npm/node_modules/which/node_modules/isexe/index.js
new file mode 100644 (file)
index 0000000..ff8ef11
--- /dev/null
@@ -0,0 +1,59 @@
+var fs = require('fs')
+var core
+if (process.platform === 'win32' || global.TESTING_WINDOWS) {
+  core = require('./windows.js')
+} else if (typeof fs.access === 'function') {
+  core = require('./access.js')
+} else {
+  core = require('./mode.js')
+}
+
+module.exports = isexe
+isexe.sync = sync
+
+function isexe (path, options, cb) {
+  if (typeof options === 'function') {
+    cb = options
+    options = {}
+  }
+
+  if (!cb) {
+    if (typeof Promise !== 'function') {
+      throw new TypeError('callback not provided')
+    }
+
+    return new Promise(function (resolve, reject) {
+      isexe(path, options || {}, function (er, is) {
+        if (er) {
+          reject(er)
+        } else {
+          resolve(is)
+        }
+      })
+    })
+  }
+
+  core(path, options || {}, function (er, is) {
+    // ignore EACCES because that just means we aren't allowed to run it
+    if (er) {
+      if (er.code === 'EACCES' || options && options.ignoreErrors) {
+        er = null
+        is = false
+      }
+    }
+    cb(er, is)
+  })
+}
+
+function sync (path, options) {
+  // my kingdom for a filtered catch
+  try {
+    return core.sync(path, options || {})
+  } catch (er) {
+    if (options && options.ignoreErrors || er.code === 'EACCES') {
+      return false
+    } else {
+      throw er
+    }
+  }
+}
diff --git a/deps/npm/node_modules/which/node_modules/isexe/mode.js b/deps/npm/node_modules/which/node_modules/isexe/mode.js
new file mode 100644 (file)
index 0000000..2044280
--- /dev/null
@@ -0,0 +1,37 @@
+module.exports = isexe
+isexe.sync = sync
+
+var fs = require('fs')
+
+function isexe (path, options, cb) {
+  fs.stat(path, function (er, st) {
+    cb(er, er ? false : checkMode(st, options))
+  })
+}
+
+function sync (path, options) {
+  return checkMode(fs.statSync(path), options)
+}
+
+function checkMode (stat, options) {
+  var mod = stat.mode
+  var uid = stat.uid
+  var gid = stat.gid
+
+  var myUid = options.uid !== undefined ?
+    options.uid : process.getuid && process.getuid()
+  var myGid = options.gid !== undefined ?
+    options.gid : process.getgid && process.getgid()
+
+  var u = parseInt('100', 8)
+  var g = parseInt('010', 8)
+  var o = parseInt('001', 8)
+  var ug = u | g
+
+  var ret = (mod & o) ||
+    (mod & g) && gid === myGid ||
+    (mod & u) && uid === myUid ||
+    (mod & ug) && myUid === 0
+
+  return ret
+}
diff --git a/deps/npm/node_modules/which/node_modules/isexe/package.json b/deps/npm/node_modules/which/node_modules/isexe/package.json
new file mode 100644 (file)
index 0000000..f5adcb6
--- /dev/null
@@ -0,0 +1,54 @@
+{
+  "name": "isexe",
+  "version": "1.1.1",
+  "description": "Minimal module to check if a file is executable.",
+  "main": "index.js",
+  "directories": {
+    "test": "test"
+  },
+  "devDependencies": {
+    "mkdirp": "^0.5.1",
+    "rimraf": "^2.5.0",
+    "tap": "^5.1.2"
+  },
+  "scripts": {
+    "test": "tap test/*.js --branches=100 --statements=100 --functions=100 --lines=100"
+  },
+  "author": {
+    "name": "Isaac Z. Schlueter",
+    "email": "i@izs.me",
+    "url": "http://blog.izs.me/"
+  },
+  "license": "ISC",
+  "repository": {
+    "type": "git",
+    "url": "git+https://github.com/isaacs/isexe.git"
+  },
+  "keywords": [],
+  "bugs": {
+    "url": "https://github.com/isaacs/isexe/issues"
+  },
+  "homepage": "https://github.com/isaacs/isexe#readme",
+  "gitHead": "af83031caed58654ad9d20b98eb710d383618ad7",
+  "_id": "isexe@1.1.1",
+  "_shasum": "f0d4793ed2fb5c46bfdeab760bbb965f4485a66c",
+  "_from": "isexe@>=1.1.1 <2.0.0",
+  "_npmVersion": "2.14.15",
+  "_nodeVersion": "4.0.0",
+  "_npmUser": {
+    "name": "isaacs",
+    "email": "i@izs.me"
+  },
+  "dist": {
+    "shasum": "f0d4793ed2fb5c46bfdeab760bbb965f4485a66c",
+    "tarball": "http://registry.npmjs.org/isexe/-/isexe-1.1.1.tgz"
+  },
+  "maintainers": [
+    {
+      "name": "isaacs",
+      "email": "i@izs.me"
+    }
+  ],
+  "_resolved": "https://registry.npmjs.org/isexe/-/isexe-1.1.1.tgz",
+  "readme": "ERROR: No README data found!"
+}
diff --git a/deps/npm/node_modules/which/node_modules/isexe/test/basic.js b/deps/npm/node_modules/which/node_modules/isexe/test/basic.js
new file mode 100644 (file)
index 0000000..969fc9a
--- /dev/null
@@ -0,0 +1,211 @@
+var t = require('tap')
+var fs = require('fs')
+var path = require('path')
+var fixture = path.resolve(__dirname, 'fixtures')
+var meow = fixture + '/meow.cat'
+var mine = fixture + '/mine.cat'
+var ours = fixture + '/ours.cat'
+var fail = fixture + '/fail.false'
+var noent = fixture + '/enoent.exe'
+var mkdirp = require('mkdirp')
+var rimraf = require('rimraf')
+
+var isWindows = process.platform === 'win32'
+var hasAccess = typeof fs.access === 'function'
+var winSkip = isWindows && 'windows'
+var accessSkip = !hasAccess && 'no fs.access function'
+var hasPromise = typeof Promise === 'function'
+var promiseSkip = !hasPromise && 'no global Promise'
+
+function reset () {
+  delete require.cache[require.resolve('../')]
+  return require('../')
+}
+
+t.test('setup fixtures', function (t) {
+  rimraf.sync(fixture)
+  mkdirp.sync(fixture)
+  fs.writeFileSync(meow, '#!/usr/bin/env cat\nmeow\n')
+  fs.chmodSync(meow, parseInt('0755', 8))
+  fs.writeFileSync(fail, '#!/usr/bin/env false\n')
+  fs.chmodSync(fail, parseInt('0644', 8))
+  fs.writeFileSync(mine, '#!/usr/bin/env cat\nmine\n')
+  fs.chmodSync(mine, parseInt('0744', 8))
+  fs.writeFileSync(ours, '#!/usr/bin/env cat\nours\n')
+  fs.chmodSync(ours, parseInt('0754', 8))
+  t.end()
+})
+
+t.test('promise', { skip: promiseSkip }, function (t) {
+  var isexe = reset()
+  t.test('meow async', function (t) {
+    isexe(meow).then(function (is) {
+      t.ok(is)
+      t.end()
+    })
+  })
+  t.test('fail async', function (t) {
+    isexe(fail).then(function (is) {
+      t.notOk(is)
+      t.end()
+    })
+  })
+  t.test('noent async', function (t) {
+    isexe(noent).catch(function (er) {
+      t.ok(er)
+      t.end()
+    })
+  })
+  t.test('noent ignore async', function (t) {
+    isexe(noent, { ignoreErrors: true }).then(function (is) {
+      t.notOk(is)
+      t.end()
+    })
+  })
+  t.end()
+})
+
+t.test('no promise', function (t) {
+  global.Promise = null
+  var isexe = reset()
+  t.throws('try to meow a promise', function () {
+    isexe(meow)
+  })
+  t.end()
+})
+
+t.test('access', { skip: accessSkip || winSkip }, function (t) {
+  runTest(t)
+})
+
+t.test('mode', { skip: winSkip }, function (t) {
+  delete fs.access
+  delete fs.accessSync
+  var isexe = reset()
+  t.ok(isexe.sync(ours, { uid: 0, gid: 0 }))
+  t.ok(isexe.sync(mine, { uid: 0, gid: 0 }))
+  runTest(t)
+})
+
+t.test('windows', function (t) {
+  global.TESTING_WINDOWS = true
+  var pathExt = '.EXE;.CAT;.CMD;.COM'
+  t.test('pathExt option', function (t) {
+    runTest(t, { pathExt: '.EXE;.CAT;.CMD;.COM' })
+  })
+  t.test('pathExt env', function (t) {
+    process.env.PATHEXT = pathExt
+    runTest(t)
+  })
+  t.test('no pathExt', function (t) {
+    // with a pathExt of '', any filename is fine.
+    // so the "fail" one would still pass.
+    runTest(t, { pathExt: '', skipFail: true })
+  })
+  t.test('pathext with empty entry', function (t) {
+    // with a pathExt of '', any filename is fine.
+    // so the "fail" one would still pass.
+    runTest(t, { pathExt: ';' + pathExt, skipFail: true })
+  })
+  t.end()
+})
+
+t.test('cleanup', function (t) {
+  rimraf.sync(fixture)
+  t.end()
+})
+
+function runTest (t, options) {
+  var isexe = reset()
+
+  var optionsIgnore = Object.create(options || {})
+  optionsIgnore.ignoreErrors = true
+
+  if (!options || !options.skipFail) {
+    t.notOk(isexe.sync(fail, options))
+  }
+  t.notOk(isexe.sync(noent, optionsIgnore))
+  if (!options) {
+    t.ok(isexe.sync(meow))
+  } else {
+    t.ok(isexe.sync(meow, options))
+  }
+
+  t.ok(isexe.sync(mine, options))
+  t.ok(isexe.sync(ours, options))
+  t.throws(function () {
+    isexe.sync(noent, options)
+  })
+
+  t.test('meow async', function (t) {
+    if (!options) {
+      isexe(meow, function (er, is) {
+        if (er) {
+          throw er
+        }
+        t.ok(is)
+        t.end()
+      })
+    } else {
+      isexe(meow, options, function (er, is) {
+        if (er) {
+          throw er
+        }
+        t.ok(is)
+        t.end()
+      })
+    }
+  })
+
+  t.test('mine async', function (t) {
+    isexe(mine, options, function (er, is) {
+      if (er) {
+        throw er
+      }
+      t.ok(is)
+      t.end()
+    })
+  })
+
+  t.test('ours async', function (t) {
+    isexe(ours, options, function (er, is) {
+      if (er) {
+        throw er
+      }
+      t.ok(is)
+      t.end()
+    })
+  })
+
+  if (!options || !options.skipFail) {
+    t.test('fail async', function (t) {
+      isexe(fail, options, function (er, is) {
+        if (er) {
+          throw er
+        }
+        t.notOk(is)
+        t.end()
+      })
+    })
+  }
+
+  t.test('noent async', function (t) {
+    isexe(noent, options, function (er, is) {
+      t.ok(er)
+      t.notOk(is)
+      t.end()
+    })
+  })
+
+  t.test('noent ignore async', function (t) {
+    isexe(noent, optionsIgnore, function (er, is) {
+      if (er) {
+        throw er
+      }
+      t.notOk(is)
+      t.end()
+    })
+  })
+
+  t.end()
+}
diff --git a/deps/npm/node_modules/which/node_modules/isexe/windows.js b/deps/npm/node_modules/which/node_modules/isexe/windows.js
new file mode 100644 (file)
index 0000000..aba8561
--- /dev/null
@@ -0,0 +1,36 @@
+module.exports = isexe
+isexe.sync = sync
+
+var fs = require('fs')
+
+function checkPathExt (path, options) {
+  var pathext = options.pathExt !== undefined ?
+    options.pathExt : process.env.PATHEXT
+
+  if (!pathext) {
+    return true
+  }
+
+  pathext = pathext.split(';')
+  if (pathext.indexOf('') !== -1) {
+    return true
+  }
+  for (var i = 0; i < pathext.length; i++) {
+    var p = pathext[i].toLowerCase()
+    if (p && path.substr(-p.length).toLowerCase() === p) {
+      return true
+    }
+  }
+  return false
+}
+
+function isexe (path, options, cb) {
+  fs.stat(path, function (er, st) {
+    cb(er, er ? false : checkPathExt(path, options))
+  })
+}
+
+function sync (path, options) {
+  fs.statSync(path)
+  return checkPathExt(path, options)
+}
index fd00e89..f3b3fd3 100644 (file)
@@ -6,7 +6,7 @@
   },
   "name": "which",
   "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
-  "version": "1.2.0",
+  "version": "1.2.4",
   "repository": {
     "type": "git",
     "url": "git://github.com/isaacs/node-which.git"
   },
   "license": "ISC",
   "dependencies": {
-    "is-absolute": "^0.1.7"
+    "is-absolute": "^0.1.7",
+    "isexe": "^1.1.1"
   },
   "devDependencies": {
     "mkdirp": "^0.5.0",
     "rimraf": "^2.3.3",
-    "tap": "^2.0.0"
+    "tap": "^5.1.1"
   },
   "scripts": {
-    "test": "tap test/*.js"
+    "test": "tap test/*.js --cov"
   },
-  "gitHead": "98925d6bced9ba820a17fd857e7a53a491958419",
+  "gitHead": "1375684d40af9de2ecc527d1ab9b87b537d7a1cc",
   "bugs": {
     "url": "https://github.com/isaacs/node-which/issues"
   },
   "homepage": "https://github.com/isaacs/node-which#readme",
-  "_id": "which@1.2.0",
-  "_shasum": "a5c8df5abc792f6ce9652c8d9ca8f3a91b77e59d",
-  "_from": "which@>=1.2.0 <1.3.0",
-  "_npmVersion": "3.3.2",
+  "_id": "which@1.2.4",
+  "_shasum": "1557f96080604e5b11b3599eb9f45b50a9efd722",
+  "_from": "which@1.2.4",
+  "_npmVersion": "2.14.15",
   "_nodeVersion": "4.0.0",
   "_npmUser": {
     "name": "isaacs",
-    "email": "isaacs@npmjs.com"
+    "email": "i@izs.me"
   },
   "dist": {
-    "shasum": "a5c8df5abc792f6ce9652c8d9ca8f3a91b77e59d",
-    "tarball": "http://registry.npmjs.org/which/-/which-1.2.0.tgz"
+    "shasum": "1557f96080604e5b11b3599eb9f45b50a9efd722",
+    "tarball": "http://registry.npmjs.org/which/-/which-1.2.4.tgz"
   },
   "maintainers": [
     {
@@ -52,6 +53,6 @@
     }
   ],
   "directories": {},
-  "_resolved": "https://registry.npmjs.org/which/-/which-1.2.0.tgz",
+  "_resolved": "https://registry.npmjs.org/which/-/which-1.2.4.tgz",
   "readme": "ERROR: No README data found!"
 }
index 80e9e96..54c8d23 100644 (file)
@@ -51,17 +51,16 @@ t.test('make executable', function (t) {
 })
 
 t.test('find when executable', function (t) {
-  t.plan(4)
   var opt = { pathExt: '.sh' }
   var expect = path.resolve(fixture, 'foo.sh').toLowerCase()
-  var PATH = process.env.PATH
+  var PATH = process.env.PATH || process.env.Path
 
   t.test('absolute', function (t) {
     runTest(fixture + '/foo.sh', t)
   })
 
   t.test('with process.env.PATH', function (t) {
-    process.env.PATH = fixture
+    process.env.PATH = process.env.Path = fixture
     runTest('foo.sh', t)
   })
 
@@ -73,6 +72,25 @@ t.test('find when executable', function (t) {
     runTest('foo.sh', t)
   })
 
+  t.test('with pathExt', {
+    skip: isWindows ? false : 'Only for Windows'
+  }, function (t) {
+    var pe = process.env.PATHEXT
+    process.env.PATHEXT = '.SH'
+
+    t.test('foo.sh', function (t) {
+      runTest('foo.sh', t)
+    })
+    t.test('foo', function (t) {
+      runTest('foo', t)
+    })
+    t.test('replace', function (t) {
+      process.env.PATHEXT = pe
+      t.end()
+    })
+    t.end()
+  })
+
   t.test('with path opt', function (t) {
     opt.path = fixture
     runTest('foo.sh', t)
@@ -80,17 +98,20 @@ t.test('find when executable', function (t) {
 
   function runTest(exec, t) {
     t.plan(2)
+
+    var found = which.sync(exec, opt).toLowerCase()
+    t.equal(found, expect)
+
     which(exec, opt, function (er, found) {
       if (er)
         throw er
       t.equal(found.toLowerCase(), expect)
+      t.end()
       process.env.PATH = PATH
     })
-
-    var found = which.sync(exec, opt).toLowerCase()
-    t.equal(found, expect)
   }
 
+  t.end()
 })
 
 t.test('clean', function (t) {
diff --git a/deps/npm/node_modules/which/test/windows.js b/deps/npm/node_modules/which/test/windows.js
new file mode 100644 (file)
index 0000000..1d5e429
--- /dev/null
@@ -0,0 +1,10 @@
+// pretend to be Windows.
+if (process.platform === 'win32') {
+  var t = require('tap')
+  t.plan(0, 'already on windows')
+  process.exit(0)
+}
+
+process.env.Path = process.env.PATH.split(':').join(';')
+process.env.OSTYPE = 'cygwin'
+require('./basic.js')
index 88bd52b..5cf0124 100644 (file)
@@ -7,46 +7,26 @@ var isWindows = process.platform === 'win32' ||
 
 var path = require('path')
 var COLON = isWindows ? ';' : ':'
-var isExe
+var isexe = require('isexe')
 var fs = require('fs')
 var isAbsolute = require('is-absolute')
 
-var G =  parseInt('0010', 8)
-var U =  parseInt('0100', 8)
-var UG = parseInt('0110', 8)
-
-if (isWindows) {
-  // On windows, there is no good way to check that a file is executable
-  isExe = function isExe () { return true }
-} else {
-  isExe = function isExe (mod, uid, gid) {
-    var ret = (mod & 1)
-        || (mod & U)  && process.getgid && gid === process.getgid()
-        || (mod & G)  && process.getuid && uid === process.getuid()
-        || (mod & UG) && process.getuid && 0   === process.getuid()
-
-    if (!ret && process.getgroups && (mod & G)) {
-      var groups = process.getgroups()
-      for (var g = 0; g < groups.length; g++) {
-        if (groups[g] === gid)
-          return true
-      }
-    }
-
-    return ret
-  }
-}
-
 function getPathInfo(cmd, opt) {
   var colon = opt.colon || COLON
-  var pathEnv = opt.path || process.env.PATH || ''
+  var pathEnv = opt.path || process.env.Path || process.env.PATH || ''
   var pathExt = ['']
 
   pathEnv = pathEnv.split(colon)
 
+  var pathExtExe = ''
   if (isWindows) {
     pathEnv.unshift(process.cwd())
-    pathExt = (opt.pathExt || process.env.PATHEXT || '.EXE').split(colon)
+    pathExtExe = (opt.pathExt || process.env.PATHEXT || '.EXE;.CMD;.BAT;.COM')
+    pathExt = pathExtExe.split(colon)
+
+
+    // Always test the cmd itself first.  isexe will check to make sure
+    // it's found in the pathExt set.
     if (cmd.indexOf('.') !== -1 && pathExt[0] !== '')
       pathExt.unshift('')
   }
@@ -56,7 +36,11 @@ function getPathInfo(cmd, opt) {
   if (isAbsolute(cmd))
     pathEnv = ['']
 
-  return {env: pathEnv, ext: pathExt}
+  return {
+    env: pathEnv,
+    ext: pathExt,
+    extExe: pathExtExe
+  }
 }
 
 function which (cmd, opt, cb) {
@@ -68,6 +52,7 @@ function which (cmd, opt, cb) {
   var info = getPathInfo(cmd, opt)
   var pathEnv = info.env
   var pathExt = info.ext
+  var pathExtExe = info.extExe
   var found = []
 
   ;(function F (i, l) {
@@ -77,14 +62,17 @@ function which (cmd, opt, cb) {
       else
         return cb(new Error('not found: '+cmd))
     }
-    var p = path.resolve(pathEnv[i], cmd)
+
+    var pathPart = pathEnv[i]
+    if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
+      pathPart = pathPart.slice(1, -1)
+
+    var p = path.resolve(pathPart, cmd)
     ;(function E (ii, ll) {
       if (ii === ll) return F(i + 1, l)
       var ext = pathExt[ii]
-      fs.stat(p + ext, function (er, stat) {
-        if (!er &&
-            stat.isFile() &&
-            isExe(stat.mode, stat.uid, stat.gid)) {
+      isexe(p + ext, { pathExt: pathExtExe }, function (er, is) {
+        if (!er && is) {
           if (opt.all)
             found.push(p + ext)
           else
@@ -102,16 +90,21 @@ function whichSync (cmd, opt) {
   var info = getPathInfo(cmd, opt)
   var pathEnv = info.env
   var pathExt = info.ext
+  var pathExtExe = info.extExe
   var found = []
 
   for (var i = 0, l = pathEnv.length; i < l; i ++) {
-    var p = path.join(pathEnv[i], cmd)
+    var pathPart = pathEnv[i]
+    if (pathPart.charAt(0) === '"' && pathPart.slice(-1) === '"')
+      pathPart = pathPart.slice(1, -1)
+
+    var p = path.join(pathPart, cmd)
     for (var j = 0, ll = pathExt.length; j < ll; j ++) {
       var cur = p + pathExt[j]
-      var stat
+      var is
       try {
-        stat = fs.statSync(cur)
-        if (stat.isFile() && isExe(stat.mode, stat.uid, stat.gid)) {
+        is = isexe.sync(cur, { pathExt: pathExtExe })
+        if (is) {
           if (opt.all)
             found.push(cur)
           else
index de1ccc3..171a1e9 100644 (file)
@@ -1,5 +1,5 @@
 {
-  "version": "2.14.17",
+  "version": "2.14.18",
   "name": "npm",
   "description": "a package manager for JavaScript",
   "keywords": [
@@ -31,7 +31,7 @@
   "bin": "./bin/npm-cli.js",
   "dependencies": {
     "abbrev": "~1.0.7",
-    "ansi": "~0.3.0",
+    "ansi": "~0.3.1",
     "ansicolors": "~0.3.2",
     "ansistyles": "~0.1.3",
     "archy": "~1.0.0",
     "chmodr": "~1.0.2",
     "chownr": "~1.0.1",
     "cmd-shim": "~2.0.1",
-    "columnify": "~1.5.2",
-    "config-chain": "~1.1.9",
+    "columnify": "~1.5.4",
+    "config-chain": "~1.1.10",
     "dezalgo": "~1.0.3",
     "editor": "~1.0.0",
     "fs-vacuum": "~1.2.7",
-    "fs-write-stream-atomic": "~1.0.5",
+    "fs-write-stream-atomic": "~1.0.8",
     "fstream": "~1.0.8",
     "fstream-npm": "~1.0.7",
     "github-url-from-git": "~1.4.0",
     "github-url-from-username-repo": "~1.0.2",
     "glob": "~5.0.15",
-    "graceful-fs": "~4.1.2",
+    "graceful-fs": "~4.1.3",
     "hosted-git-info": "~2.1.4",
     "inflight": "~1.0.4",
     "inherits": "~2.0.1",
     "ini": "~1.3.4",
-    "init-package-json": "~1.9.1",
+    "init-package-json": "~1.9.3",
     "lockfile": "~1.0.1",
     "lru-cache": "~3.2.0",
     "minimatch": "~3.0.0",
     "npm-package-arg": "~4.1.0",
     "npm-registry-client": "~7.0.9",
     "npm-user-validate": "~0.1.2",
-    "npmlog": "~2.0.0",
+    "npmlog": "~2.0.2",
     "once": "~1.3.3",
     "opener": "~1.4.1",
     "osenv": "~0.1.3",
     "path-is-inside": "~1.0.0",
     "read": "~1.0.7",
     "read-installed": "~4.0.3",
-    "read-package-json": "~2.0.2",
+    "read-package-json": "~2.0.3",
     "readable-stream": "~1.1.13",
     "realize-package-specifier": "~3.0.1",
-    "request": "~2.67.0",
-    "retry": "~0.8.0",
-    "rimraf": "~2.4.4",
+    "request": "~2.69.0",
+    "retry": "~0.9.0",
+    "rimraf": "~2.5.1",
     "semver": "~5.1.0",
     "sha": "~2.0.1",
     "slide": "~1.1.6",
     "sorted-object": "~1.0.0",
+    "spdx-license-ids": "~1.2.0",
     "tar": "~2.2.1",
     "text-table": "~0.2.0",
     "uid-number": "0.0.6",
     "umask": "~1.1.0",
     "validate-npm-package-license": "~3.0.1",
     "validate-npm-package-name": "~2.2.2",
-    "which": "~1.2.0",
+    "which": "~1.2.4",
     "wrappy": "~1.0.1",
     "write-file-atomic": "~1.1.4"
   },