diff --git a/.gitignore b/.gitignore index a86377cbe44..e00450690da 100644 --- a/.gitignore +++ b/.gitignore @@ -64,3 +64,6 @@ deps/zlib/zlib.target.mk /SHASUMS*.txt* /tools/wrk/wrk + +# test artifacts +tools/faketime diff --git a/AUTHORS b/AUTHORS index 65ddc6ac7af..c7f88646e11 100644 --- a/AUTHORS +++ b/AUTHORS @@ -557,3 +557,8 @@ Greg Sabia Tucker Calvin Metcalf cjihrig Chris Barber +Nick Apperson +Oguz Bastemur +Maurice Butler +Chris Dickinson +Julien Gilli diff --git a/ChangeLog b/ChangeLog index 2b0b1a0e5b6..b1982c617e6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -618,6 +618,41 @@ * console: `console.dir()` bypasses inspect() methods (Nathan Rajlich) +2014.07.31, Version 0.10.30 (Stable), bc0ff830aff1e016163d855e86ded5c98b0899e8 + +* uv: Upgrade to v0.10.28 + +* npm: Upgrade to v1.4.21 + +* v8: Interrupts must not mask stack overflow. + +* Revert "stream: start old-mode read in a next tick" (Fedor Indutny) + +* buffer: fix sign overflow in `readUIn32BE` (Fedor Indutny) + +* buffer: improve {read,write}{U}Int* methods (Nick Apperson) + +* child_process: handle writeUtf8String error (Fedor Indutny) + +* deps: backport 4ed5fde4f from v8 upstream (Fedor Indutny) + +* deps: cherry-pick eca441b2 from OpenSSL (Fedor Indutny) + +* lib: remove and restructure calls to isNaN() (cjihrig) + +* module: eliminate double `getenv()` (Maciej Małecki) + +* stream2: flush extant data on read of ended stream (Chris Dickinson) + +* streams: remove unused require('assert') (Rod Vagg) + +* timers: backport f8193ab (Julien Gilli) + +* util.h: interface compatibility (Oguz Bastemur) + +* zlib: do not crash on write after close (Fedor Indutny) + + 2014.06.05, Version 0.10.29 (Stable), ce82d6b8474bde7ac7df6d425fb88fb1bcba35bc * openssl: to 1.0.1h (CVE-2014-0224) diff --git a/Makefile b/Makefile index a663513b47d..11304e118f3 100644 --- a/Makefile +++ b/Makefile @@ -155,6 +155,13 @@ test-npm-publish: node test-addons: test-build $(PYTHON) tools/test.py --mode=release addons +test-timers: + $(MAKE) --directory=tools faketime + $(PYTHON) tools/test.py --mode=release timers + +test-timers-clean: + $(MAKE) --directory=tools clean + apidoc_sources = $(wildcard doc/api/*.markdown) apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html)) \ $(addprefix out/,$(apidoc_sources:.markdown=.json)) diff --git a/deps/npm/.eslintrc b/deps/npm/.eslintrc new file mode 100644 index 00000000000..5c39c67eca0 --- /dev/null +++ b/deps/npm/.eslintrc @@ -0,0 +1,18 @@ +{ + "env" : { + "node" : true + }, + "rules" : { + "curly" : 0, + "no-lonely-if" : 1, + "no-mixed-requires" : 0, + "no-underscore-dangle" : 0, + "no-unused-vars" : [2, {"vars" : "all", "args" : "after-used"}], + "no-use-before-define" : [2, "nofunc"], + "quotes" : [1, "double", "avoid-escape"], + "semi" : [2, "never"], + "space-after-keywords" : 1, + "space-infix-ops" : 0, + "strict" : 0 + } +} diff --git a/deps/npm/.npmignore b/deps/npm/.npmignore index ff0cb7fc3f0..7232cea50a8 100644 --- a/deps/npm/.npmignore +++ b/deps/npm/.npmignore @@ -7,6 +7,7 @@ npm-debug.log /test/packages/npm-test-depends-on-spark/which-spark.log /test/packages/test-package/random-data.txt /test/root +node_modules/marked node_modules/ronn node_modules/tap node_modules/.bin diff --git a/deps/npm/.tern-project b/deps/npm/.tern-project deleted file mode 100644 index d31fd9d88e6..00000000000 --- a/deps/npm/.tern-project +++ /dev/null @@ -1,7 +0,0 @@ -{ - "libs": [ - ], - "plugins": { - "node": {} - } -} \ No newline at end of file diff --git a/deps/npm/Makefile b/deps/npm/Makefile index c06734958c1..78014d5c7e5 100644 --- a/deps/npm/Makefile +++ b/deps/npm/Makefile @@ -69,7 +69,7 @@ dev: install link: uninstall node cli.js link -f -clean: ronnclean doc-clean uninstall +clean: markedclean ronnclean doc-clean uninstall rm -rf npmrc node cli.js cache clean @@ -78,12 +78,16 @@ uninstall: doc: $(mandocs) $(htmldocs) +markedclean: + rm -rf node_modules/marked node_modules/.bin/marked .building_marked + ronnclean: rm -rf node_modules/ronn node_modules/.bin/ronn .building_ronn docclean: doc-clean doc-clean: rm -rf \ + .building_marked \ .building_ronn \ html/doc \ html/api \ @@ -149,6 +153,10 @@ html/doc/misc/%.html: doc/misc/%.md $(html_docdeps) scripts/doc-build.sh $< $@ +marked: node_modules/.bin/marked + +node_modules/.bin/marked: + node cli.js install marked --no-global ronn: node_modules/.bin/ronn diff --git a/deps/npm/doc/api/npm-link.md b/deps/npm/doc/api/npm-link.md index ad8cefcab37..fe875ec60f1 100644 --- a/deps/npm/doc/api/npm-link.md +++ b/deps/npm/doc/api/npm-link.md @@ -3,8 +3,8 @@ npm-link(3) -- Symlink a package folder ## SYNOPSIS - npm.command.link(callback) - npm.command.link(packages, callback) + npm.commands.link(callback) + npm.commands.link(packages, callback) ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-explore.md b/deps/npm/doc/cli/npm-explore.md index 1c611211b33..3642d7399d0 100644 --- a/deps/npm/doc/cli/npm-explore.md +++ b/deps/npm/doc/cli/npm-explore.md @@ -3,7 +3,7 @@ npm-explore(1) -- Browse an installed package ## SYNOPSIS - npm explore [@] [ -- ] + npm explore [ -- ] ## DESCRIPTION diff --git a/deps/npm/doc/cli/npm-shrinkwrap.md b/deps/npm/doc/cli/npm-shrinkwrap.md index 70f330be8c2..05637f21db4 100644 --- a/deps/npm/doc/cli/npm-shrinkwrap.md +++ b/deps/npm/doc/cli/npm-shrinkwrap.md @@ -163,15 +163,6 @@ shrinkwrap will implicitly be included in A's shrinkwrap. ### Caveats -Shrinkwrap files only lock down package versions, not actual package -contents. While discouraged, a package author can republish an -existing version of a package, causing shrinkwrapped packages using -that version to pick up different code than they were before. If you -want to avoid any risk that a byzantine author replaces a package -you're using with code that breaks your application, you could modify -the shrinkwrap file to use git URL references rather than version -numbers so that npm always fetches all packages from git. - If you wish to lock down the specific bytes included in a package, for example to have 100% confidence in being able to reproduce a deployment or build, then you ought to check your dependencies into diff --git a/deps/npm/doc/misc/npm-config.md b/deps/npm/doc/misc/npm-config.md index b49e987360f..035923fa6f4 100644 --- a/deps/npm/doc/misc/npm-config.md +++ b/deps/npm/doc/misc/npm-config.md @@ -146,6 +146,15 @@ to trust only that specific signing authority. See also the `strict-ssl` config. +### cafile + +* Default: `null` +* Type: path + +A path to a file containing one or multiple Certificate Authority signing +certificates. Similar to the `ca` setting, but allows for multiple CA's, as +well as for the CA information to be stored in a file on disk. + ### cache * Default: Windows: `%AppData%\npm-cache`, Posix: `~/.npm` diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html index 0a192419a39..c1851ed6337 100644 --- a/deps/npm/html/doc/README.html +++ b/deps/npm/html/doc/README.html @@ -141,7 +141,7 @@

If you have a complaint about a package in the public npm registry, and cannot resolve it with the package owner, please email -support@npmjs.com and explain the situation.

+support@npmjs.com and explain the situation.

Any data published to The npm Registry (including user account information) may be removed or modified at the sole discretion of the npm server administrators.

@@ -161,7 +161,7 @@

BUGS

  • web: https://github.com/npm/npm/issues
  • email: -npm-@googlegroups.com
  • +npm-@googlegroups.com

    Be sure to include all of the output from the npm command that didn't work as expected. The npm-debug.log file is also helpful to provide.

    @@ -186,5 +186,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-bin.html b/deps/npm/html/doc/api/npm-bin.html index 4694b4d15f2..a9536450d4b 100644 --- a/deps/npm/html/doc/api/npm-bin.html +++ b/deps/npm/html/doc/api/npm-bin.html @@ -28,5 +28,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-bugs.html b/deps/npm/html/doc/api/npm-bugs.html index 1678f2fdb6b..414e931294a 100644 --- a/deps/npm/html/doc/api/npm-bugs.html +++ b/deps/npm/html/doc/api/npm-bugs.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-cache.html b/deps/npm/html/doc/api/npm-cache.html index d74e31e238f..a1e1d04f57c 100644 --- a/deps/npm/html/doc/api/npm-cache.html +++ b/deps/npm/html/doc/api/npm-cache.html @@ -42,5 +42,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-commands.html b/deps/npm/html/doc/api/npm-commands.html index 275911f3d18..7bd005464e7 100644 --- a/deps/npm/html/doc/api/npm-commands.html +++ b/deps/npm/html/doc/api/npm-commands.html @@ -36,5 +36,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-config.html b/deps/npm/html/doc/api/npm-config.html index adc681699ec..ea56784473a 100644 --- a/deps/npm/html/doc/api/npm-config.html +++ b/deps/npm/html/doc/api/npm-config.html @@ -57,5 +57,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-deprecate.html b/deps/npm/html/doc/api/npm-deprecate.html index 220b2e63769..19595be6974 100644 --- a/deps/npm/html/doc/api/npm-deprecate.html +++ b/deps/npm/html/doc/api/npm-deprecate.html @@ -47,5 +47,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-docs.html b/deps/npm/html/doc/api/npm-docs.html index 617e8886ee3..f59334121da 100644 --- a/deps/npm/html/doc/api/npm-docs.html +++ b/deps/npm/html/doc/api/npm-docs.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-edit.html b/deps/npm/html/doc/api/npm-edit.html index 700e45cedf8..2eaca93e350 100644 --- a/deps/npm/html/doc/api/npm-edit.html +++ b/deps/npm/html/doc/api/npm-edit.html @@ -36,5 +36,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-explore.html b/deps/npm/html/doc/api/npm-explore.html index ea0aacecf19..14339a2927a 100644 --- a/deps/npm/html/doc/api/npm-explore.html +++ b/deps/npm/html/doc/api/npm-explore.html @@ -31,5 +31,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-help-search.html b/deps/npm/html/doc/api/npm-help-search.html index f263eaf7997..097d816b80a 100644 --- a/deps/npm/html/doc/api/npm-help-search.html +++ b/deps/npm/html/doc/api/npm-help-search.html @@ -44,5 +44,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-init.html b/deps/npm/html/doc/api/npm-init.html index 062b2e87212..cd1478f4d8a 100644 --- a/deps/npm/html/doc/api/npm-init.html +++ b/deps/npm/html/doc/api/npm-init.html @@ -39,5 +39,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-install.html b/deps/npm/html/doc/api/npm-install.html index 11a5f377dc9..4a98068812e 100644 --- a/deps/npm/html/doc/api/npm-install.html +++ b/deps/npm/html/doc/api/npm-install.html @@ -32,5 +32,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-link.html b/deps/npm/html/doc/api/npm-link.html index def9bd2bfd3..4cfc9b96ad9 100644 --- a/deps/npm/html/doc/api/npm-link.html +++ b/deps/npm/html/doc/api/npm-link.html @@ -11,8 +11,8 @@

    npm-link

    Symlink a package folder

    SYNOPSIS

    -
    npm.command.link(callback)
    -npm.command.link(packages, callback)
    +
    npm.commands.link(callback)
    +npm.commands.link(packages, callback)
     

    DESCRIPTION

    Package linking is a two-step process.

    Without parameters, link will create a globally-installed @@ -42,5 +42,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-load.html b/deps/npm/html/doc/api/npm-load.html index 79ff0980f3e..dc05af5ebd1 100644 --- a/deps/npm/html/doc/api/npm-load.html +++ b/deps/npm/html/doc/api/npm-load.html @@ -37,5 +37,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-ls.html b/deps/npm/html/doc/api/npm-ls.html index a30aef58fb2..447d465a64b 100644 --- a/deps/npm/html/doc/api/npm-ls.html +++ b/deps/npm/html/doc/api/npm-ls.html @@ -63,5 +63,5 @@

    global

           - + diff --git a/deps/npm/html/doc/api/npm-outdated.html b/deps/npm/html/doc/api/npm-outdated.html index 0be01953893..b80d8a3eea1 100644 --- a/deps/npm/html/doc/api/npm-outdated.html +++ b/deps/npm/html/doc/api/npm-outdated.html @@ -28,5 +28,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-owner.html b/deps/npm/html/doc/api/npm-owner.html index a0d65405540..78e59032bbc 100644 --- a/deps/npm/html/doc/api/npm-owner.html +++ b/deps/npm/html/doc/api/npm-owner.html @@ -47,5 +47,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-pack.html b/deps/npm/html/doc/api/npm-pack.html index 41304792ee1..02c1f21238a 100644 --- a/deps/npm/html/doc/api/npm-pack.html +++ b/deps/npm/html/doc/api/npm-pack.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-prefix.html b/deps/npm/html/doc/api/npm-prefix.html index 09e6a5cee95..464520a3655 100644 --- a/deps/npm/html/doc/api/npm-prefix.html +++ b/deps/npm/html/doc/api/npm-prefix.html @@ -29,5 +29,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-prune.html b/deps/npm/html/doc/api/npm-prune.html index 82cd6118e1c..eece46ad496 100644 --- a/deps/npm/html/doc/api/npm-prune.html +++ b/deps/npm/html/doc/api/npm-prune.html @@ -30,5 +30,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-publish.html b/deps/npm/html/doc/api/npm-publish.html index 49eaabd59bf..b88df8a2f74 100644 --- a/deps/npm/html/doc/api/npm-publish.html +++ b/deps/npm/html/doc/api/npm-publish.html @@ -46,5 +46,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-rebuild.html b/deps/npm/html/doc/api/npm-rebuild.html index e8a30238947..465c503a9d8 100644 --- a/deps/npm/html/doc/api/npm-rebuild.html +++ b/deps/npm/html/doc/api/npm-rebuild.html @@ -30,5 +30,5 @@

    CONFIGURATION

           - + diff --git a/deps/npm/html/doc/api/npm-repo.html b/deps/npm/html/doc/api/npm-repo.html index 5fdc0d61d5a..92c60f2c288 100644 --- a/deps/npm/html/doc/api/npm-repo.html +++ b/deps/npm/html/doc/api/npm-repo.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-restart.html b/deps/npm/html/doc/api/npm-restart.html index b71335e5cf1..bc39c4f26d0 100644 --- a/deps/npm/html/doc/api/npm-restart.html +++ b/deps/npm/html/doc/api/npm-restart.html @@ -36,5 +36,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-root.html b/deps/npm/html/doc/api/npm-root.html index 82a1220691e..f50a8642347 100644 --- a/deps/npm/html/doc/api/npm-root.html +++ b/deps/npm/html/doc/api/npm-root.html @@ -29,5 +29,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-run-script.html b/deps/npm/html/doc/api/npm-run-script.html index 8b47cd5e16c..15e2bafbf8f 100644 --- a/deps/npm/html/doc/api/npm-run-script.html +++ b/deps/npm/html/doc/api/npm-run-script.html @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-search.html b/deps/npm/html/doc/api/npm-search.html index 02f8e6f42ac..83721938b2c 100644 --- a/deps/npm/html/doc/api/npm-search.html +++ b/deps/npm/html/doc/api/npm-search.html @@ -53,5 +53,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-shrinkwrap.html b/deps/npm/html/doc/api/npm-shrinkwrap.html index f8a3eca529b..04b5a4e6909 100644 --- a/deps/npm/html/doc/api/npm-shrinkwrap.html +++ b/deps/npm/html/doc/api/npm-shrinkwrap.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-start.html b/deps/npm/html/doc/api/npm-start.html index 1c9ec3a25e8..a7e1fdcbb09 100644 --- a/deps/npm/html/doc/api/npm-start.html +++ b/deps/npm/html/doc/api/npm-start.html @@ -28,5 +28,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-stop.html b/deps/npm/html/doc/api/npm-stop.html index d1ab824a38b..b80837efcb2 100644 --- a/deps/npm/html/doc/api/npm-stop.html +++ b/deps/npm/html/doc/api/npm-stop.html @@ -28,5 +28,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-submodule.html b/deps/npm/html/doc/api/npm-submodule.html index 79f00546198..b75986c23ac 100644 --- a/deps/npm/html/doc/api/npm-submodule.html +++ b/deps/npm/html/doc/api/npm-submodule.html @@ -42,5 +42,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/api/npm-tag.html b/deps/npm/html/doc/api/npm-tag.html index 6648205dda8..153e2b0e1c6 100644 --- a/deps/npm/html/doc/api/npm-tag.html +++ b/deps/npm/html/doc/api/npm-tag.html @@ -36,5 +36,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-test.html b/deps/npm/html/doc/api/npm-test.html index ae2148f76c4..afb545f408f 100644 --- a/deps/npm/html/doc/api/npm-test.html +++ b/deps/npm/html/doc/api/npm-test.html @@ -30,5 +30,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-uninstall.html b/deps/npm/html/doc/api/npm-uninstall.html index 0599d68ea79..5b7c45c3e4e 100644 --- a/deps/npm/html/doc/api/npm-uninstall.html +++ b/deps/npm/html/doc/api/npm-uninstall.html @@ -30,5 +30,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-unpublish.html b/deps/npm/html/doc/api/npm-unpublish.html index 186ae801ddd..4738206616b 100644 --- a/deps/npm/html/doc/api/npm-unpublish.html +++ b/deps/npm/html/doc/api/npm-unpublish.html @@ -33,5 +33,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-update.html b/deps/npm/html/doc/api/npm-update.html index 4d725404d61..e545681bf24 100644 --- a/deps/npm/html/doc/api/npm-update.html +++ b/deps/npm/html/doc/api/npm-update.html @@ -27,5 +27,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-version.html b/deps/npm/html/doc/api/npm-version.html index f052db67cf2..8371637453e 100644 --- a/deps/npm/html/doc/api/npm-version.html +++ b/deps/npm/html/doc/api/npm-version.html @@ -32,5 +32,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm-view.html b/deps/npm/html/doc/api/npm-view.html index c91edf916c3..f8592a682be 100644 --- a/deps/npm/html/doc/api/npm-view.html +++ b/deps/npm/html/doc/api/npm-view.html @@ -81,5 +81,5 @@

    RETURN VALUE

           - + diff --git a/deps/npm/html/doc/api/npm-whoami.html b/deps/npm/html/doc/api/npm-whoami.html index b75a055b394..e7667c1680b 100644 --- a/deps/npm/html/doc/api/npm-whoami.html +++ b/deps/npm/html/doc/api/npm-whoami.html @@ -29,5 +29,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/api/npm.html b/deps/npm/html/doc/api/npm.html index 09dfa001893..824e8b116d2 100644 --- a/deps/npm/html/doc/api/npm.html +++ b/deps/npm/html/doc/api/npm.html @@ -23,7 +23,7 @@

    SYNOPSIS

    npm.commands.install(["package"], cb) })

    VERSION

    -

    1.4.14

    +

    1.4.21

    DESCRIPTION

    This is the API documentation for npm. To find documentation of the command line @@ -110,5 +110,5 @@

    ABBREVS

           - + diff --git a/deps/npm/html/doc/cli/npm-adduser.html b/deps/npm/html/doc/cli/npm-adduser.html index a0432fcfcb4..ec7c2f37532 100644 --- a/deps/npm/html/doc/cli/npm-adduser.html +++ b/deps/npm/html/doc/cli/npm-adduser.html @@ -46,5 +46,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bin.html b/deps/npm/html/doc/cli/npm-bin.html index 4d5d742397a..f591f2b29e8 100644 --- a/deps/npm/html/doc/cli/npm-bin.html +++ b/deps/npm/html/doc/cli/npm-bin.html @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bugs.html b/deps/npm/html/doc/cli/npm-bugs.html index 1a571fd129e..b7af4b3daa5 100644 --- a/deps/npm/html/doc/cli/npm-bugs.html +++ b/deps/npm/html/doc/cli/npm-bugs.html @@ -54,5 +54,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-build.html b/deps/npm/html/doc/cli/npm-build.html index ceec5742934..e02f3eaf786 100644 --- a/deps/npm/html/doc/cli/npm-build.html +++ b/deps/npm/html/doc/cli/npm-build.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-bundle.html b/deps/npm/html/doc/cli/npm-bundle.html index b6ca08ac390..fe7b0e21104 100644 --- a/deps/npm/html/doc/cli/npm-bundle.html +++ b/deps/npm/html/doc/cli/npm-bundle.html @@ -31,5 +31,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-cache.html b/deps/npm/html/doc/cli/npm-cache.html index c36d9bd9ee6..c89683556b1 100644 --- a/deps/npm/html/doc/cli/npm-cache.html +++ b/deps/npm/html/doc/cli/npm-cache.html @@ -81,5 +81,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-completion.html b/deps/npm/html/doc/cli/npm-completion.html index 77bd6038962..cadc73cf097 100644 --- a/deps/npm/html/doc/cli/npm-completion.html +++ b/deps/npm/html/doc/cli/npm-completion.html @@ -42,5 +42,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-config.html b/deps/npm/html/doc/cli/npm-config.html index 20baf24eb12..eed9c460bab 100644 --- a/deps/npm/html/doc/cli/npm-config.html +++ b/deps/npm/html/doc/cli/npm-config.html @@ -66,5 +66,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-dedupe.html b/deps/npm/html/doc/cli/npm-dedupe.html index acdfea64adc..38647bb3372 100644 --- a/deps/npm/html/doc/cli/npm-dedupe.html +++ b/deps/npm/html/doc/cli/npm-dedupe.html @@ -63,5 +63,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-deprecate.html b/deps/npm/html/doc/cli/npm-deprecate.html index a74b329695c..fc17e620ee7 100644 --- a/deps/npm/html/doc/cli/npm-deprecate.html +++ b/deps/npm/html/doc/cli/npm-deprecate.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-docs.html b/deps/npm/html/doc/cli/npm-docs.html index bea53fb54ed..411da4db93a 100644 --- a/deps/npm/html/doc/cli/npm-docs.html +++ b/deps/npm/html/doc/cli/npm-docs.html @@ -56,5 +56,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-edit.html b/deps/npm/html/doc/cli/npm-edit.html index 7ac413dbb56..65f72c3b22d 100644 --- a/deps/npm/html/doc/cli/npm-edit.html +++ b/deps/npm/html/doc/cli/npm-edit.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-explore.html b/deps/npm/html/doc/cli/npm-explore.html index 2b2c6d86f01..e444df30224 100644 --- a/deps/npm/html/doc/cli/npm-explore.html +++ b/deps/npm/html/doc/cli/npm-explore.html @@ -11,7 +11,7 @@

    npm-explore

    Browse an installed package

    SYNOPSIS

    -
    npm explore <name>[@<version>] [ -- <cmd>]
    +
    npm explore <name> [ -- <cmd>]
     

    DESCRIPTION

    Spawn a subshell in the directory of the installed package specified.

    If a command is specified, then it is run in the subshell, which then @@ -50,5 +50,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-help-search.html b/deps/npm/html/doc/cli/npm-help-search.html index 230ba2448ed..3aa6585fe85 100644 --- a/deps/npm/html/doc/cli/npm-help-search.html +++ b/deps/npm/html/doc/cli/npm-help-search.html @@ -46,5 +46,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-help.html b/deps/npm/html/doc/cli/npm-help.html index 94390b8f882..1eb4fc0a20c 100644 --- a/deps/npm/html/doc/cli/npm-help.html +++ b/deps/npm/html/doc/cli/npm-help.html @@ -52,5 +52,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-init.html b/deps/npm/html/doc/cli/npm-init.html index 79727e3de6f..d270758415c 100644 --- a/deps/npm/html/doc/cli/npm-init.html +++ b/deps/npm/html/doc/cli/npm-init.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-install.html b/deps/npm/html/doc/cli/npm-install.html index 0990a9cfe75..1e20b3b61c0 100644 --- a/deps/npm/html/doc/cli/npm-install.html +++ b/deps/npm/html/doc/cli/npm-install.html @@ -220,5 +220,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-link.html b/deps/npm/html/doc/cli/npm-link.html index 8db82943239..506ca07ff59 100644 --- a/deps/npm/html/doc/cli/npm-link.html +++ b/deps/npm/html/doc/cli/npm-link.html @@ -66,5 +66,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-ls.html b/deps/npm/html/doc/cli/npm-ls.html index 45090d719e3..23f86e487e0 100644 --- a/deps/npm/html/doc/cli/npm-ls.html +++ b/deps/npm/html/doc/cli/npm-ls.html @@ -22,7 +22,7 @@

    SYNOPSIS

    limit the results to only the paths to the packages named. Note that nested packages will also show the paths to the specified packages. For example, running npm ls promzard in npm's source tree will show:

    -
    npm@1.4.14 /path/to/npm
    +
    npm@1.4.21 /path/to/npm
     └─┬ init-package-json@0.0.4
       └── promzard@0.1.5
     

    It will print out extraneous, missing, and invalid packages.

    @@ -85,5 +85,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-outdated.html b/deps/npm/html/doc/cli/npm-outdated.html index e784c19b300..8edc9e68352 100644 --- a/deps/npm/html/doc/cli/npm-outdated.html +++ b/deps/npm/html/doc/cli/npm-outdated.html @@ -67,5 +67,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-owner.html b/deps/npm/html/doc/cli/npm-owner.html index a7976af48e0..a658369376c 100644 --- a/deps/npm/html/doc/cli/npm-owner.html +++ b/deps/npm/html/doc/cli/npm-owner.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-pack.html b/deps/npm/html/doc/cli/npm-pack.html index 6ad4c9973ac..5c378be96df 100644 --- a/deps/npm/html/doc/cli/npm-pack.html +++ b/deps/npm/html/doc/cli/npm-pack.html @@ -41,5 +41,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-prefix.html b/deps/npm/html/doc/cli/npm-prefix.html index 9444984d514..691016503c5 100644 --- a/deps/npm/html/doc/cli/npm-prefix.html +++ b/deps/npm/html/doc/cli/npm-prefix.html @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-prune.html b/deps/npm/html/doc/cli/npm-prune.html index d936b703495..121f7b3919f 100644 --- a/deps/npm/html/doc/cli/npm-prune.html +++ b/deps/npm/html/doc/cli/npm-prune.html @@ -39,5 +39,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-publish.html b/deps/npm/html/doc/cli/npm-publish.html index d4c8077c055..ea8a4947ea2 100644 --- a/deps/npm/html/doc/cli/npm-publish.html +++ b/deps/npm/html/doc/cli/npm-publish.html @@ -54,5 +54,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-rebuild.html b/deps/npm/html/doc/cli/npm-rebuild.html index 46b73f7f4b9..0138ae35368 100644 --- a/deps/npm/html/doc/cli/npm-rebuild.html +++ b/deps/npm/html/doc/cli/npm-rebuild.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-repo.html b/deps/npm/html/doc/cli/npm-repo.html index 0900e0df872..ae61e2258e1 100644 --- a/deps/npm/html/doc/cli/npm-repo.html +++ b/deps/npm/html/doc/cli/npm-repo.html @@ -42,5 +42,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-restart.html b/deps/npm/html/doc/cli/npm-restart.html index 3fb826b6f6f..f1d59d010ca 100644 --- a/deps/npm/html/doc/cli/npm-restart.html +++ b/deps/npm/html/doc/cli/npm-restart.html @@ -37,5 +37,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-rm.html b/deps/npm/html/doc/cli/npm-rm.html index 12ed0e68d89..f5c9641abcf 100644 --- a/deps/npm/html/doc/cli/npm-rm.html +++ b/deps/npm/html/doc/cli/npm-rm.html @@ -39,5 +39,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-root.html b/deps/npm/html/doc/cli/npm-root.html index 260340e5ca1..b0d635a2b7b 100644 --- a/deps/npm/html/doc/cli/npm-root.html +++ b/deps/npm/html/doc/cli/npm-root.html @@ -35,5 +35,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-run-script.html b/deps/npm/html/doc/cli/npm-run-script.html index 8d9676aa632..2b9e3ee4998 100644 --- a/deps/npm/html/doc/cli/npm-run-script.html +++ b/deps/npm/html/doc/cli/npm-run-script.html @@ -40,5 +40,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-search.html b/deps/npm/html/doc/cli/npm-search.html index 4ada3f32eb0..509243b721c 100644 --- a/deps/npm/html/doc/cli/npm-search.html +++ b/deps/npm/html/doc/cli/npm-search.html @@ -49,5 +49,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-shrinkwrap.html b/deps/npm/html/doc/cli/npm-shrinkwrap.html index 3ccbdb7045f..294d0bfb5df 100644 --- a/deps/npm/html/doc/cli/npm-shrinkwrap.html +++ b/deps/npm/html/doc/cli/npm-shrinkwrap.html @@ -141,14 +141,6 @@

    Other Notes

    and recursively specifies all dependencies, the contents of B's shrinkwrap will implicitly be included in A's shrinkwrap.

    Caveats

    -

    Shrinkwrap files only lock down package versions, not actual package -contents. While discouraged, a package author can republish an -existing version of a package, causing shrinkwrapped packages using -that version to pick up different code than they were before. If you -want to avoid any risk that a byzantine author replaces a package -you're using with code that breaks your application, you could modify -the shrinkwrap file to use git URL references rather than version -numbers so that npm always fetches all packages from git.

    If you wish to lock down the specific bytes included in a package, for example to have 100% confidence in being able to reproduce a deployment or build, then you ought to check your dependencies into @@ -172,5 +164,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-star.html b/deps/npm/html/doc/cli/npm-star.html index 5dbe8ed10fa..af18980d3b9 100644 --- a/deps/npm/html/doc/cli/npm-star.html +++ b/deps/npm/html/doc/cli/npm-star.html @@ -36,5 +36,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-stars.html b/deps/npm/html/doc/cli/npm-stars.html index 859defc07c1..27fb258310e 100644 --- a/deps/npm/html/doc/cli/npm-stars.html +++ b/deps/npm/html/doc/cli/npm-stars.html @@ -37,5 +37,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-start.html b/deps/npm/html/doc/cli/npm-start.html index cda2070c59e..d531b236364 100644 --- a/deps/npm/html/doc/cli/npm-start.html +++ b/deps/npm/html/doc/cli/npm-start.html @@ -34,5 +34,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-stop.html b/deps/npm/html/doc/cli/npm-stop.html index 29b168d476b..11a6dc59502 100644 --- a/deps/npm/html/doc/cli/npm-stop.html +++ b/deps/npm/html/doc/cli/npm-stop.html @@ -34,5 +34,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-submodule.html b/deps/npm/html/doc/cli/npm-submodule.html index e1b1ee71474..c8d70362bde 100644 --- a/deps/npm/html/doc/cli/npm-submodule.html +++ b/deps/npm/html/doc/cli/npm-submodule.html @@ -42,5 +42,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-tag.html b/deps/npm/html/doc/cli/npm-tag.html index c534dbfbf0a..dcd2b2a518e 100644 --- a/deps/npm/html/doc/cli/npm-tag.html +++ b/deps/npm/html/doc/cli/npm-tag.html @@ -44,5 +44,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-test.html b/deps/npm/html/doc/cli/npm-test.html index a1ce4e133b2..10b8d38db8d 100644 --- a/deps/npm/html/doc/cli/npm-test.html +++ b/deps/npm/html/doc/cli/npm-test.html @@ -37,5 +37,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-uninstall.html b/deps/npm/html/doc/cli/npm-uninstall.html index e543ebc976d..a06dcda9ee6 100644 --- a/deps/npm/html/doc/cli/npm-uninstall.html +++ b/deps/npm/html/doc/cli/npm-uninstall.html @@ -55,5 +55,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-unpublish.html b/deps/npm/html/doc/cli/npm-unpublish.html index 7406cbf9309..5d8710a4e69 100644 --- a/deps/npm/html/doc/cli/npm-unpublish.html +++ b/deps/npm/html/doc/cli/npm-unpublish.html @@ -46,5 +46,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-update.html b/deps/npm/html/doc/cli/npm-update.html index d62586ce19e..8fd280d2cac 100644 --- a/deps/npm/html/doc/cli/npm-update.html +++ b/deps/npm/html/doc/cli/npm-update.html @@ -38,5 +38,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-version.html b/deps/npm/html/doc/cli/npm-version.html index ef6325b85b3..16081d8f6be 100644 --- a/deps/npm/html/doc/cli/npm-version.html +++ b/deps/npm/html/doc/cli/npm-version.html @@ -55,5 +55,5 @@

    SYNOPSIS

           - + diff --git a/deps/npm/html/doc/cli/npm-view.html b/deps/npm/html/doc/cli/npm-view.html index c3d5e9d12f9..ef0d82c8f60 100644 --- a/deps/npm/html/doc/cli/npm-view.html +++ b/deps/npm/html/doc/cli/npm-view.html @@ -82,5 +82,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm-whoami.html b/deps/npm/html/doc/cli/npm-whoami.html index 4e8885e6b6f..7c977a6f039 100644 --- a/deps/npm/html/doc/cli/npm-whoami.html +++ b/deps/npm/html/doc/cli/npm-whoami.html @@ -33,5 +33,5 @@

    SEE ALSO

           - + diff --git a/deps/npm/html/doc/cli/npm.html b/deps/npm/html/doc/cli/npm.html index 3641019fcfc..a2d5eebf9e7 100644 --- a/deps/npm/html/doc/cli/npm.html +++ b/deps/npm/html/doc/cli/npm.html @@ -13,7 +13,7 @@

    npm

    node package manager

    SYNOPSIS

    npm <command> [args]
     

    VERSION

    -

    1.4.14

    +

    1.4.21

    DESCRIPTION

    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 @@

    CONTRIBUTIONS

    the issues list or ask on the mailing list.

    BUGS

    When you find issues, please report them:

    @@ -118,7 +118,7 @@

    BUGS

  • web: http://github.com/npm/npm/issues
  • email: -npm-@googlegroups.com
  • +npm-@googlegroups.com

    Be sure to include all of the output from the npm command that didn't work as expected. The npm-debug.log file is also helpful to provide.

    @@ -128,7 +128,7 @@

    AUTHOR

    Isaac Z. Schlueter :: isaacs :: @izs :: -i@izs.me

    +i@izs.me

    SEE ALSO

    • npm-help(1)
    • @@ -154,5 +154,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/files/npm-folders.html b/deps/npm/html/doc/files/npm-folders.html index fa35509f469..e0c81bc1036 100644 --- a/deps/npm/html/doc/files/npm-folders.html +++ b/deps/npm/html/doc/files/npm-folders.html @@ -179,5 +179,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/files/npm-global.html b/deps/npm/html/doc/files/npm-global.html index fa35509f469..e0c81bc1036 100644 --- a/deps/npm/html/doc/files/npm-global.html +++ b/deps/npm/html/doc/files/npm-global.html @@ -179,5 +179,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/files/npm-json.html b/deps/npm/html/doc/files/npm-json.html index e7f51d11fd6..d5fcc037f40 100644 --- a/deps/npm/html/doc/files/npm-json.html +++ b/deps/npm/html/doc/files/npm-json.html @@ -459,5 +459,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/files/npmrc.html b/deps/npm/html/doc/files/npmrc.html index 90588e61e23..359ae4fd5dd 100644 --- a/deps/npm/html/doc/files/npmrc.html +++ b/deps/npm/html/doc/files/npmrc.html @@ -73,5 +73,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/files/package.json.html b/deps/npm/html/doc/files/package.json.html index e7f51d11fd6..d5fcc037f40 100644 --- a/deps/npm/html/doc/files/package.json.html +++ b/deps/npm/html/doc/files/package.json.html @@ -459,5 +459,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html index 56b3baff7b5..ba39cf80299 100644 --- a/deps/npm/html/doc/index.html +++ b/deps/npm/html/doc/index.html @@ -228,5 +228,5 @@

      semver(7)

             - + diff --git a/deps/npm/html/doc/misc/npm-coding-style.html b/deps/npm/html/doc/misc/npm-coding-style.html index e9c0121258f..73f25ae97dc 100644 --- a/deps/npm/html/doc/misc/npm-coding-style.html +++ b/deps/npm/html/doc/misc/npm-coding-style.html @@ -147,5 +147,5 @@

      SEE ALSO

             - + diff --git a/deps/npm/html/doc/misc/npm-config.html b/deps/npm/html/doc/misc/npm-config.html index eefe76f1b3a..06afe1cfbc1 100644 --- a/deps/npm/html/doc/misc/npm-config.html +++ b/deps/npm/html/doc/misc/npm-config.html @@ -124,6 +124,14 @@

      ca

      Set to null to only allow "known" registrars, or to a specific CA cert to trust only that specific signing authority.

      See also the strict-ssl config.

      +

      cafile

      +
        +
      • Default: null
      • +
      • Type: path
      • +
      +

      A path to a file containing one or multiple Certificate Authority signing +certificates. Similar to the ca setting, but allows for multiple CA's, as +well as for the CA information to be stored in a file on disk.

      cache

      • Default: Windows: %AppData%\npm-cache, Posix: ~/.npm
      • @@ -741,5 +749,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/misc/npm-developers.html b/deps/npm/html/doc/misc/npm-developers.html index 7c4720b5a43..fa1d7f3b495 100644 --- a/deps/npm/html/doc/misc/npm-developers.html +++ b/deps/npm/html/doc/misc/npm-developers.html @@ -181,5 +181,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/misc/npm-disputes.html b/deps/npm/html/doc/misc/npm-disputes.html index 360565f7294..07fa9bf5d57 100644 --- a/deps/npm/html/doc/misc/npm-disputes.html +++ b/deps/npm/html/doc/misc/npm-disputes.html @@ -13,7 +13,7 @@

        npm-disputes

        Handling Module

        SYNOPSIS

        1. Get the author email with npm owner ls <pkgname>
        2. -
        3. Email the author, CC support@npmjs.com
        4. +
        5. Email the author, CC support@npmjs.com
        6. After a few weeks, if there's no resolution, we'll sort it out.

        Don't squat on package names. Publish code or move out of the way.

        @@ -51,12 +51,12 @@

        DESCRIPTION

        owner (Bob).
      • Joe emails Bob, explaining the situation as respectfully as possible, and what he would like to do with the module name. He -adds the npm support staff support@npmjs.com to the CC list of +adds the npm support staff support@npmjs.com to the CC list of the email. Mention in the email that Bob can run npm owner add joe foo to add Joe as an owner of the foo package.
      • After a reasonable amount of time, if Bob has not responded, or if Bob and Joe can't come to any sort of resolution, email support -support@npmjs.com and we'll sort it out. ("Reasonable" is +support@npmjs.com and we'll sort it out. ("Reasonable" is usually at least 4 weeks, but extra time is allowed around common holidays.)
      • @@ -112,5 +112,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/misc/npm-faq.html b/deps/npm/html/doc/misc/npm-faq.html index 7e2c7aca0aa..52c5ce34980 100644 --- a/deps/npm/html/doc/misc/npm-faq.html +++ b/deps/npm/html/doc/misc/npm-faq.html @@ -237,7 +237,7 @@

        I get ECONNREFUSED a lot. What'

        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.

        -

        If the registry IS down, let us know by emailing support@npmjs.com +

        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.

        @@ -285,5 +285,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/misc/npm-index.html b/deps/npm/html/doc/misc/npm-index.html index 3db53a7490e..57cfe99cd9b 100644 --- a/deps/npm/html/doc/misc/npm-index.html +++ b/deps/npm/html/doc/misc/npm-index.html @@ -228,5 +228,5 @@

        semver(7)

               - + diff --git a/deps/npm/html/doc/misc/npm-registry.html b/deps/npm/html/doc/misc/npm-registry.html index 44faba0a9ba..3f8eb098933 100644 --- a/deps/npm/html/doc/misc/npm-registry.html +++ b/deps/npm/html/doc/misc/npm-registry.html @@ -71,5 +71,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/misc/npm-scripts.html b/deps/npm/html/doc/misc/npm-scripts.html index 31c6e2fc191..1f02b17474b 100644 --- a/deps/npm/html/doc/misc/npm-scripts.html +++ b/deps/npm/html/doc/misc/npm-scripts.html @@ -218,5 +218,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/misc/removing-npm.html b/deps/npm/html/doc/misc/removing-npm.html index d03538d595d..888c6f0b08b 100644 --- a/deps/npm/html/doc/misc/removing-npm.html +++ b/deps/npm/html/doc/misc/removing-npm.html @@ -57,5 +57,5 @@

        SEE ALSO

               - + diff --git a/deps/npm/html/doc/misc/semver.html b/deps/npm/html/doc/misc/semver.html index 818e554c6c4..1119bcc52be 100644 --- a/deps/npm/html/doc/misc/semver.html +++ b/deps/npm/html/doc/misc/semver.html @@ -165,5 +165,5 @@

        Ranges

               - + diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js index f826a76e8a0..579ecb0a9f8 100644 --- a/deps/npm/lib/adduser.js +++ b/deps/npm/lib/adduser.js @@ -23,7 +23,6 @@ function adduser (args, cb) { , p : npm.config.get("_password") || "" , e : npm.config.get("email") || "" } - , changed = false , u = {} , fns = [readUsername, readPassword, readEmail, save] @@ -134,7 +133,7 @@ function save (c, u, cb) { } npm.spinner.start() // save existing configs, but yank off for this PUT - registry.adduser(u.u, u.p, u.e, function (er) { + registry.adduser(npm.config.get("registry"), u.u, u.p, u.e, function (er) { npm.spinner.stop() if (er) return cb(er) registry.username = u.u diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js index be79ab30e62..b3022bf2a20 100644 --- a/deps/npm/lib/bugs.js +++ b/deps/npm/lib/bugs.js @@ -10,10 +10,12 @@ var npm = require("./npm.js") , path = require("path") , readJson = require("read-package-json") , fs = require("fs") + , url = require("url") bugs.completion = function (opts, cb) { if (opts.conf.argv.remain.length > 2) return cb() - registry.get("/-/short", 60000, function (er, list) { + var uri = url.resolve(npm.config.get("registry"), "-/short") + registry.get(uri, { timeout : 60000 }, function (er, list) { return cb(null, list || []) }) } @@ -54,7 +56,8 @@ function getUrlAndOpen (d, cb) { } function callRegistry (n, cb) { - registry.get(n + "/latest", 3600, function (er, d) { + var uri = url.resolve(npm.config.get("registry"), n + "/latest") + registry.get(uri, { timeout : 3600 }, function (er, d) { if (er) return cb(er) getUrlAndOpen (d, cb) }) diff --git a/deps/npm/lib/build.js b/deps/npm/lib/build.js index 4b73c1e2701..350774a453f 100644 --- a/deps/npm/lib/build.js +++ b/deps/npm/lib/build.js @@ -77,7 +77,6 @@ function linkStuff (pkg, folder, global, didRB, cb) { // otherwise, then bins are in folder/../.bin var parent = path.dirname(folder) , gnm = global && npm.globalDir - , top = parent === npm.dir , gtop = parent === gnm log.verbose("linkStuff", [global, gnm, gtop, parent]) @@ -150,7 +149,7 @@ function rebuildBundles (pkg, folder, parent, gtop, cb) { if (build._didBuild[file]) return cb() log.verbose("rebuild bundle", file) // if file is not a package dir, then don't do it. - fs.lstat(path.resolve(file, "package.json"), function (er, st) { + fs.lstat(path.resolve(file, "package.json"), function (er) { if (er) return cb() build_(false)(file, cb) }) @@ -219,7 +218,6 @@ function linkMans (pkg, folder, parent, gtop, cb) { var parseMan = man.match(/(.*\.([0-9]+)(\.gz)?)$/) , stem = parseMan[1] , sxn = parseMan[2] - , gz = parseMan[3] || "" , bn = path.basename(stem) , manDest = path.join(manRoot, "man" + sxn, bn) diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js index 99e85a0f956..37bba5a0653 100644 --- a/deps/npm/lib/cache.js +++ b/deps/npm/lib/cache.js @@ -71,6 +71,7 @@ var npm = require("./npm.js") , addLocal = require("./cache/add-local.js") , addRemoteTarball = require("./cache/add-remote-tarball.js") , addRemoteGit = require("./cache/add-remote-git.js") + , inflight = require("inflight") cache.usage = "npm cache add " + "\nnpm cache add " @@ -207,6 +208,8 @@ cache.add = function (pkg, ver, scrub, cb) { return add([pkg, ver], cb) } + +var adding = 0 function add (args, cb) { // this is hot code. almost everything passes through here. // the args can be any of: @@ -240,6 +243,10 @@ function add (args, cb) { if (!name && !spec) return cb(usage) + if (adding <= 0) { + npm.spinner.start() + } + adding ++ cb = afterAdd([name, spec], cb) // see if the spec is a url @@ -298,6 +305,10 @@ function unpack (pkg, ver, unpackTarget, dMode, fMode, uid, gid, cb) { } function afterAdd (arg, cb) { return function (er, data) { + adding -- + if (adding <= 0) { + npm.spinner.stop() + } if (er || !data || !data.name || !data.version) { return cb(er, data) } @@ -307,8 +318,17 @@ function afterAdd (arg, cb) { return function (er, data) { var name = data.name var ver = data.version var pj = path.join(npm.cache, name, ver, "package", "package.json") - fs.writeFile(pj, JSON.stringify(data), "utf8", function (er) { - cb(er, data) + var tmp = pj + "." + process.pid + + var done = inflight(pj, cb) + + if (!done) return + + fs.writeFile(tmp, JSON.stringify(data), "utf8", function (er) { + if (er) return done(er) + fs.rename(tmp, pj, function (er) { + done(er, data) + }) }) }} diff --git a/deps/npm/lib/cache/add-named.js b/deps/npm/lib/cache/add-named.js index 7684d01d0bc..7137cc9b569 100644 --- a/deps/npm/lib/cache/add-named.js +++ b/deps/npm/lib/cache/add-named.js @@ -65,7 +65,8 @@ function addNameTag (name, tag, data, cb_) { return cb_(er, data) } - registry.get(name, function (er, data, json, resp) { + var uri = url.resolve(npm.config.get("registry"), name) + registry.get(uri, null, function (er, data, json, resp) { if (!er) { er = errorResponse(name, resp) } @@ -113,7 +114,8 @@ function addNameVersion (name, v, data, cb) { response = null return next() } - registry.get(name, function (er, d, json, resp) { + var uri = url.resolve(npm.config.get("registry"), name) + registry.get(uri, null, function (er, d, json, resp) { if (!er) { er = errorResponse(name, resp) } @@ -195,7 +197,8 @@ function addNameRange (name, range, data, cb) { log.silly("addNameRange", {name:name, range:range, hasData:!!data}) if (data) return next() - registry.get(name, function (er, d, json, resp) { + var uri = url.resolve(npm.config.get("registry"), name) + registry.get(uri, null, function (er, d, json, resp) { if (!er) { er = errorResponse(name, resp) } diff --git a/deps/npm/lib/cache/add-remote-git.js b/deps/npm/lib/cache/add-remote-git.js index 2168d189fdd..7743aa4a450 100644 --- a/deps/npm/lib/cache/add-remote-git.js +++ b/deps/npm/lib/cache/add-remote-git.js @@ -1,7 +1,6 @@ var mkdir = require("mkdirp") , assert = require("assert") - , spawn = require("child_process").spawn - , exec = require("child_process").execFile + , git = require("../utils/git.js") , once = require("once") , fs = require("graceful-fs") , log = require("npmlog") @@ -86,64 +85,22 @@ function checkGitDir (p, u, co, origUrl, silent, cb) { cloneGitRemote(p, u, co, origUrl, silent, cb) }) - var git = npm.config.get("git") var args = [ "config", "--get", "remote.origin.url" ] var env = gitEnv() // check for git - which(git, function (err) { - if (err) { - err.code = "ENOGIT" - return cb(err) - } - exec(git, args, {cwd: p, env: env}, function (er, stdout, stderr) { - var stdoutTrimmed = (stdout + "\n" + stderr).trim() - if (er || u !== stdout.trim()) { - log.warn( "`git config --get remote.origin.url` returned " - + "wrong result ("+u+")", stdoutTrimmed ) - return rm(p, function (er){ - if (er) return cb(er) - cloneGitRemote(p, u, co, origUrl, silent, cb) - }) - } - log.verbose("git remote.origin.url", stdoutTrimmed) - archiveGitRemote(p, u, co, origUrl, cb) - }) - }) - }) -} - -function checkGitDir (p, u, co, origUrl, silent, cb) { - fs.stat(p, function (er, s) { - if (er) return cloneGitRemote(p, u, co, origUrl, silent, cb) - if (!s.isDirectory()) return rm(p, function (er){ - if (er) return cb(er) - cloneGitRemote(p, u, co, origUrl, silent, cb) - }) - - var git = npm.config.get("git") - var args = [ "config", "--get", "remote.origin.url" ] - var env = gitEnv() - - // check for git - which(git, function (err) { - if (err) { - err.code = "ENOGIT" - return cb(err) + git.whichAndExec(args, {cwd: p, env: env}, function (er, stdout, stderr) { + var stdoutTrimmed = (stdout + "\n" + stderr).trim() + if (er || u !== stdout.trim()) { + log.warn( "`git config --get remote.origin.url` returned " + + "wrong result ("+u+")", stdoutTrimmed ) + return rm(p, function (er){ + if (er) return cb(er) + cloneGitRemote(p, u, co, origUrl, silent, cb) + }) } - exec(git, args, {cwd: p, env: env}, function (er, stdout, stderr) { - var stdoutTrimmed = (stdout + "\n" + stderr).trim() - if (er || u !== stdout.trim()) { - log.warn( "`git config --get remote.origin.url` returned " - + "wrong result ("+u+")", stdoutTrimmed ) - return rm(p, function (er){ - if (er) return cb(er) - cloneGitRemote(p, u, co, origUrl, silent, cb) - }) - } - log.verbose("git remote.origin.url", stdoutTrimmed) - archiveGitRemote(p, u, co, origUrl, cb) - }) + log.verbose("git remote.origin.url", stdoutTrimmed) + archiveGitRemote(p, u, co, origUrl, cb) }) }) } @@ -152,35 +109,27 @@ function cloneGitRemote (p, u, co, origUrl, silent, cb) { mkdir(p, function (er) { if (er) return cb(er) - var git = npm.config.get("git") var args = [ "clone", "--mirror", u, p ] var env = gitEnv() // check for git - which(git, function (err) { - if (err) { - err.code = "ENOGIT" - return cb(err) - } - exec(git, args, {cwd: p, env: env}, function (er, stdout, stderr) { - stdout = (stdout + "\n" + stderr).trim() - if (er) { - if (silent) { - log.verbose("git clone " + u, stdout) - } else { - log.error("git clone " + u, stdout) - } - return cb(er) + git.whichAndExec(args, {cwd: p, env: env}, function (er, stdout, stderr) { + stdout = (stdout + "\n" + stderr).trim() + if (er) { + if (silent) { + log.verbose("git clone " + u, stdout) + } else { + log.error("git clone " + u, stdout) } - log.verbose("git clone " + u, stdout) - archiveGitRemote(p, u, co, origUrl, cb) - }) + return cb(er) + } + log.verbose("git clone " + u, stdout) + archiveGitRemote(p, u, co, origUrl, cb) }) }) } function archiveGitRemote (p, u, co, origUrl, cb) { - var git = npm.config.get("git") var archive = [ "fetch", "-a", "origin" ] var resolve = [ "rev-list", "-n1", co ] var env = gitEnv() @@ -188,7 +137,7 @@ function archiveGitRemote (p, u, co, origUrl, cb) { var resolved = null var tmp - exec(git, archive, {cwd: p, env: env}, function (er, stdout, stderr) { + git.whichAndExec(archive, {cwd: p, env: env}, function (er, stdout, stderr) { stdout = (stdout + "\n" + stderr).trim() if (er) { log.error("git fetch -a origin ("+u+")", stdout) @@ -221,7 +170,7 @@ function archiveGitRemote (p, u, co, origUrl, cb) { } function resolveHead () { - exec(git, resolve, {cwd: p, env: env}, function (er, stdout, stderr) { + git.whichAndExec(resolve, {cwd: p, env: env}, function (er, stdout, stderr) { stdout = (stdout + "\n" + stderr).trim() if (er) { log.error("Failed resolving git HEAD (" + u + ")", stderr) @@ -250,12 +199,11 @@ function archiveGitRemote (p, u, co, origUrl, cb) { mkdir(path.dirname(tmp), function (er) { if (er) return cb(er) var gzip = zlib.createGzip({ level: 9 }) - var git = npm.config.get("git") var args = ["archive", co, "--format=tar", "--prefix=package/"] var out = fs.createWriteStream(tmp) var env = gitEnv() cb = once(cb) - var cp = spawn(git, args, { env: env, cwd: p }) + var cp = git.spawn(args, { env: env, cwd: p }) cp.on("error", cb) cp.stderr.on("data", function(chunk) { log.silly(chunk.toString(), "git archive") diff --git a/deps/npm/lib/completion.js b/deps/npm/lib/completion.js index 0e56d043fea..5c1098a599d 100644 --- a/deps/npm/lib/completion.js +++ b/deps/npm/lib/completion.js @@ -26,12 +26,11 @@ completion.completion = function (opts, cb) { , path = require("path") , bashExists = null , zshExists = null - , bashProfExists = null - fs.stat(path.resolve(process.env.HOME, ".bashrc"), function (er, b) { + fs.stat(path.resolve(process.env.HOME, ".bashrc"), function (er) { bashExists = !er next() }) - fs.stat(path.resolve(process.env.HOME, ".zshrc"), function (er, b) { + fs.stat(path.resolve(process.env.HOME, ".zshrc"), function (er) { zshExists = !er next() }) @@ -79,7 +78,6 @@ function completion (args, cb) { , word = words[w] , line = process.env.COMP_LINE , point = +process.env.COMP_POINT - , lineLength = line.length , partialLine = line.substr(0, point) , partialWords = words.slice(0, w) @@ -159,7 +157,7 @@ function dumpScript (cb) { if (er) return cb(er) d = d.replace(/^\#\!.*?\n/, "") - process.stdout.write(d, function (n) { cb() }) + process.stdout.write(d, function () { cb() }) process.stdout.on("error", function (er) { // Darwin is a real dick sometimes. // @@ -218,8 +216,6 @@ function configCompl (opts, cb) { , split = word.match(/^(-+)((?:no-)*)(.*)$/) , dashes = split[1] , no = split[2] - , conf = split[3] - , confs = allConfs , flags = configNames.filter(isFlag) console.error(flags) @@ -241,7 +237,6 @@ function configValueCompl (opts, cb) { function isFlag (word) { // shorthands never take args. var split = word.match(/^(-*)((?:no-)+)?(.*)$/) - , dashes = split[1] , no = split[2] , conf = split[3] return no || configTypes[conf] === Boolean || shorthands[conf] diff --git a/deps/npm/lib/config.js b/deps/npm/lib/config.js index 7d9776379a2..8dc814acd0a 100644 --- a/deps/npm/lib/config.js +++ b/deps/npm/lib/config.js @@ -11,7 +11,6 @@ config.usage = "npm config set " var log = require("npmlog") , npm = require("./npm.js") - , spawn = require("child_process").spawn , fs = require("graceful-fs") , npmconf = require("npmconf") , types = npmconf.defs.types @@ -150,10 +149,6 @@ function sort (a, b) { return a > b ? 1 : -1 } -function reverse (a, b) { - return a > b ? -1 : 1 -} - function public (k) { return !(k.charAt(0) === "_" || types[k] !== types[k]) } @@ -236,7 +231,6 @@ function list (cb) { , bpath = builtin.path , bconfKeys = getKeys(bconf) if (bconfKeys.length) { - var path = require("path") msg += "; builtin config " + bpath + "\n" bconfKeys.forEach(function (k) { var val = (k.charAt(0) === "_") diff --git a/deps/npm/lib/dedupe.js b/deps/npm/lib/dedupe.js index 0c2b18a7842..e6762e15bc5 100644 --- a/deps/npm/lib/dedupe.js +++ b/deps/npm/lib/dedupe.js @@ -7,14 +7,11 @@ // much better "put pkg X at folder Y" abstraction. Oh well, // whatever. Perfect enemy of the good, and all that. +var url = require("url") var fs = require("fs") var asyncMap = require("slide").asyncMap var path = require("path") var readJson = require("read-package-json") -var archy = require("archy") -var util = require("util") -var RegClient = require("npm-registry-client") -var npmconf = require("npmconf") var semver = require("semver") var rm = require("./utils/gently-rm.js") var log = require("npmlog") @@ -93,7 +90,6 @@ function dedupe_ (dir, filter, unavoidable, dryrun, silent, cb) { })] })] }).map(function (item) { - var name = item[0] var set = item[1] var ranges = set.map(function (i) { @@ -137,7 +133,6 @@ function dedupe_ (dir, filter, unavoidable, dryrun, silent, cb) { b.pop() // find the longest chain that both A and B share. // then push the name back on it, and join by /node_modules/ - var res = [] for (var i = 0, al = a.length, bl = b.length; i < al && i < bl && a[i] === b[i]; i++); return a.slice(0, i).concat(name).join(path.sep + "node_modules" + path.sep) }) : undefined @@ -204,9 +199,9 @@ function installAndRetest (set, filter, dir, unavoidable, silent, cb) { // hrm? return cb(new Error("danger zone\n" + name + " " + - + regMatch + " " + locMatch)) + regMatch + " " + locMatch)) - }, function (er, installed) { + }, function (er) { if (er) return cb(er) asyncMap(remove, rm, function (er) { if (er) return cb(er) @@ -245,7 +240,8 @@ function findVersions (npm, summary, cb) { var versions = data.versions var ranges = data.ranges - npm.registry.get(name, function (er, data) { + var uri = url.resolve(npm.config.get("registry"), name) + npm.registry.get(uri, null, function (er, data) { var regVersions = er ? [] : Object.keys(data.versions) var locMatch = bestMatch(versions, ranges) var regMatch; diff --git a/deps/npm/lib/deprecate.js b/deps/npm/lib/deprecate.js index 7d0b41ac738..175b69ceb13 100644 --- a/deps/npm/lib/deprecate.js +++ b/deps/npm/lib/deprecate.js @@ -1,3 +1,5 @@ +var url = require("url") + , npm = require("./npm.js") module.exports = deprecate @@ -10,18 +12,15 @@ deprecate.completion = function (opts, cb) { if (!npm.config.get("username")) return cb() if (opts.conf.argv.remain.length > 2) return cb() // get the list of packages by user - var uri = "/-/by-user/"+encodeURIComponent(un) - registry.get(uri, null, 60000, function (er, list) { + var path = "/-/by-user/"+encodeURIComponent(un) + , uri = url.resolve(npm.config.get("registry"), path) + npm.registry.get(uri, { timeout : 60000 }, function (er, list) { if (er) return cb() console.error(list) return cb(null, list[un]) }) } -var semver = require("semver") - , npm = require("./npm.js") - , registry = npm.registry - function deprecate (args, cb) { var pkg = args[0] , msg = args[1] @@ -30,18 +29,7 @@ function deprecate (args, cb) { pkg = pkg.split(/@/) var name = pkg.shift() , ver = pkg.join("@") - if (semver.validRange(ver) === null) { - return cb(new Error("invalid version range: "+ver)) - } - registry.get(name, function (er, data) { - if (er) return cb(er) - // filter all the versions that match - Object.keys(data.versions).filter(function (v) { - return semver.satisfies(v, ver, true) - }).forEach(function (v) { - data.versions[v].deprecated = msg - }) - // now update the doc on the registry - registry.request('PUT', data._id, data, cb) - }) + , uri = url.resolve(npm.config.get("registry"), name) + + npm.registry.deprecate(uri, ver, msg, cb) } diff --git a/deps/npm/lib/docs.js b/deps/npm/lib/docs.js index 2abbd62f26c..77073fbb9c1 100644 --- a/deps/npm/lib/docs.js +++ b/deps/npm/lib/docs.js @@ -5,16 +5,18 @@ docs.usage += "\n" docs.usage += "npm docs ." docs.completion = function (opts, cb) { - registry.get("/-/short", 60000, function (er, list) { + var uri = url_.resolve(npm.config.get("registry"), "/-/short") + registry.get(uri, { timeout : 60000 }, function (er, list) { return cb(null, list || []) }) } -var npm = require("./npm.js") +var url_ = require("url") + , npm = require("./npm.js") , registry = npm.registry , opener = require("opener") - , path = require('path') - , log = require('npmlog') + , path = require("path") + , log = require("npmlog") function url (json) { return json.homepage ? json.homepage : "https://npmjs.org/package/" + json.name @@ -26,7 +28,9 @@ function docs (args, cb) { if (!pending) return getDoc('.', cb) args.forEach(function(proj) { getDoc(proj, function(err) { - if (err) return cb(err) + if (err) { + return cb(err) + } --pending || cb() }) }) @@ -37,8 +41,9 @@ function getDoc (project, cb) { var package = path.resolve(process.cwd(), "package.json") if (project === '.' || project === './') { + var json try { - var json = require(package) + json = require(package) if (!json.name) throw new Error('package.json does not have a valid "name" property') project = json.name } catch (e) { @@ -49,7 +54,8 @@ function getDoc (project, cb) { return opener(url(json), { command: npm.config.get("browser") }, cb) } - registry.get(project + "/latest", 3600, function (er, json) { + var uri = url_.resolve(npm.config.get("registry"), project + "/latest") + registry.get(uri, { timeout : 3600 }, function (er, json) { var github = "https://github.com/" + project + "#readme" if (er) { diff --git a/deps/npm/lib/edit.js b/deps/npm/lib/edit.js index 791dc60cfd2..ddf501d54e5 100644 --- a/deps/npm/lib/edit.js +++ b/deps/npm/lib/edit.js @@ -7,7 +7,6 @@ edit.usage = "npm edit " edit.completion = require("./utils/completion/installed-shallow.js") var npm = require("./npm.js") - , spawn = require("child_process").spawn , path = require("path") , fs = require("graceful-fs") , editor = require("editor") diff --git a/deps/npm/lib/help-search.js b/deps/npm/lib/help-search.js index 027f14c428c..d8553453bc5 100644 --- a/deps/npm/lib/help-search.js +++ b/deps/npm/lib/help-search.js @@ -4,11 +4,9 @@ module.exports = helpSearch var fs = require("graceful-fs") , path = require("path") , asyncMap = require("slide").asyncMap - , cliDocsPath = path.join(__dirname, "..", "doc", "cli") - , apiDocsPath = path.join(__dirname, "..", "doc", "api") - , log = require("npmlog") , npm = require("./npm.js") , glob = require("glob") + , color = require("ansicolors") helpSearch.usage = "npm help-search " @@ -16,9 +14,6 @@ function helpSearch (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false if (!args.length) return cb(helpSearch.usage) - // see if we're actually searching the api docs. - var argv = npm.config.get("argv").cooked - var docPath = path.resolve(__dirname, "..", "doc") return glob(docPath + "/*/*.md", function (er, files) { if (er) @@ -53,24 +48,27 @@ function searchFiles (args, files, cb) { var data = files[file] // skip if no matches at all + var match for (var a = 0, l = args.length; a < l && !match; a++) { - var match = data.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 + match = data.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 } if (!match) return var lines = data.split(/\n+/) - var context = [] // if a line has a search term, then skip it and the next line. // if the next line has a search term, then skip all 3 // otherwise, set the line to null. then remove the nulls. - for (var i = 0, l = lines.length; i < l; i ++) { + l = lines.length + for (var i = 0; i < l; i ++) { var line = lines[i] , nextLine = lines[i + 1] - , match = false + , ll + + match = false if (nextLine) { - for (var a = 0, ll = args.length; a < ll && !match; a ++) { + for (a = 0, ll = args.length; a < ll && !match; a ++) { match = nextLine.toLowerCase() .indexOf(args[a].toLowerCase()) !== -1 } @@ -82,7 +80,7 @@ function searchFiles (args, files, cb) { } match = false - for (var a = 0, ll = args.length; a < ll && !match; a ++) { + for (a = 0, ll = args.length; a < ll && !match; a ++) { match = line.toLowerCase().indexOf(args[a].toLowerCase()) !== -1 } if (match) { @@ -161,7 +159,7 @@ function formatResults (args, results, cb) { var cols = Math.min(process.stdout.columns || Infinity, 80) + 1 - var out = results.map(function (res, i, results) { + var out = results.map(function (res) { var out = res.cmd , r = Object.keys(res.hits).map(function (k) { return k + ":" + res.hits[k] @@ -170,37 +168,31 @@ function formatResults (args, results, cb) { }).join(" ") out += ((new Array(Math.max(1, cols - out.length - r.length))) - .join (" ")) + r + .join(" ")) + r if (!npm.config.get("long")) return out - var out = "\n\n" + out + out = "\n\n" + out + "\n" + (new Array(cols)).join("—") + "\n" + res.lines.map(function (line, i) { if (line === null || i > 3) return "" for (var out = line, a = 0, l = args.length; a < l; a ++) { var finder = out.toLowerCase().split(args[a].toLowerCase()) - , newOut = [] + , newOut = "" , p = 0 + finder.forEach(function (f) { - newOut.push( out.substr(p, f.length) - , "\1" - , out.substr(p + f.length, args[a].length) - , "\2" ) + newOut += out.substr(p, f.length) + + var hilit = out.substr(p + f.length, args[a].length) + if (npm.color) hilit = color.bgBlack(color.red(hilit)) + newOut += hilit + p += f.length + args[a].length }) - out = newOut.join("") } - if (npm.color) { - var color = "\033[31;40m" - , reset = "\033[0m" - } else { - var color = "" - , reset = "" - } - out = out.split("\1").join(color) - .split("\2").join(reset) - return out + + return newOut }).join("\n").trim() return out }).join("\n") diff --git a/deps/npm/lib/help.js b/deps/npm/lib/help.js index c68f322abf8..8f54d69ded7 100644 --- a/deps/npm/lib/help.js +++ b/deps/npm/lib/help.js @@ -6,8 +6,7 @@ help.completion = function (opts, cb) { getSections(cb) } -var fs = require("graceful-fs") - , path = require("path") +var path = require("path") , spawn = require("child_process").spawn , npm = require("./npm.js") , log = require("npmlog") @@ -58,7 +57,6 @@ function help (args, cb) { // npm help
        : Try to find the path var manroot = path.resolve(__dirname, "..", "man") - var htmlroot = path.resolve(__dirname, "..", "html", "doc") // legacy if (section === "global") @@ -109,10 +107,11 @@ function viewMan (man, cb) { env.MANPATH = manpath var viewer = npm.config.get("viewer") + var conf switch (viewer) { case "woman": var a = ["-e", "(woman-find-file \"" + man + "\")"] - var conf = { env: env, customFds: [ 0, 1, 2] } + conf = { env: env, customFds: [ 0, 1, 2] } var woman = spawn("emacsclient", a, conf) woman.on("close", cb) break @@ -122,9 +121,9 @@ function viewMan (man, cb) { break default: - var conf = { env: env, customFds: [ 0, 1, 2] } - var man = spawn("man", [num, section], conf) - man.on("close", cb) + conf = { env: env, customFds: [ 0, 1, 2] } + var manProcess = spawn("man", [num, section], conf) + manProcess.on("close", cb) break } } @@ -193,7 +192,6 @@ function usages () { + (usage.split("\n") .join("\n" + (new Array(maxLen + 6).join(" ")))) }).join("\n") - return out } diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js index 5cf974ea7f8..8f20bc83968 100644 --- a/deps/npm/lib/install.js +++ b/deps/npm/lib/install.js @@ -34,7 +34,8 @@ install.completion = function (opts, cb) { // if it starts with https?://, then just give up, because it's a url // for now, not yet implemented. var registry = npm.registry - registry.get("/-/short", function (er, pkgs) { + , uri = url.resolve(npm.config.get("registry"), "-/short") + registry.get(uri, null, function (er, pkgs) { if (er) return cb() if (!opts.partialWord) return cb(null, pkgs) @@ -47,7 +48,8 @@ install.completion = function (opts, cb) { return cb(null, pkgs) } - registry.get(pkgs[0], function (er, d) { + uri = url.resolve(npm.config.get("registry"), pkgs[0]) + registry.get(uri, null, function (er, d) { if (er) return cb() return cb(null, Object.keys(d["dist-tags"] || {}) .concat(Object.keys(d.versions || {})) @@ -119,7 +121,7 @@ function install (args, cb_) { }) } - mkdir(where, function (er, made) { + mkdir(where, function (er) { if (er) return cb(er) // install dependencies locally by default, // or install current folder globally @@ -151,7 +153,6 @@ function install (args, cb_) { installManyTop(deps.map(function (dep) { var target = data.dependencies[dep] - , parsed = url.parse(target.replace(/^git\+/, "git")) target = dep + "@" + target return target }), where, context, function(er, results) { @@ -206,7 +207,7 @@ function findPeerInvalid_ (packageMap, fpiList) { if (pkg.peerInvalid) { var peersDepending = {}; - for (peerName in packageMap) { + for (var peerName in packageMap) { var peer = packageMap[peerName] if (peer.peerDependencies && peer.peerDependencies[packageName]) { peersDepending[peer.name + "@" + peer.version] = @@ -289,8 +290,9 @@ function readDependencies (context, where, opts, cb) { return cb(null, data, null) } + var newwrap try { - var newwrap = JSON.parse(wrapjson) + newwrap = JSON.parse(wrapjson) } catch (ex) { return cb(ex) } @@ -525,9 +527,6 @@ function installManyTop (what, where, context, cb_) { function installManyTop_ (what, where, context, cb) { var nm = path.resolve(where, "node_modules") - , names = context.explicit - ? what.map(function (w) { return w.split(/@/).shift() }) - : [] fs.readdir(nm, function (er, pkgs) { if (er) return installMany(what, where, context, cb) @@ -837,8 +836,6 @@ function installOne_ (target, where, context, cb) { if (prettyWhere === ".") prettyWhere = null if (isIncompatibleInstallOneInProgress(target, where)) { - var prettyTarget = path.relative(process.cwd(), targetFolder) - // just call back, with no error. the error will be detected in the // final check for peer-invalid dependencies return cb() @@ -978,7 +975,6 @@ function prepareForInstallMany (packageData, depsKey, bundled, wrap, family) { return true }).map(function (d) { var t = packageData[depsKey][d] - , parsed = url.parse(t.replace(/^git\+/, "git")) t = d + "@" + t return t }) diff --git a/deps/npm/lib/link.js b/deps/npm/lib/link.js index 56284655069..8022fc78dfe 100644 --- a/deps/npm/lib/link.js +++ b/deps/npm/lib/link.js @@ -132,7 +132,7 @@ function linkPkg (folder, cb_) { if (er) return cb(er) log.verbose("link", "build target", target) // also install missing dependencies. - npm.commands.install(me, [], function (er, installed) { + npm.commands.install(me, [], function (er) { if (er) return cb(er) // build the global stuff. Don't run *any* scripts, because // install command already will have done that. diff --git a/deps/npm/lib/ls.js b/deps/npm/lib/ls.js index 12e4d2edcc1..781b6443b99 100644 --- a/deps/npm/lib/ls.js +++ b/deps/npm/lib/ls.js @@ -15,6 +15,7 @@ var npm = require("./npm.js") , semver = require("semver") , url = require("url") , isGitUrl = require("./utils/is-git-url.js") + , color = require("ansicolors") ls.usage = "npm ls" @@ -68,17 +69,12 @@ function ls (args, silent, cb) { // if any errors were found, then complain and exit status 1 if (lite.problems && lite.problems.length) { - er = lite.problems.join('\n') + er = lite.problems.join("\n") } cb(er, data, lite) }) } -// only include -function filter (data, args) { - -} - function alphasort (a, b) { a = a.toLowerCase() b = b.toLowerCase() @@ -128,6 +124,7 @@ function getLite (data, noname) { var dep = data.dependencies[d] if (typeof dep === "string") { lite.problems = lite.problems || [] + var p if (data.depth > maxDepth) { p = "max depth reached: " } else { @@ -220,14 +217,12 @@ function makeArchy (data, long, dir) { } function makeArchy_ (data, long, dir, depth, parent, d) { - var color = npm.color if (typeof data === "string") { if (depth -1 <= npm.config.get("depth")) { // just missing - var p = parent.link || parent.path var unmet = "UNMET DEPENDENCY" - if (color) { - unmet = "\033[31;40m" + unmet + "\033[0m" + if (npm.color) { + unmet = color.bgBlack(color.red(unmet)) } data = unmet + " " + d + "@" + data } else { @@ -240,35 +235,37 @@ function makeArchy_ (data, long, dir, depth, parent, d) { // the top level is a bit special. out.label = data._id || "" if (data._found === true && data._id) { - var pre = color ? "\033[33;40m" : "" - , post = color ? "\033[m" : "" - out.label = pre + out.label.trim() + post + " " + if (npm.color) { + out.label = color.bgBlack(color.yellow(out.label.trim())) + " " + } + else { + out.label = out.label.trim() + " " + } } if (data.link) out.label += " -> " + data.link if (data.invalid) { if (data.realName !== data.name) out.label += " ("+data.realName+")" - out.label += " " + (color ? "\033[31;40m" : "") - + "invalid" - + (color ? "\033[0m" : "") + var invalid = "invalid" + if (npm.color) invalid = color.bgBlack(color.red(invalid)) + out.label += " " + invalid } if (data.peerInvalid) { - out.label += " " + (color ? "\033[31;40m" : "") - + "peer invalid" - + (color ? "\033[0m" : "") + var peerInvalid = "peer invalid" + if (npm.color) peerInvalid = color.bgBlack(color.red(peerInvalid)) + out.label += " " + peerInvalid } if (data.extraneous && data.path !== dir) { - out.label += " " + (color ? "\033[32;40m" : "") - + "extraneous" - + (color ? "\033[0m" : "") + var extraneous = "extraneous" + if (npm.color) extraneous = color.bgBlack(color.green(extraneous)) + out.label += " " + extraneous } // add giturl to name@version if (data._resolved) { - var p = url.parse(data._resolved) - if (isGitUrl(p)) + if (isGitUrl(url.parse(data._resolved))) out.label += " (" + data._resolved + ")" } @@ -293,7 +290,7 @@ function makeArchy_ (data, long, dir, depth, parent, d) { return out } -function getExtras (data, dir) { +function getExtras (data) { var extras = [] if (data.description) extras.push(data.description) @@ -328,7 +325,6 @@ function makeParseable_ (data, long, dir, depth, parent, d) { if (typeof data === "string") { if (data.depth < npm.config.get("depth")) { - var p = parent.link || parent.path data = npm.config.get("long") ? path.resolve(parent.path, "node_modules", d) + ":"+d+"@"+JSON.stringify(data)+":INVALID:MISSING" diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js index c0c744f99be..c7288e2b776 100644 --- a/deps/npm/lib/npm.js +++ b/deps/npm/lib/npm.js @@ -15,8 +15,7 @@ if (typeof WScript !== "undefined") { require('child-process-close') var EventEmitter = require("events").EventEmitter - , npm = module.exports = new EventEmitter - , config = require("./config.js") + , npm = module.exports = new EventEmitter() , npmconf = require("npmconf") , log = require("npmlog") , fs = require("graceful-fs") @@ -163,13 +162,16 @@ var commandCache = {} npm.spinner = { int: null + , started: false , start: function () { if (npm.spinner.int) return var c = npm.config.get("spin") if (!c) return var stream = npm.config.get("logstream") var opt = { tty: c !== "always", stream: stream } + opt.cleanup = !npm.spinner.started npm.spinner.int = charSpin(opt) + npm.spinner.started = true } , stop: function () { clearInterval(npm.spinner.int) @@ -199,8 +201,6 @@ Object.keys(abbrevs).concat(plumbing).forEach(function addCommand (c) { } if (args.length === 1) args.unshift([]) - npm.spinner.start() - npm.registry.version = npm.version if (!npm.registry.refer) { npm.registry.refer = [a].concat(args[0]).map(function (arg) { @@ -274,6 +274,8 @@ npm.load = function (cli, cb_) { function cb (er) { if (loadErr) return + loadErr = er + if (er) return cb_(er) if (npm.config.get("force")) { log.warn("using --force", "I sure hope you know what you are doing.") } @@ -306,6 +308,21 @@ function load (npm, cli, cb) { npmconf.load(cli, builtin, function (er, config) { if (er === config) er = null + npm.config = config + if (er) return cb(er) + + // if the "project" config is not a filename, and we're + // not in global mode, then that means that it collided + // with either the default or effective userland config + if (!config.get("global") + && config.sources.project + && config.sources.project.type !== "ini") { + log.verbose("config" + , "Skipping project config: %s. " + + "(matches userconfig)" + , config.localPrefix + "/.npmrc") + } + // Include npm-version and node-version in user-agent var ua = config.get("user-agent") || "" ua = ua.replace(/\{node-version\}/gi, process.version) @@ -314,27 +331,19 @@ function load (npm, cli, cb) { ua = ua.replace(/\{arch\}/gi, process.arch) config.set("user-agent", ua) - npm.config = config - var color = config.get("color") log.level = config.get("loglevel") log.heading = config.get("heading") || "npm" log.stream = config.get("logstream") - switch (color) { - case "always": log.enableColor(); break - case false: log.disableColor(); break - } - log.resume() - if (er) return cb(er) - - // see if we need to color normal output switch (color) { case "always": + log.enableColor() npm.color = true break case false: + log.disableColor() npm.color = false break default: @@ -346,6 +355,8 @@ function load (npm, cli, cb) { break } + log.resume() + // at this point the configs are all set. // go ahead and spin up the registry client. npm.registry = new RegClient(npm.config) @@ -361,7 +372,7 @@ function load (npm, cli, cb) { var lp = Object.getOwnPropertyDescriptor(config, "localPrefix") Object.defineProperty(npm, "localPrefix", lp) - return cb() + return cb(null, npm) }) }) } diff --git a/deps/npm/lib/outdated.js b/deps/npm/lib/outdated.js index ef406fbdc55..a71df7fe76a 100644 --- a/deps/npm/lib/outdated.js +++ b/deps/npm/lib/outdated.js @@ -39,7 +39,7 @@ function outdated (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false var dir = path.resolve(npm.dir, "..") outdated_(args, dir, {}, 0, function (er, list) { - if (er || silent) return cb(er, list) + if (er || silent || list.length === 0) return cb(er, list) if (npm.config.get("json")) { console.log(makeJSON(list)) } else if (npm.config.get("parseable")) { @@ -70,8 +70,7 @@ function outdated (args, silent, cb) { // [[ dir, dep, has, want, latest ]] function makePretty (p) { - var parseable = npm.config.get("parseable") - , dep = p[1] + var dep = p[1] , dir = path.resolve(p[0], "node_modules", dep) , has = p[2] , want = p[3] @@ -225,7 +224,7 @@ function outdated_ (args, dir, parentHas, depth, cb) { if (!has || !deps) return if (deps === true) { deps = Object.keys(has).reduce(function (l, r) { - l[r] = "*" + l[r] = "latest" return l }, {}) } @@ -268,17 +267,14 @@ function shouldUpdate (args, dir, dep, has, req, depth, cb) { if (isGitUrl(url.parse(req))) return doIt("git", "git") - var registry = npm.registry // search for the latest package - registry.get(dep, function (er, d) { + var uri = url.resolve(npm.config.get("registry"), dep) + npm.registry.get(uri, null, function (er, d) { if (er) return cb() if (!d || !d['dist-tags'] || !d.versions) return cb() var l = d.versions[d['dist-tags'].latest] if (!l) return cb() - // set to true if found in doc - var found = false - var r = req if (d['dist-tags'][req]) r = d['dist-tags'][req] diff --git a/deps/npm/lib/owner.js b/deps/npm/lib/owner.js index fdf45595578..34dbbc24722 100644 --- a/deps/npm/lib/owner.js +++ b/deps/npm/lib/owner.js @@ -15,17 +15,19 @@ owner.completion = function (opts, cb) { return cb(null, subs) } var un = encodeURIComponent(npm.config.get("username")) + var theUser, uri switch (argv[2]) { case "ls": if (argv.length > 3) return cb() - else return registry.get("/-/short", cb) + uri = url.resolve(npm.config.get("registry"), "-/short") + return registry.get(uri, null, cb) case "rm": if (argv.length > 3) { - var theUser = encodeURIComponent(argv[3]) - , uri = "/-/by-user/"+theUser+"|"+un + theUser = encodeURIComponent(argv[3]) + uri = url.resolve(npm.config.get("registry"), "-/by-user/"+theUser+"|"+un) console.error(uri) - return registry.get(uri, function (er, d) { + return registry.get(uri, null, function (er, d) { if (er) return cb(er) // return the intersection return cb(null, d[theUser].filter(function (p) { @@ -37,10 +39,10 @@ owner.completion = function (opts, cb) { // else fallthrough case "add": if (argv.length > 3) { - var theUser = encodeURIComponent(argv[3]) - , uri = "/-/by-user/"+theUser+"|"+un + theUser = encodeURIComponent(argv[3]) + uri = url.resolve(npm.config.get("registry"), "-/by-user/"+theUser+"|"+un) console.error(uri) - return registry.get(uri, function (er, d) { + return registry.get(uri, null, function (er, d) { console.error(uri, er || d) // return mine that they're not already on. if (er) return cb(er) @@ -52,7 +54,8 @@ owner.completion = function (opts, cb) { }) } // just list all users who aren't me. - return registry.get("/-/users", function (er, list) { + uri = url.resolve(npm.config.get("registry"), "-/users") + return registry.get(uri, null, function (er, list) { if (er) return cb() return cb(null, Object.keys(list).filter(function (n) { return n !== un @@ -68,6 +71,7 @@ var npm = require("./npm.js") , registry = npm.registry , log = require("npmlog") , readJson = require("read-package-json") + , url = require("url") function owner (args, cb) { var action = args.shift() @@ -86,7 +90,8 @@ function ls (pkg, cb) { ls(pkg, cb) }) - registry.get(pkg, function (er, data) { + var uri = url.resolve(npm.config.get("registry"), pkg) + registry.get(uri, null, function (er, data) { var msg = "" if (er) { log.error("owner ls", "Couldn't get owner data", pkg) @@ -151,7 +156,8 @@ function rm (user, pkg, cb) { function mutate (pkg, user, mutation, cb) { if (user) { - registry.get("/-/user/org.couchdb.user:"+user, mutate_) + var uri = url.resolve(npm.config.get("registry"), "-/user/org.couchdb.user:"+user) + registry.get(uri, null, mutate_) } else { mutate_(null, null) } @@ -166,7 +172,8 @@ function mutate (pkg, user, mutation, cb) { } if (u) u = { "name" : u.name, "email" : u.email } - registry.get(pkg, function (er, data) { + var uri = url.resolve(npm.config.get("registry"), pkg) + registry.get(uri, null, function (er, data) { if (er) { log.error("owner mutate", "Error getting package data for %s", pkg) return cb(er) @@ -178,9 +185,8 @@ function mutate (pkg, user, mutation, cb) { , _rev : data._rev , maintainers : m } - registry.request("PUT" - , pkg+"/-rev/"+data._rev, data - , function (er, data) { + var uri = url.resolve(npm.config.get("registry"), pkg+"/-rev/"+data._rev) + registry.request("PUT", uri, { body : data }, function (er, data) { if (!er && data.error) er = new Error( "Failed to update package metadata: "+JSON.stringify(data)) if (er) { diff --git a/deps/npm/lib/prune.js b/deps/npm/lib/prune.js index eb58c7f6468..edba8760135 100644 --- a/deps/npm/lib/prune.js +++ b/deps/npm/lib/prune.js @@ -15,7 +15,7 @@ prune.completion = require("./utils/completion/installed-deep.js") function prune (args, cb) { //check if is a valid package.json file var jsonFile = path.resolve(npm.dir, "..", "package.json" ) - readJson(jsonFile, log.warn, function (er, data) { + readJson(jsonFile, log.warn, function (er) { if (er) return cb(er) next() }) diff --git a/deps/npm/lib/publish.js b/deps/npm/lib/publish.js index 01d66b407f3..ccad3ea8270 100644 --- a/deps/npm/lib/publish.js +++ b/deps/npm/lib/publish.js @@ -3,10 +3,8 @@ module.exports = publish var npm = require("./npm.js") , log = require("npmlog") - , tar = require("./utils/tar.js") , path = require("path") , readJson = require("read-package-json") - , fs = require("graceful-fs") , lifecycle = require("./utils/lifecycle.js") , chain = require("slide").chain , Conf = require("npmconf").Conf @@ -70,6 +68,7 @@ function publish_ (arg, data, isRetry, cachedir, cb) { // check for publishConfig hash var registry = npm.registry + var registryURI = npm.config.get("registry") if (data.publishConfig) { var pubConf = new Conf(npm.config) pubConf.save = npm.config.save.bind(npm.config) @@ -81,6 +80,7 @@ function publish_ (arg, data, isRetry, cachedir, cb) { return s }, {})) registry = new RegClient(pubConf) + registryURI = pubConf.get("registry") } data._npmVersion = npm.version @@ -93,7 +93,7 @@ function publish_ (arg, data, isRetry, cachedir, cb) { +"Remove the 'private' field from the package.json to publish it.")) var tarball = cachedir + ".tgz" - registry.publish(data, tarball, function (er) { + registry.publish(registryURI, data, tarball, function (er) { if (er && er.code === "EPUBLISHCONFLICT" && npm.config.get("force") && !isRetry) { log.warn("publish", "Forced publish over "+data._id) diff --git a/deps/npm/lib/rebuild.js b/deps/npm/lib/rebuild.js index bd0d33b65b5..e296451b705 100644 --- a/deps/npm/lib/rebuild.js +++ b/deps/npm/lib/rebuild.js @@ -4,10 +4,7 @@ module.exports = rebuild var readInstalled = require("read-installed") , semver = require("semver") , log = require("npmlog") - , path = require("path") , npm = require("./npm.js") - , asyncMap = require("slide").asyncMap - , fs = require("graceful-fs") rebuild.usage = "npm rebuild [[@] [name[@] ...]]" diff --git a/deps/npm/lib/repo.js b/deps/npm/lib/repo.js index a2ec99bb032..d209c3ca836 100644 --- a/deps/npm/lib/repo.js +++ b/deps/npm/lib/repo.js @@ -5,14 +5,14 @@ repo.usage = "npm repo " repo.completion = function (opts, cb) { if (opts.conf.argv.remain.length > 2) return cb() - registry.get("/-/short", 60000, function (er, list) { + var uri = url_.resolve(npm.config.get("registry"), "/-/short") + registry.get(uri, { timeout : 60000 }, function (er, list) { return cb(null, list || []) }) } var npm = require("./npm.js") , registry = npm.registry - , log = require("npmlog") , opener = require("opener") , github = require('github-url-from-git') , githubUserRepo = require("github-url-from-username-repo") @@ -52,7 +52,8 @@ function getUrlAndOpen (d, cb) { } function callRegistry (n, cb) { - registry.get(n + "/latest", 3600, function (er, d) { + var uri = url_.resolve(npm.config.get("registry"), n + "/latest") + registry.get(uri, { timeout : 3600 }, function (er, d) { if (er) return cb(er) getUrlAndOpen(d, cb) }) diff --git a/deps/npm/lib/run-script.js b/deps/npm/lib/run-script.js index 8797ccd9d1d..25e98f01d65 100644 --- a/deps/npm/lib/run-script.js +++ b/deps/npm/lib/run-script.js @@ -7,8 +7,6 @@ var lifecycle = require("./utils/lifecycle.js") , readJson = require("read-package-json") , log = require("npmlog") , chain = require("slide").chain - , fs = require("graceful-fs") - , asyncMap = require("slide").asyncMap runScript.usage = "npm run-script [] " diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js index 21b6ab27949..e7892350ca6 100644 --- a/deps/npm/lib/search.js +++ b/deps/npm/lib/search.js @@ -1,7 +1,8 @@ module.exports = exports = search -var npm = require("./npm.js") +var url = require("url") + , npm = require("./npm.js") , registry = npm.registry , columnify = require('columnify') @@ -57,8 +58,13 @@ function search (args, silent, staleness, cb) { } function getFilteredData (staleness, args, notArgs, cb) { - registry.get( "/-/all", staleness, false - , true, function (er, data) { + var opts = { + timeout : staleness, + follow : true, + staleOk : true + } + var uri = url.resolve(npm.config.get("registry"), "-/all") + registry.get(uri, opts, function (er, data) { if (er) return cb(er) return cb(null, filter(data, args, notArgs)) }) @@ -115,7 +121,7 @@ function filterWords (data, args, notArgs) { for (var i = 0, l = args.length; i < l; i ++) { if (!match(words, args[i])) return false } - for (var i = 0, l = notArgs.length; i < l; i ++) { + for (i = 0, l = notArgs.length; i < l; i ++) { if (match(words, notArgs[i])) return false } return true @@ -218,7 +224,7 @@ function addColorMarker (str, arg, i) { var pieces = str.toLowerCase().split(arg.toLowerCase()) , p = 0 - return pieces.map(function (piece, i) { + return pieces.map(function (piece) { piece = str.substr(p, piece.length) var mark = markStart + str.substr(p+piece.length, arg.length) @@ -239,12 +245,12 @@ function colorize (line) { } function getMaxWidth() { + var cols try { var tty = require("tty") , stdout = process.stdout - , cols = !tty.isatty(stdout.fd) ? Infinity - : process.stdout.getWindowSize()[0] - cols = (cols == 0) ? Infinity : cols + cols = !tty.isatty(stdout.fd) ? Infinity : process.stdout.getWindowSize()[0] + cols = (cols === 0) ? Infinity : cols } catch (ex) { cols = Infinity } return cols } diff --git a/deps/npm/lib/shrinkwrap.js b/deps/npm/lib/shrinkwrap.js index ef5732590e0..5f8261d095f 100644 --- a/deps/npm/lib/shrinkwrap.js +++ b/deps/npm/lib/shrinkwrap.js @@ -60,8 +60,9 @@ function save (pkginfo, silent, cb) { // copy the keys over in a well defined order // because javascript objects serialize arbitrarily pkginfo.dependencies = sortedObject(pkginfo.dependencies || {}) + var swdata try { - var swdata = JSON.stringify(pkginfo, null, 2) + "\n" + swdata = JSON.stringify(pkginfo, null, 2) + "\n" } catch (er) { log.error("shrinkwrap", "Error converting package info to json") return cb(er) diff --git a/deps/npm/lib/star.js b/deps/npm/lib/star.js index 33b12471a84..9c0b4ea9ed9 100644 --- a/deps/npm/lib/star.js +++ b/deps/npm/lib/star.js @@ -1,7 +1,8 @@ module.exports = star -var npm = require("./npm.js") +var url = require("url") + , npm = require("./npm.js") , registry = npm.registry , log = require("npmlog") , asyncMap = require("slide").asyncMap @@ -10,7 +11,8 @@ star.usage = "npm star [pkg, pkg, ...]\n" + "npm unstar [pkg, pkg, ...]" star.completion = function (opts, cb) { - registry.get("/-/short", 60000, function (er, list) { + var uri = url.resolve(npm.config.get("registry"), "-/short") + registry.get(uri, { timeout : 60000 }, function (er, list) { return cb(null, list || []) }) } @@ -22,7 +24,8 @@ function star (args, cb) { , using = !(npm.command.match(/^un/)) if (!using) s = u asyncMap(args, function (pkg, cb) { - registry.star(pkg, using, function (er, data, raw, req) { + var uri = url.resolve(npm.config.get("registry"), pkg) + registry.star(uri, using, function (er, data, raw, req) { if (!er) { console.log(s + " "+pkg) log.verbose("star", data) diff --git a/deps/npm/lib/stars.js b/deps/npm/lib/stars.js index 74841f2de3e..f0d2ef73aeb 100644 --- a/deps/npm/lib/stars.js +++ b/deps/npm/lib/stars.js @@ -2,13 +2,15 @@ module.exports = stars stars.usage = "npm stars [username]" -var npm = require("./npm.js") +var url = require("url") + , npm = require("./npm.js") , registry = npm.registry , log = require("npmlog") function stars (args, cb) { var name = args.length === 1 ? args[0] : npm.config.get("username") - registry.stars(name, showstars) + , uri = url.resolve(npm.config.get("registry"), name) + registry.stars(uri, showstars) function showstars (er, data) { if (er) { diff --git a/deps/npm/lib/submodule.js b/deps/npm/lib/submodule.js index 5ea5a4f463e..2231ced9cfb 100644 --- a/deps/npm/lib/submodule.js +++ b/deps/npm/lib/submodule.js @@ -5,8 +5,8 @@ module.exports = submodule var npm = require("./npm.js") - , exec = require("child_process").execFile , cache = require("./cache.js") + , git = require("./utils/git.js") , asyncMap = require("slide").asyncMap , chain = require("slide").chain , which = require("which") @@ -56,64 +56,36 @@ function submodule_ (pkg, cb) { } function updateSubmodule (name, cb) { - var git = npm.config.get("git") var args = [ "submodule", "update", "--init", "node_modules/", name ] - // check for git - which(git, function (err) { - if (err) { - err.code = "ENOGIT" - return cb(err) - } - - exec(git, args, cb) - }) + git.whichAndExec(args, cb) } function addSubmodule (name, url, cb) { - var git = npm.config.get("git") var args = [ "submodule", "add", url, "node_modules/", name ] - // check for git - which(git, function (err) { - if (err) { - err.code = "ENOGIT" - return cb(err) - } - - exec(git, args, function (er) { - if (er) return cb(er) - updateSubmodule(name, cb) - }) - }) + git.whichAndExec(args, cb) } -var getSubmodules = function getSubmodules (cb) { - var git = npm.config.get("git") +var getSubmodules = function (cb) { var args = [ "submodule", "status" ] - // check for git - which(git, function (err) { - if (err) { - err.code = "ENOGIT" - return cb(err) - } - exec(git, args, function (er, stdout) { - if (er) return cb(er) - var res = stdout.trim().split(/\n/).map(function (line) { - return line.trim().split(/\s+/)[1] - }).filter(function (line) { - // only care about submodules in the node_modules folder. - return line && line.match(/^node_modules\//) - }).map(function (line) { - return line.replace(/^node_modules\//g, "") - }) - - // memoize. - getSubmodules = function (cb) { return cb(null, res) } - - cb(null, res) + + git.whichAndExec(args, function _(er, stdout) { + if (er) return cb(er) + var res = stdout.trim().split(/\n/).map(function (line) { + return line.trim().split(/\s+/)[1] + }).filter(function (line) { + // only care about submodules in the node_modules folder. + return line && line.match(/^node_modules\//) + }).map(function (line) { + return line.replace(/^node_modules\//g, "") }) + + // memoize. + getSubmodules = function (cb) { return cb(null, res) } + + cb(null, res) }) } diff --git a/deps/npm/lib/tag.js b/deps/npm/lib/tag.js index 8a7c51ca012..1d04ad1f7e0 100644 --- a/deps/npm/lib/tag.js +++ b/deps/npm/lib/tag.js @@ -5,7 +5,8 @@ tag.usage = "npm tag @ []" tag.completion = require("./unpublish.js").completion -var npm = require("./npm.js") +var url = require("url") + , npm = require("./npm.js") , registry = npm.registry function tag (args, cb) { @@ -14,5 +15,6 @@ function tag (args, cb) { , version = thing.join("@") , t = args.shift() || npm.config.get("tag") if (!project || !version || !t) return cb("Usage:\n"+tag.usage) - registry.tag(project, version, t, cb) + var uri = url.resolve(npm.config.get("registry"), project) + registry.tag(uri, version, t, cb) } diff --git a/deps/npm/lib/test.js b/deps/npm/lib/test.js index d741807e616..dd4994cf28d 100644 --- a/deps/npm/lib/test.js +++ b/deps/npm/lib/test.js @@ -1,7 +1,6 @@ module.exports = test var testCmd = require("./utils/lifecycle.js").cmd("test") - , log = require("npmlog") function test (args, cb) { testCmd(args, function (er) { diff --git a/deps/npm/lib/unbuild.js b/deps/npm/lib/unbuild.js index 0384a733ea8..b594f28a9ba 100644 --- a/deps/npm/lib/unbuild.js +++ b/deps/npm/lib/unbuild.js @@ -6,7 +6,6 @@ var readJson = require("read-package-json") , gentlyRm = require("./utils/gently-rm.js") , npm = require("./npm.js") , path = require("path") - , fs = require("graceful-fs") , lifecycle = require("./utils/lifecycle.js") , asyncMap = require("slide").asyncMap , chain = require("slide").chain @@ -26,7 +25,7 @@ function unbuild_ (silent) { return function (folder, cb_) { } folder = path.resolve(folder) delete build._didBuild[folder] - log.info(folder, "unbuild") + log.verbose(folder.substr(npm.prefix.length + 1), "unbuild") readJson(path.resolve(folder, "package.json"), function (er, pkg) { // if no json, then just trash it, but no scripts or whatever. if (er) return rm(folder, cb) @@ -87,12 +86,12 @@ function rmMans (pkg, folder, parent, top, cb) { var manRoot = path.resolve(npm.config.get("prefix"), "share", "man") asyncMap(pkg.man, function (man, cb) { if (Array.isArray(man)) { - man.forEach(rm) + man.forEach(rmMan) } else { - rm(man) + rmMan(man) } - function rm(man) { + function rmMan(man) { var parseMan = man.match(/(.*)\.([0-9]+)(\.gz)?$/) , stem = parseMan[1] , sxn = parseMan[2] diff --git a/deps/npm/lib/uninstall.js b/deps/npm/lib/uninstall.js index 072d46bcf4d..42a9a83e0e5 100644 --- a/deps/npm/lib/uninstall.js +++ b/deps/npm/lib/uninstall.js @@ -79,14 +79,15 @@ function saver (args, nm, cb_) { // don't use readJson here, because we don't want all the defaults // filled in, for mans and other bs. fs.readFile(pj, 'utf8', function (er, json) { + var pkg try { - var pkg = JSON.parse(json) + pkg = JSON.parse(json) } catch (_) {} if (!pkg) return cb_(null, data) var bundle if (npm.config.get('save-bundle')) { - var bundle = pkg.bundleDependencies || pkg.bundledDependencies + bundle = pkg.bundleDependencies || pkg.bundledDependencies if (!Array.isArray(bundle)) bundle = undefined } diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js index 0e48ab72da6..225c1c3c455 100644 --- a/deps/npm/lib/unpublish.js +++ b/deps/npm/lib/unpublish.js @@ -1,7 +1,8 @@ module.exports = unpublish -var log = require("npmlog") +var url = require("url") + , log = require("npmlog") , npm = require("./npm.js") , registry = npm.registry , readJson = require("read-package-json") @@ -13,7 +14,8 @@ unpublish.completion = function (opts, cb) { if (opts.conf.argv.remain.length >= 3) return cb() var un = encodeURIComponent(npm.config.get("username")) if (!un) return cb() - registry.get("/-/by-user/"+un, function (er, pkgs) { + var uri = url.resolve(npm.config.get("registry"), "-/by-user/"+un) + registry.get(uri, null, function (er, pkgs) { // do a bit of filtering at this point, so that we don't need // to fetch versions for more than one thing, but also don't // accidentally a whole project. @@ -21,12 +23,12 @@ unpublish.completion = function (opts, cb) { if (!pkgs || !pkgs.length) return cb() var partial = opts.partialWord.split("@") , pp = partial.shift() - , pv = partial.join("@") pkgs = pkgs.filter(function (p) { return p.indexOf(pp) === 0 }) if (pkgs.length > 1) return cb(null, pkgs) - registry.get(pkgs[0], function (er, d) { + var uri = url.resolve(npm.config.get("registry"), pkgs[0]) + registry.get(uri, null, function (er, d) { if (er) return cb(er) var vers = Object.keys(d.versions) if (!vers.length) return cb(null, pkgs) @@ -38,7 +40,6 @@ unpublish.completion = function (opts, cb) { } function unpublish (args, cb) { - if (args.length > 1) return cb(unpublish.usage) var thing = args.length ? args.shift().split("@") : [] @@ -78,6 +79,7 @@ function gotProject (project, version, cb_) { return cb(er) } - registry.unpublish(project, version, cb) + var uri = url.resolve(npm.config.get("registry"), project) + registry.unpublish(uri, version, cb) }) } diff --git a/deps/npm/lib/update.js b/deps/npm/lib/update.js index 9ae50dc4173..06d199cc098 100644 --- a/deps/npm/lib/update.js +++ b/deps/npm/lib/update.js @@ -10,7 +10,6 @@ module.exports = update update.usage = "npm update [pkg]" var npm = require("./npm.js") - , lifecycle = require("./utils/lifecycle.js") , asyncMap = require("slide").asyncMap , log = require("npmlog") diff --git a/deps/npm/lib/utils/completion/file-completion.js b/deps/npm/lib/utils/completion/file-completion.js index 3605557432a..5201a15ff64 100644 --- a/deps/npm/lib/utils/completion/file-completion.js +++ b/deps/npm/lib/utils/completion/file-completion.js @@ -2,7 +2,6 @@ module.exports = fileCompletion var mkdir = require("mkdirp") , path = require("path") - , fs = require("graceful-fs") , glob = require("glob") function fileCompletion (root, req, depth, cb) { diff --git a/deps/npm/lib/utils/error-handler.js b/deps/npm/lib/utils/error-handler.js index feeec184cfb..089c71228bf 100644 --- a/deps/npm/lib/utils/error-handler.js +++ b/deps/npm/lib/utils/error-handler.js @@ -13,7 +13,7 @@ var cbCalled = false process.on("exit", function (code) { // console.error("exit", code) - if (!npm.config.loaded) return + if (!npm.config || !npm.config.loaded) return if (code) itWorked = false if (itWorked) log.info("ok") else { @@ -46,7 +46,7 @@ process.on("exit", function (code) { function exit (code, noLog) { exitCode = exitCode || process.exitCode || code - var doExit = npm.config.get("_exit") + var doExit = npm.config ? npm.config.get("_exit") : true log.verbose("exit", [code, doExit]) if (log.level === "silent") noLog = true @@ -71,7 +71,7 @@ function exit (code, noLog) { function errorHandler (er) { var printStack = false // console.error("errorHandler", er) - if (!npm.config.loaded) { + if (!npm.config || !npm.config.loaded) { // logging won't work unless we pretend that it's ready er = er || new Error("Exit prior to config file resolving.") console.error(er.stack || er.message) @@ -112,7 +112,6 @@ function errorHandler (er) { break case "ELIFECYCLE": - er.code = "ELIFECYCLE" log.error("", er.message) log.error("", ["","Failed at the "+er.pkgid+" "+er.stage+" script." ,"This is most likely a problem with the "+er.pkgname+" package," @@ -126,7 +125,6 @@ function errorHandler (er) { break case "ENOGIT": - er.code = "ENOGIT" log.error("", er.message) log.error("", ["","Failed using git." ,"This is most likely not a problem with npm itself." @@ -135,7 +133,6 @@ function errorHandler (er) { break case "EJSONPARSE": - er.code = "EJSONPARSE" log.error("", er.message) log.error("", "File: "+er.file) log.error("", ["Failed to parse package.json data." @@ -146,7 +143,6 @@ function errorHandler (er) { break case "E404": - er.code = "E404" var msg = [er.message] if (er.pkgid && er.pkgid !== "-") { msg.push("", "'"+er.pkgid+"' is not in the npm registry." @@ -168,7 +164,6 @@ function errorHandler (er) { break case "EPUBLISHCONFLICT": - er.code = "EPUBLISHCONFLICT" log.error("publish fail", ["Cannot publish over existing version." ,"Update the 'version' field in package.json and try again." ,"" @@ -181,7 +176,6 @@ function errorHandler (er) { break case "EISGIT": - er.code = "EISGIT" log.error("git", [er.message ," "+er.path ,"Refusing to remove it. Update manually," @@ -190,7 +184,6 @@ function errorHandler (er) { break case "ECYCLE": - er.code = "ECYCLE" log.error("cycle", [er.message ,"While installing: "+er.pkgid ,"Found a pathological dependency case that npm cannot solve." @@ -199,7 +192,6 @@ function errorHandler (er) { break case "EBADPLATFORM": - er.code = "EBADPLATFORM" log.error("notsup", [er.message ,"Not compatible with your operating system or architecture: "+er.pkgid ,"Valid OS: "+er.os.join(",") @@ -268,6 +260,22 @@ function errorHandler (er) { break } // else passthrough + case "ENOSPC": + log.error("nospc", [er.message + ,"This is most likely not a problem with npm itself" + ,"and is related to insufficient space on your system." + ].join("\n")) + break + + case "EROFS": + log.error("rofs", [er.message + ,"This is most likely not a problem with npm itself" + ,"and is related to the file system being read-only." + ,"\nOften virtualized file systems, or other file systems" + ,"that don't support symlinks, give this error." + ].join("\n")) + break + default: log.error("", er.stack || er.message || er) log.error("", ["If you need help, you may report this *entire* log," diff --git a/deps/npm/lib/utils/git.js b/deps/npm/lib/utils/git.js new file mode 100644 index 00000000000..7e20151938c --- /dev/null +++ b/deps/npm/lib/utils/git.js @@ -0,0 +1,45 @@ + +// handle some git configuration for windows + +exports.spawn = spawnGit +exports.chainableExec = chainableExec +exports.whichAndExec = whichAndExec + +var exec = require("child_process").execFile + , spawn = require("child_process").spawn + , npm = require("../npm.js") + , which = require("which") + , git = npm.config.get("git") + +function prefixGitArgs() { + return process.platform === "win32" ? ["-c", "core.longpaths=true"] : [] +} + +function execGit(args, options, cb) { + return exec(git, prefixGitArgs().concat(args || []), options, cb) +} + +function spawnGit(args, options, cb) { + return spawn(git, prefixGitArgs().concat(args || []), options) +} + +function chainableExec() { + var args = Array.prototype.slice.call(arguments) + return [execGit].concat(args) +} + +function whichGit(cb) { + return which(git, cb) +} + +function whichAndExec(args, options, cb) { + // check for git + whichGit(function (err) { + if (err) { + err.code = "ENOGIT" + return cb(err) + } + + execGit(args, options, cb) + }) +} diff --git a/deps/npm/lib/version.js b/deps/npm/lib/version.js index ec3f93b2021..95d5ff2ee2b 100644 --- a/deps/npm/lib/version.js +++ b/deps/npm/lib/version.js @@ -10,6 +10,7 @@ var exec = require("child_process").execFile , log = require("npmlog") , which = require("which") , npm = require("./npm.js") + , git = require("./utils/git.js") version.usage = "npm version [ | major | minor | patch | prerelease | preminor | premajor ]\n" + "\n(run in package dir)\n" @@ -37,6 +38,9 @@ function version (args, silent, cb_) { if (data && data.name && data.version) { v[data.name] = data.version } + if (npm.config.get("json")) { + v = JSON.stringify(v, null, 2) + } console.log(v) return cb_() } @@ -53,9 +57,9 @@ function version (args, silent, cb_) { return cb_(er) } - var newVer = semver.valid(args[0]) - if (!newVer) newVer = semver.inc(data.version, args[0]) - if (!newVer) return cb_(version.usage) + var newVer = semver.valid(args[0]) + if (!newVer) newVer = semver.inc(data.version, args[0]) + if (!newVer) return cb_(version.usage) if (data.version === newVer) return cb_(new Error("Version not changed")) data.version = newVer @@ -74,48 +78,36 @@ function version (args, silent, cb_) { } function checkGit (data, cb) { - var git = npm.config.get("git") var args = [ "status", "--porcelain" ] - var env = process.env + var options = {env: process.env} // check for git - which(git, function (err) { - if (err) { - err.code = "ENOGIT" - return cb(err) - } - - gitFound() - }) - - function gitFound () { - exec(git, args, {env: env}, function (er, stdout, stderr) { - var lines = stdout.trim().split("\n").filter(function (line) { - return line.trim() && !line.match(/^\?\? /) - }).map(function (line) { - return line.trim() - }) - if (lines.length) return cb(new Error( - "Git working directory not clean.\n"+lines.join("\n"))) - write(data, function (er) { - if (er) return cb(er) - var message = npm.config.get("message").replace(/%s/g, data.version) - , sign = npm.config.get("sign-git-tag") - , flag = sign ? "-sm" : "-am" - chain - ( [ [ exec, git, [ "add", "package.json" ], {env: process.env} ] - , [ exec, git, [ "commit", "-m", message ], {env: process.env} ] - , sign && function (cb) { - npm.spinner.stop() - cb() - } + git.whichAndExec(args, options, function (er, stdout) { + var lines = stdout.trim().split("\n").filter(function (line) { + return line.trim() && !line.match(/^\?\? /) + }).map(function (line) { + return line.trim() + }) + if (lines.length) return cb(new Error( + "Git working directory not clean.\n"+lines.join("\n"))) + write(data, function (er) { + if (er) return cb(er) + var message = npm.config.get("message").replace(/%s/g, data.version) + , sign = npm.config.get("sign-git-tag") + , flag = sign ? "-sm" : "-am" + chain + ( [ git.chainableExec([ "add", "package.json" ], {env: process.env}) + , git.chainableExec([ "commit", "-m", message ], {env: process.env}) + , sign && function (cb) { + npm.spinner.stop() + cb() + } - , [ exec, git, [ "tag", "v" + data.version, flag, message ] - , {env: process.env} ] ] - , cb ) - }) + , git.chainableExec([ "tag", "v" + data.version, flag, message ] + , {env: process.env}) ] + , cb ) }) - } + }) } function write (data, cb) { diff --git a/deps/npm/lib/view.js b/deps/npm/lib/view.js index 6b738237896..33bf550dd9f 100644 --- a/deps/npm/lib/view.js +++ b/deps/npm/lib/view.js @@ -4,12 +4,15 @@ module.exports = view view.usage = "npm view pkg[@version] [[.subfield]...]" view.completion = function (opts, cb) { + var uri if (opts.conf.argv.remain.length <= 2) { - return registry.get("/-/short", cb) + uri = url.resolve(npm.config.get("registry"), "-/short") + return registry.get(uri, null, cb) } // have the package, get the fields. var tag = npm.config.get("tag") - registry.get(opts.conf.argv.remain[2], function (er, d) { + uri = url.resolve(npm.config.get("registry"), opts.conf.argv.remain[2]) + registry.get(uri, null, function (er, d) { if (er) return cb(er) var dv = d.versions[d["dist-tags"][tag]] , fields = [] @@ -39,7 +42,8 @@ view.completion = function (opts, cb) { } } -var npm = require("./npm.js") +var url = require("url") + , npm = require("./npm.js") , registry = npm.registry , log = require("npmlog") , util = require("util") @@ -56,7 +60,8 @@ function view (args, silent, cb) { if (name === ".") return cb(view.usage) // get the data about this package - registry.get(name, function (er, data) { + var uri = url.resolve(npm.config.get("registry"), name) + registry.get(uri, null, function (er, data) { if (er) return cb(er) if (data["dist-tags"] && data["dist-tags"].hasOwnProperty(version)) { version = data["dist-tags"][version] @@ -64,7 +69,7 @@ function view (args, silent, cb) { if (data.time && data.time.unpublished) { var u = data.time.unpublished - var er = new Error("Unpublished by " + u.name + " on " + u.time) + er = new Error("Unpublished by " + u.name + " on " + u.time) er.statusCode = 404 er.code = "E404" er.pkgid = data._id @@ -139,8 +144,9 @@ function search (data, fields, version, title) { , tail = fields while (!field && fields.length) field = tail.shift() fields = [field].concat(tail) + var o if (!field && !tail.length) { - var o = {} + o = {} o[version] = {} o[version][title] = data return o @@ -160,7 +166,6 @@ function search (data, fields, version, title) { return search(data[0], fields, version, title) } var results = [] - , res = null data.forEach(function (data, i) { var tl = title.length , newt = title.substr(0, tl-(fields.join(".").length) - 1) @@ -182,7 +187,7 @@ function search (data, fields, version, title) { return new Error("Not an object: "+data) } } - var o = {} + o = {} o[version] = {} o[version][title] = data return o @@ -194,7 +199,7 @@ function printData (data, name, cb) { , showVersions = versions.length > 1 , showFields - versions.forEach(function (v, i) { + versions.forEach(function (v) { var fields = Object.keys(data[v]) showFields = showFields || (fields.length > 1) fields.forEach(function (f) { diff --git a/deps/npm/lib/whoami.js b/deps/npm/lib/whoami.js index 664cbdbb0de..f1c67e2b0df 100644 --- a/deps/npm/lib/whoami.js +++ b/deps/npm/lib/whoami.js @@ -7,7 +7,7 @@ whoami.usage = "npm whoami\n(just prints the 'username' config)" function whoami (args, silent, cb) { if (typeof cb !== "function") cb = silent, silent = false var me = npm.config.get("username") - msg = me ? me : "Not authed. Run 'npm adduser'" + var msg = me ? me : "Not authed. Run 'npm adduser'" if (!silent) console.log(msg) process.nextTick(cb.bind(this, null, me)) } diff --git a/deps/npm/lib/xmas.js b/deps/npm/lib/xmas.js index bf838a87a88..fa8d1db556d 100644 --- a/deps/npm/lib/xmas.js +++ b/deps/npm/lib/xmas.js @@ -1,6 +1,5 @@ // happy xmas -var npm = require("./npm.js") - , log = require("npmlog") +var log = require("npmlog") module.exports = function (args, cb) { var s = process.platform === "win32" ? " *" : " \u2605" @@ -20,26 +19,26 @@ w("\n") for (var i = 0; i < H; i ++) w(" ") w(x+"\033[33m"+s+"\n") var M = H * 2 - 1 - for (L = 1; L <= H; L ++) { + for (var L = 1; L <= H; L ++) { var O = L * 2 - 2 var S = (M - O) / 2 - for (var i = 0; i < S; i ++) w(" ") + for (i = 0; i < S; i ++) w(" ") w(x+"\033[32m"+f) - for (var i = 0; i < O; i ++) w( + for (i = 0; i < O; i ++) w( "\033["+oc[Math.floor(Math.random()*oc.length)]+"m"+ o[Math.floor(Math.random() * o.length)] ) w(x+"\033[32m"+b+"\n") } w(" ") - for (var i = 1; i < H; i ++) w("\033[32m"+l) + for (i = 1; i < H; i ++) w("\033[32m"+l) w("| "+x+" |") - for (var i = 1; i < H; i ++) w("\033[32m"+l) + for (i = 1; i < H; i ++) w("\033[32m"+l) if (H > 10) { w("\n ") - for (var i = 1; i < H; i ++) w(" ") + for (i = 1; i < H; i ++) w(" ") w("| "+x+" |") - for (var i = 1; i < H; i ++) w(" ") + for (i = 1; i < H; i ++) w(" ") } })(20) w("\n\n") diff --git a/deps/npm/man/man1/npm-README.1 b/deps/npm/man/man1/npm-README.1 index 030823c8aeb..2538040eca8 100644 --- a/deps/npm/man/man1/npm-README.1 +++ b/deps/npm/man/man1/npm-README.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM" "1" "June 2014" "" "" +.TH "NPM" "1" "July 2014" "" "" . .SH "NAME" \fBnpm\fR \-\- node package manager![Build Status \fIhttps://img\.shields\.io/travis/npm/npm/master\.svg)](https://travis\-ci\.org/npm/npm\fR diff --git a/deps/npm/man/man1/npm-adduser.1 b/deps/npm/man/man1/npm-adduser.1 index 6535cb4090f..9d59ebf66e0 100644 --- a/deps/npm/man/man1/npm-adduser.1 +++ b/deps/npm/man/man1/npm-adduser.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-ADDUSER" "1" "June 2014" "" "" +.TH "NPM\-ADDUSER" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-adduser\fR \-\- Add a registry user account diff --git a/deps/npm/man/man1/npm-bin.1 b/deps/npm/man/man1/npm-bin.1 index 750f9fb3037..7924feb095a 100644 --- a/deps/npm/man/man1/npm-bin.1 +++ b/deps/npm/man/man1/npm-bin.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-BIN" "1" "June 2014" "" "" +.TH "NPM\-BIN" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-bin\fR \-\- Display npm bin folder diff --git a/deps/npm/man/man1/npm-bugs.1 b/deps/npm/man/man1/npm-bugs.1 index 43a71a2619d..751bbe52416 100644 --- a/deps/npm/man/man1/npm-bugs.1 +++ b/deps/npm/man/man1/npm-bugs.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-BUGS" "1" "June 2014" "" "" +.TH "NPM\-BUGS" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-bugs\fR \-\- Bugs for a package in a web browser maybe diff --git a/deps/npm/man/man1/npm-build.1 b/deps/npm/man/man1/npm-build.1 index e6c41001929..ac79ebfdf57 100644 --- a/deps/npm/man/man1/npm-build.1 +++ b/deps/npm/man/man1/npm-build.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-BUILD" "1" "June 2014" "" "" +.TH "NPM\-BUILD" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-build\fR \-\- Build a package diff --git a/deps/npm/man/man1/npm-bundle.1 b/deps/npm/man/man1/npm-bundle.1 index 0a8f2d5c306..6fa075febf8 100644 --- a/deps/npm/man/man1/npm-bundle.1 +++ b/deps/npm/man/man1/npm-bundle.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-BUNDLE" "1" "June 2014" "" "" +.TH "NPM\-BUNDLE" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-bundle\fR \-\- REMOVED diff --git a/deps/npm/man/man1/npm-cache.1 b/deps/npm/man/man1/npm-cache.1 index 9976f72ab6a..75dc4ef7132 100644 --- a/deps/npm/man/man1/npm-cache.1 +++ b/deps/npm/man/man1/npm-cache.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-CACHE" "1" "June 2014" "" "" +.TH "NPM\-CACHE" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-cache\fR \-\- Manipulates packages cache diff --git a/deps/npm/man/man1/npm-completion.1 b/deps/npm/man/man1/npm-completion.1 index 2c8a411fa78..a561f66374e 100644 --- a/deps/npm/man/man1/npm-completion.1 +++ b/deps/npm/man/man1/npm-completion.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-COMPLETION" "1" "June 2014" "" "" +.TH "NPM\-COMPLETION" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-completion\fR \-\- Tab Completion for npm diff --git a/deps/npm/man/man1/npm-config.1 b/deps/npm/man/man1/npm-config.1 index ebe9cb20e2f..bc07b657749 100644 --- a/deps/npm/man/man1/npm-config.1 +++ b/deps/npm/man/man1/npm-config.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-CONFIG" "1" "June 2014" "" "" +.TH "NPM\-CONFIG" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-config\fR \-\- Manage the npm configuration files diff --git a/deps/npm/man/man1/npm-dedupe.1 b/deps/npm/man/man1/npm-dedupe.1 index 8ffe7d7fa30..104993d2b81 100644 --- a/deps/npm/man/man1/npm-dedupe.1 +++ b/deps/npm/man/man1/npm-dedupe.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-DEDUPE" "1" "June 2014" "" "" +.TH "NPM\-DEDUPE" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-dedupe\fR \-\- Reduce duplication diff --git a/deps/npm/man/man1/npm-deprecate.1 b/deps/npm/man/man1/npm-deprecate.1 index 0776d22f28b..7c312f0c40c 100644 --- a/deps/npm/man/man1/npm-deprecate.1 +++ b/deps/npm/man/man1/npm-deprecate.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-DEPRECATE" "1" "June 2014" "" "" +.TH "NPM\-DEPRECATE" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-deprecate\fR \-\- Deprecate a version of a package diff --git a/deps/npm/man/man1/npm-docs.1 b/deps/npm/man/man1/npm-docs.1 index 8b5613afd2b..3886aac406e 100644 --- a/deps/npm/man/man1/npm-docs.1 +++ b/deps/npm/man/man1/npm-docs.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-DOCS" "1" "June 2014" "" "" +.TH "NPM\-DOCS" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-docs\fR \-\- Docs for a package in a web browser maybe diff --git a/deps/npm/man/man1/npm-edit.1 b/deps/npm/man/man1/npm-edit.1 index bc2de55745f..41000e8ce65 100644 --- a/deps/npm/man/man1/npm-edit.1 +++ b/deps/npm/man/man1/npm-edit.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-EDIT" "1" "June 2014" "" "" +.TH "NPM\-EDIT" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-edit\fR \-\- Edit an installed package diff --git a/deps/npm/man/man1/npm-explore.1 b/deps/npm/man/man1/npm-explore.1 index 4380044c6d6..a4ff63f37f8 100644 --- a/deps/npm/man/man1/npm-explore.1 +++ b/deps/npm/man/man1/npm-explore.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-EXPLORE" "1" "June 2014" "" "" +.TH "NPM\-EXPLORE" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-explore\fR \-\- Browse an installed package @@ -9,7 +9,7 @@ .SH "SYNOPSIS" . .nf -npm explore [@] [ \-\- ] +npm explore [ \-\- ] . .fi . diff --git a/deps/npm/man/man1/npm-help-search.1 b/deps/npm/man/man1/npm-help-search.1 index a4078092000..a4eda6e502f 100644 --- a/deps/npm/man/man1/npm-help-search.1 +++ b/deps/npm/man/man1/npm-help-search.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-HELP\-SEARCH" "1" "June 2014" "" "" +.TH "NPM\-HELP\-SEARCH" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-help-search\fR \-\- Search npm help documentation diff --git a/deps/npm/man/man1/npm-help.1 b/deps/npm/man/man1/npm-help.1 index 66998f90af9..040107bd779 100644 --- a/deps/npm/man/man1/npm-help.1 +++ b/deps/npm/man/man1/npm-help.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-HELP" "1" "June 2014" "" "" +.TH "NPM\-HELP" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-help\fR \-\- Get help on npm diff --git a/deps/npm/man/man1/npm-init.1 b/deps/npm/man/man1/npm-init.1 index 947b6bb9542..3f69ef18b45 100644 --- a/deps/npm/man/man1/npm-init.1 +++ b/deps/npm/man/man1/npm-init.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-INIT" "1" "June 2014" "" "" +.TH "NPM\-INIT" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-init\fR \-\- Interactively create a package\.json file diff --git a/deps/npm/man/man1/npm-install.1 b/deps/npm/man/man1/npm-install.1 index 501d019caae..4501ab8a562 100644 --- a/deps/npm/man/man1/npm-install.1 +++ b/deps/npm/man/man1/npm-install.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-INSTALL" "1" "June 2014" "" "" +.TH "NPM\-INSTALL" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-install\fR \-\- Install a package diff --git a/deps/npm/man/man1/npm-link.1 b/deps/npm/man/man1/npm-link.1 index b6a851f7877..ad3baf80cbb 100644 --- a/deps/npm/man/man1/npm-link.1 +++ b/deps/npm/man/man1/npm-link.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-LINK" "1" "June 2014" "" "" +.TH "NPM\-LINK" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-link\fR \-\- Symlink a package folder diff --git a/deps/npm/man/man1/npm-ls.1 b/deps/npm/man/man1/npm-ls.1 index 8258cc7093b..40656d0bce9 100644 --- a/deps/npm/man/man1/npm-ls.1 +++ b/deps/npm/man/man1/npm-ls.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-LS" "1" "June 2014" "" "" +.TH "NPM\-LS" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-ls\fR \-\- List installed packages @@ -29,7 +29,7 @@ For example, running \fBnpm ls promzard\fR in npm\'s source tree will show: .IP "" 4 . .nf -npm@1.4.14 /path/to/npm +npm@1.4.21 /path/to/npm └─┬ init\-package\-json@0\.0\.4 └── promzard@0\.1\.5 . diff --git a/deps/npm/man/man1/npm-outdated.1 b/deps/npm/man/man1/npm-outdated.1 index ac1056b2a18..cb773bef559 100644 --- a/deps/npm/man/man1/npm-outdated.1 +++ b/deps/npm/man/man1/npm-outdated.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-OUTDATED" "1" "June 2014" "" "" +.TH "NPM\-OUTDATED" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-outdated\fR \-\- Check for outdated packages diff --git a/deps/npm/man/man1/npm-owner.1 b/deps/npm/man/man1/npm-owner.1 index 3d4195dc435..f1e0da1858f 100644 --- a/deps/npm/man/man1/npm-owner.1 +++ b/deps/npm/man/man1/npm-owner.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-OWNER" "1" "June 2014" "" "" +.TH "NPM\-OWNER" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-owner\fR \-\- Manage package owners diff --git a/deps/npm/man/man1/npm-pack.1 b/deps/npm/man/man1/npm-pack.1 index 6c79d8078b8..25e18cd19cf 100644 --- a/deps/npm/man/man1/npm-pack.1 +++ b/deps/npm/man/man1/npm-pack.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-PACK" "1" "June 2014" "" "" +.TH "NPM\-PACK" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-pack\fR \-\- Create a tarball from a package diff --git a/deps/npm/man/man1/npm-prefix.1 b/deps/npm/man/man1/npm-prefix.1 index c50736c8f8f..e865f52dbd0 100644 --- a/deps/npm/man/man1/npm-prefix.1 +++ b/deps/npm/man/man1/npm-prefix.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-PREFIX" "1" "June 2014" "" "" +.TH "NPM\-PREFIX" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-prefix\fR \-\- Display prefix diff --git a/deps/npm/man/man1/npm-prune.1 b/deps/npm/man/man1/npm-prune.1 index 37fd8ff593d..6b40d3b9ea0 100644 --- a/deps/npm/man/man1/npm-prune.1 +++ b/deps/npm/man/man1/npm-prune.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-PRUNE" "1" "June 2014" "" "" +.TH "NPM\-PRUNE" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-prune\fR \-\- Remove extraneous packages diff --git a/deps/npm/man/man1/npm-publish.1 b/deps/npm/man/man1/npm-publish.1 index 4a4d00464cf..c9ed52a944d 100644 --- a/deps/npm/man/man1/npm-publish.1 +++ b/deps/npm/man/man1/npm-publish.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-PUBLISH" "1" "June 2014" "" "" +.TH "NPM\-PUBLISH" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-publish\fR \-\- Publish a package diff --git a/deps/npm/man/man1/npm-rebuild.1 b/deps/npm/man/man1/npm-rebuild.1 index 5fc945b5a22..a84ee3e50fa 100644 --- a/deps/npm/man/man1/npm-rebuild.1 +++ b/deps/npm/man/man1/npm-rebuild.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-REBUILD" "1" "June 2014" "" "" +.TH "NPM\-REBUILD" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-rebuild\fR \-\- Rebuild a package diff --git a/deps/npm/man/man1/npm-repo.1 b/deps/npm/man/man1/npm-repo.1 index 06632131656..1c6d9b0ecb1 100644 --- a/deps/npm/man/man1/npm-repo.1 +++ b/deps/npm/man/man1/npm-repo.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-REPO" "1" "June 2014" "" "" +.TH "NPM\-REPO" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-repo\fR \-\- Open package repository page in the browser diff --git a/deps/npm/man/man1/npm-restart.1 b/deps/npm/man/man1/npm-restart.1 index 5e3bfeafbb8..39acfc16d2d 100644 --- a/deps/npm/man/man1/npm-restart.1 +++ b/deps/npm/man/man1/npm-restart.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-RESTART" "1" "June 2014" "" "" +.TH "NPM\-RESTART" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-restart\fR \-\- Start a package diff --git a/deps/npm/man/man1/npm-rm.1 b/deps/npm/man/man1/npm-rm.1 index cdde04137b8..e5eb6a461ff 100644 --- a/deps/npm/man/man1/npm-rm.1 +++ b/deps/npm/man/man1/npm-rm.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-RM" "1" "June 2014" "" "" +.TH "NPM\-RM" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-rm\fR \-\- Remove a package diff --git a/deps/npm/man/man1/npm-root.1 b/deps/npm/man/man1/npm-root.1 index 12da90c8502..37cd884303c 100644 --- a/deps/npm/man/man1/npm-root.1 +++ b/deps/npm/man/man1/npm-root.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-ROOT" "1" "June 2014" "" "" +.TH "NPM\-ROOT" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-root\fR \-\- Display npm root diff --git a/deps/npm/man/man1/npm-run-script.1 b/deps/npm/man/man1/npm-run-script.1 index fce1515360e..1af3c977de5 100644 --- a/deps/npm/man/man1/npm-run-script.1 +++ b/deps/npm/man/man1/npm-run-script.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-RUN\-SCRIPT" "1" "June 2014" "" "" +.TH "NPM\-RUN\-SCRIPT" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-run-script\fR \-\- Run arbitrary package scripts diff --git a/deps/npm/man/man1/npm-search.1 b/deps/npm/man/man1/npm-search.1 index 9fc78f2676a..020d4602de5 100644 --- a/deps/npm/man/man1/npm-search.1 +++ b/deps/npm/man/man1/npm-search.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-SEARCH" "1" "June 2014" "" "" +.TH "NPM\-SEARCH" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-search\fR \-\- Search for packages diff --git a/deps/npm/man/man1/npm-shrinkwrap.1 b/deps/npm/man/man1/npm-shrinkwrap.1 index 11760616976..eac7fce7bbd 100644 --- a/deps/npm/man/man1/npm-shrinkwrap.1 +++ b/deps/npm/man/man1/npm-shrinkwrap.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-SHRINKWRAP" "1" "June 2014" "" "" +.TH "NPM\-SHRINKWRAP" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-shrinkwrap\fR \-\- Lock down dependency versions @@ -244,16 +244,6 @@ and recursively specifies all dependencies, the contents of B\'s shrinkwrap will implicitly be included in A\'s shrinkwrap\. . .SS "Caveats" -Shrinkwrap files only lock down package versions, not actual package -contents\. While discouraged, a package author can republish an -existing version of a package, causing shrinkwrapped packages using -that version to pick up different code than they were before\. If you -want to avoid any risk that a byzantine author replaces a package -you\'re using with code that breaks your application, you could modify -the shrinkwrap file to use git URL references rather than version -numbers so that npm always fetches all packages from git\. -. -.P If you wish to lock down the specific bytes included in a package, for example to have 100% confidence in being able to reproduce a deployment or build, then you ought to check your dependencies into diff --git a/deps/npm/man/man1/npm-star.1 b/deps/npm/man/man1/npm-star.1 index efcf75b0785..862f27669c0 100644 --- a/deps/npm/man/man1/npm-star.1 +++ b/deps/npm/man/man1/npm-star.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-STAR" "1" "June 2014" "" "" +.TH "NPM\-STAR" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-star\fR \-\- Mark your favorite packages diff --git a/deps/npm/man/man1/npm-stars.1 b/deps/npm/man/man1/npm-stars.1 index 65177385406..6500130984a 100644 --- a/deps/npm/man/man1/npm-stars.1 +++ b/deps/npm/man/man1/npm-stars.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-STARS" "1" "June 2014" "" "" +.TH "NPM\-STARS" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-stars\fR \-\- View packages marked as favorites diff --git a/deps/npm/man/man1/npm-start.1 b/deps/npm/man/man1/npm-start.1 index bf2c7a738e0..93b171fabe5 100644 --- a/deps/npm/man/man1/npm-start.1 +++ b/deps/npm/man/man1/npm-start.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-START" "1" "June 2014" "" "" +.TH "NPM\-START" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-start\fR \-\- Start a package diff --git a/deps/npm/man/man1/npm-stop.1 b/deps/npm/man/man1/npm-stop.1 index f921547fceb..e54586901d5 100644 --- a/deps/npm/man/man1/npm-stop.1 +++ b/deps/npm/man/man1/npm-stop.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-STOP" "1" "June 2014" "" "" +.TH "NPM\-STOP" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-stop\fR \-\- Stop a package diff --git a/deps/npm/man/man1/npm-submodule.1 b/deps/npm/man/man1/npm-submodule.1 index 588b1f0b26a..a10e4d31899 100644 --- a/deps/npm/man/man1/npm-submodule.1 +++ b/deps/npm/man/man1/npm-submodule.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-SUBMODULE" "1" "June 2014" "" "" +.TH "NPM\-SUBMODULE" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-submodule\fR \-\- Add a package as a git submodule diff --git a/deps/npm/man/man1/npm-tag.1 b/deps/npm/man/man1/npm-tag.1 index 823e5477e8f..e6c090eaa41 100644 --- a/deps/npm/man/man1/npm-tag.1 +++ b/deps/npm/man/man1/npm-tag.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-TAG" "1" "June 2014" "" "" +.TH "NPM\-TAG" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-tag\fR \-\- Tag a published version diff --git a/deps/npm/man/man1/npm-test.1 b/deps/npm/man/man1/npm-test.1 index 35b6279c6b1..5f2edc2fd81 100644 --- a/deps/npm/man/man1/npm-test.1 +++ b/deps/npm/man/man1/npm-test.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-TEST" "1" "June 2014" "" "" +.TH "NPM\-TEST" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-test\fR \-\- Test a package diff --git a/deps/npm/man/man1/npm-uninstall.1 b/deps/npm/man/man1/npm-uninstall.1 index 688d4250010..1a89621446b 100644 --- a/deps/npm/man/man1/npm-uninstall.1 +++ b/deps/npm/man/man1/npm-uninstall.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-RM" "1" "June 2014" "" "" +.TH "NPM\-RM" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-rm\fR \-\- Remove a package diff --git a/deps/npm/man/man1/npm-unpublish.1 b/deps/npm/man/man1/npm-unpublish.1 index 691e1fa4a5c..eb7a5400ffc 100644 --- a/deps/npm/man/man1/npm-unpublish.1 +++ b/deps/npm/man/man1/npm-unpublish.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-UNPUBLISH" "1" "June 2014" "" "" +.TH "NPM\-UNPUBLISH" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-unpublish\fR \-\- Remove a package from the registry diff --git a/deps/npm/man/man1/npm-update.1 b/deps/npm/man/man1/npm-update.1 index f1856b80f28..207eb053ac3 100644 --- a/deps/npm/man/man1/npm-update.1 +++ b/deps/npm/man/man1/npm-update.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-UPDATE" "1" "June 2014" "" "" +.TH "NPM\-UPDATE" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-update\fR \-\- Update a package diff --git a/deps/npm/man/man1/npm-version.1 b/deps/npm/man/man1/npm-version.1 index 0aeea2a92ce..f9b8ac0c34e 100644 --- a/deps/npm/man/man1/npm-version.1 +++ b/deps/npm/man/man1/npm-version.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-VERSION" "1" "June 2014" "" "" +.TH "NPM\-VERSION" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-version\fR \-\- Bump a package version diff --git a/deps/npm/man/man1/npm-view.1 b/deps/npm/man/man1/npm-view.1 index de1b11a7be8..0a75f6518d7 100644 --- a/deps/npm/man/man1/npm-view.1 +++ b/deps/npm/man/man1/npm-view.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-VIEW" "1" "June 2014" "" "" +.TH "NPM\-VIEW" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-view\fR \-\- View registry info diff --git a/deps/npm/man/man1/npm-whoami.1 b/deps/npm/man/man1/npm-whoami.1 index 821e5cc7834..e9b4c6aea94 100644 --- a/deps/npm/man/man1/npm-whoami.1 +++ b/deps/npm/man/man1/npm-whoami.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-WHOAMI" "1" "June 2014" "" "" +.TH "NPM\-WHOAMI" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-whoami\fR \-\- Display npm username diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1 index 7e941b86678..e68e4806c2a 100644 --- a/deps/npm/man/man1/npm.1 +++ b/deps/npm/man/man1/npm.1 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM" "1" "June 2014" "" "" +.TH "NPM" "1" "July 2014" "" "" . .SH "NAME" \fBnpm\fR \-\- node package manager @@ -14,7 +14,7 @@ npm [args] .fi . .SH "VERSION" -1.4.14 +1.4.21 . .SH "DESCRIPTION" npm is the package manager for the Node JavaScript platform\. It puts diff --git a/deps/npm/man/man3/npm-bin.3 b/deps/npm/man/man3/npm-bin.3 index 15a0f715dda..5c06c894264 100644 --- a/deps/npm/man/man3/npm-bin.3 +++ b/deps/npm/man/man3/npm-bin.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-BIN" "3" "June 2014" "" "" +.TH "NPM\-BIN" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-bin\fR \-\- Display npm bin folder diff --git a/deps/npm/man/man3/npm-bugs.3 b/deps/npm/man/man3/npm-bugs.3 index 98d56039d2e..baf4f36e4b4 100644 --- a/deps/npm/man/man3/npm-bugs.3 +++ b/deps/npm/man/man3/npm-bugs.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-BUGS" "3" "June 2014" "" "" +.TH "NPM\-BUGS" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-bugs\fR \-\- Bugs for a package in a web browser maybe diff --git a/deps/npm/man/man3/npm-cache.3 b/deps/npm/man/man3/npm-cache.3 index efee679474f..0ca985546a0 100644 --- a/deps/npm/man/man3/npm-cache.3 +++ b/deps/npm/man/man3/npm-cache.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-CACHE" "3" "June 2014" "" "" +.TH "NPM\-CACHE" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-cache\fR \-\- manage the npm cache programmatically diff --git a/deps/npm/man/man3/npm-commands.3 b/deps/npm/man/man3/npm-commands.3 index 494139a16d2..ae5c0f7cb1a 100644 --- a/deps/npm/man/man3/npm-commands.3 +++ b/deps/npm/man/man3/npm-commands.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-COMMANDS" "3" "June 2014" "" "" +.TH "NPM\-COMMANDS" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-commands\fR \-\- npm commands diff --git a/deps/npm/man/man3/npm-config.3 b/deps/npm/man/man3/npm-config.3 index 8389e543eb8..cd42f868777 100644 --- a/deps/npm/man/man3/npm-config.3 +++ b/deps/npm/man/man3/npm-config.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-CONFIG" "3" "June 2014" "" "" +.TH "NPM\-CONFIG" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-config\fR \-\- Manage the npm configuration files diff --git a/deps/npm/man/man3/npm-deprecate.3 b/deps/npm/man/man3/npm-deprecate.3 index 30e3318bc40..c3eb13a64c5 100644 --- a/deps/npm/man/man3/npm-deprecate.3 +++ b/deps/npm/man/man3/npm-deprecate.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-DEPRECATE" "3" "June 2014" "" "" +.TH "NPM\-DEPRECATE" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-deprecate\fR \-\- Deprecate a version of a package diff --git a/deps/npm/man/man3/npm-docs.3 b/deps/npm/man/man3/npm-docs.3 index 8061baf8cf8..49a81e92ebf 100644 --- a/deps/npm/man/man3/npm-docs.3 +++ b/deps/npm/man/man3/npm-docs.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-DOCS" "3" "June 2014" "" "" +.TH "NPM\-DOCS" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-docs\fR \-\- Docs for a package in a web browser maybe diff --git a/deps/npm/man/man3/npm-edit.3 b/deps/npm/man/man3/npm-edit.3 index b7d3f657b59..a33489e628c 100644 --- a/deps/npm/man/man3/npm-edit.3 +++ b/deps/npm/man/man3/npm-edit.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-EDIT" "3" "June 2014" "" "" +.TH "NPM\-EDIT" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-edit\fR \-\- Edit an installed package diff --git a/deps/npm/man/man3/npm-explore.3 b/deps/npm/man/man3/npm-explore.3 index 60187503ec9..08fdd6113cf 100644 --- a/deps/npm/man/man3/npm-explore.3 +++ b/deps/npm/man/man3/npm-explore.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-EXPLORE" "3" "June 2014" "" "" +.TH "NPM\-EXPLORE" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-explore\fR \-\- Browse an installed package diff --git a/deps/npm/man/man3/npm-help-search.3 b/deps/npm/man/man3/npm-help-search.3 index febd3391b40..f70ffd1e8ec 100644 --- a/deps/npm/man/man3/npm-help-search.3 +++ b/deps/npm/man/man3/npm-help-search.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-HELP\-SEARCH" "3" "June 2014" "" "" +.TH "NPM\-HELP\-SEARCH" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-help-search\fR \-\- Search the help pages diff --git a/deps/npm/man/man3/npm-init.3 b/deps/npm/man/man3/npm-init.3 index 0a66df10989..a6806ad5486 100644 --- a/deps/npm/man/man3/npm-init.3 +++ b/deps/npm/man/man3/npm-init.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "INIT" "3" "June 2014" "" "" +.TH "INIT" "3" "July 2014" "" "" . .SH "NAME" \fBinit\fR \-\- Interactively create a package\.json file diff --git a/deps/npm/man/man3/npm-install.3 b/deps/npm/man/man3/npm-install.3 index 16964560a77..3f0657bfaec 100644 --- a/deps/npm/man/man3/npm-install.3 +++ b/deps/npm/man/man3/npm-install.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-INSTALL" "3" "June 2014" "" "" +.TH "NPM\-INSTALL" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-install\fR \-\- install a package programmatically diff --git a/deps/npm/man/man3/npm-link.3 b/deps/npm/man/man3/npm-link.3 index 521b7c9926e..022339c7166 100644 --- a/deps/npm/man/man3/npm-link.3 +++ b/deps/npm/man/man3/npm-link.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-LINK" "3" "June 2014" "" "" +.TH "NPM\-LINK" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-link\fR \-\- Symlink a package folder @@ -9,8 +9,8 @@ .SH "SYNOPSIS" . .nf -npm\.command\.link(callback) -npm\.command\.link(packages, callback) +npm\.commands\.link(callback) +npm\.commands\.link(packages, callback) . .fi . diff --git a/deps/npm/man/man3/npm-load.3 b/deps/npm/man/man3/npm-load.3 index 8e871ee9370..18c155f6c11 100644 --- a/deps/npm/man/man3/npm-load.3 +++ b/deps/npm/man/man3/npm-load.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-LOAD" "3" "June 2014" "" "" +.TH "NPM\-LOAD" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-load\fR \-\- Load config settings diff --git a/deps/npm/man/man3/npm-ls.3 b/deps/npm/man/man3/npm-ls.3 index 2c68f6a2c13..58bf72b6f50 100644 --- a/deps/npm/man/man3/npm-ls.3 +++ b/deps/npm/man/man3/npm-ls.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-LS" "3" "June 2014" "" "" +.TH "NPM\-LS" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-ls\fR \-\- List installed packages diff --git a/deps/npm/man/man3/npm-outdated.3 b/deps/npm/man/man3/npm-outdated.3 index f9a763585ae..8af78d813b1 100644 --- a/deps/npm/man/man3/npm-outdated.3 +++ b/deps/npm/man/man3/npm-outdated.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-OUTDATED" "3" "June 2014" "" "" +.TH "NPM\-OUTDATED" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-outdated\fR \-\- Check for outdated packages diff --git a/deps/npm/man/man3/npm-owner.3 b/deps/npm/man/man3/npm-owner.3 index e42ebfa9100..383c156729f 100644 --- a/deps/npm/man/man3/npm-owner.3 +++ b/deps/npm/man/man3/npm-owner.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-OWNER" "3" "June 2014" "" "" +.TH "NPM\-OWNER" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-owner\fR \-\- Manage package owners diff --git a/deps/npm/man/man3/npm-pack.3 b/deps/npm/man/man3/npm-pack.3 index 1384be5fff9..dc22e3aa21b 100644 --- a/deps/npm/man/man3/npm-pack.3 +++ b/deps/npm/man/man3/npm-pack.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-PACK" "3" "June 2014" "" "" +.TH "NPM\-PACK" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-pack\fR \-\- Create a tarball from a package diff --git a/deps/npm/man/man3/npm-prefix.3 b/deps/npm/man/man3/npm-prefix.3 index e10480e9e72..0e28759755b 100644 --- a/deps/npm/man/man3/npm-prefix.3 +++ b/deps/npm/man/man3/npm-prefix.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-PREFIX" "3" "June 2014" "" "" +.TH "NPM\-PREFIX" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-prefix\fR \-\- Display prefix diff --git a/deps/npm/man/man3/npm-prune.3 b/deps/npm/man/man3/npm-prune.3 index cde69a393c7..473486c696b 100644 --- a/deps/npm/man/man3/npm-prune.3 +++ b/deps/npm/man/man3/npm-prune.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-PRUNE" "3" "June 2014" "" "" +.TH "NPM\-PRUNE" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-prune\fR \-\- Remove extraneous packages diff --git a/deps/npm/man/man3/npm-publish.3 b/deps/npm/man/man3/npm-publish.3 index 139414a8fd6..04744f8624a 100644 --- a/deps/npm/man/man3/npm-publish.3 +++ b/deps/npm/man/man3/npm-publish.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-PUBLISH" "3" "June 2014" "" "" +.TH "NPM\-PUBLISH" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-publish\fR \-\- Publish a package diff --git a/deps/npm/man/man3/npm-rebuild.3 b/deps/npm/man/man3/npm-rebuild.3 index 8fede0d36d4..169f6d71744 100644 --- a/deps/npm/man/man3/npm-rebuild.3 +++ b/deps/npm/man/man3/npm-rebuild.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-REBUILD" "3" "June 2014" "" "" +.TH "NPM\-REBUILD" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-rebuild\fR \-\- Rebuild a package diff --git a/deps/npm/man/man3/npm-repo.3 b/deps/npm/man/man3/npm-repo.3 index 65daa6bf927..e1600a6a615 100644 --- a/deps/npm/man/man3/npm-repo.3 +++ b/deps/npm/man/man3/npm-repo.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-REPO" "3" "June 2014" "" "" +.TH "NPM\-REPO" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-repo\fR \-\- Open package repository page in the browser diff --git a/deps/npm/man/man3/npm-restart.3 b/deps/npm/man/man3/npm-restart.3 index 699e1cec676..a61ed86991a 100644 --- a/deps/npm/man/man3/npm-restart.3 +++ b/deps/npm/man/man3/npm-restart.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-RESTART" "3" "June 2014" "" "" +.TH "NPM\-RESTART" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-restart\fR \-\- Start a package diff --git a/deps/npm/man/man3/npm-root.3 b/deps/npm/man/man3/npm-root.3 index 1f3f4fef0f5..47872d9f791 100644 --- a/deps/npm/man/man3/npm-root.3 +++ b/deps/npm/man/man3/npm-root.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-ROOT" "3" "June 2014" "" "" +.TH "NPM\-ROOT" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-root\fR \-\- Display npm root diff --git a/deps/npm/man/man3/npm-run-script.3 b/deps/npm/man/man3/npm-run-script.3 index 44919b788b7..a48f3306677 100644 --- a/deps/npm/man/man3/npm-run-script.3 +++ b/deps/npm/man/man3/npm-run-script.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-RUN\-SCRIPT" "3" "June 2014" "" "" +.TH "NPM\-RUN\-SCRIPT" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-run-script\fR \-\- Run arbitrary package scripts diff --git a/deps/npm/man/man3/npm-search.3 b/deps/npm/man/man3/npm-search.3 index 54278ceb055..06e49bfd116 100644 --- a/deps/npm/man/man3/npm-search.3 +++ b/deps/npm/man/man3/npm-search.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-SEARCH" "3" "June 2014" "" "" +.TH "NPM\-SEARCH" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-search\fR \-\- Search for packages diff --git a/deps/npm/man/man3/npm-shrinkwrap.3 b/deps/npm/man/man3/npm-shrinkwrap.3 index 8d26fd0f871..80825279938 100644 --- a/deps/npm/man/man3/npm-shrinkwrap.3 +++ b/deps/npm/man/man3/npm-shrinkwrap.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-SHRINKWRAP" "3" "June 2014" "" "" +.TH "NPM\-SHRINKWRAP" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-shrinkwrap\fR \-\- programmatically generate package shrinkwrap file diff --git a/deps/npm/man/man3/npm-start.3 b/deps/npm/man/man3/npm-start.3 index 748f13a80d2..259f3189ff0 100644 --- a/deps/npm/man/man3/npm-start.3 +++ b/deps/npm/man/man3/npm-start.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-START" "3" "June 2014" "" "" +.TH "NPM\-START" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-start\fR \-\- Start a package diff --git a/deps/npm/man/man3/npm-stop.3 b/deps/npm/man/man3/npm-stop.3 index 7929b7d4f2c..875b2537a9f 100644 --- a/deps/npm/man/man3/npm-stop.3 +++ b/deps/npm/man/man3/npm-stop.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-STOP" "3" "June 2014" "" "" +.TH "NPM\-STOP" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-stop\fR \-\- Stop a package diff --git a/deps/npm/man/man3/npm-submodule.3 b/deps/npm/man/man3/npm-submodule.3 index cf48a8d40db..e50d928b1d3 100644 --- a/deps/npm/man/man3/npm-submodule.3 +++ b/deps/npm/man/man3/npm-submodule.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-SUBMODULE" "3" "June 2014" "" "" +.TH "NPM\-SUBMODULE" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-submodule\fR \-\- Add a package as a git submodule diff --git a/deps/npm/man/man3/npm-tag.3 b/deps/npm/man/man3/npm-tag.3 index c7df2e2d86f..0e4a5e9138b 100644 --- a/deps/npm/man/man3/npm-tag.3 +++ b/deps/npm/man/man3/npm-tag.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-TAG" "3" "June 2014" "" "" +.TH "NPM\-TAG" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-tag\fR \-\- Tag a published version diff --git a/deps/npm/man/man3/npm-test.3 b/deps/npm/man/man3/npm-test.3 index 6b580a565ca..66ebe38aa9d 100644 --- a/deps/npm/man/man3/npm-test.3 +++ b/deps/npm/man/man3/npm-test.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-TEST" "3" "June 2014" "" "" +.TH "NPM\-TEST" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-test\fR \-\- Test a package diff --git a/deps/npm/man/man3/npm-uninstall.3 b/deps/npm/man/man3/npm-uninstall.3 index 9b65ca7095f..c14627d5754 100644 --- a/deps/npm/man/man3/npm-uninstall.3 +++ b/deps/npm/man/man3/npm-uninstall.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-UNINSTALL" "3" "June 2014" "" "" +.TH "NPM\-UNINSTALL" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-uninstall\fR \-\- uninstall a package programmatically diff --git a/deps/npm/man/man3/npm-unpublish.3 b/deps/npm/man/man3/npm-unpublish.3 index de593b38053..f29c89aaf6b 100644 --- a/deps/npm/man/man3/npm-unpublish.3 +++ b/deps/npm/man/man3/npm-unpublish.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-UNPUBLISH" "3" "June 2014" "" "" +.TH "NPM\-UNPUBLISH" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-unpublish\fR \-\- Remove a package from the registry diff --git a/deps/npm/man/man3/npm-update.3 b/deps/npm/man/man3/npm-update.3 index 98a0cdd1350..8dc8ab9bf2e 100644 --- a/deps/npm/man/man3/npm-update.3 +++ b/deps/npm/man/man3/npm-update.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-UPDATE" "3" "June 2014" "" "" +.TH "NPM\-UPDATE" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-update\fR \-\- Update a package diff --git a/deps/npm/man/man3/npm-version.3 b/deps/npm/man/man3/npm-version.3 index 1e23051f35f..c20eba65a9b 100644 --- a/deps/npm/man/man3/npm-version.3 +++ b/deps/npm/man/man3/npm-version.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-VERSION" "3" "June 2014" "" "" +.TH "NPM\-VERSION" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-version\fR \-\- Bump a package version diff --git a/deps/npm/man/man3/npm-view.3 b/deps/npm/man/man3/npm-view.3 index 9aaffd57aeb..b03b11b5301 100644 --- a/deps/npm/man/man3/npm-view.3 +++ b/deps/npm/man/man3/npm-view.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-VIEW" "3" "June 2014" "" "" +.TH "NPM\-VIEW" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-view\fR \-\- View registry info diff --git a/deps/npm/man/man3/npm-whoami.3 b/deps/npm/man/man3/npm-whoami.3 index 117a1fc864d..b27069da572 100644 --- a/deps/npm/man/man3/npm-whoami.3 +++ b/deps/npm/man/man3/npm-whoami.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-WHOAMI" "3" "June 2014" "" "" +.TH "NPM\-WHOAMI" "3" "July 2014" "" "" . .SH "NAME" \fBnpm-whoami\fR \-\- Display npm username diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3 index dfb77f66597..2c1c59d98a3 100644 --- a/deps/npm/man/man3/npm.3 +++ b/deps/npm/man/man3/npm.3 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM" "3" "June 2014" "" "" +.TH "NPM" "3" "July 2014" "" "" . .SH "NAME" \fBnpm\fR \-\- node package manager @@ -21,7 +21,7 @@ npm\.load([configObject, ]function (er, npm) { .fi . .SH "VERSION" -1.4.14 +1.4.21 . .SH "DESCRIPTION" This is the API documentation for npm\. diff --git a/deps/npm/man/man5/npm-folders.5 b/deps/npm/man/man5/npm-folders.5 index 63aff661769..8e9772078f0 100644 --- a/deps/npm/man/man5/npm-folders.5 +++ b/deps/npm/man/man5/npm-folders.5 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-FOLDERS" "5" "June 2014" "" "" +.TH "NPM\-FOLDERS" "5" "July 2014" "" "" . .SH "NAME" \fBnpm-folders\fR \-\- Folder Structures Used by npm diff --git a/deps/npm/man/man5/npm-global.5 b/deps/npm/man/man5/npm-global.5 index 63aff661769..8e9772078f0 100644 --- a/deps/npm/man/man5/npm-global.5 +++ b/deps/npm/man/man5/npm-global.5 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-FOLDERS" "5" "June 2014" "" "" +.TH "NPM\-FOLDERS" "5" "July 2014" "" "" . .SH "NAME" \fBnpm-folders\fR \-\- Folder Structures Used by npm diff --git a/deps/npm/man/man5/npm-json.5 b/deps/npm/man/man5/npm-json.5 index 73ec3c3faa4..5182d29a702 100644 --- a/deps/npm/man/man5/npm-json.5 +++ b/deps/npm/man/man5/npm-json.5 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "PACKAGE\.JSON" "5" "June 2014" "" "" +.TH "PACKAGE\.JSON" "5" "July 2014" "" "" . .SH "NAME" \fBpackage.json\fR \-\- Specifics of npm\'s package\.json handling diff --git a/deps/npm/man/man5/npmrc.5 b/deps/npm/man/man5/npmrc.5 index aea7e7569b6..bf7f9be409e 100644 --- a/deps/npm/man/man5/npmrc.5 +++ b/deps/npm/man/man5/npmrc.5 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPMRC" "5" "June 2014" "" "" +.TH "NPMRC" "5" "July 2014" "" "" . .SH "NAME" \fBnpmrc\fR \-\- The npm config files diff --git a/deps/npm/man/man5/package.json.5 b/deps/npm/man/man5/package.json.5 index 73ec3c3faa4..5182d29a702 100644 --- a/deps/npm/man/man5/package.json.5 +++ b/deps/npm/man/man5/package.json.5 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "PACKAGE\.JSON" "5" "June 2014" "" "" +.TH "PACKAGE\.JSON" "5" "July 2014" "" "" . .SH "NAME" \fBpackage.json\fR \-\- Specifics of npm\'s package\.json handling diff --git a/deps/npm/man/man7/npm-coding-style.7 b/deps/npm/man/man7/npm-coding-style.7 index 863ec301ca4..c7dee81d114 100644 --- a/deps/npm/man/man7/npm-coding-style.7 +++ b/deps/npm/man/man7/npm-coding-style.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-CODING\-STYLE" "7" "June 2014" "" "" +.TH "NPM\-CODING\-STYLE" "7" "July 2014" "" "" . .SH "NAME" \fBnpm-coding-style\fR \-\- npm\'s "funny" coding style diff --git a/deps/npm/man/man7/npm-config.7 b/deps/npm/man/man7/npm-config.7 index cdf5761dd4f..807e04d9524 100644 --- a/deps/npm/man/man7/npm-config.7 +++ b/deps/npm/man/man7/npm-config.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-CONFIG" "7" "June 2014" "" "" +.TH "NPM\-CONFIG" "7" "July 2014" "" "" . .SH "NAME" \fBnpm-config\fR \-\- More than you probably want to know about npm configuration @@ -266,6 +266,21 @@ to trust only that specific signing authority\. .P See also the \fBstrict\-ssl\fR config\. . +.SS "cafile" +. +.IP "\(bu" 4 +Default: \fBnull\fR +. +.IP "\(bu" 4 +Type: path +. +.IP "" 0 +. +.P +A path to a file containing one or multiple Certificate Authority signing +certificates\. Similar to the \fBca\fR setting, but allows for multiple CA\'s, as +well as for the CA information to be stored in a file on disk\. +. .SS "cache" . .IP "\(bu" 4 diff --git a/deps/npm/man/man7/npm-developers.7 b/deps/npm/man/man7/npm-developers.7 index 70fbb46af68..01bebd8cba7 100644 --- a/deps/npm/man/man7/npm-developers.7 +++ b/deps/npm/man/man7/npm-developers.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-DEVELOPERS" "7" "June 2014" "" "" +.TH "NPM\-DEVELOPERS" "7" "July 2014" "" "" . .SH "NAME" \fBnpm-developers\fR \-\- Developer Guide diff --git a/deps/npm/man/man7/npm-disputes.7 b/deps/npm/man/man7/npm-disputes.7 index abcb426cb66..f5de204d988 100644 --- a/deps/npm/man/man7/npm-disputes.7 +++ b/deps/npm/man/man7/npm-disputes.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-DISPUTES" "7" "June 2014" "" "" +.TH "NPM\-DISPUTES" "7" "July 2014" "" "" . .SH "NAME" \fBnpm-disputes\fR \-\- Handling Module Name Disputes diff --git a/deps/npm/man/man7/npm-faq.7 b/deps/npm/man/man7/npm-faq.7 index f15f24ef970..c66d7e9de8f 100644 --- a/deps/npm/man/man7/npm-faq.7 +++ b/deps/npm/man/man7/npm-faq.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-FAQ" "7" "June 2014" "" "" +.TH "NPM\-FAQ" "7" "July 2014" "" "" . .SH "NAME" \fBnpm-faq\fR \-\- Frequently Asked Questions diff --git a/deps/npm/man/man7/npm-index.7 b/deps/npm/man/man7/npm-index.7 index 87d7308498c..a17389127f2 100644 --- a/deps/npm/man/man7/npm-index.7 +++ b/deps/npm/man/man7/npm-index.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-INDEX" "7" "June 2014" "" "" +.TH "NPM\-INDEX" "7" "July 2014" "" "" . .SH "NAME" \fBnpm-index\fR \-\- Index of all npm documentation diff --git a/deps/npm/man/man7/npm-registry.7 b/deps/npm/man/man7/npm-registry.7 index 09163fbc42b..2438b7f0ab4 100644 --- a/deps/npm/man/man7/npm-registry.7 +++ b/deps/npm/man/man7/npm-registry.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-REGISTRY" "7" "June 2014" "" "" +.TH "NPM\-REGISTRY" "7" "July 2014" "" "" . .SH "NAME" \fBnpm-registry\fR \-\- The JavaScript Package Registry diff --git a/deps/npm/man/man7/npm-scripts.7 b/deps/npm/man/man7/npm-scripts.7 index 03c5a52298a..c42d80e9c0a 100644 --- a/deps/npm/man/man7/npm-scripts.7 +++ b/deps/npm/man/man7/npm-scripts.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-SCRIPTS" "7" "June 2014" "" "" +.TH "NPM\-SCRIPTS" "7" "July 2014" "" "" . .SH "NAME" \fBnpm-scripts\fR \-\- How npm handles the "scripts" field diff --git a/deps/npm/man/man7/removing-npm.7 b/deps/npm/man/man7/removing-npm.7 index b73ed56af56..f5a0288894d 100644 --- a/deps/npm/man/man7/removing-npm.7 +++ b/deps/npm/man/man7/removing-npm.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "NPM\-REMOVAL" "1" "June 2014" "" "" +.TH "NPM\-REMOVAL" "1" "July 2014" "" "" . .SH "NAME" \fBnpm-removal\fR \-\- Cleaning the Slate diff --git a/deps/npm/man/man7/semver.7 b/deps/npm/man/man7/semver.7 index 662b9c8f2e0..6a1110fda54 100644 --- a/deps/npm/man/man7/semver.7 +++ b/deps/npm/man/man7/semver.7 @@ -1,7 +1,7 @@ .\" Generated with Ronnjs 0.3.8 .\" http://github.com/kapouer/ronnjs/ . -.TH "SEMVER" "7" "June 2014" "" "" +.TH "SEMVER" "7" "July 2014" "" "" . .SH "NAME" \fBsemver\fR \-\- The semantic versioner for npm diff --git a/deps/npm/node_modules/ansi/.jshintrc b/deps/npm/node_modules/ansi/.jshintrc new file mode 100644 index 00000000000..248c5426ea6 --- /dev/null +++ b/deps/npm/node_modules/ansi/.jshintrc @@ -0,0 +1,4 @@ +{ + "laxcomma": true, + "asi": true +} diff --git a/deps/npm/node_modules/ansi/History.md b/deps/npm/node_modules/ansi/History.md new file mode 100644 index 00000000000..f4a9fe30434 --- /dev/null +++ b/deps/npm/node_modules/ansi/History.md @@ -0,0 +1,16 @@ + +0.3.0 / 2014-05-09 +================== + + * package: remove "test" script and "devDependencies" + * package: remove "engines" section + * pacakge: remove "bin" section + * package: beautify + * examples: remove `starwars` example (#15) + * Documented goto, horizontalAbsolute, and eraseLine methods in README.md (#12, @Jammerwoch) + * add `.jshintrc` file + +< 0.3.0 +======= + + * Prehistoric diff --git a/deps/npm/node_modules/ansi/README.md b/deps/npm/node_modules/ansi/README.md index 2f9bb140a85..6ce19403c4c 100644 --- a/deps/npm/node_modules/ansi/README.md +++ b/deps/npm/node_modules/ansi/README.md @@ -7,9 +7,6 @@ writing ANSI escape codes to `Stream` instances. ANSI escape codes are used to d fancy things in a terminal window, like render text in colors, delete characters, lines, the entire window, or hide and show the cursor, and lots more! -The code for the example in the screenshot above can be found in the -`examples/imgcat` directory. - #### Features: * 256 color support for the terminal! @@ -51,7 +48,7 @@ cursor // Rendering modes are persistent: cursor.hex('#660000').bold().underline() -// You can use the regular logging functions, text will be green +// You can use the regular logging functions, text will be green: console.log('This is blood red, bold text') // To reset just the foreground color: @@ -59,6 +56,16 @@ cursor.fg.reset() console.log('This will still be bold') +// to go to a location (x,y) on the console +// note: 1-indexed, not 0-indexed: +cursor.goto(10, 5).write('Five down, ten over') + +// to clear the current line: +cursor.horizontalAbsolute(0).eraseLine().write('Starting again') + +// to go to a different column on the current line: +cursor.horizontalAbsolute(5).write('column five') + // Clean up after yourself! cursor.reset() ``` diff --git a/deps/npm/node_modules/ansi/color-spaces.pl b/deps/npm/node_modules/ansi/color-spaces.pl deleted file mode 100644 index 8774c044691..00000000000 --- a/deps/npm/node_modules/ansi/color-spaces.pl +++ /dev/null @@ -1,67 +0,0 @@ -#!/usr/bin/perl -# Author: Todd Larason -# $XFree86: xc/programs/xterm/vttests/256colors2.pl,v 1.1 1999/07/11 08:49:54 dawes Exp $ - -print "256 color mode\n\n"; - -# display back ground colors - -for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { - -# first the system ones: -print "System colors:\n"; -for ($color = 0; $color < 8; $color++) { - print "\x1b[${fgbg};5;${color}m::"; -} -print "\x1b[0m\n"; -for ($color = 8; $color < 16; $color++) { - print "\x1b[${fgbg};5;${color}m::"; -} -print "\x1b[0m\n\n"; - -# now the color cube -print "Color cube, 6x6x6:\n"; -for ($green = 0; $green < 6; $green++) { - for ($red = 0; $red < 6; $red++) { - for ($blue = 0; $blue < 6; $blue++) { - $color = 16 + ($red * 36) + ($green * 6) + $blue; - print "\x1b[${fgbg};5;${color}m::"; - } - print "\x1b[0m "; - } - print "\n"; -} - -# now the grayscale ramp -print "Grayscale ramp:\n"; -for ($color = 232; $color < 256; $color++) { - print "\x1b[${fgbg};5;${color}m::"; -} -print "\x1b[0m\n\n"; - -} - -print "Examples for the 3-byte color mode\n\n"; - -for ($fgbg = 38; $fgbg <= 48; $fgbg +=10) { - -# now the color cube -print "Color cube\n"; -for ($green = 0; $green < 256; $green+=51) { - for ($red = 0; $red < 256; $red+=51) { - for ($blue = 0; $blue < 256; $blue+=51) { - print "\x1b[${fgbg};2;${red};${green};${blue}m::"; - } - print "\x1b[0m "; - } - print "\n"; -} - -# now the grayscale ramp -print "Grayscale ramp:\n"; -for ($gray = 8; $gray < 256; $gray+=10) { - print "\x1b[${fgbg};2;${gray};${gray};${gray}m::"; -} -print "\x1b[0m\n\n"; - -} diff --git a/deps/npm/node_modules/ansi/examples/starwars.js b/deps/npm/node_modules/ansi/examples/starwars.js deleted file mode 100755 index 06f8ba84775..00000000000 --- a/deps/npm/node_modules/ansi/examples/starwars.js +++ /dev/null @@ -1,46 +0,0 @@ -#!/usr/bin/env node - -/** - * A little script to play the ASCII Star Wars, but with a hidden cursor, - * since over `telnet(1)` the cursor remains visible which is annoying. - */ - -process.title = 'starwars' - -var net = require('net') - , cursor = require('../')(process.stdout) - , color = process.argv[2] - -// enable "raw mode" so that keystrokes aren't visible -process.stdin.resume() -if (process.stdin.setRawMode) { - process.stdin.setRawMode(true) -} else { - require('tty').setRawMode(true) -} - -// connect to the ASCII Star Wars server -var socket = net.connect(23, 'towel.blinkenlights.nl') - -socket.on('connect', function () { - if (color in cursor.fg) { - cursor.fg[color]() - } - cursor.hide() - socket.pipe(process.stdout) -}) - -process.stdin.on('data', function (data) { - if (data.toString() === '\u0003') { - // Ctrl+C; a.k.a SIGINT - socket.destroy() - process.stdin.pause() - } -}) - -process.on('exit', function () { - cursor - .show() - .fg.reset() - .write('\n') -}) diff --git a/deps/npm/node_modules/ansi/package.json b/deps/npm/node_modules/ansi/package.json index e7cde26047a..706ae630676 100644 --- a/deps/npm/node_modules/ansi/package.json +++ b/deps/npm/node_modules/ansi/package.json @@ -11,7 +11,7 @@ "256", "stream" ], - "version": "0.2.1", + "version": "0.3.0", "author": { "name": "Nathan Rajlich", "email": "nathan@tootallnate.net", @@ -22,29 +22,33 @@ "url": "git://github.com/TooTallNate/ansi.js.git" }, "main": "./lib/ansi.js", - "bin": { - "beep": "./examples/beep/index.js", - "clear": "./examples/clear/index.js", - "starwars": "./examples/starwars.js" - }, - "scripts": { - "test": "mocha --reporter spec" - }, - "devDependencies": { - "mocha": "*" - }, - "engines": { - "node": "*" - }, - "readme": "ansi.js\n=========\n### Advanced ANSI formatting tool for Node.js\n\n`ansi.js` is a module for Node.js that provides an easy-to-use API for\nwriting ANSI escape codes to `Stream` instances. ANSI escape codes are used to do\nfancy things in a terminal window, like render text in colors, delete characters,\nlines, the entire window, or hide and show the cursor, and lots more!\n\nThe code for the example in the screenshot above can be found in the\n`examples/imgcat` directory.\n\n#### Features:\n\n * 256 color support for the terminal!\n * Make a beep sound from your terminal!\n * Works with *any* writable `Stream` instance.\n * Allows you to move the cursor anywhere on the terminal window.\n * Allows you to delete existing contents from the terminal window.\n * Allows you to hide and show the cursor.\n * Converts CSS color codes and RGB values into ANSI escape codes.\n * Low-level; you are in control of when escape codes are used, it's not abstracted.\n\n\nInstallation\n------------\n\nInstall with `npm`:\n\n``` bash\n$ npm install ansi\n```\n\n\nExample\n-------\n\n``` js\nvar ansi = require('ansi')\n , cursor = ansi(process.stdout)\n\n// You can chain your calls forever:\ncursor\n .red() // Set font color to red\n .bg.grey() // Set background color to grey\n .write('Hello World!') // Write 'Hello World!' to stdout\n .bg.reset() // Reset the bgcolor before writing the trailing \\n,\n // to avoid Terminal glitches\n .write('\\n') // And a final \\n to wrap things up\n\n// Rendering modes are persistent:\ncursor.hex('#660000').bold().underline()\n\n// You can use the regular logging functions, text will be green\nconsole.log('This is blood red, bold text')\n\n// To reset just the foreground color:\ncursor.fg.reset()\n\nconsole.log('This will still be bold')\n\n// Clean up after yourself!\ncursor.reset()\n```\n\n\nLicense\n-------\n\n(The MIT License)\n\nCopyright (c) 2012 Nathan Rajlich <nathan@tootallnate.net>\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\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 OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", - "readmeFilename": "README.md", "bugs": { "url": "https://github.com/TooTallNate/ansi.js/issues" }, - "_id": "ansi@0.2.1", + "homepage": "https://github.com/TooTallNate/ansi.js", + "_id": "ansi@0.3.0", + "_shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0", + "_from": "ansi@latest", + "_npmVersion": "1.4.9", + "_npmUser": { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + "maintainers": [ + { + "name": "TooTallNate", + "email": "nathan@tootallnate.net" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + } + ], "dist": { - "shasum": "76961682ac06d5ea0729af53295ea8f953a0cb21" + "shasum": "74b2f1f187c8553c7f95015bcb76009fb43d38e0", + "tarball": "http://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz" }, - "_from": "ansi@latest", - "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.2.1.tgz" + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi/-/ansi-0.3.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/cmd-shim/package.json b/deps/npm/node_modules/cmd-shim/package.json index cf6c9525db2..32e80606f11 100644 --- a/deps/npm/node_modules/cmd-shim/package.json +++ b/deps/npm/node_modules/cmd-shim/package.json @@ -11,7 +11,7 @@ }, "license": "BSD", "optionalDependencies": { - "graceful-fs": "2" + "graceful-fs": "2 || 3" }, "dependencies": { "mkdirp": "~0.3.3", diff --git a/deps/npm/node_modules/columnify/LICENSE b/deps/npm/node_modules/columnify/LICENSE new file mode 100644 index 00000000000..ed47678e61c --- /dev/null +++ b/deps/npm/node_modules/columnify/LICENSE @@ -0,0 +1,21 @@ +The MIT License (MIT) + +Copyright (c) 2013 Tim Oxley + +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/columnify/Readme.md b/deps/npm/node_modules/columnify/Readme.md index 65203796594..a20739b6532 100644 --- a/deps/npm/node_modules/columnify/Readme.md +++ b/deps/npm/node_modules/columnify/Readme.md @@ -2,8 +2,12 @@ [![Build Status](https://travis-ci.org/timoxley/columnify.png?branch=master)](https://travis-ci.org/timoxley/columnify) -Create text-based columns suitable for console output. -Supports minimum and maximum column widths via truncation and text wrapping. +Create text-based columns suitable for console output from objects or +arrays of objects. + +Columns are automatically resized to fit the content of the largest +cell. Each cell will be padded with spaces to fill the available space +and ensure column contents are left-aligned. Designed to [handle sensible wrapping in npm search results](https://github.com/isaacs/npm/pull/2328). @@ -19,7 +23,7 @@ $ npm install --save columnify@latest ## Usage -```js +```javascript var columnify = require('columnify') var columns = columnify(data, options) console.log(columns) @@ -27,14 +31,56 @@ console.log(columns) ## Examples -### Simple Columns +### Columnify Objects -Text is aligned under column headings. Columns are automatically resized -to fit the content of the largest cell. Each cell will be padded with -spaces to fill the available space and ensure column contents are -left-aligned. +Objects are converted to a list of key/value pairs: -```js +```javascript + +var data = { + "commander@0.6.1": 1, + "minimatch@0.2.14": 3, + "mkdirp@0.3.5": 2, + "sigmund@1.0.0": 3 +} + +console.log(columnify(data)) +``` +#### Output: +``` +KEY VALUE +commander@0.6.1 1 +minimatch@0.2.14 3 +mkdirp@0.3.5 2 +sigmund@1.0.0 3 +``` + +### Custom Column Names + +```javascript +var data = { + "commander@0.6.1": 1, + "minimatch@0.2.14": 3, + "mkdirp@0.3.5": 2, + "sigmund@1.0.0": 3 +} + +console.log(columnify(data, {columns: ['MODULE', 'COUNT']})) +``` +#### Output: +``` +MODULE COUNT +commander@0.6.1 1 +minimatch@0.2.14 3 +mkdirp@0.3.5 2 +sigmund@1.0.0 3 +``` + +### Columnify Arrays of Objects + +Column headings are extracted from the keys in supplied objects. + +```javascript var columnify = require('columnify') var columns = columnify([{ @@ -47,6 +93,7 @@ var columns = columnify([{ console.log(columns) ``` +#### Output: ``` NAME VERSION mod1 0.0.1 @@ -60,8 +107,7 @@ columns. Minimum width is also supported. Wrapping will happen at word boundaries. Empty cells or those which do not fill the max/min width will be padded with spaces. -```js -var columnify = require('columnify') +```javascript var columns = columnify([{ name: 'mod1', @@ -75,6 +121,7 @@ var columns = columnify([{ console.log(columns) ``` +#### Output: ``` NAME DESCRIPTION VERSION mod1 some description which happens 0.0.1 @@ -83,13 +130,13 @@ module-two another description larger 0.2.0 than the max ``` -### Truncated Columns +### Truncating Column Cells You can disable wrapping and instead truncate content at the maximum column width. Truncation respects word boundaries. A truncation marker, `…` will appear next to the last word in any truncated line. -```js +```javascript var columns = columnify(data, { truncate: true, config: { @@ -101,20 +148,124 @@ var columns = columnify(data, { console.log(columns) ``` - +#### Output: ``` NAME DESCRIPTION VERSION mod1 some description… 0.0.1 module-two another description… 0.2.0 ``` +### Filtering & Ordering Columns + +By default, all properties are converted into columns, whether or not +they exist on every object or not. + +To explicitly specify which columns to include, and in which order, +supply a "columns" or "include" array ("include" is just an alias). + +```javascript +var data = [{ + name: 'module1', + description: 'some description', + version: '0.0.1', +}, { + name: 'module2', + description: 'another description', + version: '0.2.0', +}] + +var columns = columnify(data, { + columns: ['name', 'version'] // note description not included +}) + +console.log(columns) +``` + +#### Output: +``` +NAME VERSION +module1 0.0.1 +module2 0.2.0 +``` + + +## Other Configuration Options + +### Align Right + +```js +var data = { + "mocha@1.18.2": 1, + "commander@2.0.0": 1, + "debug@0.8.1": 1 +} + +columnify(data, {config: {value: {align: 'right'}}}) +``` + +#### Output: +``` +KEY VALUE +mocha@1.18.2 1 +commander@2.0.0 1 +debug@0.8.1 1 +``` + +### Preserve existing newlines + +By default, `columnify` sanitises text by replacing any occurance of 1 or more whitespace characters with a single space. + +`columnify` can be configured to respect existing new line characters using the `preserveNewLines` option. Note this will still collapse all other whitespace. + +```javascript +var data = [{ + name: "glob@3.2.9", + paths: [ + "node_modules/tap/node_modules/glob", + "node_modules/tape/node_modules/glob" + ].join('\n') +}, { + name: "nopt@2.2.1", + paths: [ + "node_modules/tap/node_modules/nopt" + ] +}, { + name: "runforcover@0.0.2", + paths: "node_modules/tap/node_modules/runforcover" +}] + +console.log(columnify(data, {preserveNewLines: true})) +``` +#### Output: +``` +NAME PATHS +glob@3.2.9 node_modules/tap/node_modules/glob + node_modules/tape/node_modules/glob +nopt@2.2.1 node_modules/tap/node_modules/nopt +runforcover@0.0.2 node_modules/tap/node_modules/runforcover +``` + +Compare this with output without `preserveNewLines`: + +```javascript +console.log(columnify(data, {preserveNewLines: false})) +// or just +console.log(columnify(data)) +``` + +``` +NAME PATHS +glob@3.2.9 node_modules/tap/node_modules/glob node_modules/tape/node_modules/glob +nopt@2.2.1 node_modules/tap/node_modules/nopt +runforcover@0.0.2 node_modules/tap/node_modules/runforcover +``` ### Custom Truncation Marker You can change the truncation marker to something other than the default `…`. -```js +```javascript var columns = columnify(data, { truncate: true, truncateMarker: '>', @@ -127,7 +278,7 @@ var columns = columnify(data, { console.log(columns) ``` - +#### Output: ``` NAME DESCRIPTION VERSION mod1 some description> 0.0.1 @@ -139,7 +290,7 @@ module-two another description> 0.2.0 If your columns need some bling, you can split columns with custom characters. -```js +```javascript var columns = columnify(data, { columnSplitter: ' | ' @@ -147,43 +298,51 @@ var columns = columnify(data, { console.log(columns) ``` +#### Output: ``` NAME | DESCRIPTION | VERSION mod1 | some description which happens to be far larger than the max | 0.0.1 module-two | another description larger than the max | 0.2.0 ``` -### Filtering & Ordering Columns +## Multibyte Character Support -By default, all properties are converted into columns, whether or not -they exist on every object or not. - -To explicitly specify which columns to include, and in which order, -supply an "include" array: +`columnify` uses [mycoboco/wcwidth.js](https://github.com/mycoboco/wcwidth.js) to calculate length of multibyte characters: -```js +```javascript var data = [{ - name: 'module1', + name: 'module-one', description: 'some description', version: '0.0.1', }, { - name: 'module2', - description: 'another description', - version: '0.2.0', + name: '这是一个很长的名字的模块', + description: '这真的是一个描述的内容这个描述很长', + version: "0.3.3" }] -var columns = columnify(data, { - include: ['name', 'version'] // note description not included -}) +console.log(columnify(data)) +``` -console.log(columns) +#### Without multibyte handling: + +i.e. before columnify added this feature + +``` +NAME DESCRIPTION VERSION +module-one some description 0.0.1 +这是一个很长的名字的模块 这真的是一个描述的内容这个描述很长 0.3.3 ``` +#### With multibyte handling: + ``` -NAME VERSION -module1 0.0.1 -module2 0.2.0 +NAME DESCRIPTION VERSION +module-one some description 0.0.1 +这是一个很长的名字的模块 这真的是一个描述的内容这个描述很长 0.3.3 ``` + ## License MIT + + diff --git a/deps/npm/node_modules/columnify/index.js b/deps/npm/node_modules/columnify/index.js index 462c2919f95..63257dcecca 100644 --- a/deps/npm/node_modules/columnify/index.js +++ b/deps/npm/node_modules/columnify/index.js @@ -1,9 +1,12 @@ "use strict" +var wcwidth = require('./width') var utils = require('./utils') var padRight = utils.padRight +var padLeft = utils.padLeft var splitIntoLines = utils.splitIntoLines var splitLongWords = utils.splitLongWords +var truncateString = utils.truncateString var DEFAULTS = { maxWidth: Infinity, @@ -11,6 +14,7 @@ var DEFAULTS = { columnSplitter: ' ', truncate: false, truncateMarker: '…', + preserveNewLines: false, headingTransform: function(key) { return key.toUpperCase() }, @@ -26,14 +30,20 @@ module.exports = function(items, options) { var columnConfigs = options.config || {} delete options.config // remove config so doesn't appear on every column. + var maxLineWidth = options.maxLineWidth || Infinity + delete options.maxLineWidth // this is a line control option, don't pass it to column + // Option defaults inheritance: // options.config[columnName] => options => DEFAULTS options = mixin(options, DEFAULTS) options.config = options.config || Object.create(null) options.spacing = options.spacing || '\n' // probably useless + options.preserveNewLines = !!options.preserveNewLines + options.columns = options.columns || options.include // alias include/columns, prefer columns if supplied + var columnNames = options.columns || [] // optional user-supplied columns to include - var columnNames = options.include || [] // optional user-supplied columns to include + items = toArray(items, columnNames) // if not suppled column names, automatically determine columns from data keys if (!columnNames.length) { @@ -67,8 +77,13 @@ module.exports = function(items, options) { result[columnName] = item[columnName] != null ? item[columnName] : '' // toString everything result[columnName] = '' + result[columnName] - // remove funky chars - result[columnName] = result[columnName].replace(/\s+/g, " ") + if (columns[columnName].preserveNewLines) { + // merge non-newline whitespace chars + result[columnName] = result[columnName].replace(/[^\S\n]/gmi, ' ') + } else { + // merge all whitespace chars + result[columnName] = result[columnName].replace(/\s/gmi, ' ') + } }) return result }) @@ -97,7 +112,7 @@ module.exports = function(items, options) { column.width = items.map(function(item) { return item[columnName] }).reduce(function(min, cur) { - return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur.length))) + return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))) }, 0) }) @@ -119,7 +134,7 @@ module.exports = function(items, options) { // if truncating required, only include first line + add truncation char if (column.truncate && item[columnName].length > 1) { - item[columnName] = splitIntoLines(cell, column.width - column.truncateMarker.length) + item[columnName] = splitIntoLines(cell, column.width - wcwidth(column.truncateMarker)) var firstLine = item[columnName][0] if (!endsWith(firstLine, column.truncateMarker)) item[columnName][0] += column.truncateMarker item[columnName] = item[columnName].slice(0, 1) @@ -133,21 +148,23 @@ module.exports = function(items, options) { var column = columns[columnName] column.width = items.map(function(item) { return item[columnName].reduce(function(min, cur) { - return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur.length))) + return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, wcwidth(cur)))) }, 0) }).reduce(function(min, cur) { return Math.max(min, Math.min(column.maxWidth, Math.max(column.minWidth, cur))) }, 0) }) - var rows = createRows(items, columns, columnNames) // merge lines into rows + var rows = createRows(items, columns, columnNames) // merge lines into rows // conceive output return rows.reduce(function(output, row) { return output.concat(row.reduce(function(rowOut, line) { return rowOut.concat(line.join(options.columnSplitter)) }, [])) - }, []).join(options.spacing) + }, []).map(function(line) { + return truncateString(line, maxLineWidth) + }).join(options.spacing) } /** @@ -172,7 +189,8 @@ function createRows(items, columns, columnNames) { columnNames.forEach(function(columnName) { var column = columns[columnName] var val = item[columnName][i] || '' // || '' ensures empty columns get padded - row[i].push(padRight(val, column.width)) + if (column.align == 'right') row[i].push(padLeft(val, column.width)) + else row[i].push(padRight(val, column.width)) }) } return row @@ -208,3 +226,16 @@ function endsWith(target, searchString, position) { var lastIndex = target.lastIndexOf(searchString); return lastIndex !== -1 && lastIndex === position; } + + +function toArray(items, columnNames) { + if (Array.isArray(items)) return items + var rows = [] + for (var key in items) { + var item = {} + item[columnNames[0] || 'key'] = key + item[columnNames[1] || 'value'] = items[key] + rows.push(item) + } + return rows +} diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js new file mode 100755 index 00000000000..602ae00e8fc --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/cli.js @@ -0,0 +1,39 @@ +#!/usr/bin/env node +'use strict'; +var fs = require('fs'); +var pkg = require('./package.json'); +var strip = require('./'); +var input = process.argv[2]; + +function help() { + console.log([ + pkg.description, + '', + 'Usage', + ' $ strip-ansi > ', + ' $ cat | strip-ansi > ', + '', + 'Example', + ' $ strip-ansi unicorn.txt > unicorn-stripped.txt' + ].join('\n')); +} + +if (process.argv.indexOf('--help') !== -1) { + help(); + return; +} + +if (process.argv.indexOf('--version') !== -1) { + console.log(pkg.version); + return; +} + +if (input) { + process.stdout.write(strip(fs.readFileSync(input, 'utf8'))); + return; +} + +process.stdin.setEncoding('utf8'); +process.stdin.on('data', function (data) { + process.stdout.write(strip(data)); +}); diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js new file mode 100644 index 00000000000..11e072e4eaa --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/index.js @@ -0,0 +1,6 @@ +'use strict'; +var ansiRegex = require('ansi-regex'); + +module.exports = function (str) { + return typeof str === 'string' ? str.replace(ansiRegex, '') : str; +}; diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js new file mode 100644 index 00000000000..182e4345782 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/index.js @@ -0,0 +1,2 @@ +'use strict'; +module.exports = /\x1B\[([0-9]{1,3}(;[0-9]{1,3})*)?[m|K]/g; diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json new file mode 100644 index 00000000000..6b53e50dc68 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/package.json @@ -0,0 +1,75 @@ +{ + "name": "ansi-regex", + "version": "0.1.0", + "description": "Regular expression for matching ANSI escape codes", + "license": "MIT", + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/ansi-regex" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js" + ], + "keywords": [ + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "command-line", + "text", + "regex", + "regexp", + "re" + ], + "devDependencies": { + "mocha": "*" + }, + "bugs": { + "url": "https://github.com/sindresorhus/ansi-regex/issues" + }, + "homepage": "https://github.com/sindresorhus/ansi-regex", + "_id": "ansi-regex@0.1.0", + "_shasum": "55ca60db6900857c423ae9297980026f941ed903", + "_from": "ansi-regex@^0.1.0", + "_npmVersion": "1.4.9", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "55ca60db6900857c423ae9297980026f941ed903", + "tarball": "http://registry.npmjs.org/ansi-regex/-/ansi-regex-0.1.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-0.1.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md new file mode 100644 index 00000000000..72c248cd73b --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/node_modules/ansi-regex/readme.md @@ -0,0 +1,28 @@ +# ansi-regex [![Build Status](https://travis-ci.org/sindresorhus/ansi-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/ansi-regex) + +> Regular expression for matching [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +```sh +$ npm install --save ansi-regex +``` + + +## Usage + +```js +var ansiRegex = require('ansi-regex'); + +ansiRegex.test('\x1b[4mcake\x1b[0m'); +//=> true + +ansiRegex.test('cake'); +//=> false +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json new file mode 100644 index 00000000000..ea6a22fe219 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/package.json @@ -0,0 +1,84 @@ +{ + "name": "strip-ansi", + "version": "0.2.2", + "description": "Strip ANSI escape codes", + "license": "MIT", + "bin": { + "strip-ansi": "cli.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/sindresorhus/strip-ansi" + }, + "author": { + "name": "Sindre Sorhus", + "email": "sindresorhus@gmail.com", + "url": "http://sindresorhus.com" + }, + "engines": { + "node": ">=0.10.0" + }, + "scripts": { + "test": "mocha" + }, + "files": [ + "index.js", + "cli.js" + ], + "keywords": [ + "strip", + "trim", + "remove", + "ansi", + "styles", + "color", + "colour", + "colors", + "terminal", + "console", + "cli", + "string", + "tty", + "escape", + "formatting", + "rgb", + "256", + "shell", + "xterm", + "log", + "logging", + "command-line", + "text" + ], + "dependencies": { + "ansi-regex": "^0.1.0" + }, + "devDependencies": { + "mocha": "*" + }, + "bugs": { + "url": "https://github.com/sindresorhus/strip-ansi/issues" + }, + "homepage": "https://github.com/sindresorhus/strip-ansi", + "_id": "strip-ansi@0.2.2", + "_shasum": "854d290c981525fc8c397a910b025ae2d54ffc08", + "_from": "strip-ansi@^0.2.1", + "_npmVersion": "1.4.9", + "_npmUser": { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + }, + "maintainers": [ + { + "name": "sindresorhus", + "email": "sindresorhus@gmail.com" + } + ], + "dist": { + "shasum": "854d290c981525fc8c397a910b025ae2d54ffc08", + "tarball": "http://registry.npmjs.org/strip-ansi/-/strip-ansi-0.2.2.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-0.2.2.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md b/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md new file mode 100644 index 00000000000..5477079d00f --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/strip-ansi/readme.md @@ -0,0 +1,43 @@ +# strip-ansi [![Build Status](https://travis-ci.org/sindresorhus/strip-ansi.svg?branch=master)](https://travis-ci.org/sindresorhus/strip-ansi) + +> Strip [ANSI escape codes](http://en.wikipedia.org/wiki/ANSI_escape_code) + + +## Install + +```sh +$ npm install --save strip-ansi +``` + + +## Usage + +```js +var stripAnsi = require('strip-ansi'); + +stripAnsi('\x1b[4mcake\x1b[0m'); +//=> 'cake' +``` + + +## CLI + +```sh +$ npm install --global strip-ansi +``` + +```sh +$ strip-ansi --help + +Usage + $ strip-ansi > + $ cat | strip-ansi > + +Example + $ strip-ansi unicorn.txt > unicorn-stripped.txt +``` + + +## License + +MIT © [Sindre Sorhus](http://sindresorhus.com) diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/INSTALL.md b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/INSTALL.md new file mode 100644 index 00000000000..e4eafaff713 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/INSTALL.md @@ -0,0 +1,12 @@ +How To Build and Install wcwidth.js +=================================== + +This package does not provide an automated way to build or install the library +except using [`npm`](http://npmjs.org/package/wcwidth.js) because wcwidth.js is +intended to runs on top of [`node.js`](http://nodejs.org) that is a javascript +interpreter. If you have `node.js` installed, + + npm install wcwidth.js + +brings the latest version of `wcwidth.js` and installs it with its all +depending packages. diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/LICENSE.md b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/LICENSE.md new file mode 100644 index 00000000000..14deaf94b81 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/LICENSE.md @@ -0,0 +1,29 @@ +wcwidth.js: JavaScript Portng of Markus Kuhn's wcwidth() Implementation +======================================================================= + +Copyright (C) 2012 by Jun Woong. + +This package is a JavaScript porting of `wcwidth()` implementation +[by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c). + +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. + + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR +OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/NEWS b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/NEWS new file mode 100644 index 00000000000..cf80fbc1c94 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/NEWS @@ -0,0 +1,9 @@ +What's New in wcwidth.js? +========================= + +2014-04-26 0.0.4 released. +2012-12-13 0.0.3 released. +2012-12-12 Moved the repository to git/github. +2012-10-16 0.0.2 released. +2012-10-16 Using `wcwidth' without invoking it checked. +2012-10-12 First release. diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/README.md b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/README.md new file mode 100644 index 00000000000..6c562cff58f --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/README.md @@ -0,0 +1,65 @@ +wcwidth.js: A JavaScript Porting of Markus Kuhn's wcwidth() Implementation +========================================================================== + +`wcwidth.js` is a simple JavaScript porting of `wcwidth()` implemented in C +[by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c). + +`wcwidth()` and its string version, `wcswidth()` are defined by IEEE Std +1002.1-2001, a.k.a. POSIX.1-2001, and return the number of columns used to +represent the given wide character and string. Markus's implementation assumes +the wide character given to those functions to be encoded in ISO 10646, which +is almost true for JavaScript's characters. + +For convenience, `wcwidth.js` sets the getter of the property named `wcwidth` +for the string type. You don't need to invoke a function to get the width of +strings, but inspecting the `wcwidth` property is enough. The following code +snippet shows how to use `wcwidth.js`: + + var wcwidth = require('wcwidth')({ + nul: 0, + control: -1, + monkeypatch: true + }); // equivalent to var wcwidth = require('wcwidth')(); + + console.log("한글".wcwidth); // prints 4 + console.log("\0".wcwidth); // prints 0 + console.log("\t".wcwidth); // prints -1 + +The argument `{ nul: 0, control: -1, monkeypatch: true }` (which are the +default values, in fact) tells `wcwidth.js` to return 0 for the NUL character +and -1 for non-printable control characters. Setting a negative value to `nul` +or `control` makes the `wcwidth` property set to -1 for any string that +contains NUL or control characters respectively. If you plan to replace each +control character with, say, `???` when printing, you can 'require' +`wcwidth.js` as follows: + + var wcwidth = require('wcwidth')({ + control: 3 + }); // leaving nul as 0 + + console.log("\t".wcwidth); // prints 3 + console.log("\0".wcwidth); // prints 0 + +The last option `monkeypatch` allows `wcwidth.js` to monkey-patch +`String.prototype` to provide the getter `wcwidth`. Even if it is convenient to +have a getter that looks like the native one, it is sometimes unwanted as +adding a getter into `String.prototype` may break node.js's module system; you +are not guaranteed to have the version your code `require`s through the getter +if other modules you're using also depend on other versions of `wcwidth.js` +(thanks to [timoxley](https://github.com/timoxley) for the information). By +setting `monkeypatch` to `false`, `wcwidth.js` touches no global object and +provides no getter but a callable method explained below. + +`wcwidth.js` also provides a method. Since JavaScript has no character type, +it is meaningless to have two versions while POSIX does for C. The method also +accepts a code value that can be obtained by the `charCodeAt()` method. + + console.log(wcwidth('한')); // prints 2 + console.log(wcwidth('글'.charCodeAt(0)); // prints 2 + console.log(wcwidth('한글')); // prints 4 + +`INSTALL.md` explains how to build and install the library. For the copyright +issues, see the accompanying `LICENSE.md` file. + +If you have a question or suggestion, do not hesitate to contact me via email +(woong.jun at gmail.com) or web (http://code.woong.org/). diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/LICENSE b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/LICENSE new file mode 100644 index 00000000000..0d6b8739d95 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/LICENSE @@ -0,0 +1,23 @@ +Copyright (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative +Reporters & Editors + +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/columnify/node_modules/wcwidth.js/node_modules/underscore/README.md b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/README.md new file mode 100644 index 00000000000..c2ba2590c62 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/README.md @@ -0,0 +1,22 @@ + __ + /\ \ __ + __ __ ___ \_\ \ __ _ __ ____ ___ ___ _ __ __ /\_\ ____ + /\ \/\ \ /' _ `\ /'_ \ /'__`\/\ __\/ ,__\ / ___\ / __`\/\ __\/'__`\ \/\ \ /',__\ + \ \ \_\ \/\ \/\ \/\ \ \ \/\ __/\ \ \//\__, `\/\ \__//\ \ \ \ \ \//\ __/ __ \ \ \/\__, `\ + \ \____/\ \_\ \_\ \___,_\ \____\\ \_\\/\____/\ \____\ \____/\ \_\\ \____\/\_\ _\ \ \/\____/ + \/___/ \/_/\/_/\/__,_ /\/____/ \/_/ \/___/ \/____/\/___/ \/_/ \/____/\/_//\ \_\ \/___/ + \ \____/ + \/___/ + +Underscore.js is a utility-belt library for JavaScript that provides +support for the usual functional suspects (each, map, reduce, filter...) +without extending any core JavaScript objects. + +For Docs, License, Tests, and pre-packed downloads, see: +http://underscorejs.org + +Underscore is an open-sourced component of DocumentCloud: +https://github.com/documentcloud + +Many thanks to our contributors: +https://github.com/jashkenas/underscore/contributors diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/package.json new file mode 100644 index 00000000000..49e9145c99c --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/package.json @@ -0,0 +1,67 @@ +{ + "name": "underscore", + "description": "JavaScript's functional programming helper library.", + "homepage": "http://underscorejs.org", + "keywords": [ + "util", + "functional", + "server", + "client", + "browser" + ], + "author": { + "name": "Jeremy Ashkenas", + "email": "jeremy@documentcloud.org" + }, + "repository": { + "type": "git", + "url": "git://github.com/jashkenas/underscore.git" + }, + "main": "underscore.js", + "version": "1.6.0", + "devDependencies": { + "docco": "0.6.x", + "phantomjs": "1.9.0-1", + "uglify-js": "2.4.x" + }, + "scripts": { + "test": "phantomjs test/vendor/runner.js test/index.html?noglobals=true", + "build": "uglifyjs underscore.js -c \"evaluate=false\" --comments \"/ .*/\" -m --source-map underscore-min.map -o underscore-min.js", + "doc": "docco underscore.js" + }, + "licenses": [ + { + "type": "MIT", + "url": "https://raw.github.com/jashkenas/underscore/master/LICENSE" + } + ], + "files": [ + "underscore.js", + "underscore-min.js", + "LICENSE" + ], + "bugs": { + "url": "https://github.com/jashkenas/underscore/issues" + }, + "_id": "underscore@1.6.0", + "dist": { + "shasum": "8b38b10cacdef63337b8b24e4ff86d45aea529a8", + "tarball": "http://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz" + }, + "_from": "underscore@>= 1.3.0", + "_npmVersion": "1.3.21", + "_npmUser": { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + }, + "maintainers": [ + { + "name": "jashkenas", + "email": "jashkenas@gmail.com" + } + ], + "directories": {}, + "_shasum": "8b38b10cacdef63337b8b24e4ff86d45aea529a8", + "_resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore-min.js b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore-min.js new file mode 100644 index 00000000000..3434d6c5902 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore-min.js @@ -0,0 +1,6 @@ +// Underscore.js 1.6.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. +(function(){var n=this,t=n._,r={},e=Array.prototype,u=Object.prototype,i=Function.prototype,a=e.push,o=e.slice,c=e.concat,l=u.toString,f=u.hasOwnProperty,s=e.forEach,p=e.map,h=e.reduce,v=e.reduceRight,g=e.filter,d=e.every,m=e.some,y=e.indexOf,b=e.lastIndexOf,x=Array.isArray,w=Object.keys,_=i.bind,j=function(n){return n instanceof j?n:this instanceof j?void(this._wrapped=n):new j(n)};"undefined"!=typeof exports?("undefined"!=typeof module&&module.exports&&(exports=module.exports=j),exports._=j):n._=j,j.VERSION="1.6.0";var A=j.each=j.forEach=function(n,t,e){if(null==n)return n;if(s&&n.forEach===s)n.forEach(t,e);else if(n.length===+n.length){for(var u=0,i=n.length;i>u;u++)if(t.call(e,n[u],u,n)===r)return}else for(var a=j.keys(n),u=0,i=a.length;i>u;u++)if(t.call(e,n[a[u]],a[u],n)===r)return;return n};j.map=j.collect=function(n,t,r){var e=[];return null==n?e:p&&n.map===p?n.map(t,r):(A(n,function(n,u,i){e.push(t.call(r,n,u,i))}),e)};var O="Reduce of empty array with no initial value";j.reduce=j.foldl=j.inject=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),h&&n.reduce===h)return e&&(t=j.bind(t,e)),u?n.reduce(t,r):n.reduce(t);if(A(n,function(n,i,a){u?r=t.call(e,r,n,i,a):(r=n,u=!0)}),!u)throw new TypeError(O);return r},j.reduceRight=j.foldr=function(n,t,r,e){var u=arguments.length>2;if(null==n&&(n=[]),v&&n.reduceRight===v)return e&&(t=j.bind(t,e)),u?n.reduceRight(t,r):n.reduceRight(t);var i=n.length;if(i!==+i){var a=j.keys(n);i=a.length}if(A(n,function(o,c,l){c=a?a[--i]:--i,u?r=t.call(e,r,n[c],c,l):(r=n[c],u=!0)}),!u)throw new TypeError(O);return r},j.find=j.detect=function(n,t,r){var e;return k(n,function(n,u,i){return t.call(r,n,u,i)?(e=n,!0):void 0}),e},j.filter=j.select=function(n,t,r){var e=[];return null==n?e:g&&n.filter===g?n.filter(t,r):(A(n,function(n,u,i){t.call(r,n,u,i)&&e.push(n)}),e)},j.reject=function(n,t,r){return j.filter(n,function(n,e,u){return!t.call(r,n,e,u)},r)},j.every=j.all=function(n,t,e){t||(t=j.identity);var u=!0;return null==n?u:d&&n.every===d?n.every(t,e):(A(n,function(n,i,a){return(u=u&&t.call(e,n,i,a))?void 0:r}),!!u)};var k=j.some=j.any=function(n,t,e){t||(t=j.identity);var u=!1;return null==n?u:m&&n.some===m?n.some(t,e):(A(n,function(n,i,a){return u||(u=t.call(e,n,i,a))?r:void 0}),!!u)};j.contains=j.include=function(n,t){return null==n?!1:y&&n.indexOf===y?n.indexOf(t)!=-1:k(n,function(n){return n===t})},j.invoke=function(n,t){var r=o.call(arguments,2),e=j.isFunction(t);return j.map(n,function(n){return(e?t:n[t]).apply(n,r)})},j.pluck=function(n,t){return j.map(n,j.property(t))},j.where=function(n,t){return j.filter(n,j.matches(t))},j.findWhere=function(n,t){return j.find(n,j.matches(t))},j.max=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.max.apply(Math,n);var e=-1/0,u=-1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;o>u&&(e=n,u=o)}),e},j.min=function(n,t,r){if(!t&&j.isArray(n)&&n[0]===+n[0]&&n.length<65535)return Math.min.apply(Math,n);var e=1/0,u=1/0;return A(n,function(n,i,a){var o=t?t.call(r,n,i,a):n;u>o&&(e=n,u=o)}),e},j.shuffle=function(n){var t,r=0,e=[];return A(n,function(n){t=j.random(r++),e[r-1]=e[t],e[t]=n}),e},j.sample=function(n,t,r){return null==t||r?(n.length!==+n.length&&(n=j.values(n)),n[j.random(n.length-1)]):j.shuffle(n).slice(0,Math.max(0,t))};var E=function(n){return null==n?j.identity:j.isFunction(n)?n:j.property(n)};j.sortBy=function(n,t,r){return t=E(t),j.pluck(j.map(n,function(n,e,u){return{value:n,index:e,criteria:t.call(r,n,e,u)}}).sort(function(n,t){var r=n.criteria,e=t.criteria;if(r!==e){if(r>e||r===void 0)return 1;if(e>r||e===void 0)return-1}return n.index-t.index}),"value")};var F=function(n){return function(t,r,e){var u={};return r=E(r),A(t,function(i,a){var o=r.call(e,i,a,t);n(u,o,i)}),u}};j.groupBy=F(function(n,t,r){j.has(n,t)?n[t].push(r):n[t]=[r]}),j.indexBy=F(function(n,t,r){n[t]=r}),j.countBy=F(function(n,t){j.has(n,t)?n[t]++:n[t]=1}),j.sortedIndex=function(n,t,r,e){r=E(r);for(var u=r.call(e,t),i=0,a=n.length;a>i;){var o=i+a>>>1;r.call(e,n[o])t?[]:o.call(n,0,t)},j.initial=function(n,t,r){return o.call(n,0,n.length-(null==t||r?1:t))},j.last=function(n,t,r){return null==n?void 0:null==t||r?n[n.length-1]:o.call(n,Math.max(n.length-t,0))},j.rest=j.tail=j.drop=function(n,t,r){return o.call(n,null==t||r?1:t)},j.compact=function(n){return j.filter(n,j.identity)};var M=function(n,t,r){return t&&j.every(n,j.isArray)?c.apply(r,n):(A(n,function(n){j.isArray(n)||j.isArguments(n)?t?a.apply(r,n):M(n,t,r):r.push(n)}),r)};j.flatten=function(n,t){return M(n,t,[])},j.without=function(n){return j.difference(n,o.call(arguments,1))},j.partition=function(n,t){var r=[],e=[];return A(n,function(n){(t(n)?r:e).push(n)}),[r,e]},j.uniq=j.unique=function(n,t,r,e){j.isFunction(t)&&(e=r,r=t,t=!1);var u=r?j.map(n,r,e):n,i=[],a=[];return A(u,function(r,e){(t?e&&a[a.length-1]===r:j.contains(a,r))||(a.push(r),i.push(n[e]))}),i},j.union=function(){return j.uniq(j.flatten(arguments,!0))},j.intersection=function(n){var t=o.call(arguments,1);return j.filter(j.uniq(n),function(n){return j.every(t,function(t){return j.contains(t,n)})})},j.difference=function(n){var t=c.apply(e,o.call(arguments,1));return j.filter(n,function(n){return!j.contains(t,n)})},j.zip=function(){for(var n=j.max(j.pluck(arguments,"length").concat(0)),t=new Array(n),r=0;n>r;r++)t[r]=j.pluck(arguments,""+r);return t},j.object=function(n,t){if(null==n)return{};for(var r={},e=0,u=n.length;u>e;e++)t?r[n[e]]=t[e]:r[n[e][0]]=n[e][1];return r},j.indexOf=function(n,t,r){if(null==n)return-1;var e=0,u=n.length;if(r){if("number"!=typeof r)return e=j.sortedIndex(n,t),n[e]===t?e:-1;e=0>r?Math.max(0,u+r):r}if(y&&n.indexOf===y)return n.indexOf(t,r);for(;u>e;e++)if(n[e]===t)return e;return-1},j.lastIndexOf=function(n,t,r){if(null==n)return-1;var e=null!=r;if(b&&n.lastIndexOf===b)return e?n.lastIndexOf(t,r):n.lastIndexOf(t);for(var u=e?r:n.length;u--;)if(n[u]===t)return u;return-1},j.range=function(n,t,r){arguments.length<=1&&(t=n||0,n=0),r=arguments[2]||1;for(var e=Math.max(Math.ceil((t-n)/r),0),u=0,i=new Array(e);e>u;)i[u++]=n,n+=r;return i};var R=function(){};j.bind=function(n,t){var r,e;if(_&&n.bind===_)return _.apply(n,o.call(arguments,1));if(!j.isFunction(n))throw new TypeError;return r=o.call(arguments,2),e=function(){if(!(this instanceof e))return n.apply(t,r.concat(o.call(arguments)));R.prototype=n.prototype;var u=new R;R.prototype=null;var i=n.apply(u,r.concat(o.call(arguments)));return Object(i)===i?i:u}},j.partial=function(n){var t=o.call(arguments,1);return function(){for(var r=0,e=t.slice(),u=0,i=e.length;i>u;u++)e[u]===j&&(e[u]=arguments[r++]);for(;r=f?(clearTimeout(a),a=null,o=l,i=n.apply(e,u),e=u=null):a||r.trailing===!1||(a=setTimeout(c,f)),i}},j.debounce=function(n,t,r){var e,u,i,a,o,c=function(){var l=j.now()-a;t>l?e=setTimeout(c,t-l):(e=null,r||(o=n.apply(i,u),i=u=null))};return function(){i=this,u=arguments,a=j.now();var l=r&&!e;return e||(e=setTimeout(c,t)),l&&(o=n.apply(i,u),i=u=null),o}},j.once=function(n){var t,r=!1;return function(){return r?t:(r=!0,t=n.apply(this,arguments),n=null,t)}},j.wrap=function(n,t){return j.partial(t,n)},j.compose=function(){var n=arguments;return function(){for(var t=arguments,r=n.length-1;r>=0;r--)t=[n[r].apply(this,t)];return t[0]}},j.after=function(n,t){return function(){return--n<1?t.apply(this,arguments):void 0}},j.keys=function(n){if(!j.isObject(n))return[];if(w)return w(n);var t=[];for(var r in n)j.has(n,r)&&t.push(r);return t},j.values=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=n[t[u]];return e},j.pairs=function(n){for(var t=j.keys(n),r=t.length,e=new Array(r),u=0;r>u;u++)e[u]=[t[u],n[t[u]]];return e},j.invert=function(n){for(var t={},r=j.keys(n),e=0,u=r.length;u>e;e++)t[n[r[e]]]=r[e];return t},j.functions=j.methods=function(n){var t=[];for(var r in n)j.isFunction(n[r])&&t.push(r);return t.sort()},j.extend=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]=t[r]}),n},j.pick=function(n){var t={},r=c.apply(e,o.call(arguments,1));return A(r,function(r){r in n&&(t[r]=n[r])}),t},j.omit=function(n){var t={},r=c.apply(e,o.call(arguments,1));for(var u in n)j.contains(r,u)||(t[u]=n[u]);return t},j.defaults=function(n){return A(o.call(arguments,1),function(t){if(t)for(var r in t)n[r]===void 0&&(n[r]=t[r])}),n},j.clone=function(n){return j.isObject(n)?j.isArray(n)?n.slice():j.extend({},n):n},j.tap=function(n,t){return t(n),n};var S=function(n,t,r,e){if(n===t)return 0!==n||1/n==1/t;if(null==n||null==t)return n===t;n instanceof j&&(n=n._wrapped),t instanceof j&&(t=t._wrapped);var u=l.call(n);if(u!=l.call(t))return!1;switch(u){case"[object String]":return n==String(t);case"[object Number]":return n!=+n?t!=+t:0==n?1/n==1/t:n==+t;case"[object Date]":case"[object Boolean]":return+n==+t;case"[object RegExp]":return n.source==t.source&&n.global==t.global&&n.multiline==t.multiline&&n.ignoreCase==t.ignoreCase}if("object"!=typeof n||"object"!=typeof t)return!1;for(var i=r.length;i--;)if(r[i]==n)return e[i]==t;var a=n.constructor,o=t.constructor;if(a!==o&&!(j.isFunction(a)&&a instanceof a&&j.isFunction(o)&&o instanceof o)&&"constructor"in n&&"constructor"in t)return!1;r.push(n),e.push(t);var c=0,f=!0;if("[object Array]"==u){if(c=n.length,f=c==t.length)for(;c--&&(f=S(n[c],t[c],r,e)););}else{for(var s in n)if(j.has(n,s)&&(c++,!(f=j.has(t,s)&&S(n[s],t[s],r,e))))break;if(f){for(s in t)if(j.has(t,s)&&!c--)break;f=!c}}return r.pop(),e.pop(),f};j.isEqual=function(n,t){return S(n,t,[],[])},j.isEmpty=function(n){if(null==n)return!0;if(j.isArray(n)||j.isString(n))return 0===n.length;for(var t in n)if(j.has(n,t))return!1;return!0},j.isElement=function(n){return!(!n||1!==n.nodeType)},j.isArray=x||function(n){return"[object Array]"==l.call(n)},j.isObject=function(n){return n===Object(n)},A(["Arguments","Function","String","Number","Date","RegExp"],function(n){j["is"+n]=function(t){return l.call(t)=="[object "+n+"]"}}),j.isArguments(arguments)||(j.isArguments=function(n){return!(!n||!j.has(n,"callee"))}),"function"!=typeof/./&&(j.isFunction=function(n){return"function"==typeof n}),j.isFinite=function(n){return isFinite(n)&&!isNaN(parseFloat(n))},j.isNaN=function(n){return j.isNumber(n)&&n!=+n},j.isBoolean=function(n){return n===!0||n===!1||"[object Boolean]"==l.call(n)},j.isNull=function(n){return null===n},j.isUndefined=function(n){return n===void 0},j.has=function(n,t){return f.call(n,t)},j.noConflict=function(){return n._=t,this},j.identity=function(n){return n},j.constant=function(n){return function(){return n}},j.property=function(n){return function(t){return t[n]}},j.matches=function(n){return function(t){if(t===n)return!0;for(var r in n)if(n[r]!==t[r])return!1;return!0}},j.times=function(n,t,r){for(var e=Array(Math.max(0,n)),u=0;n>u;u++)e[u]=t.call(r,u);return e},j.random=function(n,t){return null==t&&(t=n,n=0),n+Math.floor(Math.random()*(t-n+1))},j.now=Date.now||function(){return(new Date).getTime()};var T={escape:{"&":"&","<":"<",">":">",'"':""","'":"'"}};T.unescape=j.invert(T.escape);var I={escape:new RegExp("["+j.keys(T.escape).join("")+"]","g"),unescape:new RegExp("("+j.keys(T.unescape).join("|")+")","g")};j.each(["escape","unescape"],function(n){j[n]=function(t){return null==t?"":(""+t).replace(I[n],function(t){return T[n][t]})}}),j.result=function(n,t){if(null==n)return void 0;var r=n[t];return j.isFunction(r)?r.call(n):r},j.mixin=function(n){A(j.functions(n),function(t){var r=j[t]=n[t];j.prototype[t]=function(){var n=[this._wrapped];return a.apply(n,arguments),z.call(this,r.apply(j,n))}})};var N=0;j.uniqueId=function(n){var t=++N+"";return n?n+t:t},j.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var q=/(.)^/,B={"'":"'","\\":"\\","\r":"r","\n":"n"," ":"t","\u2028":"u2028","\u2029":"u2029"},D=/\\|'|\r|\n|\t|\u2028|\u2029/g;j.template=function(n,t,r){var e;r=j.defaults({},r,j.templateSettings);var u=new RegExp([(r.escape||q).source,(r.interpolate||q).source,(r.evaluate||q).source].join("|")+"|$","g"),i=0,a="__p+='";n.replace(u,function(t,r,e,u,o){return a+=n.slice(i,o).replace(D,function(n){return"\\"+B[n]}),r&&(a+="'+\n((__t=("+r+"))==null?'':_.escape(__t))+\n'"),e&&(a+="'+\n((__t=("+e+"))==null?'':__t)+\n'"),u&&(a+="';\n"+u+"\n__p+='"),i=o+t.length,t}),a+="';\n",r.variable||(a="with(obj||{}){\n"+a+"}\n"),a="var __t,__p='',__j=Array.prototype.join,"+"print=function(){__p+=__j.call(arguments,'');};\n"+a+"return __p;\n";try{e=new Function(r.variable||"obj","_",a)}catch(o){throw o.source=a,o}if(t)return e(t,j);var c=function(n){return e.call(this,n,j)};return c.source="function("+(r.variable||"obj")+"){\n"+a+"}",c},j.chain=function(n){return j(n).chain()};var z=function(n){return this._chain?j(n).chain():n};j.mixin(j),A(["pop","push","reverse","shift","sort","splice","unshift"],function(n){var t=e[n];j.prototype[n]=function(){var r=this._wrapped;return t.apply(r,arguments),"shift"!=n&&"splice"!=n||0!==r.length||delete r[0],z.call(this,r)}}),A(["concat","join","slice"],function(n){var t=e[n];j.prototype[n]=function(){return z.call(this,t.apply(this._wrapped,arguments))}}),j.extend(j.prototype,{chain:function(){return this._chain=!0,this},value:function(){return this._wrapped}}),"function"==typeof define&&define.amd&&define("underscore",[],function(){return j})}).call(this); +//# sourceMappingURL=underscore-min.map \ No newline at end of file diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore.js b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore.js new file mode 100644 index 00000000000..9a4cabecf7f --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/node_modules/underscore/underscore.js @@ -0,0 +1,1343 @@ +// Underscore.js 1.6.0 +// http://underscorejs.org +// (c) 2009-2014 Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors +// Underscore may be freely distributed under the MIT license. + +(function() { + + // Baseline setup + // -------------- + + // Establish the root object, `window` in the browser, or `exports` on the server. + var root = this; + + // Save the previous value of the `_` variable. + var previousUnderscore = root._; + + // Establish the object that gets returned to break out of a loop iteration. + var breaker = {}; + + // Save bytes in the minified (but not gzipped) version: + var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype; + + // Create quick reference variables for speed access to core prototypes. + var + push = ArrayProto.push, + slice = ArrayProto.slice, + concat = ArrayProto.concat, + toString = ObjProto.toString, + hasOwnProperty = ObjProto.hasOwnProperty; + + // All **ECMAScript 5** native function implementations that we hope to use + // are declared here. + var + nativeForEach = ArrayProto.forEach, + nativeMap = ArrayProto.map, + nativeReduce = ArrayProto.reduce, + nativeReduceRight = ArrayProto.reduceRight, + nativeFilter = ArrayProto.filter, + nativeEvery = ArrayProto.every, + nativeSome = ArrayProto.some, + nativeIndexOf = ArrayProto.indexOf, + nativeLastIndexOf = ArrayProto.lastIndexOf, + nativeIsArray = Array.isArray, + nativeKeys = Object.keys, + nativeBind = FuncProto.bind; + + // Create a safe reference to the Underscore object for use below. + var _ = function(obj) { + if (obj instanceof _) return obj; + if (!(this instanceof _)) return new _(obj); + this._wrapped = obj; + }; + + // Export the Underscore object for **Node.js**, with + // backwards-compatibility for the old `require()` API. If we're in + // the browser, add `_` as a global object via a string identifier, + // for Closure Compiler "advanced" mode. + if (typeof exports !== 'undefined') { + if (typeof module !== 'undefined' && module.exports) { + exports = module.exports = _; + } + exports._ = _; + } else { + root._ = _; + } + + // Current version. + _.VERSION = '1.6.0'; + + // Collection Functions + // -------------------- + + // The cornerstone, an `each` implementation, aka `forEach`. + // Handles objects with the built-in `forEach`, arrays, and raw objects. + // Delegates to **ECMAScript 5**'s native `forEach` if available. + var each = _.each = _.forEach = function(obj, iterator, context) { + if (obj == null) return obj; + if (nativeForEach && obj.forEach === nativeForEach) { + obj.forEach(iterator, context); + } else if (obj.length === +obj.length) { + for (var i = 0, length = obj.length; i < length; i++) { + if (iterator.call(context, obj[i], i, obj) === breaker) return; + } + } else { + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + if (iterator.call(context, obj[keys[i]], keys[i], obj) === breaker) return; + } + } + return obj; + }; + + // Return the results of applying the iterator to each element. + // Delegates to **ECMAScript 5**'s native `map` if available. + _.map = _.collect = function(obj, iterator, context) { + var results = []; + if (obj == null) return results; + if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context); + each(obj, function(value, index, list) { + results.push(iterator.call(context, value, index, list)); + }); + return results; + }; + + var reduceError = 'Reduce of empty array with no initial value'; + + // **Reduce** builds up a single result from a list of values, aka `inject`, + // or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available. + _.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduce && obj.reduce === nativeReduce) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator); + } + each(obj, function(value, index, list) { + if (!initial) { + memo = value; + initial = true; + } else { + memo = iterator.call(context, memo, value, index, list); + } + }); + if (!initial) throw new TypeError(reduceError); + return memo; + }; + + // The right-associative version of reduce, also known as `foldr`. + // Delegates to **ECMAScript 5**'s native `reduceRight` if available. + _.reduceRight = _.foldr = function(obj, iterator, memo, context) { + var initial = arguments.length > 2; + if (obj == null) obj = []; + if (nativeReduceRight && obj.reduceRight === nativeReduceRight) { + if (context) iterator = _.bind(iterator, context); + return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator); + } + var length = obj.length; + if (length !== +length) { + var keys = _.keys(obj); + length = keys.length; + } + each(obj, function(value, index, list) { + index = keys ? keys[--length] : --length; + if (!initial) { + memo = obj[index]; + initial = true; + } else { + memo = iterator.call(context, memo, obj[index], index, list); + } + }); + if (!initial) throw new TypeError(reduceError); + return memo; + }; + + // Return the first value which passes a truth test. Aliased as `detect`. + _.find = _.detect = function(obj, predicate, context) { + var result; + any(obj, function(value, index, list) { + if (predicate.call(context, value, index, list)) { + result = value; + return true; + } + }); + return result; + }; + + // Return all the elements that pass a truth test. + // Delegates to **ECMAScript 5**'s native `filter` if available. + // Aliased as `select`. + _.filter = _.select = function(obj, predicate, context) { + var results = []; + if (obj == null) return results; + if (nativeFilter && obj.filter === nativeFilter) return obj.filter(predicate, context); + each(obj, function(value, index, list) { + if (predicate.call(context, value, index, list)) results.push(value); + }); + return results; + }; + + // Return all the elements for which a truth test fails. + _.reject = function(obj, predicate, context) { + return _.filter(obj, function(value, index, list) { + return !predicate.call(context, value, index, list); + }, context); + }; + + // Determine whether all of the elements match a truth test. + // Delegates to **ECMAScript 5**'s native `every` if available. + // Aliased as `all`. + _.every = _.all = function(obj, predicate, context) { + predicate || (predicate = _.identity); + var result = true; + if (obj == null) return result; + if (nativeEvery && obj.every === nativeEvery) return obj.every(predicate, context); + each(obj, function(value, index, list) { + if (!(result = result && predicate.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if at least one element in the object matches a truth test. + // Delegates to **ECMAScript 5**'s native `some` if available. + // Aliased as `any`. + var any = _.some = _.any = function(obj, predicate, context) { + predicate || (predicate = _.identity); + var result = false; + if (obj == null) return result; + if (nativeSome && obj.some === nativeSome) return obj.some(predicate, context); + each(obj, function(value, index, list) { + if (result || (result = predicate.call(context, value, index, list))) return breaker; + }); + return !!result; + }; + + // Determine if the array or object contains a given value (using `===`). + // Aliased as `include`. + _.contains = _.include = function(obj, target) { + if (obj == null) return false; + if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1; + return any(obj, function(value) { + return value === target; + }); + }; + + // Invoke a method (with arguments) on every item in a collection. + _.invoke = function(obj, method) { + var args = slice.call(arguments, 2); + var isFunc = _.isFunction(method); + return _.map(obj, function(value) { + return (isFunc ? method : value[method]).apply(value, args); + }); + }; + + // Convenience version of a common use case of `map`: fetching a property. + _.pluck = function(obj, key) { + return _.map(obj, _.property(key)); + }; + + // Convenience version of a common use case of `filter`: selecting only objects + // containing specific `key:value` pairs. + _.where = function(obj, attrs) { + return _.filter(obj, _.matches(attrs)); + }; + + // Convenience version of a common use case of `find`: getting the first object + // containing specific `key:value` pairs. + _.findWhere = function(obj, attrs) { + return _.find(obj, _.matches(attrs)); + }; + + // Return the maximum element or (element-based computation). + // Can't optimize arrays of integers longer than 65,535 elements. + // See [WebKit Bug 80797](https://bugs.webkit.org/show_bug.cgi?id=80797) + _.max = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { + return Math.max.apply(Math, obj); + } + var result = -Infinity, lastComputed = -Infinity; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + if (computed > lastComputed) { + result = value; + lastComputed = computed; + } + }); + return result; + }; + + // Return the minimum element (or element-based computation). + _.min = function(obj, iterator, context) { + if (!iterator && _.isArray(obj) && obj[0] === +obj[0] && obj.length < 65535) { + return Math.min.apply(Math, obj); + } + var result = Infinity, lastComputed = Infinity; + each(obj, function(value, index, list) { + var computed = iterator ? iterator.call(context, value, index, list) : value; + if (computed < lastComputed) { + result = value; + lastComputed = computed; + } + }); + return result; + }; + + // Shuffle an array, using the modern version of the + // [Fisher-Yates shuffle](http://en.wikipedia.org/wiki/Fisher–Yates_shuffle). + _.shuffle = function(obj) { + var rand; + var index = 0; + var shuffled = []; + each(obj, function(value) { + rand = _.random(index++); + shuffled[index - 1] = shuffled[rand]; + shuffled[rand] = value; + }); + return shuffled; + }; + + // Sample **n** random values from a collection. + // If **n** is not specified, returns a single random element. + // The internal `guard` argument allows it to work with `map`. + _.sample = function(obj, n, guard) { + if (n == null || guard) { + if (obj.length !== +obj.length) obj = _.values(obj); + return obj[_.random(obj.length - 1)]; + } + return _.shuffle(obj).slice(0, Math.max(0, n)); + }; + + // An internal function to generate lookup iterators. + var lookupIterator = function(value) { + if (value == null) return _.identity; + if (_.isFunction(value)) return value; + return _.property(value); + }; + + // Sort the object's values by a criterion produced by an iterator. + _.sortBy = function(obj, iterator, context) { + iterator = lookupIterator(iterator); + return _.pluck(_.map(obj, function(value, index, list) { + return { + value: value, + index: index, + criteria: iterator.call(context, value, index, list) + }; + }).sort(function(left, right) { + var a = left.criteria; + var b = right.criteria; + if (a !== b) { + if (a > b || a === void 0) return 1; + if (a < b || b === void 0) return -1; + } + return left.index - right.index; + }), 'value'); + }; + + // An internal function used for aggregate "group by" operations. + var group = function(behavior) { + return function(obj, iterator, context) { + var result = {}; + iterator = lookupIterator(iterator); + each(obj, function(value, index) { + var key = iterator.call(context, value, index, obj); + behavior(result, key, value); + }); + return result; + }; + }; + + // Groups the object's values by a criterion. Pass either a string attribute + // to group by, or a function that returns the criterion. + _.groupBy = group(function(result, key, value) { + _.has(result, key) ? result[key].push(value) : result[key] = [value]; + }); + + // Indexes the object's values by a criterion, similar to `groupBy`, but for + // when you know that your index values will be unique. + _.indexBy = group(function(result, key, value) { + result[key] = value; + }); + + // Counts instances of an object that group by a certain criterion. Pass + // either a string attribute to count by, or a function that returns the + // criterion. + _.countBy = group(function(result, key) { + _.has(result, key) ? result[key]++ : result[key] = 1; + }); + + // Use a comparator function to figure out the smallest index at which + // an object should be inserted so as to maintain order. Uses binary search. + _.sortedIndex = function(array, obj, iterator, context) { + iterator = lookupIterator(iterator); + var value = iterator.call(context, obj); + var low = 0, high = array.length; + while (low < high) { + var mid = (low + high) >>> 1; + iterator.call(context, array[mid]) < value ? low = mid + 1 : high = mid; + } + return low; + }; + + // Safely create a real, live array from anything iterable. + _.toArray = function(obj) { + if (!obj) return []; + if (_.isArray(obj)) return slice.call(obj); + if (obj.length === +obj.length) return _.map(obj, _.identity); + return _.values(obj); + }; + + // Return the number of elements in an object. + _.size = function(obj) { + if (obj == null) return 0; + return (obj.length === +obj.length) ? obj.length : _.keys(obj).length; + }; + + // Array Functions + // --------------- + + // Get the first element of an array. Passing **n** will return the first N + // values in the array. Aliased as `head` and `take`. The **guard** check + // allows it to work with `_.map`. + _.first = _.head = _.take = function(array, n, guard) { + if (array == null) return void 0; + if ((n == null) || guard) return array[0]; + if (n < 0) return []; + return slice.call(array, 0, n); + }; + + // Returns everything but the last entry of the array. Especially useful on + // the arguments object. Passing **n** will return all the values in + // the array, excluding the last N. The **guard** check allows it to work with + // `_.map`. + _.initial = function(array, n, guard) { + return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n)); + }; + + // Get the last element of an array. Passing **n** will return the last N + // values in the array. The **guard** check allows it to work with `_.map`. + _.last = function(array, n, guard) { + if (array == null) return void 0; + if ((n == null) || guard) return array[array.length - 1]; + return slice.call(array, Math.max(array.length - n, 0)); + }; + + // Returns everything but the first entry of the array. Aliased as `tail` and `drop`. + // Especially useful on the arguments object. Passing an **n** will return + // the rest N values in the array. The **guard** + // check allows it to work with `_.map`. + _.rest = _.tail = _.drop = function(array, n, guard) { + return slice.call(array, (n == null) || guard ? 1 : n); + }; + + // Trim out all falsy values from an array. + _.compact = function(array) { + return _.filter(array, _.identity); + }; + + // Internal implementation of a recursive `flatten` function. + var flatten = function(input, shallow, output) { + if (shallow && _.every(input, _.isArray)) { + return concat.apply(output, input); + } + each(input, function(value) { + if (_.isArray(value) || _.isArguments(value)) { + shallow ? push.apply(output, value) : flatten(value, shallow, output); + } else { + output.push(value); + } + }); + return output; + }; + + // Flatten out an array, either recursively (by default), or just one level. + _.flatten = function(array, shallow) { + return flatten(array, shallow, []); + }; + + // Return a version of the array that does not contain the specified value(s). + _.without = function(array) { + return _.difference(array, slice.call(arguments, 1)); + }; + + // Split an array into two arrays: one whose elements all satisfy the given + // predicate, and one whose elements all do not satisfy the predicate. + _.partition = function(array, predicate) { + var pass = [], fail = []; + each(array, function(elem) { + (predicate(elem) ? pass : fail).push(elem); + }); + return [pass, fail]; + }; + + // Produce a duplicate-free version of the array. If the array has already + // been sorted, you have the option of using a faster algorithm. + // Aliased as `unique`. + _.uniq = _.unique = function(array, isSorted, iterator, context) { + if (_.isFunction(isSorted)) { + context = iterator; + iterator = isSorted; + isSorted = false; + } + var initial = iterator ? _.map(array, iterator, context) : array; + var results = []; + var seen = []; + each(initial, function(value, index) { + if (isSorted ? (!index || seen[seen.length - 1] !== value) : !_.contains(seen, value)) { + seen.push(value); + results.push(array[index]); + } + }); + return results; + }; + + // Produce an array that contains the union: each distinct element from all of + // the passed-in arrays. + _.union = function() { + return _.uniq(_.flatten(arguments, true)); + }; + + // Produce an array that contains every item shared between all the + // passed-in arrays. + _.intersection = function(array) { + var rest = slice.call(arguments, 1); + return _.filter(_.uniq(array), function(item) { + return _.every(rest, function(other) { + return _.contains(other, item); + }); + }); + }; + + // Take the difference between one array and a number of other arrays. + // Only the elements present in just the first array will remain. + _.difference = function(array) { + var rest = concat.apply(ArrayProto, slice.call(arguments, 1)); + return _.filter(array, function(value){ return !_.contains(rest, value); }); + }; + + // Zip together multiple lists into a single array -- elements that share + // an index go together. + _.zip = function() { + var length = _.max(_.pluck(arguments, 'length').concat(0)); + var results = new Array(length); + for (var i = 0; i < length; i++) { + results[i] = _.pluck(arguments, '' + i); + } + return results; + }; + + // Converts lists into objects. Pass either a single array of `[key, value]` + // pairs, or two parallel arrays of the same length -- one of keys, and one of + // the corresponding values. + _.object = function(list, values) { + if (list == null) return {}; + var result = {}; + for (var i = 0, length = list.length; i < length; i++) { + if (values) { + result[list[i]] = values[i]; + } else { + result[list[i][0]] = list[i][1]; + } + } + return result; + }; + + // If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**), + // we need this function. Return the position of the first occurrence of an + // item in an array, or -1 if the item is not included in the array. + // Delegates to **ECMAScript 5**'s native `indexOf` if available. + // If the array is large and already in sort order, pass `true` + // for **isSorted** to use binary search. + _.indexOf = function(array, item, isSorted) { + if (array == null) return -1; + var i = 0, length = array.length; + if (isSorted) { + if (typeof isSorted == 'number') { + i = (isSorted < 0 ? Math.max(0, length + isSorted) : isSorted); + } else { + i = _.sortedIndex(array, item); + return array[i] === item ? i : -1; + } + } + if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item, isSorted); + for (; i < length; i++) if (array[i] === item) return i; + return -1; + }; + + // Delegates to **ECMAScript 5**'s native `lastIndexOf` if available. + _.lastIndexOf = function(array, item, from) { + if (array == null) return -1; + var hasIndex = from != null; + if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) { + return hasIndex ? array.lastIndexOf(item, from) : array.lastIndexOf(item); + } + var i = (hasIndex ? from : array.length); + while (i--) if (array[i] === item) return i; + return -1; + }; + + // Generate an integer Array containing an arithmetic progression. A port of + // the native Python `range()` function. See + // [the Python documentation](http://docs.python.org/library/functions.html#range). + _.range = function(start, stop, step) { + if (arguments.length <= 1) { + stop = start || 0; + start = 0; + } + step = arguments[2] || 1; + + var length = Math.max(Math.ceil((stop - start) / step), 0); + var idx = 0; + var range = new Array(length); + + while(idx < length) { + range[idx++] = start; + start += step; + } + + return range; + }; + + // Function (ahem) Functions + // ------------------ + + // Reusable constructor function for prototype setting. + var ctor = function(){}; + + // Create a function bound to a given object (assigning `this`, and arguments, + // optionally). Delegates to **ECMAScript 5**'s native `Function.bind` if + // available. + _.bind = function(func, context) { + var args, bound; + if (nativeBind && func.bind === nativeBind) return nativeBind.apply(func, slice.call(arguments, 1)); + if (!_.isFunction(func)) throw new TypeError; + args = slice.call(arguments, 2); + return bound = function() { + if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments))); + ctor.prototype = func.prototype; + var self = new ctor; + ctor.prototype = null; + var result = func.apply(self, args.concat(slice.call(arguments))); + if (Object(result) === result) return result; + return self; + }; + }; + + // Partially apply a function by creating a version that has had some of its + // arguments pre-filled, without changing its dynamic `this` context. _ acts + // as a placeholder, allowing any combination of arguments to be pre-filled. + _.partial = function(func) { + var boundArgs = slice.call(arguments, 1); + return function() { + var position = 0; + var args = boundArgs.slice(); + for (var i = 0, length = args.length; i < length; i++) { + if (args[i] === _) args[i] = arguments[position++]; + } + while (position < arguments.length) args.push(arguments[position++]); + return func.apply(this, args); + }; + }; + + // Bind a number of an object's methods to that object. Remaining arguments + // are the method names to be bound. Useful for ensuring that all callbacks + // defined on an object belong to it. + _.bindAll = function(obj) { + var funcs = slice.call(arguments, 1); + if (funcs.length === 0) throw new Error('bindAll must be passed function names'); + each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); }); + return obj; + }; + + // Memoize an expensive function by storing its results. + _.memoize = function(func, hasher) { + var memo = {}; + hasher || (hasher = _.identity); + return function() { + var key = hasher.apply(this, arguments); + return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments)); + }; + }; + + // Delays a function for the given number of milliseconds, and then calls + // it with the arguments supplied. + _.delay = function(func, wait) { + var args = slice.call(arguments, 2); + return setTimeout(function(){ return func.apply(null, args); }, wait); + }; + + // Defers a function, scheduling it to run after the current call stack has + // cleared. + _.defer = function(func) { + return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1))); + }; + + // Returns a function, that, when invoked, will only be triggered at most once + // during a given window of time. Normally, the throttled function will run + // as much as it can, without ever going more than once per `wait` duration; + // but if you'd like to disable the execution on the leading edge, pass + // `{leading: false}`. To disable execution on the trailing edge, ditto. + _.throttle = function(func, wait, options) { + var context, args, result; + var timeout = null; + var previous = 0; + options || (options = {}); + var later = function() { + previous = options.leading === false ? 0 : _.now(); + timeout = null; + result = func.apply(context, args); + context = args = null; + }; + return function() { + var now = _.now(); + if (!previous && options.leading === false) previous = now; + var remaining = wait - (now - previous); + context = this; + args = arguments; + if (remaining <= 0) { + clearTimeout(timeout); + timeout = null; + previous = now; + result = func.apply(context, args); + context = args = null; + } else if (!timeout && options.trailing !== false) { + timeout = setTimeout(later, remaining); + } + return result; + }; + }; + + // Returns a function, that, as long as it continues to be invoked, will not + // be triggered. The function will be called after it stops being called for + // N milliseconds. If `immediate` is passed, trigger the function on the + // leading edge, instead of the trailing. + _.debounce = function(func, wait, immediate) { + var timeout, args, context, timestamp, result; + + var later = function() { + var last = _.now() - timestamp; + if (last < wait) { + timeout = setTimeout(later, wait - last); + } else { + timeout = null; + if (!immediate) { + result = func.apply(context, args); + context = args = null; + } + } + }; + + return function() { + context = this; + args = arguments; + timestamp = _.now(); + var callNow = immediate && !timeout; + if (!timeout) { + timeout = setTimeout(later, wait); + } + if (callNow) { + result = func.apply(context, args); + context = args = null; + } + + return result; + }; + }; + + // Returns a function that will be executed at most one time, no matter how + // often you call it. Useful for lazy initialization. + _.once = function(func) { + var ran = false, memo; + return function() { + if (ran) return memo; + ran = true; + memo = func.apply(this, arguments); + func = null; + return memo; + }; + }; + + // Returns the first function passed as an argument to the second, + // allowing you to adjust arguments, run code before and after, and + // conditionally execute the original function. + _.wrap = function(func, wrapper) { + return _.partial(wrapper, func); + }; + + // Returns a function that is the composition of a list of functions, each + // consuming the return value of the function that follows. + _.compose = function() { + var funcs = arguments; + return function() { + var args = arguments; + for (var i = funcs.length - 1; i >= 0; i--) { + args = [funcs[i].apply(this, args)]; + } + return args[0]; + }; + }; + + // Returns a function that will only be executed after being called N times. + _.after = function(times, func) { + return function() { + if (--times < 1) { + return func.apply(this, arguments); + } + }; + }; + + // Object Functions + // ---------------- + + // Retrieve the names of an object's properties. + // Delegates to **ECMAScript 5**'s native `Object.keys` + _.keys = function(obj) { + if (!_.isObject(obj)) return []; + if (nativeKeys) return nativeKeys(obj); + var keys = []; + for (var key in obj) if (_.has(obj, key)) keys.push(key); + return keys; + }; + + // Retrieve the values of an object's properties. + _.values = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var values = new Array(length); + for (var i = 0; i < length; i++) { + values[i] = obj[keys[i]]; + } + return values; + }; + + // Convert an object into a list of `[key, value]` pairs. + _.pairs = function(obj) { + var keys = _.keys(obj); + var length = keys.length; + var pairs = new Array(length); + for (var i = 0; i < length; i++) { + pairs[i] = [keys[i], obj[keys[i]]]; + } + return pairs; + }; + + // Invert the keys and values of an object. The values must be serializable. + _.invert = function(obj) { + var result = {}; + var keys = _.keys(obj); + for (var i = 0, length = keys.length; i < length; i++) { + result[obj[keys[i]]] = keys[i]; + } + return result; + }; + + // Return a sorted list of the function names available on the object. + // Aliased as `methods` + _.functions = _.methods = function(obj) { + var names = []; + for (var key in obj) { + if (_.isFunction(obj[key])) names.push(key); + } + return names.sort(); + }; + + // Extend a given object with all the properties in passed-in object(s). + _.extend = function(obj) { + each(slice.call(arguments, 1), function(source) { + if (source) { + for (var prop in source) { + obj[prop] = source[prop]; + } + } + }); + return obj; + }; + + // Return a copy of the object only containing the whitelisted properties. + _.pick = function(obj) { + var copy = {}; + var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); + each(keys, function(key) { + if (key in obj) copy[key] = obj[key]; + }); + return copy; + }; + + // Return a copy of the object without the blacklisted properties. + _.omit = function(obj) { + var copy = {}; + var keys = concat.apply(ArrayProto, slice.call(arguments, 1)); + for (var key in obj) { + if (!_.contains(keys, key)) copy[key] = obj[key]; + } + return copy; + }; + + // Fill in a given object with default properties. + _.defaults = function(obj) { + each(slice.call(arguments, 1), function(source) { + if (source) { + for (var prop in source) { + if (obj[prop] === void 0) obj[prop] = source[prop]; + } + } + }); + return obj; + }; + + // Create a (shallow-cloned) duplicate of an object. + _.clone = function(obj) { + if (!_.isObject(obj)) return obj; + return _.isArray(obj) ? obj.slice() : _.extend({}, obj); + }; + + // Invokes interceptor with the obj, and then returns obj. + // The primary purpose of this method is to "tap into" a method chain, in + // order to perform operations on intermediate results within the chain. + _.tap = function(obj, interceptor) { + interceptor(obj); + return obj; + }; + + // Internal recursive comparison function for `isEqual`. + var eq = function(a, b, aStack, bStack) { + // Identical objects are equal. `0 === -0`, but they aren't identical. + // See the [Harmony `egal` proposal](http://wiki.ecmascript.org/doku.php?id=harmony:egal). + if (a === b) return a !== 0 || 1 / a == 1 / b; + // A strict comparison is necessary because `null == undefined`. + if (a == null || b == null) return a === b; + // Unwrap any wrapped objects. + if (a instanceof _) a = a._wrapped; + if (b instanceof _) b = b._wrapped; + // Compare `[[Class]]` names. + var className = toString.call(a); + if (className != toString.call(b)) return false; + switch (className) { + // Strings, numbers, dates, and booleans are compared by value. + case '[object String]': + // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is + // equivalent to `new String("5")`. + return a == String(b); + case '[object Number]': + // `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for + // other numeric values. + return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b); + case '[object Date]': + case '[object Boolean]': + // Coerce dates and booleans to numeric primitive values. Dates are compared by their + // millisecond representations. Note that invalid dates with millisecond representations + // of `NaN` are not equivalent. + return +a == +b; + // RegExps are compared by their source patterns and flags. + case '[object RegExp]': + return a.source == b.source && + a.global == b.global && + a.multiline == b.multiline && + a.ignoreCase == b.ignoreCase; + } + if (typeof a != 'object' || typeof b != 'object') return false; + // Assume equality for cyclic structures. The algorithm for detecting cyclic + // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`. + var length = aStack.length; + while (length--) { + // Linear search. Performance is inversely proportional to the number of + // unique nested structures. + if (aStack[length] == a) return bStack[length] == b; + } + // Objects with different constructors are not equivalent, but `Object`s + // from different frames are. + var aCtor = a.constructor, bCtor = b.constructor; + if (aCtor !== bCtor && !(_.isFunction(aCtor) && (aCtor instanceof aCtor) && + _.isFunction(bCtor) && (bCtor instanceof bCtor)) + && ('constructor' in a && 'constructor' in b)) { + return false; + } + // Add the first object to the stack of traversed objects. + aStack.push(a); + bStack.push(b); + var size = 0, result = true; + // Recursively compare objects and arrays. + if (className == '[object Array]') { + // Compare array lengths to determine if a deep comparison is necessary. + size = a.length; + result = size == b.length; + if (result) { + // Deep compare the contents, ignoring non-numeric properties. + while (size--) { + if (!(result = eq(a[size], b[size], aStack, bStack))) break; + } + } + } else { + // Deep compare objects. + for (var key in a) { + if (_.has(a, key)) { + // Count the expected number of properties. + size++; + // Deep compare each member. + if (!(result = _.has(b, key) && eq(a[key], b[key], aStack, bStack))) break; + } + } + // Ensure that both objects contain the same number of properties. + if (result) { + for (key in b) { + if (_.has(b, key) && !(size--)) break; + } + result = !size; + } + } + // Remove the first object from the stack of traversed objects. + aStack.pop(); + bStack.pop(); + return result; + }; + + // Perform a deep comparison to check if two objects are equal. + _.isEqual = function(a, b) { + return eq(a, b, [], []); + }; + + // Is a given array, string, or object empty? + // An "empty" object has no enumerable own-properties. + _.isEmpty = function(obj) { + if (obj == null) return true; + if (_.isArray(obj) || _.isString(obj)) return obj.length === 0; + for (var key in obj) if (_.has(obj, key)) return false; + return true; + }; + + // Is a given value a DOM element? + _.isElement = function(obj) { + return !!(obj && obj.nodeType === 1); + }; + + // Is a given value an array? + // Delegates to ECMA5's native Array.isArray + _.isArray = nativeIsArray || function(obj) { + return toString.call(obj) == '[object Array]'; + }; + + // Is a given variable an object? + _.isObject = function(obj) { + return obj === Object(obj); + }; + + // Add some isType methods: isArguments, isFunction, isString, isNumber, isDate, isRegExp. + each(['Arguments', 'Function', 'String', 'Number', 'Date', 'RegExp'], function(name) { + _['is' + name] = function(obj) { + return toString.call(obj) == '[object ' + name + ']'; + }; + }); + + // Define a fallback version of the method in browsers (ahem, IE), where + // there isn't any inspectable "Arguments" type. + if (!_.isArguments(arguments)) { + _.isArguments = function(obj) { + return !!(obj && _.has(obj, 'callee')); + }; + } + + // Optimize `isFunction` if appropriate. + if (typeof (/./) !== 'function') { + _.isFunction = function(obj) { + return typeof obj === 'function'; + }; + } + + // Is a given object a finite number? + _.isFinite = function(obj) { + return isFinite(obj) && !isNaN(parseFloat(obj)); + }; + + // Is the given value `NaN`? (NaN is the only number which does not equal itself). + _.isNaN = function(obj) { + return _.isNumber(obj) && obj != +obj; + }; + + // Is a given value a boolean? + _.isBoolean = function(obj) { + return obj === true || obj === false || toString.call(obj) == '[object Boolean]'; + }; + + // Is a given value equal to null? + _.isNull = function(obj) { + return obj === null; + }; + + // Is a given variable undefined? + _.isUndefined = function(obj) { + return obj === void 0; + }; + + // Shortcut function for checking if an object has a given property directly + // on itself (in other words, not on a prototype). + _.has = function(obj, key) { + return hasOwnProperty.call(obj, key); + }; + + // Utility Functions + // ----------------- + + // Run Underscore.js in *noConflict* mode, returning the `_` variable to its + // previous owner. Returns a reference to the Underscore object. + _.noConflict = function() { + root._ = previousUnderscore; + return this; + }; + + // Keep the identity function around for default iterators. + _.identity = function(value) { + return value; + }; + + _.constant = function(value) { + return function () { + return value; + }; + }; + + _.property = function(key) { + return function(obj) { + return obj[key]; + }; + }; + + // Returns a predicate for checking whether an object has a given set of `key:value` pairs. + _.matches = function(attrs) { + return function(obj) { + if (obj === attrs) return true; //avoid comparing an object to itself. + for (var key in attrs) { + if (attrs[key] !== obj[key]) + return false; + } + return true; + } + }; + + // Run a function **n** times. + _.times = function(n, iterator, context) { + var accum = Array(Math.max(0, n)); + for (var i = 0; i < n; i++) accum[i] = iterator.call(context, i); + return accum; + }; + + // Return a random integer between min and max (inclusive). + _.random = function(min, max) { + if (max == null) { + max = min; + min = 0; + } + return min + Math.floor(Math.random() * (max - min + 1)); + }; + + // A (possibly faster) way to get the current timestamp as an integer. + _.now = Date.now || function() { return new Date().getTime(); }; + + // List of HTML entities for escaping. + var entityMap = { + escape: { + '&': '&', + '<': '<', + '>': '>', + '"': '"', + "'": ''' + } + }; + entityMap.unescape = _.invert(entityMap.escape); + + // Regexes containing the keys and values listed immediately above. + var entityRegexes = { + escape: new RegExp('[' + _.keys(entityMap.escape).join('') + ']', 'g'), + unescape: new RegExp('(' + _.keys(entityMap.unescape).join('|') + ')', 'g') + }; + + // Functions for escaping and unescaping strings to/from HTML interpolation. + _.each(['escape', 'unescape'], function(method) { + _[method] = function(string) { + if (string == null) return ''; + return ('' + string).replace(entityRegexes[method], function(match) { + return entityMap[method][match]; + }); + }; + }); + + // If the value of the named `property` is a function then invoke it with the + // `object` as context; otherwise, return it. + _.result = function(object, property) { + if (object == null) return void 0; + var value = object[property]; + return _.isFunction(value) ? value.call(object) : value; + }; + + // Add your own custom functions to the Underscore object. + _.mixin = function(obj) { + each(_.functions(obj), function(name) { + var func = _[name] = obj[name]; + _.prototype[name] = function() { + var args = [this._wrapped]; + push.apply(args, arguments); + return result.call(this, func.apply(_, args)); + }; + }); + }; + + // Generate a unique integer id (unique within the entire client session). + // Useful for temporary DOM ids. + var idCounter = 0; + _.uniqueId = function(prefix) { + var id = ++idCounter + ''; + return prefix ? prefix + id : id; + }; + + // By default, Underscore uses ERB-style template delimiters, change the + // following template settings to use alternative delimiters. + _.templateSettings = { + evaluate : /<%([\s\S]+?)%>/g, + interpolate : /<%=([\s\S]+?)%>/g, + escape : /<%-([\s\S]+?)%>/g + }; + + // When customizing `templateSettings`, if you don't want to define an + // interpolation, evaluation or escaping regex, we need one that is + // guaranteed not to match. + var noMatch = /(.)^/; + + // Certain characters need to be escaped so that they can be put into a + // string literal. + var escapes = { + "'": "'", + '\\': '\\', + '\r': 'r', + '\n': 'n', + '\t': 't', + '\u2028': 'u2028', + '\u2029': 'u2029' + }; + + var escaper = /\\|'|\r|\n|\t|\u2028|\u2029/g; + + // JavaScript micro-templating, similar to John Resig's implementation. + // Underscore templating handles arbitrary delimiters, preserves whitespace, + // and correctly escapes quotes within interpolated code. + _.template = function(text, data, settings) { + var render; + settings = _.defaults({}, settings, _.templateSettings); + + // Combine delimiters into one regular expression via alternation. + var matcher = new RegExp([ + (settings.escape || noMatch).source, + (settings.interpolate || noMatch).source, + (settings.evaluate || noMatch).source + ].join('|') + '|$', 'g'); + + // Compile the template source, escaping string literals appropriately. + var index = 0; + var source = "__p+='"; + text.replace(matcher, function(match, escape, interpolate, evaluate, offset) { + source += text.slice(index, offset) + .replace(escaper, function(match) { return '\\' + escapes[match]; }); + + if (escape) { + source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'"; + } + if (interpolate) { + source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'"; + } + if (evaluate) { + source += "';\n" + evaluate + "\n__p+='"; + } + index = offset + match.length; + return match; + }); + source += "';\n"; + + // If a variable is not specified, place data values in local scope. + if (!settings.variable) source = 'with(obj||{}){\n' + source + '}\n'; + + source = "var __t,__p='',__j=Array.prototype.join," + + "print=function(){__p+=__j.call(arguments,'');};\n" + + source + "return __p;\n"; + + try { + render = new Function(settings.variable || 'obj', '_', source); + } catch (e) { + e.source = source; + throw e; + } + + if (data) return render(data, _); + var template = function(data) { + return render.call(this, data, _); + }; + + // Provide the compiled function source as a convenience for precompilation. + template.source = 'function(' + (settings.variable || 'obj') + '){\n' + source + '}'; + + return template; + }; + + // Add a "chain" function, which will delegate to the wrapper. + _.chain = function(obj) { + return _(obj).chain(); + }; + + // OOP + // --------------- + // If Underscore is called as a function, it returns a wrapped object that + // can be used OO-style. This wrapper holds altered versions of all the + // underscore functions. Wrapped objects may be chained. + + // Helper function to continue chaining intermediate results. + var result = function(obj) { + return this._chain ? _(obj).chain() : obj; + }; + + // Add all of the Underscore functions to the wrapper object. + _.mixin(_); + + // Add all mutator Array functions to the wrapper. + each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + var obj = this._wrapped; + method.apply(obj, arguments); + if ((name == 'shift' || name == 'splice') && obj.length === 0) delete obj[0]; + return result.call(this, obj); + }; + }); + + // Add all accessor Array functions to the wrapper. + each(['concat', 'join', 'slice'], function(name) { + var method = ArrayProto[name]; + _.prototype[name] = function() { + return result.call(this, method.apply(this._wrapped, arguments)); + }; + }); + + _.extend(_.prototype, { + + // Start chaining a wrapped Underscore object. + chain: function() { + this._chain = true; + return this; + }, + + // Extracts the result from a wrapped and chained object. + value: function() { + return this._wrapped; + } + + }); + + // AMD registration happens at the end for compatibility with AMD loaders + // that may not enforce next-turn semantics on modules. Even though general + // practice for AMD registration is to be anonymous, underscore registers + // as a named module because, like jQuery, it is a base library that is + // popular enough to be bundled in a third party lib, but not be part of + // an AMD load request. Those cases could generate an error when an + // anonymous define() is called outside of a loader request. + if (typeof define === 'function' && define.amd) { + define('underscore', [], function() { + return _; + }); + } +}).call(this); diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/package.json b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/package.json new file mode 100644 index 00000000000..104b7076326 --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/package.json @@ -0,0 +1,60 @@ +{ + "name": "wcwidth.js", + "version": "0.0.4", + "description": "A JavaScript porting of C's wcwidth() and wcswidth()", + "author": { + "name": "Woong Jun", + "email": "woong.jun@gmail.com", + "url": "http://code.woong.org/" + }, + "contributors": [], + "homepage": "http://code.woong.org/wcwidth.js", + "repository": { + "type": "git", + "url": "https://github.com/mycoboco/wcwidth.js.git" + }, + "bugs": { + "url": "https://github.com/mycoboco/wcwidth.js/issues", + "email": "woong.jun@gmail.com" + }, + "main": "wcwidth.js", + "dependencies": { + "underscore": ">= 1.3.0" + }, + "devDependencies": {}, + "engines": { + "node": ">= 0.8.0" + }, + "licenses": "MIT", + "keywords": [ + "wide character", + "wc", + "wide character string", + "wcs", + "terminal", + "width", + "wcwidth", + "wcswidth" + ], + "_id": "wcwidth.js@0.0.4", + "dist": { + "shasum": "44298a7c899c17501990fdaddd76ef6bd081be75", + "tarball": "http://registry.npmjs.org/wcwidth.js/-/wcwidth.js-0.0.4.tgz" + }, + "_from": "wcwidth.js@~0.0.4", + "_npmVersion": "1.3.11", + "_npmUser": { + "name": "mycoboco", + "email": "woong.jun@gmail.com" + }, + "maintainers": [ + { + "name": "mycoboco", + "email": "woong.jun@gmail.com" + } + ], + "directories": {}, + "_shasum": "44298a7c899c17501990fdaddd76ef6bd081be75", + "_resolved": "https://registry.npmjs.org/wcwidth.js/-/wcwidth.js-0.0.4.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/columnify/node_modules/wcwidth.js/wcwidth.js b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/wcwidth.js new file mode 100644 index 00000000000..3ce5b489a4e --- /dev/null +++ b/deps/npm/node_modules/columnify/node_modules/wcwidth.js/wcwidth.js @@ -0,0 +1,262 @@ +/* + * Javascript porting of Markus Kuhn's wcwidth() implementation + * + * The following explanation comes from the original C implementation: + * + * This is an implementation of wcwidth() and wcswidth() (defined in + * IEEE Std 1002.1-2001) for Unicode. + * + * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html + * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html + * + * In fixed-width output devices, Latin characters all occupy a single + * "cell" position of equal width, whereas ideographic CJK characters + * occupy two such cells. Interoperability between terminal-line + * applications and (teletype-style) character terminals using the + * UTF-8 encoding requires agreement on which character should advance + * the cursor by how many cell positions. No established formal + * standards exist at present on which Unicode character shall occupy + * how many cell positions on character terminals. These routines are + * a first attempt of defining such behavior based on simple rules + * applied to data provided by the Unicode Consortium. + * + * For some graphical characters, the Unicode standard explicitly + * defines a character-cell width via the definition of the East Asian + * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. + * In all these cases, there is no ambiguity about which width a + * terminal shall use. For characters in the East Asian Ambiguous (A) + * class, the width choice depends purely on a preference of backward + * compatibility with either historic CJK or Western practice. + * Choosing single-width for these characters is easy to justify as + * the appropriate long-term solution, as the CJK practice of + * displaying these characters as double-width comes from historic + * implementation simplicity (8-bit encoded characters were displayed + * single-width and 16-bit ones double-width, even for Greek, + * Cyrillic, etc.) and not any typographic considerations. + * + * Much less clear is the choice of width for the Not East Asian + * (Neutral) class. Existing practice does not dictate a width for any + * of these characters. It would nevertheless make sense + * typographically to allocate two character cells to characters such + * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be + * represented adequately with a single-width glyph. The following + * routines at present merely assign a single-cell width to all + * neutral characters, in the interest of simplicity. This is not + * entirely satisfactory and should be reconsidered before + * establishing a formal standard in this area. At the moment, the + * decision which Not East Asian (Neutral) characters should be + * represented by double-width glyphs cannot yet be answered by + * applying a simple rule from the Unicode database content. Setting + * up a proper standard for the behavior of UTF-8 character terminals + * will require a careful analysis not only of each Unicode character, + * but also of each presentation form, something the author of these + * routines has avoided to do so far. + * + * http://www.unicode.org/unicode/reports/tr11/ + * + * Markus Kuhn -- 2007-05-26 (Unicode 5.0) + * + * Permission to use, copy, modify, and distribute this software + * for any purpose and without fee is hereby granted. The author + * disclaims all warranties with regard to this software. + * + * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + */ + +var _ = require('underscore'); + + +// The following two functions define the column width of an ISO 10646 character as follows: +// +// - The null character (U+0000) has a column width of 0. +// - Other C0/C1 control characters and DEL will lead to a return value of -1. +// - Non-spacing and enclosing combining characters (general category code Mn or Me in the +// Unicode database) have a column width of 0. +// - SOFT HYPHEN (U+00AD) has a column width of 1. +// - Other format characters (general category code Cf in the Unicode database) and ZERO WIDTH +// SPACE (U+200B) have a column width of 0. +// - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) have a column width of 0. +// - Spacing characters in the East Asian Wide (W) or East Asian Full-width (F) category as +// defined in Unicode Technical Report #11 have a column width of 2. +// - All remaining characters (including all printable ISO 8859-1 and WGL4 characters, Unicode +// control characters, etc.) have a column width of 1. +// +// This implementation assumes that characters are encoded in ISO 10646. +// +// optional option = { null: width, control: width, monkeypatch: boolean } +module.exports = wcwidth = function (option) { + // sorted list of non-overlapping intervals of non-spacing characters + // generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" + var combining = [ + [ 0x0300, 0x036F ], [ 0x0483, 0x0486 ], [ 0x0488, 0x0489 ], + [ 0x0591, 0x05BD ], [ 0x05BF, 0x05BF ], [ 0x05C1, 0x05C2 ], + [ 0x05C4, 0x05C5 ], [ 0x05C7, 0x05C7 ], [ 0x0600, 0x0603 ], + [ 0x0610, 0x0615 ], [ 0x064B, 0x065E ], [ 0x0670, 0x0670 ], + [ 0x06D6, 0x06E4 ], [ 0x06E7, 0x06E8 ], [ 0x06EA, 0x06ED ], + [ 0x070F, 0x070F ], [ 0x0711, 0x0711 ], [ 0x0730, 0x074A ], + [ 0x07A6, 0x07B0 ], [ 0x07EB, 0x07F3 ], [ 0x0901, 0x0902 ], + [ 0x093C, 0x093C ], [ 0x0941, 0x0948 ], [ 0x094D, 0x094D ], + [ 0x0951, 0x0954 ], [ 0x0962, 0x0963 ], [ 0x0981, 0x0981 ], + [ 0x09BC, 0x09BC ], [ 0x09C1, 0x09C4 ], [ 0x09CD, 0x09CD ], + [ 0x09E2, 0x09E3 ], [ 0x0A01, 0x0A02 ], [ 0x0A3C, 0x0A3C ], + [ 0x0A41, 0x0A42 ], [ 0x0A47, 0x0A48 ], [ 0x0A4B, 0x0A4D ], + [ 0x0A70, 0x0A71 ], [ 0x0A81, 0x0A82 ], [ 0x0ABC, 0x0ABC ], + [ 0x0AC1, 0x0AC5 ], [ 0x0AC7, 0x0AC8 ], [ 0x0ACD, 0x0ACD ], + [ 0x0AE2, 0x0AE3 ], [ 0x0B01, 0x0B01 ], [ 0x0B3C, 0x0B3C ], + [ 0x0B3F, 0x0B3F ], [ 0x0B41, 0x0B43 ], [ 0x0B4D, 0x0B4D ], + [ 0x0B56, 0x0B56 ], [ 0x0B82, 0x0B82 ], [ 0x0BC0, 0x0BC0 ], + [ 0x0BCD, 0x0BCD ], [ 0x0C3E, 0x0C40 ], [ 0x0C46, 0x0C48 ], + [ 0x0C4A, 0x0C4D ], [ 0x0C55, 0x0C56 ], [ 0x0CBC, 0x0CBC ], + [ 0x0CBF, 0x0CBF ], [ 0x0CC6, 0x0CC6 ], [ 0x0CCC, 0x0CCD ], + [ 0x0CE2, 0x0CE3 ], [ 0x0D41, 0x0D43 ], [ 0x0D4D, 0x0D4D ], + [ 0x0DCA, 0x0DCA ], [ 0x0DD2, 0x0DD4 ], [ 0x0DD6, 0x0DD6 ], + [ 0x0E31, 0x0E31 ], [ 0x0E34, 0x0E3A ], [ 0x0E47, 0x0E4E ], + [ 0x0EB1, 0x0EB1 ], [ 0x0EB4, 0x0EB9 ], [ 0x0EBB, 0x0EBC ], + [ 0x0EC8, 0x0ECD ], [ 0x0F18, 0x0F19 ], [ 0x0F35, 0x0F35 ], + [ 0x0F37, 0x0F37 ], [ 0x0F39, 0x0F39 ], [ 0x0F71, 0x0F7E ], + [ 0x0F80, 0x0F84 ], [ 0x0F86, 0x0F87 ], [ 0x0F90, 0x0F97 ], + [ 0x0F99, 0x0FBC ], [ 0x0FC6, 0x0FC6 ], [ 0x102D, 0x1030 ], + [ 0x1032, 0x1032 ], [ 0x1036, 0x1037 ], [ 0x1039, 0x1039 ], + [ 0x1058, 0x1059 ], [ 0x1160, 0x11FF ], [ 0x135F, 0x135F ], + [ 0x1712, 0x1714 ], [ 0x1732, 0x1734 ], [ 0x1752, 0x1753 ], + [ 0x1772, 0x1773 ], [ 0x17B4, 0x17B5 ], [ 0x17B7, 0x17BD ], + [ 0x17C6, 0x17C6 ], [ 0x17C9, 0x17D3 ], [ 0x17DD, 0x17DD ], + [ 0x180B, 0x180D ], [ 0x18A9, 0x18A9 ], [ 0x1920, 0x1922 ], + [ 0x1927, 0x1928 ], [ 0x1932, 0x1932 ], [ 0x1939, 0x193B ], + [ 0x1A17, 0x1A18 ], [ 0x1B00, 0x1B03 ], [ 0x1B34, 0x1B34 ], + [ 0x1B36, 0x1B3A ], [ 0x1B3C, 0x1B3C ], [ 0x1B42, 0x1B42 ], + [ 0x1B6B, 0x1B73 ], [ 0x1DC0, 0x1DCA ], [ 0x1DFE, 0x1DFF ], + [ 0x200B, 0x200F ], [ 0x202A, 0x202E ], [ 0x2060, 0x2063 ], + [ 0x206A, 0x206F ], [ 0x20D0, 0x20EF ], [ 0x302A, 0x302F ], + [ 0x3099, 0x309A ], [ 0xA806, 0xA806 ], [ 0xA80B, 0xA80B ], + [ 0xA825, 0xA826 ], [ 0xFB1E, 0xFB1E ], [ 0xFE00, 0xFE0F ], + [ 0xFE20, 0xFE23 ], [ 0xFEFF, 0xFEFF ], [ 0xFFF9, 0xFFFB ], + [ 0x10A01, 0x10A03 ], [ 0x10A05, 0x10A06 ], [ 0x10A0C, 0x10A0F ], + [ 0x10A38, 0x10A3A ], [ 0x10A3F, 0x10A3F ], [ 0x1D167, 0x1D169 ], + [ 0x1D173, 0x1D182 ], [ 0x1D185, 0x1D18B ], [ 0x1D1AA, 0x1D1AD ], + [ 0x1D242, 0x1D244 ], [ 0xE0001, 0xE0001 ], [ 0xE0020, 0xE007F ], + [ 0xE0100, 0xE01EF ] + ]; + + // auxiliary function for binary search in interval table + var bisearch = function(ucs) { + var min = 0, + max = combining.length-1; + var mid; + + if (ucs < combining[0][0] || ucs > combining[max][1]) + return false; + while (max >= min) { + mid = Math.floor((min + max) / 2); + if (ucs > combining[mid][1]) + min = mid + 1; + else if (ucs < combining[mid][0]) + max = mid - 1; + else + return true; + } + + return false; + } + + // ucs = 'character' or charCode + var wcwidth = function (ucs) { + // test for 8-bit control characters + if (ucs === 0) + return option.nul; + if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) + return option.control; + + // binary search in table of non-spacing characters + if (bisearch(ucs)) + return 0; + + // if we arrive here, ucs is not a combining or C0/C1 control character + return 1 + + (ucs >= 0x1100 && + (ucs <= 0x115f || // Hangul Jamo init. consonants + ucs == 0x2329 || ucs == 0x232a || + (ucs >= 0x2e80 && ucs <= 0xa4cf && + ucs != 0x303f) || // CJK ... Yi + (ucs >= 0xac00 && ucs <= 0xd7a3) || // Hangul Syllables + (ucs >= 0xf900 && ucs <= 0xfaff) || // CJK Compatibility Ideographs + (ucs >= 0xfe10 && ucs <= 0xfe19) || // Vertical forms + (ucs >= 0xfe30 && ucs <= 0xfe6f) || // CJK Compatibility Forms + (ucs >= 0xff00 && ucs <= 0xff60) || // Fullwidth Forms + (ucs >= 0xffe0 && ucs <= 0xffe6) || + (ucs >= 0x20000 && ucs <= 0x2fffd) || + (ucs >= 0x30000 && ucs <= 0x3fffd))); + }; + + var wcswidth = function (str) { + var i, l, n, s = 0; + + if (_.isString(str)) + for (i=0, l=str.length; i < l; i++) { + if ((n = wcwidth(str.charCodeAt(i))) < 0) + return -1; + s += n; + } + else + s = wcwidth(str); + + return s; + }; + + option = _.extend({ + nul: 0, + control: -1, + monkeypatch: true + }, option); + + if (option.monkeypatch) + String.prototype.__defineGetter__('wcwidth', function () { + return wcswidth(this); + }); + + return wcswidth; +}; + + +/* +(function () { + var ww = wcwidth(); + var test = [ + '다섯글자임', + 'four', + 'ten chars', + ' \n\t', + '\0' + ]; + + for (var i = 0; i < test.length; i++) + console.log(test[i], test[i].length, ww(test[i]), test[i].wcwidth); + console.log(ww('한글')); + console.log(ww('한'.charCodeAt(0))); +}()); +*/ + + +/* +(function () { + var ww = wcwidth({ + nul: 1, + control: 1, + monkeypatch: false + }); + var test = [ + '다섯글자임', + 'four', + 'ten chars', + ' \n\t', + '\0' + ]; + + for (var i = 0; i < test.length; i++) + console.log(test[i], test[i].length, ww(test[i]), test[i].wcwidth); + console.log(ww('한글')); + console.log(ww('한'.charCodeAt(0))); +}()); +*/ + +// end of wcwidth.js diff --git a/deps/npm/node_modules/columnify/package.json b/deps/npm/node_modules/columnify/package.json index 5ad3d4a7208..ba3124f147d 100644 --- a/deps/npm/node_modules/columnify/package.json +++ b/deps/npm/node_modules/columnify/package.json @@ -1,18 +1,19 @@ { "name": "columnify", - "version": "0.1.2", + "version": "1.1.0", "description": "Render data in text columns, supports in-column text-wrap.", "main": "index.js", "scripts": { - "test": "tap test" + "test": "faucet" }, "author": { "name": "Tim Oxley" }, "license": "MIT", "devDependencies": { - "tape": "~2.3.0", - "tap": "~0.4.6" + "chalk": "^0.4.0", + "faucet": "0.0.1", + "tape": "~2.12.3" }, "repository": { "type": "git", @@ -31,13 +32,17 @@ "url": "https://github.com/timoxley/columnify/issues" }, "homepage": "https://github.com/timoxley/columnify", - "_id": "columnify@0.1.2", - "dist": { - "shasum": "ab1a1f1e37b26ba4b87c6920fb717fe51c827042", - "tarball": "http://registry.npmjs.org/columnify/-/columnify-0.1.2.tgz" + "dependencies": { + "strip-ansi": "^0.2.1", + "wcwidth.js": "~0.0.4" + }, + "directories": { + "test": "test" }, - "_from": "columnify@0.1.2", - "_npmVersion": "1.3.23", + "_id": "columnify@1.1.0", + "_shasum": "0b908e6d4f1c80194358a1933aaf9dc49271c679", + "_from": "columnify@latest", + "_npmVersion": "1.4.10", "_npmUser": { "name": "timoxley", "email": "secoif@gmail.com" @@ -48,7 +53,10 @@ "email": "secoif@gmail.com" } ], - "directories": {}, - "_shasum": "ab1a1f1e37b26ba4b87c6920fb717fe51c827042", - "_resolved": "https://registry.npmjs.org/columnify/-/columnify-0.1.2.tgz" + "dist": { + "shasum": "0b908e6d4f1c80194358a1933aaf9dc49271c679", + "tarball": "http://registry.npmjs.org/columnify/-/columnify-1.1.0.tgz" + }, + "_resolved": "https://registry.npmjs.org/columnify/-/columnify-1.1.0.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/columnify/utils.js b/deps/npm/node_modules/columnify/utils.js index bd7641da427..12c4f003c59 100644 --- a/deps/npm/node_modules/columnify/utils.js +++ b/deps/npm/node_modules/columnify/utils.js @@ -1,3 +1,7 @@ +"use strict" + +var wcwidth = require('./width') + /** * Pad `str` up to total length `max` with `chr`. * If `str` is longer than `max`, padRight will return `str` unaltered. @@ -11,15 +15,33 @@ function padRight(str, max, chr) { str = str != null ? str : '' str = String(str) - var length = 1 + max - str.length + var length = 1 + max - wcwidth(str) if (length <= 0) return str return str + Array.apply(null, {length: length}) .join(chr || ' ') } +/** + * Pad `str` up to total length `max` with `chr`, on the left. + * If `str` is longer than `max`, padRight will return `str` unaltered. + * + * @param String str string to pad + * @param Number max total length of output string + * @param String chr optional. Character to pad with. default: ' ' + * @return String padded str + */ + +function padLeft(str, max, chr) { + str = str != null ? str : '' + str = String(str) + var length = 1 + max - wcwidth(str) + if (length <= 0) return str + return Array.apply(null, {length: length}).join(chr || ' ') + str +} + /** * Split a String `str` into lines of maxiumum length `max`. - * Splits on word boundaries. + * Splits on word boundaries. Preserves existing new lines. * * @param String str string to split * @param Number max length of each line @@ -27,16 +49,23 @@ function padRight(str, max, chr) { */ function splitIntoLines(str, max) { - return str.trim().split(' ').reduce(function(lines, word) { - var line = lines[lines.length - 1] - if (line && line.join(' ').length + word.length < max) { - lines[lines.length - 1].push(word) // add to line - } - else lines.push([word]) // new line - return lines - }, []).map(function(l) { - return l.join(' ') - }) + function _splitIntoLines(str, max) { + return str.trim().split(' ').reduce(function(lines, word) { + var line = lines[lines.length - 1] + if (line && wcwidth(line.join(' ')) + wcwidth(word) < max) { + lines[lines.length - 1].push(word) // add to line + } + else lines.push([word]) // new line + return lines + }, []).map(function(l) { + return l.join(' ') + }) + } + return str.split('\n').map(function(str) { + return _splitIntoLines(str, max) + }).reduce(function(lines, line) { + return lines.concat(line) + }, []) } /** @@ -55,22 +84,67 @@ function splitLongWords(str, max, truncationChar, result) { if (!str) return result.join(' ') || '' 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 + } - if (word.length > max) { - var remainder = word.slice(max - truncationChar.length) // get remainder + var remainder = word.slice(i) // get remainder words.unshift(remainder) // save remainder for next loop - word = word.slice(0, max - truncationChar.length) // grab truncated word + word = word.slice(0, i) // grab truncated word word += truncationChar // add trailing … or whatever } result.push(word) return splitLongWords(words.join(' '), max, truncationChar, result) } + +/** + * Truncate `str` into total width `max` + * If `str` is shorter than `max`, will return `str` unaltered. + * + * @param String str string to truncated + * @param Number max total wcwidth of output string + * @return String truncated str + */ + +function truncateString(str, max) { + + str = str != null ? str : '' + str = String(str) + + if(max == Infinity) return str + + var i = 0 + var wwidth = 0 + while (i < str.length) { + var w = wcwidth(str.charAt(i)) + if(w + wwidth > max) + break + wwidth += w + ++i + } + return str.slice(0, i) +} + + + /** * Exports */ module.exports.padRight = padRight +module.exports.padLeft = padLeft module.exports.splitIntoLines = splitIntoLines module.exports.splitLongWords = splitLongWords +module.exports.truncateString = truncateString + diff --git a/deps/npm/node_modules/columnify/width.js b/deps/npm/node_modules/columnify/width.js new file mode 100644 index 00000000000..8498f408385 --- /dev/null +++ b/deps/npm/node_modules/columnify/width.js @@ -0,0 +1,6 @@ +var stripAnsi = require('strip-ansi') +var wcwidth = require('wcwidth.js')({ monkeypatch: false, control: 0 }) + +module.exports = function(str) { + return wcwidth(stripAnsi(str)) +} diff --git a/deps/npm/node_modules/editor/LICENSE b/deps/npm/node_modules/editor/LICENSE index ee27ba4b441..8b856bc4a47 100644 --- a/deps/npm/node_modules/editor/LICENSE +++ b/deps/npm/node_modules/editor/LICENSE @@ -1,18 +1,21 @@ -This software is released under the MIT license: +Copyright 2013 James Halliday (mail@substack.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: +This project is free software released under the MIT license: -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. +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. +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/editor/index.js b/deps/npm/node_modules/editor/index.js index 8f1a3ebefbd..3774edbe37b 100644 --- a/deps/npm/node_modules/editor/index.js +++ b/deps/npm/node_modules/editor/index.js @@ -9,18 +9,12 @@ module.exports = function (file, opts, cb) { var ed = /^win/.test(process.platform) ? 'notepad' : 'vim'; var editor = opts.editor || process.env.VISUAL || process.env.EDITOR || ed; + var args = editor.split(/\s+/); + var bin = args.shift(); - setRaw(true); - var ps = spawn(editor, [ file ], { customFds : [ 0, 1, 2 ] }); + var ps = spawn(bin, args.concat([ file ]), { stdio: 'inherit' }); ps.on('exit', function (code, sig) { - setRaw(false); - process.stdin.pause(); if (typeof cb === 'function') cb(code, sig) }); }; - -var tty = require('tty'); -function setRaw (mode) { - process.stdin.setRawMode ? process.stdin.setRawMode(mode) : tty.setRawMode(mode); -} diff --git a/deps/npm/node_modules/editor/package.json b/deps/npm/node_modules/editor/package.json index 36e5f7efaea..963b5d29bc3 100644 --- a/deps/npm/node_modules/editor/package.json +++ b/deps/npm/node_modules/editor/package.json @@ -1,6 +1,6 @@ { "name": "editor", - "version": "0.0.5", + "version": "0.1.0", "description": "launch $EDITOR in your program", "main": "index.js", "directories": { @@ -33,11 +33,26 @@ "engine": { "node": ">=0.6" }, - "readme": "editor\n======\n\nLaunch $EDITOR in your program.\n\nexample\n=======\n\n``` js\nvar editor = require('editor');\neditor('beep.json', function (code, sig) {\n console.log('finished editing with code ' + code);\n});\n```\n\n***\n\n```\n$ node edit.js\n```\n\n![editor](http://substack.net/images/screenshots/editor.png)\n\n```\nfinished editing with code 0\n```\n\nmethods\n=======\n\n``` js\nvar editor = require('editor')\n```\n\neditor(file, opts={}, cb)\n-------------------------\n\nLaunch the `$EDITOR` (or `opts.editor`) for `file`.\n\nWhen the editor exits, `cb(code, sig)` fires.\n\ninstall\n=======\n\nWith [npm](http://npmjs.org) do:\n\n```\nnpm install editor\n```\n\nlicense\n=======\n\nMIT\n", - "readmeFilename": "README.markdown", "bugs": { "url": "https://github.com/substack/node-editor/issues" }, - "_id": "editor@0.0.5", - "_from": "editor@latest" + "_id": "editor@0.1.0", + "dist": { + "shasum": "542f4662c6a8c88e862fc11945e204e51981b9a1", + "tarball": "http://registry.npmjs.org/editor/-/editor-0.1.0.tgz" + }, + "_from": "editor@latest", + "_npmVersion": "1.3.21", + "_npmUser": { + "name": "substack", + "email": "mail@substack.net" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + } + ], + "_shasum": "542f4662c6a8c88e862fc11945e204e51981b9a1", + "_resolved": "https://registry.npmjs.org/editor/-/editor-0.1.0.tgz" } diff --git a/deps/npm/node_modules/fstream/lib/reader.js b/deps/npm/node_modules/fstream/lib/reader.js index eaf921cd096..0edb794d38f 100644 --- a/deps/npm/node_modules/fstream/lib/reader.js +++ b/deps/npm/node_modules/fstream/lib/reader.js @@ -210,13 +210,15 @@ Reader.prototype._stat = function (currentStat) { return } - if (me._paused) { + if (me._paused && me.type !== "Directory") { me.once("resume", go) return } var ev = events[e ++] - if (!ev) return me._read() + if (!ev) { + return me._read() + } me.emit(ev, props) go() })() diff --git a/deps/npm/node_modules/fstream/package.json b/deps/npm/node_modules/fstream/package.json index cf86878db4f..fcdda9c65b0 100644 --- a/deps/npm/node_modules/fstream/package.json +++ b/deps/npm/node_modules/fstream/package.json @@ -6,7 +6,7 @@ }, "name": "fstream", "description": "Advanced file system stream things", - "version": "0.1.25", + "version": "0.1.28", "repository": { "type": "git", "url": "git://github.com/isaacs/fstream.git" @@ -16,10 +16,10 @@ "node": ">=0.6" }, "dependencies": { - "rimraf": "2", + "graceful-fs": "~3.0.2", + "inherits": "~2.0.0", "mkdirp": "0.3", - "graceful-fs": "~2.0.0", - "inherits": "~2.0.0" + "rimraf": "2" }, "devDependencies": { "tap": "" @@ -30,14 +30,12 @@ "license": "BSD", "readme": "Like FS streams, but with stat on them, and supporting directories and\nsymbolic links, as well as normal files. Also, you can use this to set\nthe stats on a file, even if you don't change its contents, or to create\na symlink, etc.\n\nSo, for example, you can \"write\" a directory, and it'll call `mkdir`. You\ncan specify a uid and gid, and it'll call `chown`. You can specify a\n`mtime` and `atime`, and it'll call `utimes`. You can call it a symlink\nand provide a `linkpath` and it'll call `symlink`.\n\nNote that it won't automatically resolve symbolic links. So, if you\ncall `fstream.Reader('/some/symlink')` then you'll get an object\nthat stats and then ends immediately (since it has no data). To follow\nsymbolic links, do this: `fstream.Reader({path:'/some/symlink', follow:\ntrue })`.\n\nThere are various checks to make sure that the bytes emitted are the\nsame as the intended size, if the size is set.\n\n## Examples\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n })\n .write(\"hello\\n\")\n .end()\n```\n\nThis will create the directories if they're missing, and then write\n`hello\\n` into the file, chmod it to 0755, and assert that 6 bytes have\nbeen written when it's done.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/file\"\n , mode: 0755\n , size: 6\n , flags: \"a\"\n })\n .write(\"hello\\n\")\n .end()\n```\n\nYou can pass flags in, if you want to append to a file.\n\n```javascript\nfstream\n .Writer({ path: \"path/to/symlink\"\n , linkpath: \"./file\"\n , SymbolicLink: true\n , mode: \"0755\" // octal strings supported\n })\n .end()\n```\n\nIf isSymbolicLink is a function, it'll be called, and if it returns\ntrue, then it'll treat it as a symlink. If it's not a function, then\nany truish value will make a symlink, or you can set `type:\n'SymbolicLink'`, which does the same thing.\n\nNote that the linkpath is relative to the symbolic link location, not\nthe parent dir or cwd.\n\n```javascript\nfstream\n .Reader(\"path/to/dir\")\n .pipe(fstream.Writer(\"path/to/other/dir\"))\n```\n\nThis will do like `cp -Rp path/to/dir path/to/other/dir`. If the other\ndir exists and isn't a directory, then it'll emit an error. It'll also\nset the uid, gid, mode, etc. to be identical. In this way, it's more\nlike `rsync -a` than simply a copy.\n", "readmeFilename": "README.md", + "gitHead": "f757159eb6a5198a9ebc6cde1c4c1b9ae8e0d7b2", "bugs": { "url": "https://github.com/isaacs/fstream/issues" }, "homepage": "https://github.com/isaacs/fstream", - "_id": "fstream@0.1.25", - "dist": { - "shasum": "deef2db7c7898357c2b37202212a9e5b36abc732" - }, - "_from": "fstream@0.1.25", - "_resolved": "https://registry.npmjs.org/fstream/-/fstream-0.1.25.tgz" + "_id": "fstream@0.1.28", + "_shasum": "2b9286f3a646e30075efd0354729361c4b762a29", + "_from": "fstream@~0.1.27" } diff --git a/deps/npm/node_modules/github-url-from-username-repo/index.js b/deps/npm/node_modules/github-url-from-username-repo/index.js index 46b0bb51399..60ed7aa4e4e 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/index.js +++ b/deps/npm/node_modules/github-url-from-username-repo/index.js @@ -3,7 +3,7 @@ module.exports = getUrl function getUrl (r) { if (!r) return null if (/^[\w-]+\/[\w\.-]+$/.test(r)) - return "git://github.com/" + r + return "https://github.com/" + r else return null } diff --git a/deps/npm/node_modules/github-url-from-username-repo/package.json b/deps/npm/node_modules/github-url-from-username-repo/package.json index 7eadf899d3e..56dd698df2c 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/package.json +++ b/deps/npm/node_modules/github-url-from-username-repo/package.json @@ -1,6 +1,6 @@ { "name": "github-url-from-username-repo", - "version": "0.1.0", + "version": "0.2.0", "description": "Create urls from username/repo", "main": "index.js", "scripts": { @@ -27,13 +27,10 @@ "repo" ], "homepage": "https://github.com/robertkowalski/github-url-from-username-repo", - "_id": "github-url-from-username-repo@0.1.0", - "dist": { - "shasum": "fe398af670692e91af7bcfc5ae1d99ff97b1df89", - "tarball": "http://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-0.1.0.tgz" - }, - "_from": "github-url-from-username-repo@~0.1.0", - "_npmVersion": "1.4.6", + "_id": "github-url-from-username-repo@0.2.0", + "_shasum": "7590b4fa605b7a6cbb7e06ffcd9d253210f9dbe1", + "_from": "github-url-from-username-repo@latest", + "_npmVersion": "1.4.9", "_npmUser": { "name": "robertkowalski", "email": "rok@kowalski.gd" @@ -44,8 +41,10 @@ "email": "rok@kowalski.gd" } ], + "dist": { + "shasum": "7590b4fa605b7a6cbb7e06ffcd9d253210f9dbe1", + "tarball": "http://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-0.2.0.tgz" + }, "directories": {}, - "_shasum": "fe398af670692e91af7bcfc5ae1d99ff97b1df89", - "_resolved": "https://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-0.1.0.tgz", - "readme": "ERROR: No README data found!" + "_resolved": "https://registry.npmjs.org/github-url-from-username-repo/-/github-url-from-username-repo-0.2.0.tgz" } diff --git a/deps/npm/node_modules/github-url-from-username-repo/test/index.js b/deps/npm/node_modules/github-url-from-username-repo/test/index.js index e8e7b47600c..14c7dd16c28 100644 --- a/deps/npm/node_modules/github-url-from-username-repo/test/index.js +++ b/deps/npm/node_modules/github-url-from-username-repo/test/index.js @@ -4,7 +4,7 @@ var getUrl = require("../") describe("github url from username/repo", function () { it("returns a github url for the username/repo", function () { var url = getUrl("visionmedia/express") - assert.equal("git://github.com/visionmedia/express", url) + assert.equal("https://github.com/visionmedia/express", url) }) it("returns null if it does not match", function () { @@ -19,16 +19,16 @@ describe("github url from username/repo", function () { it("works with .", function () { var url = getUrl("component/downloader.js") - assert.equal("git://github.com/component/downloader.js", url) + assert.equal("https://github.com/component/downloader.js", url) }) it("works with . in the beginning", function () { var url = getUrl("component/.downloader.js") - assert.equal("git://github.com/component/.downloader.js", url) + assert.equal("https://github.com/component/.downloader.js", url) }) it("works with -", function () { var url = getUrl("component/-dow-nloader.j-s") - assert.equal("git://github.com/component/-dow-nloader.j-s", url) + assert.equal("https://github.com/component/-dow-nloader.j-s", url) }) }) diff --git a/deps/npm/node_modules/glob/.travis.yml b/deps/npm/node_modules/glob/.travis.yml index baa0031d500..fca8ef01940 100644 --- a/deps/npm/node_modules/glob/.travis.yml +++ b/deps/npm/node_modules/glob/.travis.yml @@ -1,3 +1,4 @@ language: node_js node_js: - - 0.8 + - 0.10 + - 0.11 diff --git a/deps/npm/node_modules/glob/glob.js b/deps/npm/node_modules/glob/glob.js index f646c44838f..36bbba84cf6 100644 --- a/deps/npm/node_modules/glob/glob.js +++ b/deps/npm/node_modules/glob/glob.js @@ -36,14 +36,17 @@ module.exports = glob -var fs = require("fs") -, minimatch = require("minimatch") +var fs +try { fs = require("graceful-fs") } catch (e) { fs = require("fs") } + +var minimatch = require("minimatch") , Minimatch = minimatch.Minimatch , inherits = require("inherits") , EE = require("events").EventEmitter , path = require("path") , isDir = {} , assert = require("assert").ok +, once = require("once") function glob (pattern, options, cb) { if (typeof options === "function") cb = options, options = {} @@ -91,6 +94,7 @@ function Glob (pattern, options, cb) { } if (typeof cb === "function") { + cb = once(cb) this.on("error", cb) this.on("end", function (matches) { cb(null, matches) @@ -149,6 +153,10 @@ function Glob (pattern, options, cb) { this.stat = !!options.stat this.debug = !!options.debug || !!options.globDebug + + if (/\bglob\b/.test(process.env.NODE_DEBUG || '')) + this.debug = true + if (this.debug) this.log = console.error @@ -176,6 +184,10 @@ function Glob (pattern, options, cb) { // Keep them as a list so we can fill in when nonull is set. this.matches = new Array(n) + if (this.minimatch.set.length === 0) { + return process.nextTick(this._finish.bind(this)) + } + this.minimatch.set.forEach(iterator.bind(this)) function iterator (pattern, i, set) { this._process(pattern, 0, i, function (er) { @@ -429,9 +441,9 @@ Glob.prototype._process = function (pattern, depth, index, cb_) { if (prefix === null) read = "." else if (isAbsolute(prefix) || isAbsolute(pattern.join("/"))) { if (!prefix || !isAbsolute(prefix)) { - prefix = path.join("/", prefix) + prefix = "/" + prefix } - read = prefix = path.resolve(prefix) + read = prefix // if (process.platform === "win32") // read = prefix = prefix.replace(/^[a-zA-Z]:|\\/g, "/") diff --git a/deps/npm/node_modules/glob/package.json b/deps/npm/node_modules/glob/package.json index 795af8cbe38..f479f06eb15 100644 --- a/deps/npm/node_modules/glob/package.json +++ b/deps/npm/node_modules/glob/package.json @@ -6,7 +6,7 @@ }, "name": "glob", "description": "a little globber", - "version": "3.2.10", + "version": "4.0.3", "repository": { "type": "git", "url": "git://github.com/isaacs/node-glob.git" @@ -15,9 +15,14 @@ "engines": { "node": "*" }, + "optionalDependencies": { + "graceful-fs": "^3.0.2" + }, "dependencies": { "inherits": "2", - "minimatch": "^0.3.0" + "minimatch": "^0.3.0", + "once": "^1.3.0", + "graceful-fs": "^3.0.2" }, "devDependencies": { "tap": "~0.4.0", @@ -31,12 +36,12 @@ "license": "BSD", "readme": "# Glob\n\nMatch files using the patterns the shell uses, like stars and stuff.\n\nThis is a glob implementation in JavaScript. It uses the `minimatch`\nlibrary to do its matching.\n\n## Attention: node-glob users!\n\nThe API has changed dramatically between 2.x and 3.x. This library is\nnow 100% JavaScript, and the integer flags have been replaced with an\noptions object.\n\nAlso, there's an event emitter class, proper tests, and all the other\nthings you've come to expect from node modules.\n\nAnd best of all, no compilation!\n\n## Usage\n\n```javascript\nvar glob = require(\"glob\")\n\n// options is optional\nglob(\"**/*.js\", options, function (er, files) {\n // files is an array of filenames.\n // If the `nonull` option is set, and nothing\n // was found, then files is [\"**/*.js\"]\n // er is an error object or null.\n})\n```\n\n## Features\n\nPlease see the [minimatch\ndocumentation](https://github.com/isaacs/minimatch) for more details.\n\nSupports these glob features:\n\n* Brace Expansion\n* Extended glob matching\n* \"Globstar\" `**` matching\n\nSee:\n\n* `man sh`\n* `man bash`\n* `man 3 fnmatch`\n* `man 5 gitignore`\n* [minimatch documentation](https://github.com/isaacs/minimatch)\n\n## glob(pattern, [options], cb)\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* `cb` {Function}\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nPerform an asynchronous glob search.\n\n## glob.sync(pattern, [options])\n\n* `pattern` {String} Pattern to be matched\n* `options` {Object}\n* return: {Array} filenames found matching the pattern\n\nPerform a synchronous glob search.\n\n## Class: glob.Glob\n\nCreate a Glob object by instanting the `glob.Glob` class.\n\n```javascript\nvar Glob = require(\"glob\").Glob\nvar mg = new Glob(pattern, options, cb)\n```\n\nIt's an EventEmitter, and starts walking the filesystem to find matches\nimmediately.\n\n### new glob.Glob(pattern, [options], [cb])\n\n* `pattern` {String} pattern to search for\n* `options` {Object}\n* `cb` {Function} Called when an error occurs, or matches are found\n * `err` {Error | null}\n * `matches` {Array} filenames found matching the pattern\n\nNote that if the `sync` flag is set in the options, then matches will\nbe immediately available on the `g.found` member.\n\n### Properties\n\n* `minimatch` The minimatch object that the glob uses.\n* `options` The options object passed in.\n* `error` The error encountered. When an error is encountered, the\n glob object is in an undefined state, and should be discarded.\n* `aborted` Boolean which is set to true when calling `abort()`. There\n is no way at this time to continue a glob search after aborting, but\n you can re-use the statCache to avoid having to duplicate syscalls.\n* `statCache` Collection of all the stat results the glob search\n performed.\n* `cache` Convenience object. Each field has the following possible\n values:\n * `false` - Path does not exist\n * `true` - Path exists\n * `1` - Path exists, and is not a directory\n * `2` - Path exists, and is a directory\n * `[file, entries, ...]` - Path exists, is a directory, and the\n array value is the results of `fs.readdir`\n\n### Events\n\n* `end` When the matching is finished, this is emitted with all the\n matches found. If the `nonull` option is set, and no match was found,\n then the `matches` list contains the original pattern. The matches\n are sorted, unless the `nosort` flag is set.\n* `match` Every time a match is found, this is emitted with the matched.\n* `error` Emitted when an unexpected error is encountered, or whenever\n any fs error occurs if `options.strict` is set.\n* `abort` When `abort()` is called, this event is raised.\n\n### Methods\n\n* `abort` Stop the search.\n\n### Options\n\nAll the options that can be passed to Minimatch can also be passed to\nGlob to change pattern matching behavior. Also, some have been added,\nor have glob-specific ramifications.\n\nAll options are false by default, unless otherwise noted.\n\nAll options are added to the glob object, as well.\n\n* `cwd` The current working directory in which to search. Defaults\n to `process.cwd()`.\n* `root` The place where patterns starting with `/` will be mounted\n onto. Defaults to `path.resolve(options.cwd, \"/\")` (`/` on Unix\n systems, and `C:\\` or some such on Windows.)\n* `dot` Include `.dot` files in normal matches and `globstar` matches.\n Note that an explicit dot in a portion of the pattern will always\n match dot files.\n* `nomount` By default, a pattern starting with a forward-slash will be\n \"mounted\" onto the root setting, so that a valid filesystem path is\n returned. Set this flag to disable that behavior.\n* `mark` Add a `/` character to directory matches. Note that this\n requires additional stat calls.\n* `nosort` Don't sort the results.\n* `stat` Set to true to stat *all* results. This reduces performance\n somewhat, and is completely unnecessary, unless `readdir` is presumed\n to be an untrustworthy indicator of file existence. It will cause\n ELOOP to be triggered one level sooner in the case of cyclical\n symbolic links.\n* `silent` When an unusual error is encountered\n when attempting to read a directory, a warning will be printed to\n stderr. Set the `silent` option to true to suppress these warnings.\n* `strict` When an unusual error is encountered\n when attempting to read a directory, the process will just continue on\n in search of other matches. Set the `strict` option to raise an error\n in these cases.\n* `cache` See `cache` property above. Pass in a previously generated\n cache object to save some fs calls.\n* `statCache` A cache of results of filesystem information, to prevent\n unnecessary stat calls. While it should not normally be necessary to\n set this, you may pass the statCache from one glob() call to the\n options object of another, if you know that the filesystem will not\n change between calls. (See \"Race Conditions\" below.)\n* `sync` Perform a synchronous glob search.\n* `nounique` In some cases, brace-expanded patterns can result in the\n same file showing up multiple times in the result set. By default,\n this implementation prevents duplicates in the result set.\n Set this flag to disable that behavior.\n* `nonull` Set to never return an empty set, instead returning a set\n containing the pattern itself. This is the default in glob(3).\n* `nocase` Perform a case-insensitive match. Note that case-insensitive\n filesystems will sometimes result in glob returning results that are\n case-insensitively matched anyway, since readdir and stat will not\n raise an error.\n* `debug` Set to enable debug logging in minimatch and glob.\n* `globDebug` Set to enable debug logging in glob, but not minimatch.\n\n## Comparisons to other fnmatch/glob implementations\n\nWhile strict compliance with the existing standards is a worthwhile\ngoal, some discrepancies exist between node-glob and other\nimplementations, and are intentional.\n\nIf the pattern starts with a `!` character, then it is negated. Set the\n`nonegate` flag to suppress this behavior, and treat leading `!`\ncharacters normally. This is perhaps relevant if you wish to start the\npattern with a negative extglob pattern like `!(a|B)`. Multiple `!`\ncharacters at the start of a pattern will negate the pattern multiple\ntimes.\n\nIf a pattern starts with `#`, then it is treated as a comment, and\nwill not match anything. Use `\\#` to match a literal `#` at the\nstart of a line, or set the `nocomment` flag to suppress this behavior.\n\nThe double-star character `**` is supported by default, unless the\n`noglobstar` flag is set. This is supported in the manner of bsdglob\nand bash 4.1, where `**` only has special significance if it is the only\nthing in a path part. That is, `a/**/b` will match `a/x/y/b`, but\n`a/**b` will not.\n\nIf an escaped pattern has no matches, and the `nonull` flag is set,\nthen glob returns the pattern as-provided, rather than\ninterpreting the character escapes. For example,\n`glob.match([], \"\\\\*a\\\\?\")` will return `\"\\\\*a\\\\?\"` rather than\n`\"*a?\"`. This is akin to setting the `nullglob` option in bash, except\nthat it does not resolve escaped pattern characters.\n\nIf brace expansion is not disabled, then it is performed before any\nother interpretation of the glob pattern. Thus, a pattern like\n`+(a|{b),c)}`, which would not be valid in bash or zsh, is expanded\n**first** into the set of `+(a|b)` and `+(a|c)`, and those patterns are\nchecked for validity. Since those two are valid, matching proceeds.\n\n## Windows\n\n**Please only use forward-slashes in glob expressions.**\n\nThough windows uses either `/` or `\\` as its path separator, only `/`\ncharacters are used by this glob implementation. You must use\nforward-slashes **only** in glob expressions. Back-slashes will always\nbe interpreted as escape characters, not path separators.\n\nResults from absolute patterns such as `/foo/*` are mounted onto the\nroot setting using `path.join`. On windows, this will by default result\nin `/foo/*` matching `C:\\foo\\bar.txt`.\n\n## Race Conditions\n\nGlob searching, by its very nature, is susceptible to race conditions,\nsince it relies on directory walking and such.\n\nAs a result, it is possible that a file that exists when glob looks for\nit may have been deleted or modified by the time it returns the result.\n\nAs part of its internal implementation, this program caches all stat\nand readdir calls that it makes, in order to cut down on system\noverhead. However, this also makes it even more susceptible to races,\nespecially if the cache or statCache objects are reused between glob\ncalls.\n\nUsers are thus advised not to use a glob result as a guarantee of\nfilesystem state in the face of rapid changes. For the vast majority\nof operations, this is never a problem.\n", "readmeFilename": "README.md", - "gitHead": "4e00805b5529af626bf0512d6810c27a96ca2a12", + "gitHead": "3e6881cb2c584f540c814476629b5bbdfccf36f2", "bugs": { "url": "https://github.com/isaacs/node-glob/issues" }, "homepage": "https://github.com/isaacs/node-glob", - "_id": "glob@3.2.10", - "_shasum": "e229a4d843fdabca3dd8cdc96c456e29c6e79f13", + "_id": "glob@4.0.3", + "_shasum": "cb30c860359801cb7d56436976888fc4a09a35db", "_from": "glob@latest" } diff --git a/deps/npm/node_modules/glob/test/bash-results.json b/deps/npm/node_modules/glob/test/bash-results.json index 8051c7238d1..9b5796d6c52 100644 --- a/deps/npm/node_modules/glob/test/bash-results.json +++ b/deps/npm/node_modules/glob/test/bash-results.json @@ -283,9 +283,11 @@ "{./*/*,/tmp/glob-test/*}": [ "./examples/g.js", "./examples/usr-local.js", + "./node_modules/graceful-fs", "./node_modules/inherits", "./node_modules/minimatch", "./node_modules/mkdirp", + "./node_modules/once", "./node_modules/rimraf", "./node_modules/tap", "./test/00-setup.js", @@ -293,6 +295,8 @@ "./test/bash-comparison.js", "./test/bash-results.json", "./test/cwd-test.js", + "./test/empty-set.js", + "./test/error-callback.js", "./test/globstar-match.js", "./test/mark.js", "./test/new-glob-optional-options.js", diff --git a/deps/npm/node_modules/glob/test/empty-set.js b/deps/npm/node_modules/glob/test/empty-set.js new file mode 100644 index 00000000000..3b627b0ab8a --- /dev/null +++ b/deps/npm/node_modules/glob/test/empty-set.js @@ -0,0 +1,20 @@ +var test = require('tap').test +var glob = require("../glob.js") + +// Patterns that cannot match anything +var patterns = [ + '# comment', + ' ', + '\n', + 'just doesnt happen to match anything so this is a control' +] + +patterns.forEach(function (p) { + test(JSON.stringify(p), function (t) { + glob(p, function (e, f) { + t.equal(e, null, 'no error') + t.same(f, [], 'no returned values') + t.end() + }) + }) +}) diff --git a/deps/npm/node_modules/glob/test/error-callback.js b/deps/npm/node_modules/glob/test/error-callback.js new file mode 100644 index 00000000000..629eb28434e --- /dev/null +++ b/deps/npm/node_modules/glob/test/error-callback.js @@ -0,0 +1,22 @@ +var fs +try { fs = require('graceful-fs') } catch (e) { fs = require('fs') } +var fs = require('graceful-fs') +var test = require('tap').test +var glob = require('../') + +test('mock fs', function(t) { + fs.readdir = function(path, cb) { + process.nextTick(function() { + cb(new Error('mock fs.readdir error')) + }) + } + t.pass('mocked') + t.end() +}) + +test('error callback', function(t) { + glob('*', function(err, res) { + t.ok(err, 'expecting mock error') + t.end() + }) +}) diff --git a/deps/npm/node_modules/glob/test/nocase-nomagic.js b/deps/npm/node_modules/glob/test/nocase-nomagic.js index 2503f23101c..5a29b08591f 100644 --- a/deps/npm/node_modules/glob/test/nocase-nomagic.js +++ b/deps/npm/node_modules/glob/test/nocase-nomagic.js @@ -1,4 +1,5 @@ -var fs = require('fs'); +var fs +try { fs = require('graceful-fs') } catch (e) { fs = require('fs') } var test = require('tap').test; var glob = require('../'); @@ -11,10 +12,10 @@ test('mock fs', function(t) { function fakeStat(path) { var ret switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': + case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\': ret = { isDirectory: function() { return true } } break - case '/tmp/a': + case '/tmp/a': case 'c:\\tmp\\a': ret = { isDirectory: function() { return false } } break } @@ -39,10 +40,10 @@ test('mock fs', function(t) { function fakeReaddir(path) { var ret switch (path.toLowerCase()) { - case '/tmp': case '/tmp/': + case '/tmp': case '/tmp/': case 'c:\\tmp': case 'c:\\tmp\\': ret = [ 'a', 'A' ] break - case '/': + case '/': case 'c:\\': ret = ['tmp', 'tMp', 'tMP', 'TMP'] } return ret @@ -76,6 +77,11 @@ test('nocase, nomagic', function(t) { '/tMp/a', '/tmp/A', '/tmp/a' ] + if(process.platform.match(/^win/)) { + want = want.map(function(p) { + return 'C:' + p + }) + } glob('/tmp/a', { nocase: true }, function(er, res) { if (er) throw er @@ -100,6 +106,12 @@ test('nocase, with some magic', function(t) { '/tMp/a', '/tmp/A', '/tmp/a' ] + if(process.platform.match(/^win/)) { + want = want.map(function(p) { + return 'C:' + p + }) + } + glob('/tmp/*', { nocase: true }, function(er, res) { if (er) throw er diff --git a/deps/npm/node_modules/glob/test/stat.js b/deps/npm/node_modules/glob/test/stat.js index 62917114b44..f555b39b167 100644 --- a/deps/npm/node_modules/glob/test/stat.js +++ b/deps/npm/node_modules/glob/test/stat.js @@ -20,7 +20,7 @@ test('stat all the things', function(t) { t.same(eof, matches) var cache = Object.keys(this.statCache) t.same(cache.map(function (f) { - return path.relative(__dirname, f) + return path.relative(__dirname, f).replace(/\\/g, '/') }).sort(), matches) cache.forEach(function(c) { diff --git a/deps/npm/node_modules/graceful-fs/README.md b/deps/npm/node_modules/graceful-fs/README.md index eb1a1093568..13a2e86050a 100644 --- a/deps/npm/node_modules/graceful-fs/README.md +++ b/deps/npm/node_modules/graceful-fs/README.md @@ -7,7 +7,7 @@ The improvements are meant to normalize behavior across different platforms and environments, and to make filesystem access more resilient to errors. -## Improvements over fs module +## Improvements over [fs module](http://api.nodejs.org/fs.html) graceful-fs: @@ -24,3 +24,13 @@ graceful-fs: On Windows, it retries renaming a file for up to one second if `EACCESS` or `EPERM` error occurs, likely because antivirus software has locked the directory. + +## USAGE + +```javascript +// use just like fs +var fs = require('graceful-fs') + +// now go and do stuff with it... +fs.readFileSync('some-file-or-whatever') +``` diff --git a/deps/npm/node_modules/graceful-fs/fs.js b/deps/npm/node_modules/graceful-fs/fs.js new file mode 100644 index 00000000000..ae9fd6f61e3 --- /dev/null +++ b/deps/npm/node_modules/graceful-fs/fs.js @@ -0,0 +1,11 @@ +// eeeeeevvvvviiiiiiillllll +// more evil than monkey-patching the native builtin? +// Not sure. + +var mod = require("module") +var pre = '(function (exports, require, module, __filename, __dirname) { ' +var post = '});' +var src = pre + process.binding('natives').fs + post +var vm = require('vm') +var fn = vm.runInThisContext(src) +return fn(exports, require, module, __filename, __dirname) diff --git a/deps/npm/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/graceful-fs/graceful-fs.js index baf957d8b12..77fc702d802 100644 --- a/deps/npm/node_modules/graceful-fs/graceful-fs.js +++ b/deps/npm/node_modules/graceful-fs/graceful-fs.js @@ -1,20 +1,17 @@ // Monkey-patching the fs module. // It's ugly, but there is simply no other way to do this. -var fs = module.exports = require('fs') +var fs = module.exports = require('./fs.js') var assert = require('assert') // fix up some busted stuff, mostly on windows and old nodes require('./polyfills.js') -// The EMFILE enqueuing stuff - var util = require('util') function noop () {} var debug = noop -var util = require('util') if (util.debuglog) debug = util.debuglog('gfs') else if (/\bgfs\b/i.test(process.env.NODE_DEBUG || '')) diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json index 9de02f6e3cc..a77f90c7dce 100644 --- a/deps/npm/node_modules/graceful-fs/package.json +++ b/deps/npm/node_modules/graceful-fs/package.json @@ -6,7 +6,7 @@ }, "name": "graceful-fs", "description": "A drop-in replacement for fs, making various improvements.", - "version": "2.0.2", + "version": "3.0.2", "repository": { "type": "git", "url": "git://github.com/isaacs/node-graceful-fs.git" @@ -38,11 +38,28 @@ "EACCESS" ], "license": "BSD", + "gitHead": "0caa11544c0c9001db78bf593cf0c5805d149a41", "bugs": { "url": "https://github.com/isaacs/node-graceful-fs/issues" }, - "readme": "ERROR: No README data found!", "homepage": "https://github.com/isaacs/node-graceful-fs", - "_id": "graceful-fs@2.0.2", - "_from": "graceful-fs@latest" + "_id": "graceful-fs@3.0.2", + "_shasum": "2cb5bf7f742bea8ad47c754caeee032b7e71a577", + "_from": "graceful-fs@~3.0.0", + "_npmVersion": "1.4.14", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "2cb5bf7f742bea8ad47c754caeee032b7e71a577", + "tarball": "http://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.2.tgz" + }, + "_resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-3.0.2.tgz" } diff --git a/deps/npm/node_modules/graceful-fs/polyfills.js b/deps/npm/node_modules/graceful-fs/polyfills.js index afc83b3f2c5..9d62af58617 100644 --- a/deps/npm/node_modules/graceful-fs/polyfills.js +++ b/deps/npm/node_modules/graceful-fs/polyfills.js @@ -1,4 +1,4 @@ -var fs = require('fs') +var fs = require('./fs.js') var constants = require('constants') var origCwd = process.cwd @@ -116,15 +116,25 @@ if (!fs.lutimes) { // https://github.com/isaacs/node-graceful-fs/issues/4 // Chown should not fail on einval or eperm if non-root. +// It should not fail on enosys ever, as this just indicates +// that a fs doesn't support the intended operation. fs.chown = chownFix(fs.chown) fs.fchown = chownFix(fs.fchown) fs.lchown = chownFix(fs.lchown) +fs.chmod = chownFix(fs.chmod) +fs.fchmod = chownFix(fs.fchmod) +fs.lchmod = chownFix(fs.lchmod) + fs.chownSync = chownFixSync(fs.chownSync) fs.fchownSync = chownFixSync(fs.fchownSync) fs.lchownSync = chownFixSync(fs.lchownSync) +fs.chmodSync = chownFix(fs.chmodSync) +fs.fchmodSync = chownFix(fs.fchmodSync) +fs.lchmodSync = chownFix(fs.lchmodSync) + function chownFix (orig) { if (!orig) return orig return function (target, uid, gid, cb) { @@ -146,15 +156,32 @@ function chownFixSync (orig) { } } +// ENOSYS means that the fs doesn't support the op. Just ignore +// that, because it doesn't matter. +// +// if there's no getuid, or if getuid() is something other +// than 0, and the error is EINVAL or EPERM, then just ignore +// it. +// +// This specific case is a silent failure in cp, install, tar, +// and most other unix tools that manage permissions. +// +// When running as root, or if other types of errors are +// encountered, then it's strict. function chownErOk (er) { - // if there's no getuid, or if getuid() is something other than 0, - // and the error is EINVAL or EPERM, then just ignore it. - // This specific case is a silent failure in cp, install, tar, - // and most other unix tools that manage permissions. - // When running as root, or if other types of errors are encountered, - // then it's strict. - if (!er || (!process.getuid || process.getuid() !== 0) - && (er.code === "EINVAL" || er.code === "EPERM")) return true + if (!er) + return true + + if (er.code === "ENOSYS") + return true + + var nonroot = !process.getuid || process.getuid() !== 0 + if (nonroot) { + if (er.code === "EINVAL" || er.code === "EPERM") + return true + } + + return false } diff --git a/deps/npm/node_modules/graceful-fs/test/open.js b/deps/npm/node_modules/graceful-fs/test/open.js index 104f36b0b9a..85732f236b0 100644 --- a/deps/npm/node_modules/graceful-fs/test/open.js +++ b/deps/npm/node_modules/graceful-fs/test/open.js @@ -2,7 +2,7 @@ var test = require('tap').test var fs = require('../graceful-fs.js') test('graceful fs is monkeypatched fs', function (t) { - t.equal(fs, require('fs')) + t.equal(fs, require('../fs.js')) t.end() }) diff --git a/deps/npm/node_modules/graceful-fs/test/readdir-sort.js b/deps/npm/node_modules/graceful-fs/test/readdir-sort.js index aeaedf1c166..fe005aa7a2e 100644 --- a/deps/npm/node_modules/graceful-fs/test/readdir-sort.js +++ b/deps/npm/node_modules/graceful-fs/test/readdir-sort.js @@ -1,5 +1,5 @@ var test = require("tap").test -var fs = require("fs") +var fs = require("../fs.js") var readdir = fs.readdir fs.readdir = function(path, cb) { diff --git a/deps/npm/node_modules/ini/ini.js b/deps/npm/node_modules/ini/ini.js index 1d1e6e9341c..f5e44411863 100644 --- a/deps/npm/node_modules/ini/ini.js +++ b/deps/npm/node_modules/ini/ini.js @@ -15,13 +15,13 @@ function encode (obj, section) { var val = obj[k] if (val && Array.isArray(val)) { val.forEach(function(item) { - out += safe(k + "[]") + " = " + safe(item) + "\n" + out += safe(k + "[]") + "=" + safe(item) + "\n" }) } else if (val && typeof val === "object") { children.push(k) } else { - out += safe(k) + " = " + safe(val) + eol + out += safe(k) + "=" + safe(val) + eol } }) diff --git a/deps/npm/node_modules/ini/package.json b/deps/npm/node_modules/ini/package.json index 6c3c8d18e6f..5212afb063f 100644 --- a/deps/npm/node_modules/ini/package.json +++ b/deps/npm/node_modules/ini/package.json @@ -6,7 +6,7 @@ }, "name": "ini", "description": "An ini encoder/decoder for node", - "version": "1.2.0", + "version": "1.2.1", "repository": { "type": "git", "url": "git://github.com/isaacs/ini.git" @@ -22,14 +22,15 @@ "devDependencies": { "tap": "~0.4.0" }, + "gitHead": "13498ce1ba5a6a20cd77ed2b55de0e714786f70c", "bugs": { "url": "https://github.com/isaacs/ini/issues" }, "homepage": "https://github.com/isaacs/ini", - "_id": "ini@1.2.0", - "_shasum": "2cc36789605809930722e793ae13ac835e623ac6", + "_id": "ini@1.2.1", + "_shasum": "7f774e2f22752cd1dacbf9c63323df2a164ebca3", "_from": "ini@latest", - "_npmVersion": "1.4.10", + "_npmVersion": "1.4.11", "_npmUser": { "name": "isaacs", "email": "i@izs.me" @@ -41,9 +42,9 @@ } ], "dist": { - "shasum": "2cc36789605809930722e793ae13ac835e623ac6", - "tarball": "http://registry.npmjs.org/ini/-/ini-1.2.0.tgz" + "shasum": "7f774e2f22752cd1dacbf9c63323df2a164ebca3", + "tarball": "http://registry.npmjs.org/ini/-/ini-1.2.1.tgz" }, "directories": {}, - "_resolved": "https://registry.npmjs.org/ini/-/ini-1.2.0.tgz" + "_resolved": "https://registry.npmjs.org/ini/-/ini-1.2.1.tgz" } diff --git a/deps/npm/node_modules/ini/test/foo.js b/deps/npm/node_modules/ini/test/foo.js index e1499cbe393..5c59890e8b6 100644 --- a/deps/npm/node_modules/ini/test/foo.js +++ b/deps/npm/node_modules/ini/test/foo.js @@ -6,32 +6,32 @@ var i = require("../") , fixture = path.resolve(__dirname, "./fixtures/foo.ini") , data = fs.readFileSync(fixture, "utf8") , d - , expectE = 'o = p\n' - + 'a with spaces = b c\n' - + '" xa n p " = "\\"\\r\\nyoyoyo\\r\\r\\n"\n' - + '"[disturbing]" = hey you never know\n' - + 's = something\n' - + 's1 = \"something\'\n' - + 's2 = something else\n' - + 'zr[] = deedee\n' - + 'ar[] = one\n' - + 'ar[] = three\n' - + 'ar[] = this is included\n' - + 'br = warm\n' + , expectE = 'o=p\n' + + 'a with spaces=b c\n' + + '" xa n p "="\\"\\r\\nyoyoyo\\r\\r\\n"\n' + + '"[disturbing]"=hey you never know\n' + + 's=something\n' + + 's1=\"something\'\n' + + 's2=something else\n' + + 'zr[]=deedee\n' + + 'ar[]=one\n' + + 'ar[]=three\n' + + 'ar[]=this is included\n' + + 'br=warm\n' + '\n' + '[a]\n' - + 'av = a val\n' - + 'e = { o: p, a: ' + + 'av=a val\n' + + 'e={ o: p, a: ' + '{ av: a val, b: { c: { e: "this [value]" ' - + '} } } }\nj = "\\"{ o: \\"p\\", a: { av:' + + '} } } }\nj="\\"{ o: \\"p\\", a: { av:' + ' \\"a val\\", b: { c: { e: \\"this [value]' - + '\\" } } } }\\""\n"[]" = a square?\n' - + 'cr[] = four\ncr[] = eight\n\n' - +'[a.b.c]\ne = 1\n' - + 'j = 2\n\n[x\\.y\\.z]\nx.y.z = xyz\n\n' - + '[x\\.y\\.z.a\\.b\\.c]\na.b.c = abc\n' - + 'nocomment = this\\; this is not a comment\n' - + 'noHashComment = this\\# this is not a comment\n' + + '\\" } } } }\\""\n"[]"=a square?\n' + + 'cr[]=four\ncr[]=eight\n\n' + +'[a.b.c]\ne=1\n' + + 'j=2\n\n[x\\.y\\.z]\nx.y.z=xyz\n\n' + + '[x\\.y\\.z.a\\.b\\.c]\na.b.c=abc\n' + + 'nocomment=this\\; this is not a comment\n' + + 'noHashComment=this\\# this is not a comment\n' , expectD = { o: 'p', 'a with spaces': 'b c', diff --git a/deps/npm/node_modules/init-package-json/package.json b/deps/npm/node_modules/init-package-json/package.json index 84d3814f8b4..a03182a126f 100644 --- a/deps/npm/node_modules/init-package-json/package.json +++ b/deps/npm/node_modules/init-package-json/package.json @@ -1,6 +1,6 @@ { "name": "init-package-json", - "version": "0.0.17", + "version": "0.1.0", "main": "init-package-json.js", "scripts": { "test": "tap test/*.js" @@ -17,11 +17,11 @@ "license": "ISC", "description": "A node module to get your node module started", "dependencies": { + "glob": "^4.0.2", "promzard": "~0.2.0", "read": "~1.0.1", "read-package-json": "1", - "semver": "2.x", - "glob": "~3.2.7" + "semver": "2.x" }, "devDependencies": { "tap": "~0.2.5", @@ -37,29 +37,14 @@ "prompt", "start" ], - "gitHead": "cbc53fbedd4246d62ec99ea3a61a113a07d21629", + "readme": "# init-package-json\n\nA node module to get your node module started.\n\n## Usage\n\n```javascript\nvar init = require('init-package-json')\nvar path = require('path')\n\n// a path to a promzard module. In the event that this file is\n// not found, one will be provided for you.\nvar initFile = path.resolve(process.env.HOME, '.npm-init')\n\n// the dir where we're doin stuff.\nvar dir = process.cwd()\n\n// extra stuff that gets put into the PromZard module's context.\n// In npm, this is the resolved config object. Exposed as 'config'\n// Optional.\nvar configData = { some: 'extra stuff' }\n\n// Any existing stuff from the package.json file is also exposed in the\n// PromZard module as the `package` object. There will also be free\n// vars for:\n// * `filename` path to the package.json file\n// * `basename` the tip of the package dir\n// * `dirname` the parent of the package dir\n\ninit(dir, initFile, configData, function (er, data) {\n // the data's already been written to {dir}/package.json\n // now you can do stuff with it\n})\n```\n\nOr from the command line:\n\n```\n$ npm-init\n```\n\nSee [PromZard](https://github.com/isaacs/promzard) for details about\nwhat can go in the config file.\n", + "readmeFilename": "README.md", + "gitHead": "378bf828106a56e340d3017258ae372a12f0efe7", "bugs": { "url": "https://github.com/isaacs/init-package-json/issues" }, "homepage": "https://github.com/isaacs/init-package-json", - "_id": "init-package-json@0.0.17", - "_shasum": "395f2cb8d1c5af93ba6ec19dafa64717047f90c3", - "_from": "init-package-json@latest", - "_npmVersion": "1.4.10", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "dist": { - "shasum": "395f2cb8d1c5af93ba6ec19dafa64717047f90c3", - "tarball": "http://registry.npmjs.org/init-package-json/-/init-package-json-0.0.17.tgz" - }, - "directories": {}, - "_resolved": "https://registry.npmjs.org/init-package-json/-/init-package-json-0.0.17.tgz" + "_id": "init-package-json@0.1.0", + "_shasum": "249c982759a102556f294f2592c14a2dad855f52", + "_from": "init-package-json@latest" } diff --git a/deps/npm/node_modules/node-gyp/package.json b/deps/npm/node_modules/node-gyp/package.json index 223e87b4b7d..88ba331fae6 100644 --- a/deps/npm/node_modules/node-gyp/package.json +++ b/deps/npm/node_modules/node-gyp/package.json @@ -27,12 +27,12 @@ }, "main": "./lib/node-gyp.js", "dependencies": { - "glob": "3", - "graceful-fs": "2", + "glob": "3 || 4", + "graceful-fs": "2||3", "fstream": "0", "minimatch": "0", "mkdirp": "0", - "nopt": "2", + "nopt": "2 || 3", "npmlog": "0", "osenv": "0", "request": "2", diff --git a/deps/npm/node_modules/nopt/README.md b/deps/npm/node_modules/nopt/README.md index 96798a1da01..5aba088b568 100644 --- a/deps/npm/node_modules/nopt/README.md +++ b/deps/npm/node_modules/nopt/README.md @@ -116,8 +116,7 @@ considered valid values. For instance, in the example above, the and any other value will be rejected. When parsing unknown fields, `"true"`, `"false"`, and `"null"` will be -interpreted as their JavaScript equivalents, and numeric values will be -interpreted as a number. +interpreted as their JavaScript equivalents. You can also mix types and values, or multiple types, in a list. For instance `{ blah: [Number, null] }` would allow a value to be set to diff --git a/deps/npm/node_modules/nopt/bin/nopt.js b/deps/npm/node_modules/nopt/bin/nopt.js index 30e9fdbab5d..3232d4c570f 100755 --- a/deps/npm/node_modules/nopt/bin/nopt.js +++ b/deps/npm/node_modules/nopt/bin/nopt.js @@ -1,5 +1,6 @@ #!/usr/bin/env node var nopt = require("../lib/nopt") + , path = require("path") , types = { num: Number , bool: Boolean , help: Boolean @@ -11,6 +12,7 @@ var nopt = require("../lib/nopt") , clear: Boolean , config: Boolean , length: Number + , file: path } , shorthands = { s: [ "--str", "astring" ] , b: [ "--bool" ] @@ -22,6 +24,7 @@ var nopt = require("../lib/nopt") , n: [ "--num", "125" ] , c: ["--config"] , l: ["--length"] + , f: ["--file"] } , parsed = nopt( types , shorthands diff --git a/deps/npm/node_modules/nopt/lib/nopt.js b/deps/npm/node_modules/nopt/lib/nopt.js index 9efab7af4c3..5309a00fc7d 100644 --- a/deps/npm/node_modules/nopt/lib/nopt.js +++ b/deps/npm/node_modules/nopt/lib/nopt.js @@ -50,7 +50,7 @@ function nopt (types, shorthands, args, slice) { function clean (data, types, typeDefs) { typeDefs = typeDefs || exports.typeDefs var remove = {} - , typeDefault = [false, true, null, String, Number, Array] + , typeDefault = [false, true, null, String, Array] Object.keys(data).forEach(function (k) { if (k === "argv") return @@ -126,6 +126,8 @@ function validateString (data, k, val) { function validatePath (data, k, val) { if (val === true) return false + if (val === null) return true + val = String(val) var homePattern = process.platform === 'win32' ? /^~(\/|\\)/ : /^~\// if (val.match(homePattern) && process.env.HOME) { diff --git a/deps/npm/node_modules/nopt/package.json b/deps/npm/node_modules/nopt/package.json index 72aba5d36c3..874f1128c0f 100644 --- a/deps/npm/node_modules/nopt/package.json +++ b/deps/npm/node_modules/nopt/package.json @@ -1,6 +1,6 @@ { "name": "nopt", - "version": "2.2.1", + "version": "3.0.1", "description": "Option parsing for Node, supporting types, shorthands, etc. Used by npm.", "author": { "name": "Isaac Z. Schlueter", @@ -28,13 +28,14 @@ "devDependencies": { "tap": "~0.4.8" }, - "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents, and numeric values will be\ninterpreted as a number.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", + "readme": "If you want to write an option parser, and have it be good, there are\ntwo ways to do it. The Right Way, and the Wrong Way.\n\nThe Wrong Way is to sit down and write an option parser. We've all done\nthat.\n\nThe Right Way is to write some complex configurable program with so many\noptions that you go half-insane just trying to manage them all, and put\nit off with duct-tape solutions until you see exactly to the core of the\nproblem, and finally snap and write an awesome option parser.\n\nIf you want to write an option parser, don't write an option parser.\nWrite a package manager, or a source control system, or a service\nrestarter, or an operating system. You probably won't end up with a\ngood one of those, but if you don't give up, and you are relentless and\ndiligent enough in your procrastination, you may just end up with a very\nnice option parser.\n\n## USAGE\n\n // my-program.js\n var nopt = require(\"nopt\")\n , Stream = require(\"stream\").Stream\n , path = require(\"path\")\n , knownOpts = { \"foo\" : [String, null]\n , \"bar\" : [Stream, Number]\n , \"baz\" : path\n , \"bloo\" : [ \"big\", \"medium\", \"small\" ]\n , \"flag\" : Boolean\n , \"pick\" : Boolean\n , \"many\" : [String, Array]\n }\n , shortHands = { \"foofoo\" : [\"--foo\", \"Mr. Foo\"]\n , \"b7\" : [\"--bar\", \"7\"]\n , \"m\" : [\"--bloo\", \"medium\"]\n , \"p\" : [\"--pick\"]\n , \"f\" : [\"--flag\"]\n }\n // everything is optional.\n // knownOpts and shorthands default to {}\n // arg list defaults to process.argv\n // slice defaults to 2\n , parsed = nopt(knownOpts, shortHands, process.argv, 2)\n console.log(parsed)\n\nThis would give you support for any of the following:\n\n```bash\n$ node my-program.js --foo \"blerp\" --no-flag\n{ \"foo\" : \"blerp\", \"flag\" : false }\n\n$ node my-program.js ---bar 7 --foo \"Mr. Hand\" --flag\n{ bar: 7, foo: \"Mr. Hand\", flag: true }\n\n$ node my-program.js --foo \"blerp\" -f -----p\n{ foo: \"blerp\", flag: true, pick: true }\n\n$ node my-program.js -fp --foofoo\n{ foo: \"Mr. Foo\", flag: true, pick: true }\n\n$ node my-program.js --foofoo -- -fp # -- stops the flag parsing.\n{ foo: \"Mr. Foo\", argv: { remain: [\"-fp\"] } }\n\n$ node my-program.js --blatzk -fp # unknown opts are ok.\n{ blatzk: true, flag: true, pick: true }\n\n$ node my-program.js --blatzk=1000 -fp # but you need to use = if they have a value\n{ blatzk: 1000, flag: true, pick: true }\n\n$ node my-program.js --no-blatzk -fp # unless they start with \"no-\"\n{ blatzk: false, flag: true, pick: true }\n\n$ node my-program.js --baz b/a/z # known paths are resolved.\n{ baz: \"/Users/isaacs/b/a/z\" }\n\n# if Array is one of the types, then it can take many\n# values, and will always be an array. The other types provided\n# specify what types are allowed in the list.\n\n$ node my-program.js --many 1 --many null --many foo\n{ many: [\"1\", \"null\", \"foo\"] }\n\n$ node my-program.js --many foo\n{ many: [\"foo\"] }\n```\n\nRead the tests at the bottom of `lib/nopt.js` for more examples of\nwhat this puppy can do.\n\n## Types\n\nThe following types are supported, and defined on `nopt.typeDefs`\n\n* String: A normal string. No parsing is done.\n* path: A file system path. Gets resolved against cwd if not absolute.\n* url: A url. If it doesn't parse, it isn't accepted.\n* Number: Must be numeric.\n* Date: Must parse as a date. If it does, and `Date` is one of the options,\n then it will return a Date object, not a string.\n* Boolean: Must be either `true` or `false`. If an option is a boolean,\n then it does not need a value, and its presence will imply `true` as\n the value. To negate boolean flags, do `--no-whatever` or `--whatever\n false`\n* NaN: Means that the option is strictly not allowed. Any value will\n fail.\n* Stream: An object matching the \"Stream\" class in node. Valuable\n for use when validating programmatically. (npm uses this to let you\n supply any WriteStream on the `outfd` and `logfd` config options.)\n* Array: If `Array` is specified as one of the types, then the value\n will be parsed as a list of options. This means that multiple values\n can be specified, and that the value will always be an array.\n\nIf a type is an array of values not on this list, then those are\nconsidered valid values. For instance, in the example above, the\n`--bloo` option can only be one of `\"big\"`, `\"medium\"`, or `\"small\"`,\nand any other value will be rejected.\n\nWhen parsing unknown fields, `\"true\"`, `\"false\"`, and `\"null\"` will be\ninterpreted as their JavaScript equivalents.\n\nYou can also mix types and values, or multiple types, in a list. For\ninstance `{ blah: [Number, null] }` would allow a value to be set to\neither a Number or null. When types are ordered, this implies a\npreference, and the first type that can be used to properly interpret\nthe value will be used.\n\nTo define a new type, add it to `nopt.typeDefs`. Each item in that\nhash is an object with a `type` member and a `validate` method. The\n`type` member is an object that matches what goes in the type list. The\n`validate` method is a function that gets called with `validate(data,\nkey, val)`. Validate methods should assign `data[key]` to the valid\nvalue of `val` if it can be handled properly, or return boolean\n`false` if it cannot.\n\nYou can also call `nopt.clean(data, types, typeDefs)` to clean up a\nconfig object and remove its invalid properties.\n\n## Error Handling\n\nBy default, nopt outputs a warning to standard error when invalid\noptions are found. You can change this behavior by assigning a method\nto `nopt.invalidHandler`. This method will be called with\nthe offending `nopt.invalidHandler(key, val, types)`.\n\nIf no `nopt.invalidHandler` is assigned, then it will console.error\nits whining. If it is assigned to boolean `false` then the warning is\nsuppressed.\n\n## Abbreviations\n\nYes, they are supported. If you define options like this:\n\n```javascript\n{ \"foolhardyelephants\" : Boolean\n, \"pileofmonkeys\" : Boolean }\n```\n\nThen this will work:\n\n```bash\nnode program.js --foolhar --pil\nnode program.js --no-f --pileofmon\n# etc.\n```\n\n## Shorthands\n\nShorthands are a hash of shorter option names to a snippet of args that\nthey expand to.\n\nIf multiple one-character shorthands are all combined, and the\ncombination does not unambiguously match any other option or shorthand,\nthen they will be broken up into their constituent parts. For example:\n\n```json\n{ \"s\" : [\"--loglevel\", \"silent\"]\n, \"g\" : \"--global\"\n, \"f\" : \"--force\"\n, \"p\" : \"--parseable\"\n, \"l\" : \"--long\"\n}\n```\n\n```bash\nnpm ls -sgflp\n# just like doing this:\nnpm ls --loglevel silent --global --force --long --parseable\n```\n\n## The Rest of the args\n\nThe config object returned by nopt is given a special member called\n`argv`, which is an object with the following fields:\n\n* `remain`: The remaining args after all the parsing has occurred.\n* `original`: The args as they originally appeared.\n* `cooked`: The args after flags and shorthands are expanded.\n\n## Slicing\n\nNode programs are called with more or less the exact argv as it appears\nin C land, after the v8 and node-specific options have been plucked off.\nAs such, `argv[0]` is always `node` and `argv[1]` is always the\nJavaScript program being run.\n\nThat's usually not very useful to you. So they're sliced off by\ndefault. If you want them, then you can pass in `0` as the last\nargument, or any other number that you'd like to slice off the start of\nthe list.\n", "readmeFilename": "README.md", + "gitHead": "4296f7aba7847c198fea2da594f9e1bec02817ec", "bugs": { "url": "https://github.com/isaacs/nopt/issues" }, "homepage": "https://github.com/isaacs/nopt", - "_id": "nopt@2.2.1", - "_shasum": "2aa09b7d1768487b3b89a9c5aa52335bff0baea7", + "_id": "nopt@3.0.1", + "_shasum": "bce5c42446a3291f47622a370abbf158fbbacbfd", "_from": "nopt@latest" } diff --git a/deps/npm/node_modules/nopt/test/basic.js b/deps/npm/node_modules/nopt/test/basic.js index b31dccf54b1..2f9088cf674 100644 --- a/deps/npm/node_modules/nopt/test/basic.js +++ b/deps/npm/node_modules/nopt/test/basic.js @@ -23,6 +23,14 @@ test("~ path is resolved to $HOME", function (t) { t.end() }) +// https://github.com/npm/nopt/issues/24 +test("Unknown options are not parsed as numbers", function (t) { + var parsed = nopt({"parse-me": Number}, null, ['--leave-as-is=1.20', '--parse-me=1.20'], 0) + t.equal(parsed['leave-as-is'], '1.20') + t.equal(parsed['parse-me'], 1.2) + t.end() +}); + test("other tests", function (t) { var util = require("util") @@ -170,7 +178,7 @@ test("other tests", function (t) { ,{t:["true"]} ,[]] ,["-aoa one -aoa null -aoa 100" - ,{aoa:["one", null, 100]} + ,{aoa:["one", null, '100']} ,[]] ,["-str 100" ,{str:"100"} diff --git a/deps/npm/node_modules/npm-install-checks/package.json b/deps/npm/node_modules/npm-install-checks/package.json index a4e8695ca14..9457df0b5c3 100644 --- a/deps/npm/node_modules/npm-install-checks/package.json +++ b/deps/npm/node_modules/npm-install-checks/package.json @@ -1,10 +1,10 @@ { "name": "npm-install-checks", - "version": "1.0.1", + "version": "1.0.2", "description": "checks that npm runs during the installation of a module", "main": "index.js", "dependencies": { - "npmlog": "0.0.6", + "npmlog": "0.1", "semver": "^2.3.0" }, "devDependencies": { @@ -34,7 +34,8 @@ }, "readme": "# npm-install-checks\n\nA package that contains checks that npm runs during the installation.\n\n## API\n\n### .checkEngine(target, npmVer, nodeVer, force, strict, cb)\nCheck if node/npm version is supported by the package.\n\nError type: `ENOTSUP`\n\n### .checkPlatform(target, force, cb)\nCheck if OS/Arch is supported by the package.\n\nError type: `EBADPLATFORM`\n\n### .checkCycle(target, ancestors, cb)\nCheck for cyclic dependencies.\n\nError type: `ECYCLE`\n\n### .checkGit(folder, cb)\nCheck if a folder is a .git folder.\n\nError type: `EISGIT`\n", "readmeFilename": "README.md", - "_id": "npm-install-checks@1.0.1", - "_shasum": "547a73dec58acfd52365012e60de9418b6405101", - "_from": "npm-install-checks@~1.0.0" + "gitHead": "056ade7c5e3a6b3c720ca6a743c1b99a0705d29e", + "_id": "npm-install-checks@1.0.2", + "_shasum": "ebba769753fc8551308333ef411920743a6809f6", + "_from": "npm-install-checks@latest" } diff --git a/deps/npm/node_modules/npm-registry-client/README.md b/deps/npm/node_modules/npm-registry-client/README.md index 4b3d4c3c650..6d15dadf7f5 100644 --- a/deps/npm/node_modules/npm-registry-client/README.md +++ b/deps/npm/node_modules/npm-registry-client/README.md @@ -9,8 +9,10 @@ It handles all the caching and HTTP calls. ```javascript var RegClient = require('npm-registry-client') var client = new RegClient(config) +var uri = "npm://registry.npmjs.org/npm" +var options = {timeout: 1000} -client.get("npm", "latest", 1000, function (er, data, raw, res) { +client.get(uri, options, function (error, data, raw, res) { // error is an error if there was a problem. // data is the parsed data object // raw is the json string @@ -18,6 +20,15 @@ client.get("npm", "latest", 1000, function (er, data, raw, res) { }) ``` +# Registry URLs + +The registry calls take either a full URL pointing to a resource in the +registry, or a base URL for the registry as a whole (for the base URL, any path +will be ignored). In addition to `http` and `https`, `npm` URLs are allowed. +`npm` URLs are `https` URLs with the additional restrictions that they will +always include authorization credentials, and the response is always registry +metadata (and not tarballs or other attachments). + # Configuration This program is designed to work with @@ -26,7 +37,6 @@ a plain-jane object with the appropriate configs, and it'll shim it for you. Any configuration thingie that has get/set/del methods will also be accepted. -* `registry` **Required** {String} URL to the registry * `cache` **Required** {String} Path to the cache folder * `always-auth` {Boolean} Auth even for GET requests. * `auth` {String} A base64-encoded `username:password` @@ -59,25 +69,27 @@ also be accepted. * `_token` {Object} A token for use with [couch-login](https://npmjs.org/package/couch-login) -# client.request(method, where, [what], [etag], [nofollow], cb) +# client.request(method, uri, options, cb) * `method` {String} HTTP method -* `where` {String} Path to request on the server -* `what` {Stream | Buffer | String | Object} The request body. Objects - that are not Buffers or Streams are encoded as JSON. -* `etag` {String} The cached ETag -* `nofollow` {Boolean} Prevent following 302/301 responses +* `uri` {String} URI pointing to the resource to request +* `options` {Object} Object containing optional per-request properties. + * `what` {Stream | Buffer | String | Object} The request body. Objects + that are not Buffers or Streams are encoded as JSON. + * `etag` {String} The cached ETag + * `follow` {Boolean} Follow 302/301 responses (defaults to true) * `cb` {Function} * `error` {Error | null} * `data` {Object} the parsed data object * `raw` {String} the json * `res` {Response Object} response from couch -Make a request to the registry. All the other methods are wrappers -around this. one. +Make a request to the registry. All the other methods are wrappers around +`request`. -# client.adduser(username, password, email, cb) +# client.adduser(base, username, password, email, cb) +* `base` {String} Base registry URL * `username` {String} * `password` {String} * `email` {String} @@ -85,88 +97,88 @@ around this. one. Add a user account to the registry, or verify the credentials. -# client.deprecate(name, version, message, cb) +# client.deprecate(uri, version, message, cb) -* `name` {String} The package name +* `uri` {String} Full registry URI for the deprecated package * `version` {String} Semver version range * `message` {String} The message to use as a deprecation warning * `cb` {Function} Deprecate a version of a package in the registry. -# client.bugs(name, cb) +# client.bugs(uri, cb) -* `name` {String} the name of the package +* `uri` {String} Full registry URI for the package * `cb` {Function} Get the url for bugs of a package -# client.get(url, [timeout], [nofollow], [staleOk], cb) +# client.get(uri, options, cb) -* `url` {String} The url path to fetch -* `timeout` {Number} Number of seconds old that a cached copy must be - before a new request will be made. -* `nofollow` {Boolean} Do not follow 301/302 responses -* `staleOk` {Boolean} If there's cached data available, then return that - to the callback quickly, and update the cache the background. +* `uri` {String} The complete registry URI to fetch +* `options` {Object} Object containing optional per-request properties. + * `timeout` {Number} Duration before the request times out. + * `follow` {Boolean} Follow 302/301 responses (defaults to true) + * `staleOk` {Boolean} If there's cached data available, then return that + to the callback quickly, and update the cache the background. -Fetches data from the registry via a GET request, saving it in -the cache folder with the ETag. +Fetches data from the registry via a GET request, saving it in the cache folder +with the ETag. -# client.publish(data, tarball, cb) +# client.publish(uri, data, tarball, cb) +* `uri` {String} The registry URI to publish to * `data` {Object} Package data * `tarball` {String | Stream} Filename or stream of the package tarball * `cb` {Function} Publish a package to the registry. -Note that this does not create the tarball from a folder. However, it -can accept a gzipped tar stream or a filename to a tarball. +Note that this does not create the tarball from a folder. However, it can +accept a gzipped tar stream or a filename to a tarball. -# client.star(package, starred, cb) +# client.star(uri, starred, cb) -* `package` {String} Name of the package to star +* `uri` {String} The complete registry URI to star * `starred` {Boolean} True to star the package, false to unstar it. * `cb` {Function} Star or unstar a package. -Note that the user does not have to be the package owner to star or -unstar a package, though other writes do require that the user be the -package owner. +Note that the user does not have to be the package owner to star or unstar a +package, though other writes do require that the user be the package owner. -# client.stars(username, cb) +# client.stars(base, username, cb) +* `base` {String} The base URL for the registry * `username` {String} Name of user to fetch starred packages for. * `cb` {Function} View your own or another user's starred packages. -# client.tag(project, version, tag, cb) +# client.tag(uri, version, tag, cb) -* `project` {String} Project name +* `uri` {String} The complete registry URI to tag * `version` {String} Version to tag * `tag` {String} Tag name to apply * `cb` {Function} -Mark a version in the `dist-tags` hash, so that `pkg@tag` -will fetch the specified version. +Mark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the +specified version. -# client.unpublish(name, [ver], cb) +# client.unpublish(uri, [ver], cb) -* `name` {String} package name +* `uri` {String} The complete registry URI to unpublish * `ver` {String} version to unpublish. Leave blank to unpublish all versions. * `cb` {Function} -Remove a version of a package (or all versions) from the registry. When -the last version us unpublished, the entire document is removed from the -database. +Remove a version of a package (or all versions) from the registry. When the +last version us unpublished, the entire document is removed from the database. -# client.upload(where, file, [etag], [nofollow], cb) +# client.upload(uri, file, [etag], [nofollow], cb) -* `where` {String} URL path to upload to +* `uri` {String} The complete registry URI to upload to * `file` {String | Stream} Either the filename or a readable stream * `etag` {String} Cache ETag * `nofollow` {Boolean} Do not follow 301/302 responses diff --git a/deps/npm/node_modules/npm-registry-client/index.js b/deps/npm/node_modules/npm-registry-client/index.js index eac60d605fa..a75e8bbdbeb 100644 --- a/deps/npm/node_modules/npm-registry-client/index.js +++ b/deps/npm/node_modules/npm-registry-client/index.js @@ -2,9 +2,7 @@ module.exports = RegClient -var fs = require('fs') -, url = require('url') -, path = require('path') +var url = require('url') , npmlog , cacheFile = require('npm-cache-filename') diff --git a/deps/npm/node_modules/npm-registry-client/lib/adduser.js b/deps/npm/node_modules/npm-registry-client/lib/adduser.js index 5a76b028c02..d1fcac8e918 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/adduser.js +++ b/deps/npm/node_modules/npm-registry-client/lib/adduser.js @@ -1,6 +1,12 @@ module.exports = adduser -function adduser (username, password, email, cb) { +var url = require("url") + +function adduser (base, username, password, email, cb) { + if (!base) return cb(new Error("Required base URI not supplied")) + + username = ("" + (username || "")).trim() + if (!username) return cb(new Error("No username supplied.")) password = ("" + (password || "")).trim() if (!password) return cb(new Error("No password supplied.")) @@ -48,9 +54,10 @@ function adduser (username, password, email, cb) { this.log.verbose("adduser", "before first PUT", logObj) + var uri = url.resolve(base, '/-/user/org.couchdb.user:' + encodeURIComponent(username)) this.request('PUT' - , '/-/user/org.couchdb.user:'+encodeURIComponent(username) - , userobj + , uri + , { body : userobj } , function (error, data, json, response) { // if it worked, then we just created a new user, and all is well. // but if we're updating a current record, then it'll 409 first @@ -69,8 +76,8 @@ function adduser (username, password, email, cb) { this.log.verbose("adduser", "update existing user") return this.request('GET' - , '/-/user/org.couchdb.user:'+encodeURIComponent(username) + - '?write=true' + , uri + '?write=true' + , null , function (er, data, json, response) { if (er || data.error) { return cb(er, data, json, response) @@ -82,10 +89,9 @@ function adduser (username, password, email, cb) { }) this.log.verbose("adduser", "userobj", logObj) this.request('PUT' - , '/-/user/org.couchdb.user:'+encodeURIComponent(username) - + "/-rev/" + userobj._rev - , userobj - , cb ) + , uri + "/-rev/" + userobj._rev + , { body : userobj } + , cb) }.bind(this)) }.bind(this)) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/bugs.js b/deps/npm/node_modules/npm-registry-client/lib/bugs.js index a04701316da..fd0365eed60 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/bugs.js +++ b/deps/npm/node_modules/npm-registry-client/lib/bugs.js @@ -1,8 +1,8 @@ module.exports = bugs -function bugs (name, cb) { - this.get(name + "/latest", 3600, function (er, d) { +function bugs (uri, cb) { + this.get(uri + "/latest", 3600, function (er, d) { if (er) return cb(er) cb(null, d.bugs) }) diff --git a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js index 9cbc6d88e3a..078968dd327 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/deprecate.js +++ b/deps/npm/node_modules/npm-registry-client/lib/deprecate.js @@ -1,9 +1,9 @@ - module.exports = deprecate +var url = require("url") var semver = require("semver") -function deprecate (name, ver, message, cb) { +function deprecate (uri, ver, message, cb) { if (!this.conf.get('username')) { return cb(new Error("Must be logged in to deprecate a package")) } @@ -12,7 +12,7 @@ function deprecate (name, ver, message, cb) { return cb(new Error("invalid version range: "+ver)) } - this.get(name + '?write=true', function (er, data) { + this.get(uri + '?write=true', null, function (er, data) { if (er) return cb(er) // filter all the versions that match Object.keys(data.versions).filter(function (v) { @@ -21,6 +21,6 @@ function deprecate (name, ver, message, cb) { data.versions[v].deprecated = message }) // now update the doc on the registry - this.request('PUT', data._id, data, cb) + this.request('PUT', url.resolve(uri, data._id), { body : data }, cb) }.bind(this)) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/get.js b/deps/npm/node_modules/npm-registry-client/lib/get.js index 9aab7d7b0ff..d7b58092b7f 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/get.js +++ b/deps/npm/node_modules/npm-registry-client/lib/get.js @@ -2,83 +2,94 @@ module.exports = get var fs = require("graceful-fs") + , assert = require("assert") , path = require("path") , mkdir = require("mkdirp") , chownr = require("chownr") - -function get (uri, timeout, nofollow, staleOk, cb) { - if (typeof cb !== "function") cb = staleOk, staleOk = false - if (typeof cb !== "function") cb = nofollow, nofollow = false - if (typeof cb !== "function") cb = timeout, timeout = -1 - - timeout = Math.min(timeout, this.conf.get('cache-max') || 0) - timeout = Math.max(timeout, this.conf.get('cache-min') || -Infinity) - - if (!this.conf.get('registry')) timeout = Infinity - - if ( process.env.COMP_CWORD !== undefined - && process.env.COMP_LINE !== undefined - && process.env.COMP_POINT !== undefined - ) timeout = Math.max(timeout, 60000) - - var cache = this.cacheFile(this.registry + uri) + "/.cache.json" + , url = require("url") + +/** + * options: + * + * timeout: request timeouts + * follow: follow redirects + * staleOk: stale results are OK + * stat: results of checking for cached metadata + * data: the cached metadata + */ +function get (uri, options, cb) { + assert(uri, "must have URL to fetch") + assert(cb, "must have callback") + if (!options) options = {} + + var parsed = url.parse(uri) + assert(parsed.protocol, "must have a URL that starts with npm:, http:, or https:") + + var cache = this.cacheFile(uri) + "/.cache.json" // /-/all is special. // It uses timestamp-based caching and partial updates, // because it is a monster. - if (uri === "/-/all") { - return requestAll.call(this, cache, cb) + if (parsed.pathname === "/-/all") { + return requestAll.call(this, uri, cache, cb) } // If the GET is part of a write operation (PUT or DELETE), then // skip past the cache entirely, but still save the results. - if (uri.match(/\?write=true$/)) - return get_.call(this, uri, timeout, cache, null, null, nofollow, staleOk, cb) - + if (uri.match(/\?write=true$/)) { + return get_.call(this, uri, cache, options, cb) + } fs.stat(cache, function (er, stat) { if (!er) fs.readFile(cache, function (er, data) { try { data = JSON.parse(data) } catch (ex) { data = null } - get_.call(this, uri, timeout, cache, stat, data, nofollow, staleOk, cb) + options.stat = stat + options.data = data + get_.call(this, uri, cache, options, cb) }.bind(this)) - else get_.call(this, uri, timeout, cache, null, null, nofollow, staleOk, cb) + else { + get_.call(this, uri, cache, options, cb) + } }.bind(this)) } -function requestAll (cache, cb) { +function requestAll (uri, cache, cb) { + this.log.info("get", cache) mkdir(path.dirname(cache), function (er) { + if (er) return cb(er) fs.readFile(cache, function (er, data) { - if (er) return requestAll_.call(this, 0, {}, cache, cb) + if (er) return requestAll_.call(this, uri, 0, {}, cache, cb) try { data = JSON.parse(data) } catch (ex) { fs.writeFile(cache, "{}", function (er) { if (er) return cb(new Error("Broken cache.")) - return requestAll_.call(this, 0, {}, cache, cb) + return requestAll_.call(this, uri, 0, {}, cache, cb) }.bind(this)) } var t = +data._updated || 0 - requestAll_.call(this, t, data, cache, cb) + requestAll_.call(this, uri, t, data, cache, cb) }.bind(this)) }.bind(this)) } -function requestAll_ (c, data, cache, cb) { +function requestAll_ (uri, c, data, cache, cb) { // use the cache and update in the background if it's not too old if (Date.now() - c < 60000) { cb(null, data) cb = function () {} } - var uri = "/-/all/since?stale=update_after&startkey=" + c - if (c === 0) { this.log.warn("", "Building the local index for the first time, please be patient") - uri = "/-/all" + uri = url.resolve(uri, "/-/all") + } + else { + uri = url.resolve(uri, "/-/all/since?stale=update_after&startkey=" + c) } - this.request('GET', uri, function (er, updates, _, res) { + this.request('GET', uri, null, function (er, updates, _, res) { if (er) return cb(er, data) var headers = res.headers , updated = updates._updated || Date.parse(headers.date) @@ -94,10 +105,25 @@ function requestAll_ (c, data, cache, cb) { }) } -function get_ (uri, timeout, cache, stat, data, nofollow, staleOk, cb) { - var etag +function get_ (uri, cache, options, cb) { + var staleOk = options.staleOk === undefined ? false : options.staleOk + , follow = options.follow + , data = options.data + , stat = options.stat + , etag + + var timeout = options.timeout === undefined ? -1 : options.timeout + timeout = Math.min(timeout, this.conf.get('cache-max') || 0) + timeout = Math.max(timeout, this.conf.get('cache-min') || -Infinity) + if (process.env.COMP_CWORD !== undefined && + process.env.COMP_LINE !== undefined && + process.env.COMP_POINT !== undefined) { + timeout = Math.max(timeout, 60000) + } + if (data && data._etag) etag = data._etag - if (timeout && timeout > 0 && stat && data) { + + if (timeout && timeout > 0 && options.stat && options.data) { if ((Date.now() - stat.mtime.getTime())/1000 < timeout) { this.log.verbose("registry.get", uri, "not expired, no request") delete data._etag @@ -112,7 +138,7 @@ function get_ (uri, timeout, cache, stat, data, nofollow, staleOk, cb) { } } - this.request('GET', uri, null, etag, nofollow, function (er, remoteData, raw, response) { + this.request('GET', uri, { etag : etag, follow : follow }, function (er, remoteData, raw, response) { // if we get an error talking to the registry, but we have it // from the cache, then just pretend we got it. if (er && cache && data && !data.error) { diff --git a/deps/npm/node_modules/npm-registry-client/lib/publish.js b/deps/npm/node_modules/npm-registry-client/lib/publish.js index 2a503802ab4..5504658d332 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/publish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/publish.js @@ -6,7 +6,7 @@ var url = require("url") , crypto = require("crypto") , fs = require("fs") -function publish (data, tarball, cb) { +function publish (uri, data, tarball, cb) { var email = this.conf.get('email') var auth = this.conf.get('_auth') var username = this.conf.get('username') @@ -30,12 +30,12 @@ function publish (data, tarball, cb) { if (er) return cb(er) fs.readFile(tarball, function(er, tarbuffer) { if (er) return cb(er) - putFirst.call(self, data, tarbuffer, s, username, email, cb) + putFirst.call(self, uri, data, tarbuffer, s, username, email, cb) }) }) } -function putFirst (data, tarbuffer, stat, username, email, cb) { +function putFirst (registry, data, tarbuffer, stat, username, email, cb) { // optimistically try to PUT all in one single atomic thing. // If 409, then GET and merge, try again. // If other error, then fail. @@ -59,7 +59,6 @@ function putFirst (data, tarbuffer, stat, username, email, cb) { var tag = data.tag || this.conf.get('tag') || "latest" root["dist-tags"][tag] = data.version - var registry = this.conf.get('registry') var tbName = data.name + "-" + data.version + ".tgz" , tbURI = data.name + "/-/" + tbName @@ -76,7 +75,8 @@ function putFirst (data, tarbuffer, stat, username, email, cb) { length: stat.size }; - this.request("PUT", data.name, root, function (er, parsed, json, res) { + var fixed = url.resolve(registry, data.name) + this.request("PUT", fixed, { body : root }, function (er, parsed, json, res) { var r409 = "must supply latest _rev to update existing package" var r409b = "Document update conflict." var conflict = res && res.statusCode === 409 @@ -94,16 +94,16 @@ function putFirst (data, tarbuffer, stat, username, email, cb) { return cb(er, parsed, json, res) // let's see what versions are already published. - var getUrl = data.name + "?write=true" - this.request("GET", getUrl, function (er, current) { - if (er) - return cb(er) - putNext.call(this, data.version, root, current, cb) + var getUrl = url.resolve(registry, data.name + "?write=true") + this.request("GET", getUrl, null, function (er, current) { + if (er) return cb(er) + + putNext.call(this, registry, data.version, root, current, cb) }.bind(this)) }.bind(this)) } -function putNext(newVersion, root, current, cb) { +function putNext(registry, newVersion, root, current, cb) { // already have the tardata on the root object // just merge in existing stuff var curVers = Object.keys(current.versions || {}).map(function (v) { @@ -143,7 +143,7 @@ function putNext(newVersion, root, current, cb) { var maint = JSON.parse(JSON.stringify(root.maintainers)) root.versions[newVersion].maintainers = maint - this.request("PUT", root.name, current, cb) + this.request("PUT", url.resolve(registry, root.name), { body : current }, cb) } function conflictError (pkgid, version) { diff --git a/deps/npm/node_modules/npm-registry-client/lib/request.js b/deps/npm/node_modules/npm-registry-client/lib/request.js index 4af0b8ff3c2..bad31b7ea6e 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/request.js +++ b/deps/npm/node_modules/npm-registry-client/lib/request.js @@ -2,27 +2,52 @@ module.exports = regRequest var url = require("url") , zlib = require("zlib") + , assert = require("assert") , rm = require("rimraf") - , asyncMap = require("slide").asyncMap , Stream = require("stream").Stream , request = require("request") , retry = require("retry") , crypto = require("crypto") , pkg = require("../package.json") -function regRequest (method, where, what, etag, nofollow, cb_) { - if (typeof cb_ !== "function") cb_ = nofollow, nofollow = false - if (typeof cb_ !== "function") cb_ = etag, etag = null - if (typeof cb_ !== "function") cb_ = what, what = null + +// npm: means +// 1. https +// 2. send authorization +// 3. content-type is 'application/json' -- metadata +function regRequest (method, uri, options, cb_) { + assert(uri, "must pass resource to load") + assert(cb_, "must pass callback") + + options = options || {} + var nofollow = (typeof options.follow === 'boolean' ? !options.follow : false) + var etag = options.etag + var what = options.body + + var parsed = url.parse(uri) + + var authThis = false + if (parsed.protocol === "npm") { + parsed.protocol = "https" + authThis = true + } + + var where = parsed.pathname + if (parsed.search) { + where = where + parsed.search + parsed.search = "" + } + parsed.pathname = "/" + this.log.verbose("request", "where is", where) + + var registry = url.format(parsed) + this.log.verbose("request", "registry", registry) if (!this.sessionToken) { this.sessionToken = crypto.randomBytes(8).toString("hex") + this.log.verbose("request id", this.sessionToken) } - var registry = this.conf.get('registry') - if (!registry) return cb(new Error( - "No registry url provided: " + method + " " + where)) - // Since there are multiple places where an error could occur, // don't let the cb be called more than once. var errState = null @@ -43,7 +68,7 @@ function regRequest (method, where, what, etag, nofollow, cb_) { , alwaysAuth = this.conf.get('always-auth') , isDel = method === "DELETE" , isWrite = what || isDel - , authRequired = (alwaysAuth || isWrite) && !nu || uc || isDel + , authRequired = (authThis || alwaysAuth || isWrite) && !nu || uc || isDel // resolve to a full url on the registry if (!where.match(/^https?:\/\//)) { @@ -66,6 +91,7 @@ function regRequest (method, where, what, etag, nofollow, cb_) { where = url.resolve(registry, where) this.log.verbose("url resolved", where) } + this.log.verbose("request", "where is", where) var remote = url.parse(where) , auth = this.conf.get('_auth') diff --git a/deps/npm/node_modules/npm-registry-client/lib/star.js b/deps/npm/node_modules/npm-registry-client/lib/star.js index 23fbd916923..c0590f1e2ee 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/star.js +++ b/deps/npm/node_modules/npm-registry-client/lib/star.js @@ -1,11 +1,11 @@ module.exports = star -function star (package, starred, cb) { +function star (uri, starred, cb) { if (!this.conf.get('username')) return cb(new Error( "Must be logged in to star/unstar packages")) - this.request("GET", package + '?write=true', function (er, fullData) { + this.request("GET", uri+"?write=true", null, function (er, fullData) { if (er) return cb(er) fullData = { _id: fullData._id @@ -22,6 +22,6 @@ function star (package, starred, cb) { this.log.verbose("unstarring", fullData) } - return this.request("PUT", package, fullData, cb) + return this.request("PUT", uri, { body : fullData }, cb) }.bind(this)) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/stars.js b/deps/npm/node_modules/npm-registry-client/lib/stars.js index 4ef57e2716f..86a252efbb7 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/stars.js +++ b/deps/npm/node_modules/npm-registry-client/lib/stars.js @@ -1,7 +1,9 @@ +var url = require("url") + module.exports = stars -function stars (name, cb) { +function stars (base, name, cb) { name = encodeURIComponent(name) var path = "/-/_view/starredByUser?key=\""+name+"\"" - this.request("GET", path, cb) + this.request("GET", url.resolve(base, path), null, cb) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/tag.js b/deps/npm/node_modules/npm-registry-client/lib/tag.js index d7ebf08a66c..65430fe9307 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/tag.js +++ b/deps/npm/node_modules/npm-registry-client/lib/tag.js @@ -1,6 +1,5 @@ - module.exports = tag -function tag (project, version, tagName, cb) { - this.request("PUT", project+"/"+tagName, JSON.stringify(version), cb) +function tag (uri, version, tagName, cb) { + this.request("PUT", uri+"/"+tagName, { body : JSON.stringify(version) }, cb) } diff --git a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js index 1887a99e641..6a4ac8a1916 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/unpublish.js +++ b/deps/npm/node_modules/npm-registry-client/lib/unpublish.js @@ -11,19 +11,18 @@ var semver = require("semver") , url = require("url") , chain = require("slide").chain -function unpublish (name, ver, cb) { +function unpublish (uri, ver, cb) { if (typeof cb !== "function") cb = ver, ver = null - var u = name + '?write=true' - this.get(u, null, -1, true, function (er, data) { + this.get(uri + "?write=true", { timeout : -1, follow : false }, function (er, data) { if (er) { - this.log.info("unpublish", name+" not published") + this.log.info("unpublish", uri+" not published") return cb() } // remove all if no version specified if (!ver) { this.log.info("unpublish", "No version specified, removing all") - return this.request("DELETE", name+'/-rev/'+data._rev, cb) + return this.request("DELETE", uri+'/-rev/'+data._rev, null, cb) } var versions = data.versions || {} @@ -31,7 +30,7 @@ function unpublish (name, ver, cb) { var dist if (!versionPublic) { - this.log.info("unpublish", name+"@"+ver+" not published") + this.log.info("unpublish", uri+"@"+ver+" not published") } else { dist = versions[ver].dist this.log.verbose("unpublish", "removing attachments", dist) @@ -41,7 +40,7 @@ function unpublish (name, ver, cb) { // if it was the only version, then delete the whole package. if (!Object.keys(versions).length) { this.log.info("unpublish", "No versions remain, removing entire package") - return this.request("DELETE", name+"/-rev/"+data._rev, cb) + return this.request("DELETE", uri + "/-rev/" + data._rev, null, cb) } if (!versionPublic) return cb() @@ -59,8 +58,9 @@ function unpublish (name, ver, cb) { var rev = data._rev delete data._revisions delete data._attachments - var cb_ = detacher.call(this, data, dist, cb) - this.request("PUT", name+"/-rev/"+rev, data, function (er) { + var cb_ = detacher.call(this, uri, data, dist, cb) + + this.request("PUT", uri + "/-rev/" + rev, { body : data }, function (er) { if (er) { this.log.error("unpublish", "Failed to update data") } @@ -69,20 +69,20 @@ function unpublish (name, ver, cb) { }.bind(this)) } -function detacher (data, dist, cb) { +function detacher (uri, data, dist, cb) { return function (er) { if (er) return cb(er) - this.get(data.name, function (er, data) { + this.get(url.resolve(uri, data.name), null, function (er, data) { if (er) return cb(er) var tb = url.parse(dist.tarball) - detach.call(this, data, tb.pathname, data._rev, function (er) { + detach.call(this, uri, data, tb.pathname, data._rev, function (er) { if (er || !dist.bin) return cb(er) chain(Object.keys(dist.bin).map(function (bt) { return function (cb) { var d = dist.bin[bt] - detach.call(this, data, url.parse(d.tarball).pathname, null, cb) + detach.call(this, uri, data, url.parse(d.tarball).pathname, null, cb) }.bind(this) }, this), cb) }.bind(this)) @@ -90,13 +90,13 @@ function detacher (data, dist, cb) { }.bind(this) } -function detach (data, path, rev, cb) { +function detach (uri, data, path, rev, cb) { if (rev) { path += "/-rev/" + rev this.log.info("detach", path) - return this.request("DELETE", path, cb) + return this.request("DELETE", url.resolve(uri, path), null, cb) } - this.get(data.name, function (er, data) { + this.get(url.resolve(uri, data.name), null, function (er, data) { rev = data._rev if (!rev) return cb(new Error( "No _rev found in "+data._id)) diff --git a/deps/npm/node_modules/npm-registry-client/lib/upload.js b/deps/npm/node_modules/npm-registry-client/lib/upload.js index 2418997b441..f624a266c42 100644 --- a/deps/npm/node_modules/npm-registry-client/lib/upload.js +++ b/deps/npm/node_modules/npm-registry-client/lib/upload.js @@ -3,12 +3,12 @@ module.exports = upload var fs = require('fs') , Stream = require("stream").Stream -function upload (where, file, etag, nofollow, cb) { +function upload (uri, file, etag, nofollow, cb) { if (typeof nofollow === "function") cb = nofollow, nofollow = false if (typeof etag === "function") cb = etag, etag = null if (file instanceof Stream) { - return this.request("PUT", where, file, etag, nofollow, cb) + return this.request("PUT", uri, { body : file, etag : etag, follow : !nofollow }, cb) } fs.stat(file, function (er, stat) { @@ -17,6 +17,6 @@ function upload (where, file, etag, nofollow, cb) { s.size = stat.size s.on("error", cb) - this.request("PUT", where, s, etag, nofollow, cb) + this.request("PUT", uri, { body : s, etag : etag, follow : !nofollow }, cb) }.bind(this)) } diff --git a/deps/npm/node_modules/npm-registry-client/package.json b/deps/npm/node_modules/npm-registry-client/package.json index c5b1cec6db8..b377643037d 100644 --- a/deps/npm/node_modules/npm-registry-client/package.json +++ b/deps/npm/node_modules/npm-registry-client/package.json @@ -6,7 +6,7 @@ }, "name": "npm-registry-client", "description": "Client for the npm registry", - "version": "1.0.0", + "version": "2.0.3", "repository": { "url": "git://github.com/isaacs/npm-registry-client" }, @@ -16,7 +16,7 @@ }, "dependencies": { "chownr": "0", - "graceful-fs": "~2.0.0", + "graceful-fs": "^3.0.0", "mkdirp": "~0.3.3", "npm-cache-filename": "^1.0.0", "request": "2 >=2.25.0", @@ -33,13 +33,14 @@ "npmlog": "" }, "license": "BSD", - "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\n\nclient.get(\"npm\", \"latest\", 1000, function (er, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Configuration\n\nThis program is designed to work with\n[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\na plain-jane object with the appropriate configs, and it'll shim it\nfor you. Any configuration thingie that has get/set/del methods will\nalso be accepted.\n\n* `registry` **Required** {String} URL to the registry\n* `cache` **Required** {String} Path to the cache folder\n* `always-auth` {Boolean} Auth even for GET requests.\n* `auth` {String} A base64-encoded `username:password`\n* `email` {String} User's email address\n* `tag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `ca` {String} Cerficate signing authority certificates to trust.\n* `cert` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates\n* `key` {String} Private key (PEM encoded) for client certificate 'cert'\n* `strict-ssl` {Boolean} Whether or not to be strict with SSL\n certificates. Default = `true`\n* `user-agent` {String} User agent header to send. Default =\n `\"node/{process.version} {process.platform} {process.arch}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `fetch-retries` {Number} Number of times to retry on GET failures.\n Default=2\n* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\n* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\n Default=10000 (10 seconds)\n* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default=60000 (60 seconds)\n* `proxy` {URL} The url to proxy requests through.\n* `https-proxy` {URL} The url to proxy https requests through.\n Defaults to be the same as `proxy` if unset.\n* `_auth` {String} The base64-encoded authorization header.\n* `username` `_password` {String} Username/password to use to generate\n `_auth` if not supplied.\n* `_token` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login)\n\n# client.request(method, where, [what], [etag], [nofollow], cb)\n\n* `method` {String} HTTP method\n* `where` {String} Path to request on the server\n* `what` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON.\n* `etag` {String} The cached ETag\n* `nofollow` {Boolean} Prevent following 302/301 responses\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a request to the registry. All the other methods are wrappers\naround this. one.\n\n# client.adduser(username, password, email, cb)\n\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `cb` {Function}\n\nAdd a user account to the registry, or verify the credentials.\n\n# client.deprecate(name, version, message, cb)\n\n* `name` {String} The package name\n* `version` {String} Semver version range\n* `message` {String} The message to use as a deprecation warning\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n# client.bugs(name, cb)\n\n* `name` {String} the name of the package\n* `cb` {Function}\n\nGet the url for bugs of a package\n\n# client.get(url, [timeout], [nofollow], [staleOk], cb)\n\n* `url` {String} The url path to fetch\n* `timeout` {Number} Number of seconds old that a cached copy must be\n before a new request will be made.\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `staleOk` {Boolean} If there's cached data available, then return that\n to the callback quickly, and update the cache the background.\n\nFetches data from the registry via a GET request, saving it in\nthe cache folder with the ETag.\n\n# client.publish(data, tarball, cb)\n\n* `data` {Object} Package data\n* `tarball` {String | Stream} Filename or stream of the package tarball\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder. However, it\ncan accept a gzipped tar stream or a filename to a tarball.\n\n# client.star(package, starred, cb)\n\n* `package` {String} Name of the package to star\n* `starred` {Boolean} True to star the package, false to unstar it.\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or\nunstar a package, though other writes do require that the user be the\npackage owner.\n\n# client.stars(username, cb)\n\n* `username` {String} Name of user to fetch starred packages for.\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n# client.tag(project, version, tag, cb)\n\n* `project` {String} Project name\n* `version` {String} Version to tag\n* `tag` {String} Tag name to apply\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag`\nwill fetch the specified version.\n\n# client.unpublish(name, [ver], cb)\n\n* `name` {String} package name\n* `ver` {String} version to unpublish. Leave blank to unpublish all\n versions.\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When\nthe last version us unpublished, the entire document is removed from the\ndatabase.\n\n# client.upload(where, file, [etag], [nofollow], cb)\n\n* `where` {String} URL path to upload to\n* `file` {String | Stream} Either the filename or a readable stream\n* `etag` {String} Cache ETag\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `cb` {Function}\n\nUpload an attachment. Mostly used by `client.publish()`.\n", + "readme": "# npm-registry-client\n\nThe code that npm uses to talk to the registry.\n\nIt handles all the caching and HTTP calls.\n\n## Usage\n\n```javascript\nvar RegClient = require('npm-registry-client')\nvar client = new RegClient(config)\nvar uri = \"npm://registry.npmjs.org/npm\"\nvar options = {timeout: 1000}\n\nclient.get(uri, options, function (error, data, raw, res) {\n // error is an error if there was a problem.\n // data is the parsed data object\n // raw is the json string\n // res is the response from couch\n})\n```\n\n# Registry URLs\n\nThe registry calls take either a full URL pointing to a resource in the\nregistry, or a base URL for the registry as a whole (for the base URL, any path\nwill be ignored). In addition to `http` and `https`, `npm` URLs are allowed.\n`npm` URLs are `https` URLs with the additional restrictions that they will\nalways include authorization credentials, and the response is always registry\nmetadata (and not tarballs or other attachments).\n\n# Configuration\n\nThis program is designed to work with\n[npmconf](https://npmjs.org/package/npmconf), but you can also pass in\na plain-jane object with the appropriate configs, and it'll shim it\nfor you. Any configuration thingie that has get/set/del methods will\nalso be accepted.\n\n* `cache` **Required** {String} Path to the cache folder\n* `always-auth` {Boolean} Auth even for GET requests.\n* `auth` {String} A base64-encoded `username:password`\n* `email` {String} User's email address\n* `tag` {String} The default tag to use when publishing new packages.\n Default = `\"latest\"`\n* `ca` {String} Cerficate signing authority certificates to trust.\n* `cert` {String} Client certificate (PEM encoded). Enable access\n to servers that require client certificates\n* `key` {String} Private key (PEM encoded) for client certificate 'cert'\n* `strict-ssl` {Boolean} Whether or not to be strict with SSL\n certificates. Default = `true`\n* `user-agent` {String} User agent header to send. Default =\n `\"node/{process.version} {process.platform} {process.arch}\"`\n* `log` {Object} The logger to use. Defaults to `require(\"npmlog\")` if\n that works, otherwise logs are disabled.\n* `fetch-retries` {Number} Number of times to retry on GET failures.\n Default=2\n* `fetch-retry-factor` {Number} `factor` setting for `node-retry`. Default=10\n* `fetch-retry-mintimeout` {Number} `minTimeout` setting for `node-retry`.\n Default=10000 (10 seconds)\n* `fetch-retry-maxtimeout` {Number} `maxTimeout` setting for `node-retry`.\n Default=60000 (60 seconds)\n* `proxy` {URL} The url to proxy requests through.\n* `https-proxy` {URL} The url to proxy https requests through.\n Defaults to be the same as `proxy` if unset.\n* `_auth` {String} The base64-encoded authorization header.\n* `username` `_password` {String} Username/password to use to generate\n `_auth` if not supplied.\n* `_token` {Object} A token for use with\n [couch-login](https://npmjs.org/package/couch-login)\n\n# client.request(method, uri, options, cb)\n\n* `method` {String} HTTP method\n* `uri` {String} URI pointing to the resource to request\n* `options` {Object} Object containing optional per-request properties.\n * `what` {Stream | Buffer | String | Object} The request body. Objects\n that are not Buffers or Streams are encoded as JSON.\n * `etag` {String} The cached ETag\n * `follow` {Boolean} Follow 302/301 responses (defaults to true)\n* `cb` {Function}\n * `error` {Error | null}\n * `data` {Object} the parsed data object\n * `raw` {String} the json\n * `res` {Response Object} response from couch\n\nMake a request to the registry. All the other methods are wrappers around\n`request`.\n\n# client.adduser(base, username, password, email, cb)\n\n* `base` {String} Base registry URL\n* `username` {String}\n* `password` {String}\n* `email` {String}\n* `cb` {Function}\n\nAdd a user account to the registry, or verify the credentials.\n\n# client.deprecate(uri, version, message, cb)\n\n* `uri` {String} Full registry URI for the deprecated package\n* `version` {String} Semver version range\n* `message` {String} The message to use as a deprecation warning\n* `cb` {Function}\n\nDeprecate a version of a package in the registry.\n\n# client.bugs(uri, cb)\n\n* `uri` {String} Full registry URI for the package\n* `cb` {Function}\n\nGet the url for bugs of a package\n\n# client.get(uri, options, cb)\n\n* `uri` {String} The complete registry URI to fetch\n* `options` {Object} Object containing optional per-request properties.\n * `timeout` {Number} Duration before the request times out.\n * `follow` {Boolean} Follow 302/301 responses (defaults to true)\n * `staleOk` {Boolean} If there's cached data available, then return that\n to the callback quickly, and update the cache the background.\n\nFetches data from the registry via a GET request, saving it in the cache folder\nwith the ETag.\n\n# client.publish(uri, data, tarball, cb)\n\n* `uri` {String} The registry URI to publish to\n* `data` {Object} Package data\n* `tarball` {String | Stream} Filename or stream of the package tarball\n* `cb` {Function}\n\nPublish a package to the registry.\n\nNote that this does not create the tarball from a folder. However, it can\naccept a gzipped tar stream or a filename to a tarball.\n\n# client.star(uri, starred, cb)\n\n* `uri` {String} The complete registry URI to star\n* `starred` {Boolean} True to star the package, false to unstar it.\n* `cb` {Function}\n\nStar or unstar a package.\n\nNote that the user does not have to be the package owner to star or unstar a\npackage, though other writes do require that the user be the package owner.\n\n# client.stars(base, username, cb)\n\n* `base` {String} The base URL for the registry\n* `username` {String} Name of user to fetch starred packages for.\n* `cb` {Function}\n\nView your own or another user's starred packages.\n\n# client.tag(uri, version, tag, cb)\n\n* `uri` {String} The complete registry URI to tag\n* `version` {String} Version to tag\n* `tag` {String} Tag name to apply\n* `cb` {Function}\n\nMark a version in the `dist-tags` hash, so that `pkg@tag` will fetch the\nspecified version.\n\n# client.unpublish(uri, [ver], cb)\n\n* `uri` {String} The complete registry URI to unpublish\n* `ver` {String} version to unpublish. Leave blank to unpublish all\n versions.\n* `cb` {Function}\n\nRemove a version of a package (or all versions) from the registry. When the\nlast version us unpublished, the entire document is removed from the database.\n\n# client.upload(uri, file, [etag], [nofollow], cb)\n\n* `uri` {String} The complete registry URI to upload to\n* `file` {String | Stream} Either the filename or a readable stream\n* `etag` {String} Cache ETag\n* `nofollow` {Boolean} Do not follow 301/302 responses\n* `cb` {Function}\n\nUpload an attachment. Mostly used by `client.publish()`.\n", "readmeFilename": "README.md", + "gitHead": "2578fb9a807d77417554ba235ba8fac39405e832", "bugs": { "url": "https://github.com/isaacs/npm-registry-client/issues" }, "homepage": "https://github.com/isaacs/npm-registry-client", - "_id": "npm-registry-client@1.0.0", - "_shasum": "2a6f9dfdce5f8ebf4b9af4dbfd738384d25014e5", - "_from": "npm-registry-client@1" + "_id": "npm-registry-client@2.0.3", + "_shasum": "93dad3d9a162c99404badb71739c622c0f3b9a72", + "_from": "npm-registry-client@2.0.3" } diff --git a/deps/npm/node_modules/npm-registry-client/test/00-setup.js b/deps/npm/node_modules/npm-registry-client/test/00-setup.js index 747768fb85f..ae6d03ed3f3 100644 --- a/deps/npm/node_modules/npm-registry-client/test/00-setup.js +++ b/deps/npm/node_modules/npm-registry-client/test/00-setup.js @@ -1,10 +1,10 @@ -var tap = require('tap') -var rimraf = require('rimraf') +var tap = require("tap") +var rimraf = require("rimraf") -tap.test('setup', function (t) { - rimraf(__dirname + '/fixtures/cache', function (er) { +tap.test("setup", function (t) { + rimraf(__dirname + "/fixtures/cache", function (er) { if (er) throw er - t.pass('cache cleaned') + t.pass("cache cleaned") t.end() }) }) diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-new.js b/deps/npm/node_modules/npm-registry-client/test/adduser-new.js index 96dfc26d159..6cedf94d14b 100644 --- a/deps/npm/node_modules/npm-registry-client/test/adduser-new.js +++ b/deps/npm/node_modules/npm-registry-client/test/adduser-new.js @@ -1,26 +1,21 @@ -var tap = require('tap') -var server = require('./fixtures/server.js') -var RC = require('../') -var client = new RC({ - cache: __dirname + '/fixtures/cache' - , registry: 'http://localhost:' + server.port }) +var tap = require("tap") -var userdata = -{ name: 'username', - email: 'i@izs.me', - _id: 'org.couchdb.user:username', - type: 'user', - roles: [], - date: '2012-06-07T04:11:21.591Z' } -, password = "password" -, username = "username" -, crypto = require("crypto") -, SD = require('string_decoder').StringDecoder -, decoder = new SD +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient() -function sha (s) { - return crypto.createHash("sha1").update(s).digest("hex") -} +var password = "password" +, username = "username" +, email = "i@izs.me" +, userdata = { + name: username, + email: email, + _id: "org.couchdb.user:username", + type: "user", + roles: [], + date: "2012-06-07T04:11:21.591Z" } +, SD = require("string_decoder").StringDecoder +, decoder = new SD() tap.test("create new user account", function (t) { server.expect("/-/user/org.couchdb.user:username", function (req, res) { @@ -41,7 +36,7 @@ tap.test("create new user account", function (t) { }) }) - client.adduser(username, password, "i@izs.me", function (er, data, raw, res) { + client.adduser("http://localhost:1337/", username, password, email, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js index 3704571475c..551c9843ed3 100644 --- a/deps/npm/node_modules/npm-registry-client/test/adduser-update.js +++ b/deps/npm/node_modules/npm-registry-client/test/adduser-update.js @@ -1,29 +1,22 @@ -var tap = require('tap') -var server = require('./fixtures/server.js') -var RC = require('../') -var client = new RC({ - cache: __dirname + '/fixtures/cache' - , registry: 'http://localhost:' + server.port }) +var tap = require("tap") -var userdata = -{ name: 'username', - email: 'i@izs.me', - _id: 'org.couchdb.user:username', - type: 'user', - roles: [], - _rev: "1-15aac515ac515aac515aac515aac5125" -} +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient() -, password = "password" +var password = "password" , username = "username" -, crypto = require("crypto") -, SD = require('string_decoder').StringDecoder -, decoder = new SD - +, email = "i@izs.me" +, userdata = { + name: username, + email: email, + _id: "org.couchdb.user:username", + type: "user", + roles: [], + date: "2012-06-07T04:11:21.591Z" } +, SD = require("string_decoder").StringDecoder +, decoder = new SD() -function sha (s) { - return crypto.createHash("sha1").update(s).digest("hex") -} tap.test("update a user acct", function (t) { server.expect("PUT", "/-/user/org.couchdb.user:username", function (req, res) { @@ -56,9 +49,7 @@ tap.test("update a user acct", function (t) { }) }) - - - client.adduser(username, password, "i@izs.me", function (er, data, raw, res) { + client.adduser("http://localhost:1337/", username, password, email, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/basic.js b/deps/npm/node_modules/npm-registry-client/test/basic.js deleted file mode 100644 index 022466aeea6..00000000000 --- a/deps/npm/node_modules/npm-registry-client/test/basic.js +++ /dev/null @@ -1,32 +0,0 @@ -var tap = require('tap') -var server = require('./fixtures/server.js') -var RC = require('../') -var rimraf = require("rimraf") -var client = new RC({ - cache: __dirname + '/fixtures/cache' - , registry: 'http://localhost:' + server.port }) -var us = require('./fixtures/underscore/1.3.3/cache.json') -var usroot = require("./fixtures/underscore/cache.json") - -tap.test("basic request", function (t) { - server.expect("/underscore/1.3.3", function (req, res) { - console.error('got a request') - res.json(us) - }) - - server.expect("/underscore", function (req, res) { - console.error('got a request') - res.json(usroot) - }) - - t.plan(2) - client.get("/underscore/1.3.3", function (er, data, raw, res) { - console.error("got response") - t.deepEqual(data, us) - }) - - client.get("/underscore", function (er, data, raw, res) { - console.error("got response") - t.deepEqual(data, usroot) - }) -}) diff --git a/deps/npm/node_modules/npm-registry-client/test/bugs.js b/deps/npm/node_modules/npm-registry-client/test/bugs.js new file mode 100644 index 00000000000..092ec9f7910 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/bugs.js @@ -0,0 +1,33 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + _auth : new Buffer("username : password").toString("base64"), + "always-auth" : true +}) + +tap.test("get the URL for the bugs page on a package", function (t) { + server.expect("GET", "/sample/latest", function (req, res) { + t.equal(req.method, "GET") + + res.json({ + bugs : { + url : "http://github.com/example/sample/issues", + email : "sample@example.com" + } + }) + }) + + client.bugs("http://localhost:1337/sample", function (error, info) { + t.notOk(error, "no errors") + t.ok(info.url, "got the URL") + t.ok(info.email, "got the email address") + + t.end() + }) +}) + diff --git a/deps/npm/node_modules/npm-registry-client/test/deprecate.js b/deps/npm/node_modules/npm-registry-client/test/deprecate.js new file mode 100644 index 00000000000..52c21b2f8e0 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/deprecate.js @@ -0,0 +1,66 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + _auth : new Buffer("username : password").toString("base64"), + "always-auth" : true +}) + +var cache = require("./fixtures/underscore/cache.json") + +var VERSION = "1.3.2" +var MESSAGE = "uhhh" + +tap.test("deprecate a package", function (t) { + server.expect("GET", "/underscore?write=true", function (req, res) { + t.equal(req.method, "GET") + + res.json(cache) + }) + + server.expect("PUT", "/underscore", function (req, res) { + t.equal(req.method, "PUT") + + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var updated = JSON.parse(b) + + var undeprecated = [ + "1.0.3", "1.0.4", "1.1.0", "1.1.1", "1.1.2", "1.1.3", "1.1.4", "1.1.5", "1.1.6", + "1.1.7", "1.2.0", "1.2.1", "1.2.2", "1.2.3", "1.2.4", "1.3.0", "1.3.1", "1.3.3" + ] + for (var i = 0; i < undeprecated.length; i++) { + var current = undeprecated[i] + t.notEqual( + updated.versions[current].deprecated, + MESSAGE, + current + " not deprecated" + ) + } + + t.equal( + updated.versions[VERSION].deprecated, + MESSAGE, + VERSION + " deprecated" + ) + res.statusCode = 201 + res.json({deprecated:true}) + }) + }) + + client.deprecate("http://localhost:1337/underscore", VERSION, MESSAGE, function (error, data) { + t.notOk(error, "no errors") + t.ok(data.deprecated, "was deprecated") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-all.js b/deps/npm/node_modules/npm-registry-client/test/get-all.js new file mode 100644 index 00000000000..86978b26703 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/get-all.js @@ -0,0 +1,16 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient() + +tap.test("basic request", function (t) { + server.expect("/-/all", function (req, res) { + res.json([]) + }) + + client.get("http://localhost:1337/-/all", null, function (er) { + t.notOk(er, "no error") + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/get-basic.js b/deps/npm/node_modules/npm-registry-client/test/get-basic.js new file mode 100644 index 00000000000..10c48b0b876 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/get-basic.js @@ -0,0 +1,27 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient() + +var us = require("./fixtures/underscore/1.3.3/cache.json") +var usroot = require("./fixtures/underscore/cache.json") + +tap.test("basic request", function (t) { + server.expect("/underscore/1.3.3", function (req, res) { + res.json(us) + }) + + server.expect("/underscore", function (req, res) { + res.json(usroot) + }) + + t.plan(2) + client.get("http://localhost:1337/underscore/1.3.3", null, function (er, data) { + t.deepEqual(data, us) + }) + + client.get("http://localhost:1337/underscore", null, function (er, data) { + t.deepEqual(data, usroot) + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/lib/common.js b/deps/npm/node_modules/npm-registry-client/test/lib/common.js new file mode 100644 index 00000000000..f9048c09453 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/lib/common.js @@ -0,0 +1,17 @@ +var resolve = require("path").resolve +var server = require('./server.js') +var RC = require('../../') + +module.exports = { + freshClient : function freshClient(config) { + config = config || {} + config.cache = resolve(__dirname, '../fixtures/cache') + config.registry = 'http://localhost:' + server.port + + var client = new RC(config) + server.log = client.log + client.log.level = 'silent' + + return client + } +} diff --git a/deps/npm/node_modules/npm-registry-client/test/fixtures/server.js b/deps/npm/node_modules/npm-registry-client/test/lib/server.js similarity index 84% rename from deps/npm/node_modules/npm-registry-client/test/fixtures/server.js rename to deps/npm/node_modules/npm-registry-client/test/lib/server.js index 80bbf4803b3..03d3cd1fc6e 100644 --- a/deps/npm/node_modules/npm-registry-client/test/fixtures/server.js +++ b/deps/npm/node_modules/npm-registry-client/test/lib/server.js @@ -9,7 +9,6 @@ module.exports = server server._expect = {} -var expect = {} function handler (req, res) { req.connection.setTimeout(1000) @@ -27,8 +26,8 @@ function handler (req, res) { return s + server._expect[k].length }, 0)) if (remain === 0) server.close() - else console.error("TEST SERVER: %d reqs remain", remain) - console.error(Object.keys(server._expect).map(function(k) { + else this.log.info("fake-registry", "TEST SERVER: %d reqs remain", remain) + this.log.info("fake-registry", Object.keys(server._expect).map(function(k) { return [k, server._expect[k].length] }).reduce(function (acc, kv) { acc[kv[0]] = kv[1] @@ -44,6 +43,9 @@ function json (o) { this.end(JSON.stringify(o)) } +// this log is meanto to be overridden +server.log = require("npmlog") + server.expect = function (method, u, fn) { if (typeof u === 'function') { fn = u diff --git a/deps/npm/node_modules/npm-registry-client/test/publish-again.js b/deps/npm/node_modules/npm-registry-client/test/publish-again.js index 011fbaf5afa..af59980b3e2 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish-again.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish-again.js @@ -1,24 +1,22 @@ -var tap = require('tap') -var server = require('./fixtures/server.js') -var RC = require('../') -var client = new RC( - { cache: __dirname + '/fixtures/cache' - , registry: 'http://localhost:' + server.port - , username: "username" - , password: "password" - , email: "i@izs.me" - , _auth: new Buffer("username:password").toString('base64') - , "always-auth": true - }) - +var tap = require("tap") var fs = require("fs") +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + username: "username", + password: "password", + email: "i@izs.me", + _auth: new Buffer("username:password").toString("base64"), + "always-auth": true +}) + tap.test("publish again", function (t) { var lastTime = null server.expect("/npm-registry-client", function (req, res) { t.equal(req.method, "PUT") var b = "" - req.setEncoding('utf8') + req.setEncoding("utf8") req.on("data", function (d) { b += d }) @@ -28,8 +26,8 @@ tap.test("publish again", function (t) { t.equal(o._id, "npm-registry-client") t.equal(o["dist-tags"].latest, pkg.version) t.has(o.versions[pkg.version], pkg) - t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) - var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] + t.same(o.maintainers, [ { name: "username", email: "i@izs.me" } ]) + var att = o._attachments[ pkg.name + "-" + pkg.version + ".tgz" ] t.same(att.data, pd) res.statusCode = 409 res.json({reason: "must supply latest _rev to update existing package"}) @@ -54,7 +52,7 @@ tap.test("publish again", function (t) { t.ok(lastTime) var b = "" - req.setEncoding('utf8') + req.setEncoding("utf8") req.on("data", function (d) { b += d }) @@ -70,10 +68,10 @@ tap.test("publish again", function (t) { // not really a tarball, but doesn't matter - var tarball = require.resolve('../package.json') - var pd = fs.readFileSync(tarball, 'base64') - var pkg = require('../package.json') - client.publish(pkg, tarball, function (er, data, raw, res) { + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/publish.js b/deps/npm/node_modules/npm-registry-client/test/publish.js index 9dcfc33740f..a6233905f36 100644 --- a/deps/npm/node_modules/npm-registry-client/test/publish.js +++ b/deps/npm/node_modules/npm-registry-client/test/publish.js @@ -1,24 +1,23 @@ -var tap = require('tap') -var crypto = require('crypto') -var server = require('./fixtures/server.js') -var RC = require('../') -var client = new RC( - { cache: __dirname + '/fixtures/cache' - , registry: 'http://localhost:' + server.port - , username: "username" - , password: "password" - , email: "i@izs.me" - , _auth: new Buffer("username:password").toString('base64') - , "always-auth": true - }) - +var tap = require("tap") +var crypto = require("crypto") var fs = require("fs") +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + username: "username", + password: "password", + email: "i@izs.me", + _auth: new Buffer("username:password").toString("base64"), + "always-auth": true +}) + + tap.test("publish", function (t) { server.expect("/npm-registry-client", function (req, res) { t.equal(req.method, "PUT") var b = "" - req.setEncoding('utf8') + req.setEncoding("utf8") req.on("data", function (d) { b += d }) @@ -28,11 +27,11 @@ tap.test("publish", function (t) { t.equal(o._id, "npm-registry-client") t.equal(o["dist-tags"].latest, pkg.version) t.has(o.versions[pkg.version], pkg) - t.same(o.maintainers, [ { name: 'username', email: 'i@izs.me' } ]) + t.same(o.maintainers, [ { name: "username", email: "i@izs.me" } ]) t.same(o.maintainers, o.versions[pkg.version].maintainers) - var att = o._attachments[ pkg.name + '-' + pkg.version + '.tgz' ] + var att = o._attachments[ pkg.name + "-" + pkg.version + ".tgz" ] t.same(att.data, pd) - var hash = crypto.createHash('sha1').update(pd, 'base64').digest('hex') + var hash = crypto.createHash("sha1").update(pd, "base64").digest("hex") t.equal(o.versions[pkg.version].dist.shasum, hash) res.statusCode = 201 res.json({created:true}) @@ -40,10 +39,10 @@ tap.test("publish", function (t) { }) // not really a tarball, but doesn't matter - var tarball = require.resolve('../package.json') - var pd = fs.readFileSync(tarball, 'base64') - var pkg = require('../package.json') - client.publish(pkg, tarball, function (er, data, raw, res) { + var tarball = require.resolve("../package.json") + var pd = fs.readFileSync(tarball, "base64") + var pkg = require("../package.json") + client.publish("http://localhost:1337/", pkg, tarball, function (er, data) { if (er) throw er t.deepEqual(data, { created: true }) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/redirects.js b/deps/npm/node_modules/npm-registry-client/test/redirects.js new file mode 100644 index 00000000000..b7ead8795fa --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/redirects.js @@ -0,0 +1,48 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient() + +var pkg = { + _id: "some-package@1.2.3", + name: "some-package", + version: "1.2.3" +} + +tap.test("basic request", function (t) { + // Expect one request for { follow : false } + server.expect("/-/some-package/1.2.3", function (req, res) { + res.writeHead(301, { + "Location": "/some-package/1.2.3" + }) + res.end("Redirecting") + }) + + // Expect 2 requests for { follow : true } + server.expect("/-/some-package/1.2.3", function (req, res) { + res.writeHead(301, { + "Location": "/some-package/1.2.3" + }) + res.end("Redirecting") + }) + + server.expect("/some-package/1.2.3", function (req, res) { + res.json(pkg) + }) + + t.plan(2); + + client.get("http://localhost:1337/-/some-package/1.2.3", { + follow: false + }, function(er, data) { + t.assert(er, "Error must be set"); + }) + + client.get("http://localhost:1337/-/some-package/1.2.3", { + follow: true + }, function(er, data) { + t.deepEqual(data, pkg) + }) +}) + diff --git a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js index 2c7dcae59ea..79c2e8dc02e 100644 --- a/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js +++ b/deps/npm/node_modules/npm-registry-client/test/request-gzip-content.js @@ -1,45 +1,47 @@ -var zlib = require('zlib') -var tap = require('tap') -var server = require('./fixtures/server.js') -var RC = require('../') +var zlib = require("zlib") +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + "fetch-retries" : 1, + "fetch-retry-mintimeout" : 10, + "fetch-retry-maxtimeout" : 100 +}) + +var TEST_URL = "http://localhost:1337/some-package-gzip/1.2.3" + var pkg = { - _id: 'some-package-gzip@1.2.3', - name: 'some-package-gzip', - version: '1.2.3' + _id: "some-package-gzip@1.2.3", + name: "some-package-gzip", + version: "1.2.3" } zlib.gzip(JSON.stringify(pkg), function (err, pkgGzip) { - var client = new RC({ - cache: __dirname + '/fixtures/cache' - , 'fetch-retries': 1 - , 'fetch-retry-mintimeout': 10 - , 'fetch-retry-maxtimeout': 100 - , registry: 'http://localhost:' + server.port }) - - tap.test('request gzip package content', function (t) { - server.expect('GET', '/some-package-gzip/1.2.3', function (req, res) { + tap.test("request gzip package content", function (t) { + server.expect("GET", "/some-package-gzip/1.2.3", function (req, res) { res.statusCode = 200 - res.setHeader('Content-Encoding', 'gzip'); - res.setHeader('Content-Type', 'application/json'); + res.setHeader("Content-Encoding", "gzip"); + res.setHeader("Content-Type", "application/json"); res.end(pkgGzip) }) - client.get('/some-package-gzip/1.2.3', function (er, data, raw, res) { + client.get(TEST_URL, null, function (er, data) { if (er) throw er t.deepEqual(data, pkg) t.end() }) }) - tap.test('request wrong gzip package content', function (t) { - server.expect('GET', '/some-package-gzip-error/1.2.3', function (req, res) { + tap.test("request wrong gzip package content", function (t) { + server.expect("GET", "/some-package-gzip-error/1.2.3", function (req, res) { res.statusCode = 200 - res.setHeader('Content-Encoding', 'gzip') - res.setHeader('Content-Type', 'application/json') - res.end(new Buffer('wrong gzip content')) + res.setHeader("Content-Encoding", "gzip") + res.setHeader("Content-Type", "application/json") + res.end(new Buffer("wrong gzip content")) }) - client.get('/some-package-gzip-error/1.2.3', function (er, data, raw, res) { + client.get(TEST_URL, null, function (er) { t.ok(er) t.end() }) diff --git a/deps/npm/node_modules/npm-registry-client/test/retries.js b/deps/npm/node_modules/npm-registry-client/test/retries.js index 8f0e63f721c..f30f6808018 100644 --- a/deps/npm/node_modules/npm-registry-client/test/retries.js +++ b/deps/npm/node_modules/npm-registry-client/test/retries.js @@ -1,44 +1,47 @@ -var tap = require('tap') -var server = require('./fixtures/server.js') -var RC = require('../') -var pkg = { _id: 'some-package@1.2.3', - name: 'some-package', - version: '1.2.3' } -var client = new RC({ - 'fetch-retries': 6 - , 'fetch-retry-mintimeout': 10 - , 'fetch-retry-maxtimeout': 100 - , cache: __dirname + '/fixtures/cache' - , registry: 'http://localhost:' + server.port }) +var tap = require("tap") -tap.test('create new user account', function (t) { +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + "fetch-retries": 6, + "fetch-retry-mintimeout": 10, + "fetch-retry-maxtimeout": 100 +}) + +var pkg = { + _id : "some-package@1.2.3", + name : "some-package", + version : "1.2.3" +} + +tap.test("create new user account", function (t) { // first time, return a 408 - server.expect('GET', '/some-package/1.2.3', function (req, res) { + server.expect("GET", "/some-package/1.2.3", function (req, res) { res.statusCode = 408 - res.end('Timeout') + res.end("Timeout") }) // then, slam the door in their face - server.expect('GET', '/some-package/1.2.3', function (req, res) { + server.expect("GET", "/some-package/1.2.3", function (req, res) { res.destroy() }) // then, blame someone else - server.expect('GET', '/some-package/1.2.3', function (req, res) { + server.expect("GET", "/some-package/1.2.3", function (req, res) { res.statusCode = 502 - res.end('Gateway Timeout') + res.end("Gateway Timeout") }) // 'No one's home right now, come back later' - server.expect('GET', '/some-package/1.2.3', function (req, res) { + server.expect("GET", "/some-package/1.2.3", function (req, res) { res.statusCode = 503 - res.setHeader('retry-after', '10') - res.end('Come back later') + res.setHeader("retry-after", "10") + res.end("Come back later") }) // finally, you may enter. - server.expect('GET', '/some-package/1.2.3', function (req, res) { + server.expect("GET", "/some-package/1.2.3", function (req, res) { res.statusCode = 200 res.json(pkg) }) - client.get('/some-package/1.2.3', function (er, data, raw, res) { + client.get("http://localhost:1337/some-package/1.2.3", null, function (er, data) { if (er) throw er t.deepEqual(data, pkg) t.end() diff --git a/deps/npm/node_modules/npm-registry-client/test/star.js b/deps/npm/node_modules/npm-registry-client/test/star.js new file mode 100644 index 00000000000..3e140aae82c --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/star.js @@ -0,0 +1,60 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + username : "othiym23", + password : "password", + email : "ogd@aoaioxxysz.net", + _auth : new Buffer("username : password").toString("base64"), + "always-auth" : true +}) + +var cache = require("./fixtures/underscore/cache.json") + +var DEP_USER = "othiym23" + +tap.test("star a package", function (t) { + server.expect("GET", "/underscore?write=true", function (req, res) { + t.equal(req.method, "GET") + + res.json(cache) + }) + + server.expect("PUT", "/underscore", function (req, res) { + t.equal(req.method, "PUT") + + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var updated = JSON.parse(b) + + var already = [ + "vesln", "mvolkmann", "lancehunt", "mikl", "linus", "vasc", "bat", + "dmalam", "mbrevoort", "danielr", "rsimoes", "thlorenz" + ] + for (var i = 0; i < already.length; i++) { + var current = already[i] + t.ok( + updated.users[current], + current + " still likes this package" + ) + } + t.ok(updated.users[DEP_USER], "user is in the starred list") + + res.statusCode = 201 + res.json({starred:true}) + }) + }) + + client.star("http://localhost:1337/underscore", true, function (error, data) { + t.notOk(error, "no errors") + t.ok(data.starred, "was starred") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/stars.js b/deps/npm/node_modules/npm-registry-client/test/stars.js new file mode 100644 index 00000000000..64835c02a62 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/stars.js @@ -0,0 +1,32 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + _auth : new Buffer("username : password").toString("base64"), + "always-auth" : true +}) + +var users = [ + "benjamincoe", + "seldo", + "ceejbot" +] + +tap.test("get the URL for the bugs page on a package", function (t) { + server.expect("GET", "/-/_view/starredByUser?key=%22sample%22", function (req, res) { + t.equal(req.method, "GET") + + res.json(users) + }) + + client.stars("http://localhost:1337/", "sample", function (error, info) { + t.notOk(error, "no errors") + t.deepEqual(info, users, "got the list of users") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/tag.js b/deps/npm/node_modules/npm-registry-client/test/tag.js new file mode 100644 index 00000000000..b8b8e192758 --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/tag.js @@ -0,0 +1,39 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + username : "username", + password : "password", + email : "ogd@aoaioxxysz.net", + _auth : new Buffer("username : password").toString("base64"), + "always-auth" : true +}) + +tap.test("tag a package", function (t) { + server.expect("PUT", "/underscore/not-lodash", function (req, res) { + t.equal(req.method, "PUT") + + var b = "" + req.setEncoding("utf8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var updated = JSON.parse(b) + + t.deepEqual(updated, {"1.3.2":{}}) + + res.statusCode = 201 + res.json({tagged:true}) + }) + }) + + client.tag("http://localhost:1337/underscore", {"1.3.2":{}}, "not-lodash", function (error, data) { + t.notOk(error, "no errors") + t.ok(data.tagged, "was tagged") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/unpublish.js b/deps/npm/node_modules/npm-registry-client/test/unpublish.js new file mode 100644 index 00000000000..e8a209306de --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/unpublish.js @@ -0,0 +1,59 @@ +var tap = require("tap") + +var server = require("./lib/server.js") +var common = require("./lib/common.js") +var client = common.freshClient({ + username : "othiym23", + password : "password", + email : "ogd@aoaioxxysz.net", + _auth : new Buffer("username : password").toString("base64"), + "always-auth" : true +}) + +var cache = require("./fixtures/underscore/cache.json") + +var REV = "/-rev/72-47f2986bfd8e8b55068b204588bbf484" +var VERSION = "1.3.2" + +tap.test("unpublish a package", function (t) { + server.expect("GET", "/underscore?write=true", function (req, res) { + t.equal(req.method, "GET") + + res.json(cache) + }) + + server.expect("PUT", "/underscore" + REV, function (req, res) { + t.equal(req.method, "PUT") + + var b = "" + req.setEncoding("utf-8") + req.on("data", function (d) { + b += d + }) + + req.on("end", function () { + var updated = JSON.parse(b) + t.notOk(updated.versions[VERSION]) + }) + + res.json(cache) + }) + + server.expect("GET", "/underscore", function (req, res) { + t.equal(req.method, "GET") + + res.json(cache) + }) + + server.expect("DELETE", "/underscore/-/underscore-1.3.2.tgz" + REV, function (req, res) { + t.equal(req.method, "DELETE") + + res.json({unpublished:true}) + }) + + client.unpublish("http://localhost:1337/underscore", VERSION, function (error) { + t.notOk(error, "no errors") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/upload.js b/deps/npm/node_modules/npm-registry-client/test/upload.js new file mode 100644 index 00000000000..8884db8f33a --- /dev/null +++ b/deps/npm/node_modules/npm-registry-client/test/upload.js @@ -0,0 +1,37 @@ +var tap = require("tap") +var Readable = require("stream").Readable +var inherits = require("util").inherits + +var common = require("./lib/common.js") +var server = require("./lib/server.js") + +var cache = require("./fixtures/underscore/cache.json") + +var client = common.freshClient({ + username : "othiym23", + password : "password", + email : "ogd@aoaioxxysz.net", + _auth : new Buffer("username : password").toString("base64"), + "always-auth" : true +}) + +function OneA() { + Readable.call(this) + this.push("A") + this.push(null) +} +inherits(OneA, Readable) + +tap.test("unpublish a package", function (t) { + server.expect("PUT", "/underscore", function (req, res) { + t.equal(req.method, "PUT") + + res.json(cache) + }) + + client.upload("http://localhost:1337/underscore", new OneA(), "daedabeefa", true, function (error) { + t.notOk(error, "no errors") + + t.end() + }) +}) diff --git a/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js b/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js index 35253c7acd7..f030b11ee09 100644 --- a/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js +++ b/deps/npm/node_modules/npm-registry-client/test/zz-cleanup.js @@ -1,10 +1,10 @@ -var tap = require('tap') -var rimraf = require('rimraf') +var tap = require("tap") +var rimraf = require("rimraf") -tap.test('teardown', function (t) { - rimraf(__dirname + '/fixtures/cache', function (er) { +tap.test("teardown", function (t) { + rimraf(__dirname + "/fixtures/cache", function (er) { if (er) throw er - t.pass('cache cleaned') + t.pass("cache cleaned") t.end() }) }) diff --git a/deps/npm/node_modules/npmconf/config-defs.js b/deps/npm/node_modules/npmconf/config-defs.js index 7d76f812918..66f4f1b47cc 100644 --- a/deps/npm/node_modules/npmconf/config-defs.js +++ b/deps/npm/node_modules/npmconf/config-defs.js @@ -7,14 +7,15 @@ var path = require("path") , semver = require("semver") , stableFamily = semver.parse(process.version) , nopt = require("nopt") - , os = require('os') + , os = require("os") , osenv = require("osenv") +var log try { - var log = require("npmlog") + log = require("npmlog") } catch (er) { - var util = require('util') - var log = { warn: function (m) { + var util = require("util") + log = { warn: function (m) { console.warn(m + util.format.apply(util, [].slice.call(arguments, 1))) } } } @@ -48,7 +49,7 @@ nopt.typeDefs.semver = { type: semver, validate: validateSemver } nopt.typeDefs.Octal = { type: Octal, validate: validateOctal } nopt.typeDefs.Stream = { type: Stream, validate: validateStream } -nopt.invalidHandler = function (k, val, type, data) { +nopt.invalidHandler = function (k, val, type) { log.warn("invalid config", k + "=" + JSON.stringify(val)) if (Array.isArray(type)) { @@ -118,6 +119,7 @@ Object.defineProperty(exports, "defaults", {get: function () { , browser : null , ca: null + , cafile: null , cache : cache @@ -153,7 +155,7 @@ Object.defineProperty(exports, "defaults", {get: function () { : process.env.SUDO_GID || (process.getgid && process.getgid()) , heading: "npm" , "ignore-scripts": false - , "init-module": path.resolve(home, '.npm-init.js') + , "init-module": path.resolve(home, ".npm-init.js") , "init.author.name" : "" , "init.author.email" : "" , "init.author.url" : "" @@ -190,6 +192,7 @@ Object.defineProperty(exports, "defaults", {get: function () { , "save-exact" : false , "save-optional" : false , "save-prefix": "^" + //, scope : "" , searchopts: "" , searchexclude: null , searchsort: "name" @@ -210,7 +213,7 @@ Object.defineProperty(exports, "defaults", {get: function () { , user : process.platform === "win32" ? 0 : "nobody" , username : "" , userconfig : path.resolve(home, ".npmrc") - , umask: 022 + , umask: process.umask ? process.umask() : parseInt("022", 8) , version : false , versions : false , viewer: process.platform === "win32" ? "browser" : "man" @@ -224,6 +227,7 @@ exports.types = , "bin-links": Boolean , browser : [null, String] , ca: [null, String, Array] + , cafile : path , cache : path , "cache-lock-stale": Number , "cache-lock-retries": Number @@ -262,16 +266,7 @@ exports.types = , link: Boolean // local-address must be listed as an IP for a local network interface // must be IPv4 due to node bug - , "local-address" : Object.keys(os.networkInterfaces()).map(function (nic) { - return os.networkInterfaces()[nic].filter(function (addr) { - return addr.family === "IPv4" - }) - .map(function (addr) { - return addr.address - }) - }).reduce(function (curr, next) { - return curr.concat(next) - }, []) + , "local-address" : getLocalAddresses() , loglevel : ["silent","win","error","warn","http","info","verbose","silly"] , logstream : Stream , long : Boolean @@ -294,6 +289,7 @@ exports.types = , "save-exact" : Boolean , "save-optional" : Boolean , "save-prefix": String + //, scope : String , searchopts : String , searchexclude: [null, String] , searchsort: [ "name", "-name" @@ -322,6 +318,19 @@ exports.types = , _password: String } +function getLocalAddresses() { + Object.keys(os.networkInterfaces()).map(function (nic) { + return os.networkInterfaces()[nic].filter(function (addr) { + return addr.family === "IPv4" + }) + .map(function (addr) { + return addr.address + }) + }).reduce(function (curr, next) { + return curr.concat(next) + }, []).concat(undefined) +} + exports.shorthands = { s : ["--loglevel", "silent"] , d : ["--loglevel", "info"] diff --git a/deps/npm/node_modules/npmconf/lib/load-cafile.js b/deps/npm/node_modules/npmconf/lib/load-cafile.js new file mode 100644 index 00000000000..b8c9fff2330 --- /dev/null +++ b/deps/npm/node_modules/npmconf/lib/load-cafile.js @@ -0,0 +1,31 @@ +module.exports = loadCAFile + +var fs = require('fs') + +function loadCAFile(cafilePath, cb) { + if (!cafilePath) + return process.nextTick(cb) + + fs.readFile(cafilePath, 'utf8', afterCARead.bind(this)) + + function afterCARead(er, cadata) { + if (er) + return cb(er) + + var delim = '-----END CERTIFICATE-----' + var output + + output = cadata + .split(delim) + .filter(function(xs) { + return !!xs.trim() + }) + .map(function(xs) { + return xs.trimLeft() + delim + }) + + this.set('ca', output) + cb(null) + } + +} diff --git a/deps/npm/node_modules/npmconf/lib/load-prefix.js b/deps/npm/node_modules/npmconf/lib/load-prefix.js index c161b064950..bb39d9c98de 100644 --- a/deps/npm/node_modules/npmconf/lib/load-prefix.js +++ b/deps/npm/node_modules/npmconf/lib/load-prefix.js @@ -1,51 +1,49 @@ module.exports = loadPrefix var findPrefix = require("./find-prefix.js") -var mkdirp = require("mkdirp") var path = require('path') function loadPrefix (cb) { var cli = this.list[0] - // try to guess at a good node_modules location. - var p - , gp - - if (!Object.prototype.hasOwnProperty.call(cli, "prefix")) { - p = process.cwd() - } else { - p = this.get("prefix") - } - gp = this.get("prefix") - - findPrefix(p, function (er, p) { - Object.defineProperty(this, "localPrefix", - { get : function () { return p } - , set : function (r) { return p = r } - , enumerable : true - }) - // the prefix MUST exist, or else nothing works. - if (!this.get("global")) { - mkdirp(p, next.bind(this)) - } else { - next.bind(this)(er) - } - }.bind(this)) + Object.defineProperty(this, "prefix", + { set : function (prefix) { + var g = this.get("global") + this[g ? 'globalPrefix' : 'localPrefix'] = prefix + }.bind(this) + , get : function () { + var g = this.get("global") + return g ? this.globalPrefix : this.localPrefix + }.bind(this) + , enumerable : true + }) - gp = path.resolve(gp) Object.defineProperty(this, "globalPrefix", - { get : function () { return gp } - , set : function (r) { return gp = r } + { set : function (prefix) { + this.set('prefix', prefix) + }.bind(this) + , get : function () { + return path.resolve(this.get("prefix")) + }.bind(this) , enumerable : true }) - // the prefix MUST exist, or else nothing works. - mkdirp(gp, next.bind(this)) - var i = 2 - var errState = null - function next (er) { - if (errState) return - if (er) return cb(errState = er) - if (--i === 0) return cb() + var p + Object.defineProperty(this, "localPrefix", + { set : function (prefix) { p = prefix }, + get : function () { return p } + , enumerable: true }) + + // try to guess at a good node_modules location. + // If we are *explicitly* given a prefix on the cli, then + // always use that. otherwise, infer local prefix from cwd. + if (Object.prototype.hasOwnProperty.call(cli, "prefix")) { + p = path.resolve(cli.prefix) + process.nextTick(cb) + } else { + findPrefix(process.cwd(), function (er, found) { + p = found + cb(er) + }.bind(this)) } } diff --git a/deps/npm/node_modules/npmconf/lib/set-user.js b/deps/npm/node_modules/npmconf/lib/set-user.js index 2e7774aec3f..cf29b1ace21 100644 --- a/deps/npm/node_modules/npmconf/lib/set-user.js +++ b/deps/npm/node_modules/npmconf/lib/set-user.js @@ -1,10 +1,13 @@ module.exports = setUser +var Conf = require('../npmconf.js').Conf +var assert = require('assert') var path = require('path') var fs = require('fs') function setUser (cb) { - var defaultConf = Object.getPrototypeOf(this.root) + var defaultConf = this.root + assert(defaultConf !== Object.prototype) // If global, leave it as-is. // If not global, then set the user to the owner of the prefix folder. diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json index f96627c7288..2dff2917c05 100644 --- a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json +++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/package.json @@ -1,6 +1,6 @@ { "name": "proto-list", - "version": "1.2.2", + "version": "1.2.3", "description": "A utility for managing a prototype chain", "main": "./proto-list.js", "author": { @@ -22,24 +22,30 @@ "devDependencies": { "tap": "0" }, - "readme": "A list of objects, bound by their prototype chain.\n\nUsed in npm's config stuff.\n", - "_id": "proto-list@1.2.2", - "dist": { - "shasum": "48b88798261ec2c4a785720cdfec6200d57d3326", - "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.2.tgz" + "gitHead": "44d76897176861d176a53ed3f3fc5e05cdee7643", + "bugs": { + "url": "https://github.com/isaacs/proto-list/issues" + }, + "homepage": "https://github.com/isaacs/proto-list", + "_id": "proto-list@1.2.3", + "_shasum": "6235554a1bca1f0d15e3ca12ca7329d5def42bd9", + "_from": "proto-list@~1.2.1", + "_npmVersion": "1.4.14", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" }, "maintainers": [ { "name": "isaacs", "email": "i@izs.me" - }, - { - "name": "substack", - "email": "mail@substack.net" } ], + "dist": { + "shasum": "6235554a1bca1f0d15e3ca12ca7329d5def42bd9", + "tarball": "http://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz" + }, "directories": {}, - "_shasum": "48b88798261ec2c4a785720cdfec6200d57d3326", - "_from": "proto-list@~1.2.1", - "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.2.tgz" + "_resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.3.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js index 67d250387cc..b55c25c052f 100644 --- a/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js +++ b/deps/npm/node_modules/npmconf/node_modules/config-chain/node_modules/proto-list/proto-list.js @@ -1,6 +1,13 @@ module.exports = ProtoList +function setProto(obj, proto) { + if (typeof Object.setPrototypeOf === "function") + return Object.setPrototypeOf(obj, proto) + else + obj.__proto__ = proto +} + function ProtoList () { this.list = [] var root = null @@ -9,7 +16,7 @@ function ProtoList () { set: function (r) { root = r if (this.list.length) { - this.list[this.list.length - 1].__proto__ = r + setProto(this.list[this.list.length - 1], r) } }, enumerable: true, @@ -35,24 +42,24 @@ ProtoList.prototype = , push : function (obj) { if (typeof obj !== "object") obj = {valueOf:obj} if (this.list.length >= 1) { - this.list[this.list.length - 1].__proto__ = obj + setProto(this.list[this.list.length - 1], obj) } - obj.__proto__ = this.root + setProto(obj, this.root) return this.list.push(obj) } , pop : function () { if (this.list.length >= 2) { - this.list[this.list.length - 2].__proto__ = this.root + setProto(this.list[this.list.length - 2], this.root) } return this.list.pop() } , unshift : function (obj) { - obj.__proto__ = this.list[0] || this.root + setProto(obj, this.list[0] || this.root) return this.list.unshift(obj) } , shift : function () { if (this.list.length === 1) { - this.list[0].__proto__ = this.root + setProto(this.list[0], this.root) } return this.list.shift() } @@ -74,7 +81,7 @@ ProtoList.prototype = // handle injections var ret = this.list.splice.apply(this.list, arguments) for (var i = 0, l = this.list.length; i < l; i++) { - this.list[i].__proto__ = this.list[i + 1] || this.root + setProto(this.list[i], this.list[i + 1] || this.root) } return ret } diff --git a/deps/npm/node_modules/npmconf/npmconf.js b/deps/npm/node_modules/npmconf/npmconf.js index aa2c7b2e6ef..248220a8fef 100644 --- a/deps/npm/node_modules/npmconf/npmconf.js +++ b/deps/npm/node_modules/npmconf/npmconf.js @@ -103,16 +103,38 @@ function load_(builtin, rc, cli, cb) { conf.add(cli, 'cli') conf.addEnv() - conf.loadExtras(function(er) { + conf.loadPrefix(function(er) { if (er) return cb(er) - if (!conf.get('global')) { - var projectConf = path.resolve(conf.localPrefix, '.npmrc') + // If you're doing `npm --userconfig=~/foo.npmrc` then you'd expect + // that ~/.npmrc won't override the stuff in ~/foo.npmrc (or, indeed + // be used at all). + // + // However, if the cwd is ~, then ~/.npmrc is the home for the project + // config, and will override the userconfig. + // + // If you're not setting the userconfig explicitly, then it will be loaded + // twice, which is harmless but excessive. If you *are* setting the + // userconfig explicitly then it will override your explicit intent, and + // that IS harmful and unexpected. + // + // Solution: Do not load project config file that is the same as either + // the default or resolved userconfig value. npm will log a "verbose" + // message about this when it happens, but it is a rare enough edge case + // that we don't have to be super concerned about it. + var projectConf = path.resolve(conf.localPrefix, '.npmrc') + var defaultUserConfig = rc.get('userconfig') + var resolvedUserConfig = conf.get('userconfig') + if (!conf.get('global') && + projectConf !== defaultUserConfig && + projectConf !== resolvedUserConfig) { conf.addFile(projectConf, 'project') conf.once('load', afterPrefix) + } else { + conf.add({}, 'project') + afterPrefix() } - else return afterPrefix() }) function afterPrefix() { @@ -139,12 +161,34 @@ function load_(builtin, rc, cli, cb) { conf.root = defaults conf.add(rc.shift(), 'builtin') conf.once('load', function () { - // warn about invalid bits. - validate(conf) - exports.loaded = conf - cb(null, conf) + conf.loadExtras(afterExtras) }) } + + function afterExtras(er) { + if (er) + return cb(er) + + // warn about invalid bits. + validate(conf) + + var cafile = conf.get('cafile') + + if (cafile) { + return conf.loadCAFile(cafile, finalize) + } + + finalize() + } + + function finalize(er, cadata) { + if (er) { + return cb(er) + } + + exports.loaded = conf + cb(er, conf) + } } // Basically the same as CC, but: @@ -169,18 +213,20 @@ function Conf (base) { } Conf.prototype.loadPrefix = require('./lib/load-prefix.js') +Conf.prototype.loadCAFile = require('./lib/load-cafile.js') Conf.prototype.loadUid = require('./lib/load-uid.js') Conf.prototype.setUser = require('./lib/set-user.js') Conf.prototype.findPrefix = require('./lib/find-prefix.js') Conf.prototype.loadExtras = function(cb) { - this.loadPrefix(function(er) { + this.setUser(function(er) { if (er) return cb(er) - this.setUser(function(er) { + this.loadUid(function(er) { if (er) return cb(er) - this.loadUid(cb) + // Without prefix, nothing will ever work + mkdirp(this.prefix, cb) }.bind(this)) }.bind(this)) } @@ -228,9 +274,12 @@ Conf.prototype.save = function (where, cb) { this._saving ++ var mode = where === 'user' ? 0600 : 0666 - if (!data.trim()) - fs.unlink(target.path, done) - else { + if (!data.trim()) { + fs.unlink(target.path, function (er) { + // ignore the possible error (e.g. the file doesn't exist) + done(null) + }) + } else { mkdirp(path.dirname(target.path), function (er) { if (er) return then(er) @@ -303,14 +352,16 @@ Conf.prototype.addEnv = function (env) { env = env || process.env var conf = {} Object.keys(env) - .filter(function (k) { return k.match(/^npm_config_[^_]/i) }) + .filter(function (k) { return k.match(/^npm_config_/i) }) .forEach(function (k) { if (!env[k]) return - conf[k.replace(/^npm_config_/i, '') - .toLowerCase() - .replace(/_/g, '-')] = env[k] + // leave first char untouched, even if + // it is a "_" - convert all other to "-" + var p = k.replace(/^npm_config_/, '') + .replace(/(?!^)_/g, '-') + conf[p] = env[k] }) return CC.prototype.addEnv.call(this, '', conf, 'env') } @@ -378,4 +429,6 @@ function validate (cl) { cl.list.forEach(function (conf, level) { nopt.clean(conf, configDefs.types) }) + + nopt.clean(cl.root, configDefs.types) } diff --git a/deps/npm/node_modules/npmconf/package.json b/deps/npm/node_modules/npmconf/package.json index f6727d98ffd..a0e1bbbd774 100644 --- a/deps/npm/node_modules/npmconf/package.json +++ b/deps/npm/node_modules/npmconf/package.json @@ -1,6 +1,6 @@ { "name": "npmconf", - "version": "1.0.1", + "version": "1.1.4", "description": "The config thing npm uses", "main": "npmconf.js", "directories": { @@ -11,9 +11,9 @@ "inherits": "~2.0.0", "ini": "^1.2.0", "mkdirp": "~0.3.3", - "nopt": "2", + "nopt": "~3.0.1", "once": "~1.3.0", - "osenv": "0.0.3", + "osenv": "^0.1.0", "semver": "2", "uid-number": "0.0.5" }, @@ -42,12 +42,12 @@ "license": "BSD", "readme": "# npmconf\n\nThe config thing npm uses\n\nIf you are interested in interacting with the config settings that npm\nuses, then use this module.\n\nHowever, if you are writing a new Node.js program, and want\nconfiguration functionality similar to what npm has, but for your\nown thing, then I'd recommend using [rc](https://github.com/dominictarr/rc),\nwhich is probably what you want.\n\nIf I were to do it all over again, that's what I'd do for npm. But,\nalas, there are many systems depending on many of the particulars of\nnpm's configuration setup, so it's not worth the cost of changing.\n\n## USAGE\n\n```javascript\nvar npmconf = require('npmconf')\n\n// pass in the cli options that you read from the cli\n// or whatever top-level configs you want npm to use for now.\nnpmconf.load({some:'configs'}, function (er, conf) {\n // do stuff with conf\n conf.get('some', 'cli') // 'configs'\n conf.get('username') // 'joebobwhatevers'\n conf.set('foo', 'bar', 'user')\n conf.save('user', function (er) {\n // foo = bar is now saved to ~/.npmrc or wherever\n })\n})\n```\n", "readmeFilename": "README.md", - "gitHead": "7da0322e33d6116378f6a2206d8b8fa113c06e4b", + "gitHead": "3662624af0834159c35843fcf850469c09e0873c", "bugs": { "url": "https://github.com/isaacs/npmconf/issues" }, "homepage": "https://github.com/isaacs/npmconf", - "_id": "npmconf@1.0.1", - "_shasum": "3503d12c6585395b0d8378d76e2d4a2453a23328", + "_id": "npmconf@1.1.4", + "_shasum": "2ac5d080206d4bfb9abc01bd34f083f93ae1603c", "_from": "npmconf@latest" } diff --git a/deps/npm/node_modules/npmconf/test/00-setup.js b/deps/npm/node_modules/npmconf/test/00-setup.js index 79cbbb127f3..27e10691591 100644 --- a/deps/npm/node_modules/npmconf/test/00-setup.js +++ b/deps/npm/node_modules/npmconf/test/00-setup.js @@ -14,6 +14,19 @@ Object.keys(process.env).forEach(function (k) { process.env.npm_config_userconfig = exports.userconfig process.env.npm_config_other_env_thing = 1000 process.env.random_env_var = 'asdf' +process.env.npm_config__underbar_env_thing = 'underful' + +exports.envData = { + userconfig: exports.userconfig, + '_underbar-env-thing': 'underful', + 'other-env-thing': '1000' +} +exports.envDataFix = { + userconfig: exports.userconfig, + '_underbar-env-thing': 'underful', + 'other-env-thing': 1000, +} + if (module === require.main) { // set the globalconfig in the userconfig diff --git a/deps/npm/node_modules/npmconf/test/basic.js b/deps/npm/node_modules/npmconf/test/basic.js index f17f0fb8e01..29d708b3a67 100644 --- a/deps/npm/node_modules/npmconf/test/basic.js +++ b/deps/npm/node_modules/npmconf/test/basic.js @@ -31,8 +31,8 @@ var ucData = path: '/', httponly: true } } -var envData = { userconfig: common.userconfig, 'other-env-thing': '1000' } -var envDataFix = { userconfig: common.userconfig, 'other-env-thing': 1000 } +var envData = common.envData +var envDataFix = common.envDataFix var gcData = { 'package-config:foo': 'boo' } diff --git a/deps/npm/node_modules/npmconf/test/builtin.js b/deps/npm/node_modules/npmconf/test/builtin.js index 0a305d2a65f..15cb9083aaf 100644 --- a/deps/npm/node_modules/npmconf/test/builtin.js +++ b/deps/npm/node_modules/npmconf/test/builtin.js @@ -29,8 +29,8 @@ var ucData = path: '/', httponly: true } } -var envData = { userconfig: common.userconfig, 'other-env-thing': '1000' } -var envDataFix = { userconfig: common.userconfig, 'other-env-thing': 1000 } +var envData = common.envData +var envDataFix = common.envDataFix var gcData = { 'package-config:foo': 'boo' } diff --git a/deps/npm/node_modules/npmconf/test/certfile.js b/deps/npm/node_modules/npmconf/test/certfile.js new file mode 100644 index 00000000000..3dfb6e90f98 --- /dev/null +++ b/deps/npm/node_modules/npmconf/test/certfile.js @@ -0,0 +1,17 @@ +var test = require('tap').test +var npmconf = require('../npmconf.js') +var common = require('./00-setup.js') +var path = require('path') +var fs = require('fs') + +test('cafile loads as ca', function (t) { + var cafile = path.join(__dirname, 'fixtures', 'multi-ca') + + npmconf.load({cafile: cafile}, function (er, conf) { + if (er) throw er + + t.same(conf.get('cafile'), cafile) + t.same(conf.get('ca').join('\n'), fs.readFileSync(cafile, 'utf8').trim()) + t.end() + }) +}) diff --git a/deps/npm/node_modules/npmconf/test/fixtures/multi-ca b/deps/npm/node_modules/npmconf/test/fixtures/multi-ca new file mode 100644 index 00000000000..0bc922b25c5 --- /dev/null +++ b/deps/npm/node_modules/npmconf/test/fixtures/multi-ca @@ -0,0 +1,32 @@ +-----BEGIN CERTIFICATE----- +MIICjTCCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx +NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz +dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw +ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu +ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2 +ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp +miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ5iQHmkwlYDTL2fTgVfw0C +AQOjgaswgagwZAYDVR0ZAQH/BFowWDBWMFQxCzAJBgNVBAYTAlVTMTYwNAYDVQQK +Ey1OYXRpAAAAACBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x +DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR +MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB +AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21 +X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3 +WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO +-----END CERTIFICATE----- +-----BEGIN CERTIFICATE----- +AAAAAACCAfigAwIBAgIEMaYgRzALBgkqhkiG9w0BAQQwRTELMAkGA1UEBhMCVVMx +NjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFuZCBTcGFjZSBBZG1pbmlz +dHJhdGlvbjAmFxE5NjA1MjgxMzQ5MDUrMDgwMBcROTgwNTI4MTM0OTA1KzA4MDAw +ZzELMAkGA1UEBhMCVVMxNjA0BgNVBAoTLU5hdGlvbmFsIEFlcm9uYXV0aWNzIGFu +ZCBTcGFjZSBBZG1pbmlzdHJhdGlvbjEgMAkGA1UEBRMCMTYwEwYDVQQDEwxTdGV2 +ZSBTY2hvY2gwWDALBgkqhkiG9w0BAQEDSQAwRgJBALrAwyYdgxmzNP/ts0Uyf6Bp +miJYktU/w4NG67ULaN4B5CnEz7k57s9o3YY3LecETgQ5iQHmkwlYDTL2fTgVfw0C +AQOjgaswgagwZAYDVR0ZAQH/BFowWDBWMFQxCzAJBgNVBAYTAlVTMTYwNAYDVQQK +Ey1OYXRpb25hbCBBZXJvbmF1dGljcyBhbmQgU3BhY2UgQWRtaW5pc3RyYXRpb24x +DTALBgNVBAMTBENSTDEwFwYDVR0BAQH/BA0wC4AJODMyOTcwODEwMBgGA1UdAgQR +MA8ECTgzMjk3MDgyM4ACBSAwDQYDVR0KBAYwBAMCBkAwCwYJKoZIhvcNAQEEA4GB +AH2y1VCEw/A4zaXzSYZJTTUi3uawbbFiS2yxHvgf28+8Js0OHXk1H1w2d6qOHH21 +X82tZXd/0JtG0g1T9usFFBDvYK8O0ebgz/P5ELJnBL2+atObEuJy1ZZ0pBDWINR3 +WkDNLCGiTkCKp0F5EWIrVDwh54NNevkCQRZita+z4IBO +-----END CERTIFICATE----- diff --git a/deps/npm/node_modules/npmconf/test/project.js b/deps/npm/node_modules/npmconf/test/project.js index 04e063855b6..fa21e43d22b 100644 --- a/deps/npm/node_modules/npmconf/test/project.js +++ b/deps/npm/node_modules/npmconf/test/project.js @@ -33,8 +33,8 @@ var ucData = path: '/', httponly: true } } -var envData = { userconfig: common.userconfig, 'other-env-thing': '1000' } -var envDataFix = { userconfig: common.userconfig, 'other-env-thing': 1000 } +var envData = common.envData +var envDataFix = common.envDataFix var gcData = { 'package-config:foo': 'boo' } diff --git a/deps/npm/node_modules/npmconf/test/save.js b/deps/npm/node_modules/npmconf/test/save.js index 05230cd0a6c..64b114449ee 100644 --- a/deps/npm/node_modules/npmconf/test/save.js +++ b/deps/npm/node_modules/npmconf/test/save.js @@ -72,3 +72,13 @@ test('saving configs', function (t) { }) }) +test('setting prefix', function (t) { + npmconf.load(function (er, conf) { + if (er) + throw er + + conf.prefix = 'newvalue' + t.same(conf.prefix, 'newvalue'); + t.end(); + }) +}) diff --git a/deps/npm/node_modules/npmlog/.npmrc b/deps/npm/node_modules/npmlog/.npmrc new file mode 100644 index 00000000000..ca0bc48dd55 --- /dev/null +++ b/deps/npm/node_modules/npmlog/.npmrc @@ -0,0 +1,2 @@ +save-prefix = ~ +proprietary-attribs = false diff --git a/deps/npm/node_modules/npmlog/package.json b/deps/npm/node_modules/npmlog/package.json index 5bb39255379..3d36b8a15a6 100644 --- a/deps/npm/node_modules/npmlog/package.json +++ b/deps/npm/node_modules/npmlog/package.json @@ -6,7 +6,7 @@ }, "name": "npmlog", "description": "logger for npm", - "version": "0.0.6", + "version": "0.1.1", "repository": { "type": "git", "url": "git://github.com/isaacs/npmlog.git" @@ -16,7 +16,7 @@ "test": "tap test/*.js" }, "dependencies": { - "ansi": "~0.2.1" + "ansi": "~0.3.0" }, "devDependencies": { "tap": "" @@ -24,27 +24,12 @@ "license": "BSD", "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.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# Events\n\nEvents are all emitted with the message object.\n\n* `log` Emitted for all messages\n* `log.` Emitted for all messages with the `` level.\n* `` 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": "b58e360cd99db707d1191ce6125ae53d79f075a1", "bugs": { "url": "https://github.com/isaacs/npmlog/issues" }, - "_id": "npmlog@0.0.6", - "dist": { - "shasum": "685043fe71aa1665d6e3b2acef180640caf40873", - "tarball": "http://registry.npmjs.org/npmlog/-/npmlog-0.0.6.tgz" - }, - "_from": "npmlog@latest", - "_npmVersion": "1.3.11", - "_npmUser": { - "name": "isaacs", - "email": "i@izs.me" - }, - "maintainers": [ - { - "name": "isaacs", - "email": "i@izs.me" - } - ], - "directories": {}, - "_shasum": "685043fe71aa1665d6e3b2acef180640caf40873", - "_resolved": "https://registry.npmjs.org/npmlog/-/npmlog-0.0.6.tgz" + "homepage": "https://github.com/isaacs/npmlog", + "_id": "npmlog@0.1.1", + "_shasum": "8b9b9e4405d7ec48c31c2346965aadc7abaecaa5", + "_from": "npmlog@latest" } diff --git a/deps/npm/node_modules/osenv/LICENSE b/deps/npm/node_modules/osenv/LICENSE index 74489e2e265..0c44ae716db 100644 --- a/deps/npm/node_modules/osenv/LICENSE +++ b/deps/npm/node_modules/osenv/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) Isaac Z. Schlueter +Copyright (c) Isaac Z. Schlueter ("Author") All rights reserved. The BSD License @@ -6,20 +6,22 @@ The BSD License Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. -THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS -``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED -TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS +THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR +BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE +OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN +IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/deps/npm/node_modules/osenv/osenv.js b/deps/npm/node_modules/osenv/osenv.js index e3367a77439..7836fafcc1a 100644 --- a/deps/npm/node_modules/osenv/osenv.js +++ b/deps/npm/node_modules/osenv/osenv.js @@ -1,7 +1,7 @@ var isWindows = process.platform === 'win32' -var windir = isWindows ? process.env.windir || 'C:\\Windows' : null var path = require('path') var exec = require('child_process').exec +var os = require('os') // looking up envs is a bit costly. // Also, sometimes we want to have a fallback @@ -46,14 +46,7 @@ memo('hostname', function () { }, 'hostname') memo('tmpdir', function () { - var t = isWindows ? 'temp' : 'tmp' - return process.env.TMPDIR || - process.env.TMP || - process.env.TEMP || - ( exports.home() ? path.resolve(exports.home(), t) - : isWindows ? path.resolve(windir, t) - : '/tmp' - ) + return os.tmpDir() }) memo('home', function () { diff --git a/deps/npm/node_modules/osenv/package.json b/deps/npm/node_modules/osenv/package.json index 0c01cc8152a..b66ce8df24c 100644 --- a/deps/npm/node_modules/osenv/package.json +++ b/deps/npm/node_modules/osenv/package.json @@ -1,13 +1,13 @@ { "name": "osenv", - "version": "0.0.3", + "version": "0.1.0", "main": "osenv.js", "directories": { "test": "test" }, "dependencies": {}, "devDependencies": { - "tap": "~0.2.5" + "tap": "~0.4.9" }, "scripts": { "test": "tap test/*.js" @@ -33,6 +33,12 @@ "license": "BSD", "description": "Look up environment settings specific to different operating systems", "readme": "# osenv\n\nLook up environment settings specific to different operating systems.\n\n## Usage\n\n```javascript\nvar osenv = require('osenv')\nvar path = osenv.path()\nvar user = osenv.user()\n// etc.\n\n// Some things are not reliably in the env, and have a fallback command:\nvar h = osenv.hostname(function (er, hostname) {\n h = hostname\n})\n// This will still cause it to be memoized, so calling osenv.hostname()\n// is now an immediate operation.\n\n// You can always send a cb, which will get called in the nextTick\n// if it's been memoized, or wait for the fallback data if it wasn't\n// found in the environment.\nosenv.hostname(function (er, hostname) {\n if (er) console.error('error looking up hostname')\n else console.log('this machine calls itself %s', hostname)\n})\n```\n\n## osenv.hostname()\n\nThe machine name. Calls `hostname` if not found.\n\n## osenv.user()\n\nThe currently logged-in user. Calls `whoami` if not found.\n\n## osenv.prompt()\n\nEither PS1 on unix, or PROMPT on Windows.\n\n## osenv.tmpdir()\n\nThe place where temporary files should be created.\n\n## osenv.home()\n\nNo place like it.\n\n## osenv.path()\n\nAn array of the places that the operating system will search for\nexecutables.\n\n## osenv.editor() \n\nReturn the executable name of the editor program. This uses the EDITOR\nand VISUAL environment variables, and falls back to `vi` on Unix, or\n`notepad.exe` on Windows.\n\n## osenv.shell()\n\nThe SHELL on Unix, which Windows calls the ComSpec. Defaults to 'bash'\nor 'cmd'.\n", - "_id": "osenv@0.0.3", - "_from": "osenv@latest" + "readmeFilename": "README.md", + "bugs": { + "url": "https://github.com/isaacs/osenv/issues" + }, + "homepage": "https://github.com/isaacs/osenv", + "_id": "osenv@0.1.0", + "_shasum": "61668121eec584955030b9f470b1d2309504bfcb", + "_from": "osenv@~0.1.0" } diff --git a/deps/npm/node_modules/osenv/test/unix.js b/deps/npm/node_modules/osenv/test/unix.js index b72eb0b3f50..f87cbfb3295 100644 --- a/deps/npm/node_modules/osenv/test/unix.js +++ b/deps/npm/node_modules/osenv/test/unix.js @@ -23,7 +23,6 @@ process.env.EDITOR = 'edit' process.env.VISUAL = 'visualedit' process.env.SHELL = 'zsh' - tap.test('basic unix sanity test', function (t) { var osenv = require('../osenv.js') @@ -46,10 +45,6 @@ tap.test('basic unix sanity test', function (t) { t.equal(osenv.tmpdir(), process.env.TEMP) process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), '/home/sirUser/tmp') - delete require.cache[require.resolve('../osenv.js')] var osenv = require('../osenv.js') osenv.home = function () { return null } diff --git a/deps/npm/node_modules/osenv/test/windows.js b/deps/npm/node_modules/osenv/test/windows.js index dd3fe807002..63ca453212a 100644 --- a/deps/npm/node_modules/osenv/test/windows.js +++ b/deps/npm/node_modules/osenv/test/windows.js @@ -12,7 +12,7 @@ if (process.platform !== 'win32') { // load this before clubbing the platform name. var tap = require('tap') -process.env.windir = 'C:\\windows' +process.env.windir = 'c:\\windows' process.env.USERDOMAIN = 'some-domain' process.env.USERNAME = 'sirUser' process.env.USERPROFILE = 'C:\\Users\\sirUser' @@ -29,8 +29,6 @@ process.env.ComSpec = 'some-com' tap.test('basic windows sanity test', function (t) { var osenv = require('../osenv.js') - var osenv = require('../osenv.js') - t.equal(osenv.user(), process.env.USERDOMAIN + '\\' + process.env.USERNAME) t.equal(osenv.home(), process.env.USERPROFILE) @@ -50,16 +48,11 @@ tap.test('basic windows sanity test', function (t) { var osenv = require('../osenv.js') t.equal(osenv.tmpdir(), process.env.TEMP) - process.env.TEMP = '' - delete require.cache[require.resolve('../osenv.js')] - var osenv = require('../osenv.js') - t.equal(osenv.tmpdir(), 'C:\\Users\\sirUser\\temp') - process.env.TEMP = '' delete require.cache[require.resolve('../osenv.js')] var osenv = require('../osenv.js') osenv.home = function () { return null } - t.equal(osenv.tmpdir(), 'C:\\windows\\temp') + t.equal(osenv.tmpdir(), 'c:\\windows\\temp') t.equal(osenv.editor(), 'edit') process.env.EDITOR = '' diff --git a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json index a1f2911ad91..96f5a3f51bf 100644 --- a/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json +++ b/deps/npm/node_modules/read-installed/node_modules/util-extend/package.json @@ -36,6 +36,5 @@ ], "directories": {}, "_shasum": "bb703b79480293ddcdcfb3c6a9fea20f483415bc", - "_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz", - "homepage": "https://github.com/isaacs/util-extend" + "_resolved": "https://registry.npmjs.org/util-extend/-/util-extend-1.0.1.tgz" } diff --git a/deps/npm/node_modules/read-installed/package.json b/deps/npm/node_modules/read-installed/package.json index 46b0036fc53..de958a544e8 100644 --- a/deps/npm/node_modules/read-installed/package.json +++ b/deps/npm/node_modules/read-installed/package.json @@ -1,7 +1,7 @@ { "name": "read-installed", "description": "Read all the installed packages in a folder, and return a tree structure with all the data.", - "version": "2.0.4", + "version": "2.0.5", "repository": { "type": "git", "url": "git://github.com/isaacs/read-installed" @@ -15,10 +15,10 @@ "semver": "2", "slide": "~1.1.3", "util-extend": "^1.0.1", - "graceful-fs": "~2" + "graceful-fs": "2 || 3" }, "optionalDependencies": { - "graceful-fs": "~2" + "graceful-fs": "2 || 3" }, "author": { "name": "Isaac Z. Schlueter", @@ -31,12 +31,12 @@ }, "readme": "# read-installed\n\nRead all the installed packages in a folder, and return a tree\nstructure with all the data.\n\nnpm uses this.\n\n## 2.0.0\n\nBreaking changes in `2.0.0`:\n\nThe second argument is now an `Object` that contains the following keys:\n\n * `depth` optional, defaults to Infinity\n * `log` optional log Function\n * `dev` optional, default false, set to true to include devDependencies\n\n## Usage\n\n```javascript\nvar readInstalled = require(\"read-installed\")\n// optional options\nvar options = { dev: false, log: fn, depth: 2 }\nreadInstalled(folder, options, function (er, data) {\n ...\n})\n```\n", "readmeFilename": "README.md", - "gitHead": "86c1d4444724b82855a6879d443b6fa184f2f9dd", + "gitHead": "2595631e4d3cbd64b26cee63dc3b5ce9f53e3533", "bugs": { "url": "https://github.com/isaacs/read-installed/issues" }, "homepage": "https://github.com/isaacs/read-installed", - "_id": "read-installed@2.0.4", - "_shasum": "3a1e12b977a93132b93c5a6a8663fbd62c812671", + "_id": "read-installed@2.0.5", + "_shasum": "761eda1fd2dc322f8e77844a8bf1ddedbcfc754b", "_from": "read-installed@latest" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js index 2bcc2290d42..cc560f30e40 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js +++ b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/lib/fixer.js @@ -139,7 +139,7 @@ var fixer = module.exports = { // "/" is not allowed as packagename for publishing, but for git-urls // normalize shorthand-urls if (githubUserRepo(data[deps][d])) { - data[deps][d] = githubUserRepo(data[deps][d]) + data[deps][d] = 'git+' + githubUserRepo(data[deps][d]) } }, this) }, this) @@ -379,4 +379,4 @@ function bugsTypos(bugs, warn) { delete bugs[k] } }) -} \ No newline at end of file +} diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json index 449cfb7df24..d368d4af534 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json +++ b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/package.json @@ -1,6 +1,6 @@ { "name": "normalize-package-data", - "version": "0.2.13", + "version": "0.3.0", "author": { "name": "Meryn Stol", "email": "merynstol@gmail.com" @@ -16,7 +16,7 @@ }, "dependencies": { "github-url-from-git": "~1.1.1", - "github-url-from-username-repo": "^0.1.0", + "github-url-from-username-repo": "^0.2.0", "semver": "2" }, "devDependencies": { @@ -38,13 +38,33 @@ "email": "rok@kowalski.gd" } ], - "readme": "# normalize-package-data [![Build Status](https://travis-ci.org/meryn/normalize-package-data.png?branch=master)](https://travis-ci.org/meryn/normalize-package-data)\n\nnormalize-package data exports a function that normalizes package metadata. This data is typically found in a package.json file, but in principle could come from any source - for example the npm registry.\n\nnormalize-package-data is used by [read-package-json](https://npmjs.org/package/read-package-json) to normalize the data it reads from a package.json file. In turn, read-package-json is used by [npm](https://npmjs.org/package/npm) and various npm-related tools.\n\n## Installation\n\n```\nnpm install normalize-package-data\n```\n\n## Usage\n\nBasic usage is really simple. You call the function that normalize-package-data exports. Let's call it `normalizeData`.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readfileSync(\"package.json\")\nnormalizeData(packageData)\n// packageData is now normalized\n```\n\n#### Strict mode\n\nYou may activate strict validation by passing true as the second argument.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readfileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, true)\n// packageData is now normalized\n```\n\nIf strict mode is activated, only Semver 2.0 version strings are accepted. Otherwise, Semver 1.0 strings are accepted as well. Packages must have a name, and the name field must not have contain leading or trailing whitespace.\n\n#### Warnings\n\nOptionally, you may pass a \"warning\" function. It gets called whenever the `normalizeData` function encounters something that doesn't look right. It indicates less than perfect input data.\n\n```javascript\nnormalizeData = require('normalize-package-data')\npackageData = fs.readfileSync(\"package.json\")\nwarnFn = function(msg) { console.error(msg) }\nnormalizeData(packageData, warnFn)\n// packageData is now normalized. Any number of warnings may have been logged.\n```\n\nYou may combine strict validation with warnings by passing `true` as the second argument, and `warnFn` as third.\n\nWhen `private` field is set to `true`, warnings will be suppressed.\n\n### Potential exceptions\n\nIf the supplied data has an invalid name or version vield, `normalizeData` will throw an error. Depending on where you call `normalizeData`, you may want to catch these errors so can pass them to a callback.\n\n## What normalization (currently) entails\n\n* The value of `name` field gets trimmed (unless in strict mode).\n* The value of the `version` field gets cleaned by `semver.clean`. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n* If `name` and/or `version` fields are missing, they are set to empty strings.\n* If `files` field is not an array, it will be removed.\n* If `bin` field is a string, then `bin` field will become an object with `name` set to the value of the `name` field, and `bin` set to the original string value.\n* If `man` field is a string, it will become an array with the original string as its sole member.\n* If `keywords` field is string, it is considered to be a list of keywords separated by one or more white-space characters. It gets converted to an array by splitting on `\\s+`.\n* All people fields (`author`, `maintainers`, `contributors`) get converted into objects with name, email and url properties.\n* If `bundledDependencies` field (a typo) exists and `bundleDependencies` field does not, `bundledDependencies` will get renamed to `bundleDependencies`.\n* If the value of any of the dependencies fields (`dependencies`, `devDependencies`, `optionalDependencies`) is a string, it gets converted into an object with familiar `name=>value` pairs.\n* The values in `optionalDependencies` get added to `dependencies`. The `optionalDependencies` array is left untouched.\n* If `description` field does not exists, but `readme` field does, then (more or less) the first paragraph of text that's found in the readme is taken as value for `description`.\n* If `repository` field is a string, it will become an object with `url` set to the original string value, and `type` set to `\"git\"`.\n* If `repository.url` is not a valid url, but in the style of \"[owner-name]/[repo-name]\", `repository.url` will be set to git://github.com/[owner-name]/[repo-name]\n* If `bugs` field is a string, the value of `bugs` field is changed into an object with `url` set to the original string value.\n* If `bugs` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `bugs` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/issues . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n* If `bugs` field is an object, the resulting value only has email and url properties. If email and url properties are not strings, they are ignored. If no valid values for either email or url is found, bugs field will be removed.\n* If `homepage` field is not a string, it will be removed.\n* If the url in the `homepage` field does not specify a protocol, then http is assumed. For example, `myproject.org` will be changed to `http://myproject.org`.\n* If `homepage` field does not exist, but `repository` field points to a repository hosted on GitHub, the value of the `homepage` field gets set to an url in the form of https://github.com/[owner-name]/[repo-name]/ . If the repository field points to a GitHub Gist repo url, the associated http url is chosen.\n\n### Rules for name field\n\nIf `name` field is given, the value of the name field must be a string. The string may not:\n\n* start with a period.\n* contain the following characters: `/@\\s+%`\n* contain and characters that would need to be encoded for use in urls.\n* resemble the word `node_modules` or `favicon.ico` (case doesn't matter).\n\n### Rules for version field\n\nIf `version` field is given, the value of the version field must be a valid *semver* string, as determined by the `semver.valid` method. See [documentation for the semver module](https://github.com/isaacs/node-semver).\n\n## Credits\n\nThis package contains code based on read-package-json written by Isaac Z. Schlueter. Used with permisson.\n\n## License\n\nnormalize-package-data is released under the [BSD 2-Clause License](http://opensource.org/licenses/MIT). \nCopyright (c) 2013 Meryn Stol ", - "readmeFilename": "README.md", + "gitHead": "f4d4268894a23d6f37a335d4ae28bd90b14e4ef9", "bugs": { "url": "https://github.com/meryn/normalize-package-data/issues" }, "homepage": "https://github.com/meryn/normalize-package-data", - "_id": "normalize-package-data@0.2.13", - "_shasum": "50f9fd9e77b1c8411cd231db2962e73963de774d", - "_from": "normalize-package-data@^0.2.13" + "_id": "normalize-package-data@0.3.0", + "_shasum": "70ea9e5b6caf69faa9d83e42f71489642372d815", + "_from": "normalize-package-data@^0.3.0", + "_npmVersion": "1.4.14", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "meryn", + "email": "merynstol@gmail.com" + }, + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "70ea9e5b6caf69faa9d83e42f71489642372d815", + "tarball": "http://registry.npmjs.org/normalize-package-data/-/normalize-package-data-0.3.0.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-0.3.0.tgz" } diff --git a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js index dd26c5d01ff..b35eed7659c 100644 --- a/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js +++ b/deps/npm/node_modules/read-package-json/node_modules/normalize-package-data/test/normalize.js @@ -158,21 +158,21 @@ tap.test("singularize repositories", function(t) { tap.test("treat visionmedia/express as github repo", function(t) { var d = {repository: {type: "git", url: "visionmedia/express"}} normalize(d) - t.same(d.repository, { type: "git", url: "git://github.com/visionmedia/express" }) + t.same(d.repository, { type: "git", url: "https://github.com/visionmedia/express" }) t.end() }); tap.test("treat isaacs/node-graceful-fs as github repo", function(t) { var d = {repository: {type: "git", url: "isaacs/node-graceful-fs"}} normalize(d) - t.same(d.repository, { type: "git", url: "git://github.com/isaacs/node-graceful-fs" }) + t.same(d.repository, { type: "git", url: "https://github.com/isaacs/node-graceful-fs" }) t.end() }); tap.test("homepage field will set to github url if repository is a github repo", function(t) { var a normalize(a={ - repository: { type: "git", url: "git://github.com/isaacs/node-graceful-fs" } + repository: { type: "git", url: "https://github.com/isaacs/node-graceful-fs" } }) t.same(a.homepage, 'https://github.com/isaacs/node-graceful-fs') t.end() @@ -199,7 +199,7 @@ tap.test("homepage field will set to github gist url if repository is a shorthan tap.test("treat isaacs/node-graceful-fs as github repo in dependencies", function(t) { var d = {dependencies: {"node-graceful-fs": "isaacs/node-graceful-fs"}} normalize(d) - t.same(d.dependencies, {"node-graceful-fs": "git://github.com/isaacs/node-graceful-fs" }) + t.same(d.dependencies, {"node-graceful-fs": "git+https://github.com/isaacs/node-graceful-fs" }) t.end() }); diff --git a/deps/npm/node_modules/read-package-json/package.json b/deps/npm/node_modules/read-package-json/package.json index fdfe963f6ff..5d64ff0e381 100644 --- a/deps/npm/node_modules/read-package-json/package.json +++ b/deps/npm/node_modules/read-package-json/package.json @@ -1,6 +1,6 @@ { "name": "read-package-json", - "version": "1.1.9", + "version": "1.2.2", "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", @@ -16,25 +16,26 @@ "test": "tap test/*.js" }, "dependencies": { - "glob": "~3.2.1", + "glob": "^4.0.2", "lru-cache": "2", - "normalize-package-data": "^0.2.13", - "graceful-fs": "2" + "normalize-package-data": "^0.3.0", + "graceful-fs": "2 || 3" }, "devDependencies": { "tap": "~0.2.5" }, "optionalDependencies": { - "graceful-fs": "2" + "graceful-fs": "2 || 3" }, "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### `wscript`\n\nIf a wscript file exists, and there is not already a `scripts.install`\nfield, then the `scripts.install` field will be set to `node-waf clean ;\nnode-waf configure build`.\n\nNote that the `bindings.gyp` file supercedes this, since node-waf has\nbeen deprecated in favor of node-gyp.\n\n### `index.js`\n\nIf the json file does not exist, but there is a `index.js` file\npresent instead, and that file has a package comment, then it will try\nto parse the package comment, and use that as the data instead.\n\nA package comment looks like this:\n\n```javascript\n/**package\n * { \"name\": \"my-bare-module\"\n * , \"version\": \"1.2.3\"\n * , \"description\": \"etc....\" }\n **/\n\n// or...\n\n/**package\n{ \"name\": \"my-bare-module\"\n, \"version\": \"1.2.3\"\n, \"description\": \"etc....\" }\n**/\n```\n\nThe important thing is that it starts with `/**package`, and ends with\n`**/`. If the package.json file exists, then the index.js is not\nparsed.\n\n### `{directories.man}/*.[0-9]`\n\nIf there is not already a `man` field defined as an array of files or a\nsingle file, and\nthere is a `directories.man` field defined, then that directory will\nbe searched for manpages.\n\nAny valid manpages found in that directory will be assigned to the `man`\narray, and installed in the appropriate man directory at package install\ntime, when installed globally on a Unix system.\n\n### `{directories.bin}/*`\n\nIf there is not already a `bin` field defined as a string filename or a\nhash of ` : ` pairs, then the `directories.bin`\ndirectory will be searched and all the files within it will be linked as\nexecutables at install time.\n\nWhen installing locally, npm links bins into `node_modules/.bin`, which\nis in the `PATH` environ when npm runs scripts. When\ninstalling globally, they are linked into `{prefix}/bin`, which is\npresumably in the `PATH` environment variable.\n", "readmeFilename": "README.md", + "gitHead": "ed8df916a4432b3317e4d3c7154aac2a790844cb", "bugs": { "url": "https://github.com/isaacs/read-package-json/issues" }, "homepage": "https://github.com/isaacs/read-package-json", - "_id": "read-package-json@1.1.9", - "_shasum": "9c319185e5f8461661c01f8d4e5e80b468aa18ee", + "_id": "read-package-json@1.2.2", + "_shasum": "545fc9044d135bf5fe0a67c6eab368c3186cbafe", "_from": "read-package-json@latest" } diff --git a/deps/npm/node_modules/rimraf/package.json b/deps/npm/node_modules/rimraf/package.json index d26d949f9c0..164fc495a44 100644 --- a/deps/npm/node_modules/rimraf/package.json +++ b/deps/npm/node_modules/rimraf/package.json @@ -1,6 +1,6 @@ { "name": "rimraf", - "version": "2.2.6", + "version": "2.2.8", "main": "rimraf.js", "description": "A deep deletion module for node (like `rm -rf`)", "author": { @@ -45,12 +45,29 @@ "email": "yosefd@microsoft.com" } ], - "readme": "`rm -rf` for node.\n\nInstall with `npm install rimraf`, or just drop rimraf.js somewhere.\n\n## API\n\n`rimraf(f, callback)`\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.\n* `ENOENT` - If the file doesn't exist, rimraf will return\n successfully, since your desired outcome is already the case.\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 ` 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", "bugs": { "url": "https://github.com/isaacs/rimraf/issues" }, "homepage": "https://github.com/isaacs/rimraf", - "_id": "rimraf@2.2.6", - "_from": "rimraf@~2.2.5" + "_id": "rimraf@2.2.8", + "_shasum": "e439be2aaee327321952730f99a8929e4fc50582", + "_from": "rimraf@latest", + "_npmVersion": "1.4.10", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "dist": { + "shasum": "e439be2aaee327321952730f99a8929e4fc50582", + "tarball": "http://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz" + }, + "directories": {}, + "_resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.2.8.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/rimraf/rimraf.js b/deps/npm/node_modules/rimraf/rimraf.js index ce62051fc59..eb96c46afde 100644 --- a/deps/npm/node_modules/rimraf/rimraf.js +++ b/deps/npm/node_modules/rimraf/rimraf.js @@ -1,6 +1,7 @@ module.exports = rimraf rimraf.sync = rimrafSync +var assert = require("assert") var path = require("path") var fs = require("fs") @@ -11,11 +12,36 @@ exports.BUSYTRIES_MAX = 3 var isWindows = (process.platform === "win32") -function rimraf (p, cb) { +function defaults (options) { + var methods = [ + 'unlink', + 'chmod', + 'stat', + 'rmdir', + 'readdir' + ] + methods.forEach(function(m) { + options[m] = options[m] || fs[m] + m = m + 'Sync' + options[m] = options[m] || fs[m] + }) +} + +function rimraf (p, options, cb) { + if (typeof options === 'function') { + cb = options + options = {} + } + assert(p) + assert(options) + assert(typeof cb === 'function') + + defaults(options) + if (!cb) throw new Error("No callback passed to rimraf()") var busyTries = 0 - rimraf_(p, function CB (er) { + rimraf_(p, options, function CB (er) { if (er) { if (isWindows && (er.code === "EBUSY" || er.code === "ENOTEMPTY") && busyTries < exports.BUSYTRIES_MAX) { @@ -23,14 +49,14 @@ function rimraf (p, cb) { var time = busyTries * 100 // try again, with the same exact callback as this one. return setTimeout(function () { - rimraf_(p, CB) + rimraf_(p, options, CB) }, time) } // this one won't happen if graceful-fs is used. if (er.code === "EMFILE" && timeout < exports.EMFILE_MAX) { return setTimeout(function () { - rimraf_(p, CB) + rimraf_(p, options, CB) }, timeout ++) } @@ -54,64 +80,91 @@ function rimraf (p, cb) { // // If anyone ever complains about this, then I guess the strategy could // be made configurable somehow. But until then, YAGNI. -function rimraf_ (p, cb) { - fs.unlink(p, function (er) { +function rimraf_ (p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.unlink(p, function (er) { if (er) { if (er.code === "ENOENT") return cb(null) if (er.code === "EPERM") - return (isWindows) ? fixWinEPERM(p, er, cb) : rmdir(p, er, cb) + return (isWindows) + ? fixWinEPERM(p, options, er, cb) + : rmdir(p, options, er, cb) if (er.code === "EISDIR") - return rmdir(p, er, cb) + return rmdir(p, options, er, cb) } return cb(er) }) } -function fixWinEPERM (p, er, cb) { - fs.chmod(p, 666, function (er2) { +function fixWinEPERM (p, options, er, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + if (er) + assert(er instanceof Error) + + options.chmod(p, 666, function (er2) { if (er2) cb(er2.code === "ENOENT" ? null : er) else - fs.stat(p, function(er3, stats) { + options.stat(p, function(er3, stats) { if (er3) cb(er3.code === "ENOENT" ? null : er) else if (stats.isDirectory()) - rmdir(p, er, cb) + rmdir(p, options, er, cb) else - fs.unlink(p, cb) + options.unlink(p, cb) }) }) } -function fixWinEPERMSync (p, er, cb) { +function fixWinEPERMSync (p, options, er) { + assert(p) + assert(options) + if (er) + assert(er instanceof Error) + try { - fs.chmodSync(p, 666) + options.chmodSync(p, 666) } catch (er2) { - if (er2.code !== "ENOENT") + if (er2.code === "ENOENT") + return + else throw er } try { - var stats = fs.statSync(p) + var stats = options.statSync(p) } catch (er3) { - if (er3 !== "ENOENT") + if (er3.code === "ENOENT") + return + else throw er } if (stats.isDirectory()) - rmdirSync(p, er) + rmdirSync(p, options, er) else - fs.unlinkSync(p) + options.unlinkSync(p) } -function rmdir (p, originalEr, cb) { +function rmdir (p, options, originalEr, cb) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + assert(typeof cb === 'function') + // try to rmdir first, and only readdir on ENOTEMPTY or EEXIST (SunOS) // if we guessed wrong, and it's not a directory, then // raise the original error. - fs.rmdir(p, function (er) { + options.rmdir(p, function (er) { if (er && (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM")) - rmkids(p, cb) + rmkids(p, options, cb) else if (er && er.code === "ENOTDIR") cb(originalEr) else @@ -119,22 +172,26 @@ function rmdir (p, originalEr, cb) { }) } -function rmkids(p, cb) { - fs.readdir(p, function (er, files) { +function rmkids(p, options, cb) { + assert(p) + assert(options) + assert(typeof cb === 'function') + + options.readdir(p, function (er, files) { if (er) return cb(er) var n = files.length if (n === 0) - return fs.rmdir(p, cb) + return options.rmdir(p, cb) var errState files.forEach(function (f) { - rimraf(path.join(p, f), function (er) { + rimraf(path.join(p, f), options, function (er) { if (errState) return if (er) return cb(errState = er) if (--n === 0) - fs.rmdir(p, cb) + options.rmdir(p, cb) }) }) }) @@ -143,36 +200,49 @@ function rmkids(p, cb) { // this looks simpler, and is strictly *faster*, but will // tie up the JavaScript thread and fail on excessively // deep directory trees. -function rimrafSync (p) { +function rimrafSync (p, options) { + options = options || {} + defaults(options) + + assert(p) + assert(options) + try { - fs.unlinkSync(p) + options.unlinkSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "EPERM") - return isWindows ? fixWinEPERMSync(p, er) : rmdirSync(p, er) + return isWindows ? fixWinEPERMSync(p, options, er) : rmdirSync(p, options, er) if (er.code !== "EISDIR") throw er - rmdirSync(p, er) + rmdirSync(p, options, er) } } -function rmdirSync (p, originalEr) { +function rmdirSync (p, options, originalEr) { + assert(p) + assert(options) + if (originalEr) + assert(originalEr instanceof Error) + try { - fs.rmdirSync(p) + options.rmdirSync(p) } catch (er) { if (er.code === "ENOENT") return if (er.code === "ENOTDIR") throw originalEr if (er.code === "ENOTEMPTY" || er.code === "EEXIST" || er.code === "EPERM") - rmkidsSync(p) + rmkidsSync(p, options) } } -function rmkidsSync (p) { - fs.readdirSync(p).forEach(function (f) { - rimrafSync(path.join(p, f)) +function rmkidsSync (p, options) { + assert(p) + assert(options) + options.readdirSync(p).forEach(function (f) { + rimrafSync(path.join(p, f), options) }) - fs.rmdirSync(p) + options.rmdirSync(p, options) } diff --git a/deps/npm/node_modules/rimraf/test/run.sh b/deps/npm/node_modules/rimraf/test/run.sh index 598f0163b23..653ff9b7988 100644 --- a/deps/npm/node_modules/rimraf/test/run.sh +++ b/deps/npm/node_modules/rimraf/test/run.sh @@ -1,10 +1,16 @@ #!/bin/bash set -e +code=0 for i in test-*.js; do echo -n $i ... bash setup.sh node $i - ! [ -d target ] - echo "pass" + if [ -d target ]; then + echo "fail" + code=1 + else + echo "pass" + fi done rm -rf target +exit $code diff --git a/deps/npm/node_modules/sha/README.md b/deps/npm/node_modules/sha/README.md index b1b45f0c3cc..c881194c213 100644 --- a/deps/npm/node_modules/sha/README.md +++ b/deps/npm/node_modules/sha/README.md @@ -2,9 +2,9 @@ Check and get file hashes (using any algorithm) -[![Build Status](https://travis-ci.org/ForbesLindesay/sha.png?branch=master)](https://travis-ci.org/ForbesLindesay/sha) -[![Dependency Status](https://gemnasium.com/ForbesLindesay/sha.png)](https://gemnasium.com/ForbesLindesay/sha) -[![NPM version](https://badge.fury.io/js/sha.png)](http://badge.fury.io/js/sha) +[![Build Status](https://img.shields.io/travis/ForbesLindesay/sha/master.svg)](https://travis-ci.org/ForbesLindesay/sha) +[![Dependency Status](https://img.shields.io/gemnasium/ForbesLindesay/sha.svg)](https://gemnasium.com/ForbesLindesay/sha) +[![NPM version](https://img.shields.io/npm/v/sha.svg)](http://badge.fury.io/js/sha) ## Installation diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/README.md index be976683e44..34c11897927 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/README.md +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/README.md @@ -1,768 +1,15 @@ # readable-stream -A new class of streams for Node.js +***Node-core streams for userland*** -This module provides the new Stream base classes introduced in Node -v0.10, for use in Node v0.8. You can use it to have programs that -have to work with node v0.8, while being forward-compatible for v0.10 -and beyond. When you drop support for v0.8, you can remove this -module, and only use the native streams. +[![NPM](https://nodei.co/npm/readable-stream.png?downloads=true)](https://nodei.co/npm/readable-stream/) +[![NPM](https://nodei.co/npm-dl/readable-stream.png)](https://nodei.co/npm/readable-stream/) -This is almost exactly the same codebase as appears in Node v0.10. -However: +This package is a mirror of the Streams2 and Streams3 implementations in Node-core. -1. The exported object is actually the Readable class. Decorating the - native `stream` module would be global pollution. -2. In v0.10, you can safely use `base64` as an argument to - `setEncoding` in Readable streams. However, in v0.8, the - StringDecoder class has no `end()` method, which is problematic for - Base64. So, don't use that, because it'll break and be weird. +If you want to guarantee a stable streams base, regardless of what version of Node you, or the users of your libraries are using, use **readable-stream** *only* and avoid the *"stream"* module in Node-core. -Other than that, the API is the same as `require('stream')` in v0.10, -so the API docs are reproduced below. +**readable-stream** comes in two major versions, v1.0.x and v1.1.x. The former tracks the Streams2 implementation in Node 0.10, including bug-fixes and minor improvements as they are added. The latter tracks Streams3 as it develops in Node 0.11; we will likely see a v1.2.x branch for Node 0.12. ----------- +**readable-stream** uses proper patch-level versioning so if you pin to `"~1.0.0"` you’ll get the latest Node 0.10 Streams2 implementation, including any fixes and minor non-breaking improvements. The patch-level versions of 1.0.x and 1.1.x should mirror the patch-level versions of Node-core releases. You should prefer the **1.0.x** releases for now and when you’re ready to start using Streams3, pin to `"~1.1.0"` - Stability: 2 - Unstable - -A stream is an abstract interface implemented by various objects in -Node. 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][] - -You can load the Stream base classes by doing `require('stream')`. -There are base classes provided for Readable streams, Writable -streams, Duplex streams, and Transform streams. - -## Compatibility - -In earlier versions of Node, the Readable stream interface was -simpler, but also less powerful and less useful. - -* Rather than waiting for you to call the `read()` method, `'data'` - events would start emitting immediately. If you needed to do some - I/O to decide how to handle data, then you had to store the chunks - in some kind of buffer so that they would not be lost. -* The `pause()` method was advisory, rather than guaranteed. This - meant that you still had to be prepared to receive `'data'` events - even when the stream was in a paused state. - -In Node v0.10, the Readable class described below was added. For -backwards compatibility with older Node programs, Readable streams -switch into "old mode" when a `'data'` event handler is added, or when -the `pause()` or `resume()` methods are called. The effect is that, -even if you are not using the new `read()` method and `'readable'` -event, you no longer have to worry about losing `'data'` chunks. - -Most programs will continue to function normally. However, this -introduces an edge case in the following conditions: - -* No `'data'` event handler is added. -* The `pause()` and `resume()` methods are never called. - -For example, consider the following code: - -```javascript -// WARNING! BROKEN! -net.createServer(function(socket) { - - // we add an 'end' method, but never consume the data - socket.on('end', function() { - // It will never get here. - socket.end('I got your message (but didnt read it)\n'); - }); - -}).listen(1337); -``` - -In versions of node prior to v0.10, the incoming message data would be -simply discarded. However, in Node v0.10 and beyond, the socket will -remain paused forever. - -The workaround in this situation is to call the `resume()` method to -trigger "old mode" behavior: - -```javascript -// Workaround -net.createServer(function(socket) { - - socket.on('end', function() { - socket.end('I got your message (but didnt read it)\n'); - }); - - // start the flow of data, discarding it. - socket.resume(); - -}).listen(1337); -``` - -In addition to new Readable streams switching into old-mode, pre-v0.10 -style streams can be wrapped in a Readable class using the `wrap()` -method. - -## Class: stream.Readable - - - -A `Readable Stream` has the following methods, members, and events. - -Note that `stream.Readable` is an abstract class designed to be -extended with an underlying implementation of the `_read(size)` -method. (See below.) - -### 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 - * `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 - -In classes that extend the Readable class, make sure to call the -constructor so that the buffering settings can be properly -initialized. - -### readable.\_read(size) - -* `size` {Number} Number of bytes to read asynchronously - -Note: **This function should NOT be called directly.** It should be -implemented by child classes, and called by the internal Readable -class methods only. - -All Readable stream implementations must provide a `_read` method -to fetch data from the underlying resource. - -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. - -When data is available, put it into the read queue by calling -`readable.push(chunk)`. If `push` returns false, then you should stop -reading. When `_read` is called again, you should start pushing more -data. - -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) - -* `chunk` {Buffer | null | String} Chunk of data to push into the read queue -* return {Boolean} Whether or not more pushes should be performed - -Note: **This function should be called by Readable implementors, NOT -by consumers of Readable subclasses.** The `_read()` function will not -be called again until at least one `push(chunk)` call is made. If no -data is available, then you MAY call `push('')` (an empty string) to -allow a future `_read` call, without adding any data to the queue. - -The `Readable` class works by putting data into a read queue to be -pulled out later by calling the `read()` method when the `'readable'` -event fires. - -The `push()` method will explicitly insert some data into the read -queue. If it is called with `null` then it will signal the end of the -data. - -In some cases, 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. - -var stream = new Readable(); - -source.ondata = function(chunk) { - // if push() returns false, then we need to stop reading from source - if (!stream.push(chunk)) - source.readStop(); -}; - -source.onend = function() { - stream.push(null); -}; - -// _read will be called when the stream wants to pull more data in -// the advisory size argument is ignored in this case. -stream._read = function(n) { - source.readStart(); -}; -``` - -### readable.unshift(chunk) - -* `chunk` {Buffer | null | String} Chunk of data to unshift onto the read queue -* return {Boolean} Whether or not more pushes should be performed - -This is the corollary of `readable.push(chunk)`. Rather than putting -the data at the *end* of the read queue, it puts it at the *front* of -the read queue. - -This is useful in certain use-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. - -```javascript -// A parser for a simple data protocol. -// The "header" is a JSON object, followed by 2 \n characters, and -// then a message body. -// -// Note: This can be done more simply as a Transform stream. See below. - -function SimpleProtocol(source, options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Readable.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - - // source is a readable stream, such as a socket or file - this._source = source; - - var self = this; - source.on('end', function() { - self.push(null); - }); - - // give it a kick whenever the source is readable - // read(0) will not consume any bytes - source.on('readable', function() { - self.read(0); - }); - - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype = Object.create( - Readable.prototype, { constructor: { value: SimpleProtocol }}); - -SimpleProtocol.prototype._read = function(n) { - if (!this._inBody) { - var chunk = this._source.read(); - - // if the source doesn't have data, we don't have data yet. - if (chunk === null) - return this.push(''); - - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - this.push(''); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // now, because we got some extra data, unshift the rest - // back into the read queue so that our consumer will see it. - var b = chunk.slice(split); - this.unshift(b); - - // and let them know that we are done parsing the header. - this.emit('header', this.header); - } - } else { - // from there on, just provide the data to our consumer. - // careful not to push(null), since that would indicate EOF. - var chunk = this._source.read(); - if (chunk) this.push(chunk); - } -}; - -// Usage: -var parser = new SimpleProtocol(source); -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - -### readable.wrap(stream) - -* `stream` {Stream} An "old style" readable stream - -If you are using an older Node library that emits `'data'` events and -has a `pause()` method that is advisory only, then you can use the -`wrap()` method to create a Readable stream that uses the old stream -as its data source. - -For example: - -```javascript -var OldReader = require('./old-api-module.js').OldReader; -var oreader = new OldReader; -var Readable = require('stream').Readable; -var myReader = new Readable().wrap(oreader); - -myReader.on('readable', function() { - myReader.read(); // etc. -}); -``` - -### Event: 'readable' - -When there is data ready to be consumed, this event will fire. - -When this event emits, call the `read()` method to consume the data. - -### Event: 'end' - -Emitted when the stream has received an EOF (FIN in TCP terminology). -Indicates that no more `'data'` events will happen. If the stream is -also writable, it may be possible to continue writing. - -### Event: 'data' - -The `'data'` event emits either a `Buffer` (by default) or a string if -`setEncoding()` was used. - -Note that adding a `'data'` event listener will switch the Readable -stream into "old mode", where data is emitted as soon as it is -available, rather than waiting for you to call `read()` to consume it. - -### Event: 'error' - -Emitted if there was an error receiving data. - -### Event: 'close' - -Emitted when the underlying resource (for example, the backing file -descriptor) has been closed. Not all streams will emit this. - -### readable.setEncoding(encoding) - -Makes the `'data'` event emit a string instead of a `Buffer`. `encoding` -can be `'utf8'`, `'utf16le'` (`'ucs2'`), `'ascii'`, or `'hex'`. - -The encoding can also be set by specifying an `encoding` field to the -constructor. - -### readable.read([size]) - -* `size` {Number | null} Optional number of bytes to read. -* Return: {Buffer | String | null} - -Note: **This function SHOULD be called by Readable stream users.** - -Call this method to consume data once the `'readable'` event is -emitted. - -The `size` argument will set a minimum number of bytes that you are -interested in. If not set, then the entire content of the internal -buffer is returned. - -If there is no data to consume, or if there are fewer bytes in the -internal buffer than the `size` argument, then `null` is returned, and -a future `'readable'` event will be emitted when more is available. - -Calling `stream.read(0)` will always return `null`, and will trigger a -refresh of the internal buffer, but otherwise be a no-op. - -### readable.pipe(destination, [options]) - -* `destination` {Writable Stream} -* `options` {Object} Optional - * `end` {Boolean} Default=true - -Connects this readable stream to `destination` WriteStream. Incoming -data on this stream gets written to `destination`. Properly manages -back-pressure so that a slow destination will not be overwhelmed by a -fast readable stream. - -This function returns the `destination` stream. - -For example, emulating the Unix `cat` command: - - process.stdin.pipe(process.stdout); - -By default `end()` is called on the destination when the source stream -emits `end`, so that `destination` is no longer writable. Pass `{ end: -false }` as `options` to keep the destination stream open. - -This keeps `writer` open so that "Goodbye" can be written at the -end. - - reader.pipe(writer, { end: false }); - reader.on("end", function() { - writer.end("Goodbye\n"); - }); - -Note that `process.stderr` and `process.stdout` are never closed until -the process exits, regardless of the specified options. - -### readable.unpipe([destination]) - -* `destination` {Writable Stream} Optional - -Undo a previously established `pipe()`. If no destination is -provided, then all previously established pipes are removed. - -### readable.pause() - -Switches the readable stream into "old mode", where data is emitted -using a `'data'` event rather than being buffered for consumption via -the `read()` method. - -Ceases the flow of data. No `'data'` events are emitted while the -stream is in a paused state. - -### readable.resume() - -Switches the readable stream into "old mode", where data is emitted -using a `'data'` event rather than being buffered for consumption via -the `read()` method. - -Resumes the incoming `'data'` events after a `pause()`. - - -## Class: stream.Writable - - - -A `Writable` Stream has the following methods, members, and events. - -Note that `stream.Writable` is an abstract class designed to be -extended with an underlying implementation of the -`_write(chunk, encoding, cb)` method. (See below.) - -### new stream.Writable([options]) - -* `options` {Object} - * `highWaterMark` {Number} Buffer level when `write()` starts - returning false. Default=16kb - * `decodeStrings` {Boolean} Whether or not to decode strings into - Buffers before passing them to `_write()`. Default=true - -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. Ignore chunk is a buffer. Note that chunk will - **always** be a buffer unless the `decodeStrings` option is - explicitly set to `false`. -* `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.write(chunk, [encoding], [callback]) - -* `chunk` {Buffer | String} Data to be written -* `encoding` {String} Optional. If `chunk` is a string, then encoding - defaults to `'utf8'` -* `callback` {Function} Optional. Called when this chunk is - successfully written. -* Returns {Boolean} - -Writes `chunk` to the stream. Returns `true` if the data has been -flushed to the underlying resource. Returns `false` to indicate that -the buffer is full, and the data will be sent out in the future. The -`'drain'` event will indicate when the buffer is empty again. - -The specifics of when `write()` will return false, is determined by -the `highWaterMark` option provided to the constructor. - -### writable.end([chunk], [encoding], [callback]) - -* `chunk` {Buffer | String} Optional final data to be written -* `encoding` {String} Optional. If `chunk` is a string, then encoding - defaults to `'utf8'` -* `callback` {Function} Optional. Called when the final chunk is - successfully written. - -Call this method to signal the end of the data being written to the -stream. - -### Event: 'drain' - -Emitted when the stream's write queue empties and it's safe to write -without buffering again. Listen for it when `stream.write()` returns -`false`. - -### Event: 'close' - -Emitted when the underlying resource (for example, the backing file -descriptor) has been closed. Not all streams will emit this. - -### Event: 'finish' - -When `end()` is called and there are no more chunks to write, this -event is emitted. - -### Event: 'pipe' - -* `source` {Readable Stream} - -Emitted when the stream is passed to a readable stream's pipe method. - -### Event 'unpipe' - -* `source` {Readable Stream} - -Emitted when a previously established `pipe()` is removed using the -source Readable stream's `unpipe()` method. - -## Class: stream.Duplex - - - -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, cb)` 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. - -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 -connected in some way to the input, such as a zlib stream or a crypto -stream. - -There is no requirement that the output be the same size as the input, -the same number of chunks, or arrive at the same time. For example, a -Hash stream will only ever have a single chunk of output which is -provided when the input is ended. A zlib stream will either produce -much smaller or much larger than its input. - -Rather than implement the `_read()` and `_write()` methods, Transform -classes must implement the `_transform()` method, and may optionally -also implement the `_flush()` method. (See below.) - -### new stream.Transform([options]) - -* `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. - -### transform.\_transform(chunk, encoding, callback) - -* `chunk` {Buffer | String} The chunk to be transformed. 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. (Ignore if `decodeStrings` chunk is a buffer.) -* `callback` {Function} Call this function (optionally with an error - argument) when you are done processing the supplied chunk. - -Note: **This function MUST NOT be called directly.** It should be -implemented by child classes, and called by the internal Transform -class methods only. - -All Transform stream implementations must provide a `_transform` -method to accept input and produce output. - -`_transform` should do whatever has to be done in this specific -Transform class, to handle the bytes being written, and pass them off -to the readable portion of the interface. Do asynchronous I/O, -process things, and so on. - -Call `transform.push(outputChunk)` 0 or more times to generate output -from this input chunk, depending on how much data you want to output -as a result of this chunk. - -Call the callback function only when the current chunk is completely -consumed. Note that there may or may not be output as a result of any -particular input chunk. - -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.\_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. - -### Example: `SimpleProtocol` parser - -The example above of a simple protocol parser can be implemented much -more simply by using the higher level `Transform` stream class. - -In this example, rather than providing the input as an argument, it -would be piped into the parser, which is a more idiomatic Node stream -approach. - -```javascript -function SimpleProtocol(options) { - if (!(this instanceof SimpleProtocol)) - return new SimpleProtocol(options); - - Transform.call(this, options); - this._inBody = false; - this._sawFirstCr = false; - this._rawHeader = []; - this.header = null; -} - -SimpleProtocol.prototype = Object.create( - Transform.prototype, { constructor: { value: SimpleProtocol }}); - -SimpleProtocol.prototype._transform = function(chunk, encoding, done) { - if (!this._inBody) { - // check if the chunk has a \n\n - var split = -1; - for (var i = 0; i < chunk.length; i++) { - if (chunk[i] === 10) { // '\n' - if (this._sawFirstCr) { - split = i; - break; - } else { - this._sawFirstCr = true; - } - } else { - this._sawFirstCr = false; - } - } - - if (split === -1) { - // still waiting for the \n\n - // stash the chunk, and try again. - this._rawHeader.push(chunk); - } else { - this._inBody = true; - var h = chunk.slice(0, split); - this._rawHeader.push(h); - var header = Buffer.concat(this._rawHeader).toString(); - try { - this.header = JSON.parse(header); - } catch (er) { - this.emit('error', new Error('invalid simple protocol data')); - return; - } - // and let them know that we are done parsing the header. - this.emit('header', this.header); - - // now, because we got some extra data, emit this first. - this.push(b); - } - } else { - // from there on, just provide the data to our consumer as-is. - this.push(b); - } - done(); -}; - -var parser = new SimpleProtocol(); -source.pipe(parser) - -// Now parser is a readable stream that will emit 'header' -// with the parsed header data. -``` - - -## 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. - - -[EventEmitter]: events.html#events_class_events_eventemitter diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/float.patch b/deps/npm/node_modules/sha/node_modules/readable-stream/float.patch deleted file mode 100644 index 0ad71a1f0d3..00000000000 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/float.patch +++ /dev/null @@ -1,68 +0,0 @@ -diff --git a/lib/_stream_duplex.js b/lib/_stream_duplex.js -index c5a741c..a2e0d8e 100644 ---- a/lib/_stream_duplex.js -+++ b/lib/_stream_duplex.js -@@ -26,8 +26,8 @@ - - module.exports = Duplex; - var util = require('util'); --var Readable = require('_stream_readable'); --var Writable = require('_stream_writable'); -+var Readable = require('./_stream_readable'); -+var Writable = require('./_stream_writable'); - - util.inherits(Duplex, Readable); - -diff --git a/lib/_stream_passthrough.js b/lib/_stream_passthrough.js -index a5e9864..330c247 100644 ---- a/lib/_stream_passthrough.js -+++ b/lib/_stream_passthrough.js -@@ -25,7 +25,7 @@ - - module.exports = PassThrough; - --var Transform = require('_stream_transform'); -+var Transform = require('./_stream_transform'); - var util = require('util'); - util.inherits(PassThrough, Transform); - -diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js -index 2259d2e..e6681ee 100644 ---- a/lib/_stream_readable.js -+++ b/lib/_stream_readable.js -@@ -23,6 +23,9 @@ module.exports = Readable; - Readable.ReadableState = ReadableState; - - var EE = require('events').EventEmitter; -+if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { -+ return emitter.listeners(type).length; -+}; - var Stream = require('stream'); - var util = require('util'); - var StringDecoder; -diff --git a/lib/_stream_transform.js b/lib/_stream_transform.js -index e925b4b..f08b05e 100644 ---- a/lib/_stream_transform.js -+++ b/lib/_stream_transform.js -@@ -64,7 +64,7 @@ - - module.exports = Transform; - --var Duplex = require('_stream_duplex'); -+var Duplex = require('./_stream_duplex'); - var util = require('util'); - util.inherits(Transform, Duplex); - -diff --git a/lib/_stream_writable.js b/lib/_stream_writable.js -index a26f711..56ca47d 100644 ---- a/lib/_stream_writable.js -+++ b/lib/_stream_writable.js -@@ -109,7 +109,7 @@ function WritableState(options, stream) { - function Writable(options) { - // Writable ctor is applied to Duplexes, though they're not - // instanceof Writable, they're instanceof Readable. -- if (!(this instanceof Writable) && !(this instanceof Stream.Duplex)) -+ if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex'))) - return new Writable(options); - - this._writableState = new WritableState(options, this); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js index a2e0d8e0dac..b513d61a963 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_duplex.js @@ -25,13 +25,27 @@ // Writable. module.exports = Duplex; -var util = require('util'); + +/**/ +var objectKeys = Object.keys || function (obj) { + var keys = []; + for (var key in obj) keys.push(key); + return keys; +} +/**/ + + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + var Readable = require('./_stream_readable'); var Writable = require('./_stream_writable'); util.inherits(Duplex, Readable); -Object.keys(Writable.prototype).forEach(function(method) { +forEach(objectKeys(Writable.prototype), function(method) { if (!Duplex.prototype[method]) Duplex.prototype[method] = Writable.prototype[method]; }); @@ -67,3 +81,9 @@ function onend() { // But allow more writes to happen in this tick. process.nextTick(this.end.bind(this)); } + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js index 330c247d401..895ca50a1d2 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_passthrough.js @@ -26,7 +26,12 @@ module.exports = PassThrough; var Transform = require('./_stream_transform'); -var util = require('util'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + util.inherits(PassThrough, Transform); function PassThrough(options) { diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js index 0ac8534b7a4..0ca77052840 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_readable.js @@ -20,14 +20,33 @@ // USE OR OTHER DEALINGS IN THE SOFTWARE. module.exports = Readable; + +/**/ +var isArray = require('isarray'); +/**/ + + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + Readable.ReadableState = ReadableState; var EE = require('events').EventEmitter; + +/**/ if (!EE.listenerCount) EE.listenerCount = function(emitter, type) { return emitter.listeners(type).length; }; +/**/ + var Stream = require('stream'); -var util = require('util'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + var StringDecoder; util.inherits(Readable, Stream); @@ -94,7 +113,7 @@ function ReadableState(options, stream) { this.encoding = null; if (options.encoding) { if (!StringDecoder) - StringDecoder = require('string_decoder').StringDecoder; + StringDecoder = require('string_decoder/').StringDecoder; this.decoder = new StringDecoder(options.encoding); this.encoding = options.encoding; } @@ -195,7 +214,7 @@ function needMoreData(state) { // backwards compatibility. Readable.prototype.setEncoding = function(enc) { if (!StringDecoder) - StringDecoder = require('string_decoder').StringDecoder; + StringDecoder = require('string_decoder/').StringDecoder; this._readableState.decoder = new StringDecoder(enc); this._readableState.encoding = enc; }; @@ -372,7 +391,7 @@ function chunkInvalid(state, chunk) { function onEofChunk(stream, state) { - if (state.decoder && !state.ended && state.decoder.end) { + if (state.decoder && !state.ended) { var chunk = state.decoder.end(); if (chunk && chunk.length) { state.buffer.push(chunk); @@ -524,7 +543,7 @@ Readable.prototype.pipe = function(dest, pipeOpts) { // is attached before any userland ones. NEVER DO THIS. if (!dest._events || !dest._events.error) dest.on('error', onerror); - else if (Array.isArray(dest._events.error)) + else if (isArray(dest._events.error)) dest._events.error.unshift(onerror); else dest._events.error = [onerror, dest._events.error]; @@ -594,7 +613,7 @@ function flow(src) { if (state.pipesCount === 1) write(state.pipes, 0, null); else - state.pipes.forEach(write); + forEach(state.pipes, write); src.emit('data', chunk); @@ -672,7 +691,7 @@ Readable.prototype.unpipe = function(dest) { } // try to find the right one. - var i = state.pipes.indexOf(dest); + var i = indexOf(state.pipes, dest); if (i === -1) return this; @@ -818,7 +837,7 @@ Readable.prototype.wrap = function(stream) { // proxy certain important events. var events = ['error', 'close', 'destroy', 'pause', 'resume']; - events.forEach(function(ev) { + forEach(events, function(ev) { stream.on(ev, self.emit.bind(self, ev)); }); @@ -925,3 +944,16 @@ function endReadable(stream) { }); } } + +function forEach (xs, f) { + for (var i = 0, l = xs.length; i < l; i++) { + f(xs[i], i); + } +} + +function indexOf (xs, x) { + for (var i = 0, l = xs.length; i < l; i++) { + if (xs[i] === x) return i; + } + return -1; +} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js index 707e4b3bf00..eb188df3e86 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_transform.js @@ -65,7 +65,12 @@ module.exports = Transform; var Duplex = require('./_stream_duplex'); -var util = require('util'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + util.inherits(Transform, Duplex); diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js index 4b976a9f3fc..d0254d5a714 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/lib/_stream_writable.js @@ -24,10 +24,20 @@ // the drain event emission and buffering. module.exports = Writable; + +/**/ +var Buffer = require('buffer').Buffer; +/**/ + Writable.WritableState = WritableState; -var util = require('util'); -var assert = require('assert'); + +/**/ +var util = require('core-util-is'); +util.inherits = require('inherits'); +/**/ + + var Stream = require('stream'); util.inherits(Writable, Stream); @@ -104,12 +114,17 @@ function WritableState(options, stream) { this.writelen = 0; this.buffer = []; + + // True if the error was already emitted and should not be thrown again + this.errorEmitted = false; } function Writable(options) { + var Duplex = require('./_stream_duplex'); + // Writable ctor is applied to Duplexes, though they're not // instanceof Writable, they're instanceof Readable. - if (!(this instanceof Writable) && !(this instanceof require('./_stream_duplex'))) + if (!(this instanceof Writable) && !(this instanceof Duplex)) return new Writable(options); this._writableState = new WritableState(options, this); @@ -203,7 +218,9 @@ function writeOrBuffer(stream, state, chunk, encoding, cb) { state.length += len; var ret = state.length < state.highWaterMark; - state.needDrain = !ret; + // we must ensure that previous needDrain will not be reset to false. + if (!ret) + state.needDrain = true; if (state.writing) state.buffer.push(new WriteReq(chunk, encoding, cb)); @@ -230,6 +247,7 @@ function onwriteError(stream, state, sync, er, cb) { else cb(er); + stream._writableState.errorEmitted = true; stream.emit('error', er); } diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md new file mode 100644 index 00000000000..5a76b4149c5 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/README.md @@ -0,0 +1,3 @@ +# core-util-is + +The `util.is*` functions introduced in Node v0.12. diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch new file mode 100644 index 00000000000..a06d5c05f75 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/float.patch @@ -0,0 +1,604 @@ +diff --git a/lib/util.js b/lib/util.js +index a03e874..9074e8e 100644 +--- a/lib/util.js ++++ b/lib/util.js +@@ -19,430 +19,6 @@ + // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE + // USE OR OTHER DEALINGS IN THE SOFTWARE. + +-var formatRegExp = /%[sdj%]/g; +-exports.format = function(f) { +- if (!isString(f)) { +- var objects = []; +- for (var i = 0; i < arguments.length; i++) { +- objects.push(inspect(arguments[i])); +- } +- return objects.join(' '); +- } +- +- var i = 1; +- var args = arguments; +- var len = args.length; +- var str = String(f).replace(formatRegExp, function(x) { +- if (x === '%%') return '%'; +- if (i >= len) return x; +- switch (x) { +- case '%s': return String(args[i++]); +- case '%d': return Number(args[i++]); +- case '%j': +- try { +- return JSON.stringify(args[i++]); +- } catch (_) { +- return '[Circular]'; +- } +- default: +- return x; +- } +- }); +- for (var x = args[i]; i < len; x = args[++i]) { +- if (isNull(x) || !isObject(x)) { +- str += ' ' + x; +- } else { +- str += ' ' + inspect(x); +- } +- } +- return str; +-}; +- +- +-// Mark that a method should not be used. +-// Returns a modified function which warns once by default. +-// If --no-deprecation is set, then it is a no-op. +-exports.deprecate = function(fn, msg) { +- // Allow for deprecating things in the process of starting up. +- if (isUndefined(global.process)) { +- return function() { +- return exports.deprecate(fn, msg).apply(this, arguments); +- }; +- } +- +- if (process.noDeprecation === true) { +- return fn; +- } +- +- var warned = false; +- function deprecated() { +- if (!warned) { +- if (process.throwDeprecation) { +- throw new Error(msg); +- } else if (process.traceDeprecation) { +- console.trace(msg); +- } else { +- console.error(msg); +- } +- warned = true; +- } +- return fn.apply(this, arguments); +- } +- +- return deprecated; +-}; +- +- +-var debugs = {}; +-var debugEnviron; +-exports.debuglog = function(set) { +- if (isUndefined(debugEnviron)) +- debugEnviron = process.env.NODE_DEBUG || ''; +- set = set.toUpperCase(); +- if (!debugs[set]) { +- if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) { +- var pid = process.pid; +- debugs[set] = function() { +- var msg = exports.format.apply(exports, arguments); +- console.error('%s %d: %s', set, pid, msg); +- }; +- } else { +- debugs[set] = function() {}; +- } +- } +- return debugs[set]; +-}; +- +- +-/** +- * Echos the value of a value. Trys to print the value out +- * in the best way possible given the different types. +- * +- * @param {Object} obj The object to print out. +- * @param {Object} opts Optional options object that alters the output. +- */ +-/* legacy: obj, showHidden, depth, colors*/ +-function inspect(obj, opts) { +- // default options +- var ctx = { +- seen: [], +- stylize: stylizeNoColor +- }; +- // legacy... +- if (arguments.length >= 3) ctx.depth = arguments[2]; +- if (arguments.length >= 4) ctx.colors = arguments[3]; +- if (isBoolean(opts)) { +- // legacy... +- ctx.showHidden = opts; +- } else if (opts) { +- // got an "options" object +- exports._extend(ctx, opts); +- } +- // set default options +- if (isUndefined(ctx.showHidden)) ctx.showHidden = false; +- if (isUndefined(ctx.depth)) ctx.depth = 2; +- if (isUndefined(ctx.colors)) ctx.colors = false; +- if (isUndefined(ctx.customInspect)) ctx.customInspect = true; +- if (ctx.colors) ctx.stylize = stylizeWithColor; +- return formatValue(ctx, obj, ctx.depth); +-} +-exports.inspect = inspect; +- +- +-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics +-inspect.colors = { +- 'bold' : [1, 22], +- 'italic' : [3, 23], +- 'underline' : [4, 24], +- 'inverse' : [7, 27], +- 'white' : [37, 39], +- 'grey' : [90, 39], +- 'black' : [30, 39], +- 'blue' : [34, 39], +- 'cyan' : [36, 39], +- 'green' : [32, 39], +- 'magenta' : [35, 39], +- 'red' : [31, 39], +- 'yellow' : [33, 39] +-}; +- +-// Don't use 'blue' not visible on cmd.exe +-inspect.styles = { +- 'special': 'cyan', +- 'number': 'yellow', +- 'boolean': 'yellow', +- 'undefined': 'grey', +- 'null': 'bold', +- 'string': 'green', +- 'date': 'magenta', +- // "name": intentionally not styling +- 'regexp': 'red' +-}; +- +- +-function stylizeWithColor(str, styleType) { +- var style = inspect.styles[styleType]; +- +- if (style) { +- return '\u001b[' + inspect.colors[style][0] + 'm' + str + +- '\u001b[' + inspect.colors[style][1] + 'm'; +- } else { +- return str; +- } +-} +- +- +-function stylizeNoColor(str, styleType) { +- return str; +-} +- +- +-function arrayToHash(array) { +- var hash = {}; +- +- array.forEach(function(val, idx) { +- hash[val] = true; +- }); +- +- return hash; +-} +- +- +-function formatValue(ctx, value, recurseTimes) { +- // Provide a hook for user-specified inspect functions. +- // Check that value is an object with an inspect function on it +- if (ctx.customInspect && +- value && +- isFunction(value.inspect) && +- // Filter out the util module, it's inspect function is special +- value.inspect !== exports.inspect && +- // Also filter out any prototype objects using the circular check. +- !(value.constructor && value.constructor.prototype === value)) { +- var ret = value.inspect(recurseTimes, ctx); +- if (!isString(ret)) { +- ret = formatValue(ctx, ret, recurseTimes); +- } +- return ret; +- } +- +- // Primitive types cannot have properties +- var primitive = formatPrimitive(ctx, value); +- if (primitive) { +- return primitive; +- } +- +- // Look up the keys of the object. +- var keys = Object.keys(value); +- var visibleKeys = arrayToHash(keys); +- +- if (ctx.showHidden) { +- keys = Object.getOwnPropertyNames(value); +- } +- +- // Some type of object without properties can be shortcutted. +- if (keys.length === 0) { +- if (isFunction(value)) { +- var name = value.name ? ': ' + value.name : ''; +- return ctx.stylize('[Function' + name + ']', 'special'); +- } +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } +- if (isDate(value)) { +- return ctx.stylize(Date.prototype.toString.call(value), 'date'); +- } +- if (isError(value)) { +- return formatError(value); +- } +- } +- +- var base = '', array = false, braces = ['{', '}']; +- +- // Make Array say that they are Array +- if (isArray(value)) { +- array = true; +- braces = ['[', ']']; +- } +- +- // Make functions say that they are functions +- if (isFunction(value)) { +- var n = value.name ? ': ' + value.name : ''; +- base = ' [Function' + n + ']'; +- } +- +- // Make RegExps say that they are RegExps +- if (isRegExp(value)) { +- base = ' ' + RegExp.prototype.toString.call(value); +- } +- +- // Make dates with properties first say the date +- if (isDate(value)) { +- base = ' ' + Date.prototype.toUTCString.call(value); +- } +- +- // Make error with message first say the error +- if (isError(value)) { +- base = ' ' + formatError(value); +- } +- +- if (keys.length === 0 && (!array || value.length == 0)) { +- return braces[0] + base + braces[1]; +- } +- +- if (recurseTimes < 0) { +- if (isRegExp(value)) { +- return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp'); +- } else { +- return ctx.stylize('[Object]', 'special'); +- } +- } +- +- ctx.seen.push(value); +- +- var output; +- if (array) { +- output = formatArray(ctx, value, recurseTimes, visibleKeys, keys); +- } else { +- output = keys.map(function(key) { +- return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array); +- }); +- } +- +- ctx.seen.pop(); +- +- return reduceToSingleString(output, base, braces); +-} +- +- +-function formatPrimitive(ctx, value) { +- if (isUndefined(value)) +- return ctx.stylize('undefined', 'undefined'); +- if (isString(value)) { +- var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '') +- .replace(/'/g, "\\'") +- .replace(/\\"/g, '"') + '\''; +- return ctx.stylize(simple, 'string'); +- } +- if (isNumber(value)) { +- // Format -0 as '-0'. Strict equality won't distinguish 0 from -0, +- // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 . +- if (value === 0 && 1 / value < 0) +- return ctx.stylize('-0', 'number'); +- return ctx.stylize('' + value, 'number'); +- } +- if (isBoolean(value)) +- return ctx.stylize('' + value, 'boolean'); +- // For some reason typeof null is "object", so special case here. +- if (isNull(value)) +- return ctx.stylize('null', 'null'); +-} +- +- +-function formatError(value) { +- return '[' + Error.prototype.toString.call(value) + ']'; +-} +- +- +-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) { +- var output = []; +- for (var i = 0, l = value.length; i < l; ++i) { +- if (hasOwnProperty(value, String(i))) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- String(i), true)); +- } else { +- output.push(''); +- } +- } +- keys.forEach(function(key) { +- if (!key.match(/^\d+$/)) { +- output.push(formatProperty(ctx, value, recurseTimes, visibleKeys, +- key, true)); +- } +- }); +- return output; +-} +- +- +-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) { +- var name, str, desc; +- desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] }; +- if (desc.get) { +- if (desc.set) { +- str = ctx.stylize('[Getter/Setter]', 'special'); +- } else { +- str = ctx.stylize('[Getter]', 'special'); +- } +- } else { +- if (desc.set) { +- str = ctx.stylize('[Setter]', 'special'); +- } +- } +- if (!hasOwnProperty(visibleKeys, key)) { +- name = '[' + key + ']'; +- } +- if (!str) { +- if (ctx.seen.indexOf(desc.value) < 0) { +- if (isNull(recurseTimes)) { +- str = formatValue(ctx, desc.value, null); +- } else { +- str = formatValue(ctx, desc.value, recurseTimes - 1); +- } +- if (str.indexOf('\n') > -1) { +- if (array) { +- str = str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n').substr(2); +- } else { +- str = '\n' + str.split('\n').map(function(line) { +- return ' ' + line; +- }).join('\n'); +- } +- } +- } else { +- str = ctx.stylize('[Circular]', 'special'); +- } +- } +- if (isUndefined(name)) { +- if (array && key.match(/^\d+$/)) { +- return str; +- } +- name = JSON.stringify('' + key); +- if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) { +- name = name.substr(1, name.length - 2); +- name = ctx.stylize(name, 'name'); +- } else { +- name = name.replace(/'/g, "\\'") +- .replace(/\\"/g, '"') +- .replace(/(^"|"$)/g, "'"); +- name = ctx.stylize(name, 'string'); +- } +- } +- +- return name + ': ' + str; +-} +- +- +-function reduceToSingleString(output, base, braces) { +- var numLinesEst = 0; +- var length = output.reduce(function(prev, cur) { +- numLinesEst++; +- if (cur.indexOf('\n') >= 0) numLinesEst++; +- return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1; +- }, 0); +- +- if (length > 60) { +- return braces[0] + +- (base === '' ? '' : base + '\n ') + +- ' ' + +- output.join(',\n ') + +- ' ' + +- braces[1]; +- } +- +- return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1]; +-} +- +- + // NOTE: These type checking functions intentionally don't use `instanceof` + // because it is fragile and can be easily faked with `Object.create()`. + function isArray(ar) { +@@ -522,166 +98,10 @@ function isPrimitive(arg) { + exports.isPrimitive = isPrimitive; + + function isBuffer(arg) { +- return arg instanceof Buffer; ++ return Buffer.isBuffer(arg); + } + exports.isBuffer = isBuffer; + + function objectToString(o) { + return Object.prototype.toString.call(o); +-} +- +- +-function pad(n) { +- return n < 10 ? '0' + n.toString(10) : n.toString(10); +-} +- +- +-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', +- 'Oct', 'Nov', 'Dec']; +- +-// 26 Feb 16:19:34 +-function timestamp() { +- var d = new Date(); +- var time = [pad(d.getHours()), +- pad(d.getMinutes()), +- pad(d.getSeconds())].join(':'); +- return [d.getDate(), months[d.getMonth()], time].join(' '); +-} +- +- +-// log is just a thin wrapper to console.log that prepends a timestamp +-exports.log = function() { +- console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments)); +-}; +- +- +-/** +- * Inherit the prototype methods from one constructor into another. +- * +- * The Function.prototype.inherits from lang.js rewritten as a standalone +- * function (not on Function.prototype). NOTE: If this file is to be loaded +- * during bootstrapping this function needs to be rewritten using some native +- * functions as prototype setup using normal JavaScript does not work as +- * expected during bootstrapping (see mirror.js in r114903). +- * +- * @param {function} ctor Constructor function which needs to inherit the +- * prototype. +- * @param {function} superCtor Constructor function to inherit prototype from. +- */ +-exports.inherits = function(ctor, superCtor) { +- ctor.super_ = superCtor; +- ctor.prototype = Object.create(superCtor.prototype, { +- constructor: { +- value: ctor, +- enumerable: false, +- writable: true, +- configurable: true +- } +- }); +-}; +- +-exports._extend = function(origin, add) { +- // Don't do anything if add isn't an object +- if (!add || !isObject(add)) return origin; +- +- var keys = Object.keys(add); +- var i = keys.length; +- while (i--) { +- origin[keys[i]] = add[keys[i]]; +- } +- return origin; +-}; +- +-function hasOwnProperty(obj, prop) { +- return Object.prototype.hasOwnProperty.call(obj, prop); +-} +- +- +-// Deprecated old stuff. +- +-exports.p = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- console.error(exports.inspect(arguments[i])); +- } +-}, 'util.p: Use console.error() instead'); +- +- +-exports.exec = exports.deprecate(function() { +- return require('child_process').exec.apply(this, arguments); +-}, 'util.exec is now called `child_process.exec`.'); +- +- +-exports.print = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(String(arguments[i])); +- } +-}, 'util.print: Use console.log instead'); +- +- +-exports.puts = exports.deprecate(function() { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stdout.write(arguments[i] + '\n'); +- } +-}, 'util.puts: Use console.log instead'); +- +- +-exports.debug = exports.deprecate(function(x) { +- process.stderr.write('DEBUG: ' + x + '\n'); +-}, 'util.debug: Use console.error instead'); +- +- +-exports.error = exports.deprecate(function(x) { +- for (var i = 0, len = arguments.length; i < len; ++i) { +- process.stderr.write(arguments[i] + '\n'); +- } +-}, 'util.error: Use console.error instead'); +- +- +-exports.pump = exports.deprecate(function(readStream, writeStream, callback) { +- var callbackCalled = false; +- +- function call(a, b, c) { +- if (callback && !callbackCalled) { +- callback(a, b, c); +- callbackCalled = true; +- } +- } +- +- readStream.addListener('data', function(chunk) { +- if (writeStream.write(chunk) === false) readStream.pause(); +- }); +- +- writeStream.addListener('drain', function() { +- readStream.resume(); +- }); +- +- readStream.addListener('end', function() { +- writeStream.end(); +- }); +- +- readStream.addListener('close', function() { +- call(); +- }); +- +- readStream.addListener('error', function(err) { +- writeStream.end(); +- call(err); +- }); +- +- writeStream.addListener('error', function(err) { +- readStream.destroy(); +- call(err); +- }); +-}, 'util.pump(): Use readableStream.pipe() instead'); +- +- +-var uv; +-exports._errnoException = function(err, syscall) { +- if (isUndefined(uv)) uv = process.binding('uv'); +- var errname = uv.errname(err); +- var e = new Error(syscall + ' ' + errname); +- e.code = errname; +- e.errno = errname; +- e.syscall = syscall; +- return e; +-}; ++} \ No newline at end of file diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js new file mode 100644 index 00000000000..9074e8ebcb6 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/lib/util.js @@ -0,0 +1,107 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && + (objectToString(e) === '[object Error]' || e instanceof Error); +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +function isBuffer(arg) { + return Buffer.isBuffer(arg); +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} \ No newline at end of file diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json new file mode 100644 index 00000000000..2b7593c1939 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/package.json @@ -0,0 +1,54 @@ +{ + "name": "core-util-is", + "version": "1.0.1", + "description": "The `util.is*` functions introduced in Node v0.12.", + "main": "lib/util.js", + "repository": { + "type": "git", + "url": "git://github.com/isaacs/core-util-is" + }, + "keywords": [ + "util", + "isBuffer", + "isArray", + "isNumber", + "isString", + "isRegExp", + "isThis", + "isThat", + "polyfill" + ], + "author": { + "name": "Isaac Z. Schlueter", + "email": "i@izs.me", + "url": "http://blog.izs.me/" + }, + "license": "MIT", + "bugs": { + "url": "https://github.com/isaacs/core-util-is/issues" + }, + "readme": "# core-util-is\n\nThe `util.is*` functions introduced in Node v0.12.\n", + "readmeFilename": "README.md", + "homepage": "https://github.com/isaacs/core-util-is", + "_id": "core-util-is@1.0.1", + "dist": { + "shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", + "tarball": "http://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz" + }, + "_from": "core-util-is@~1.0.0", + "_npmVersion": "1.3.23", + "_npmUser": { + "name": "isaacs", + "email": "i@izs.me" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + } + ], + "directories": {}, + "_shasum": "6b07085aef9a3ccac6ee53bf9d3df0c1521a5538", + "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.1.tgz", + "scripts": {} +} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js new file mode 100644 index 00000000000..007fa105756 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/core-util-is/util.js @@ -0,0 +1,106 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +// NOTE: These type checking functions intentionally don't use `instanceof` +// because it is fragile and can be easily faked with `Object.create()`. +function isArray(ar) { + return Array.isArray(ar); +} +exports.isArray = isArray; + +function isBoolean(arg) { + return typeof arg === 'boolean'; +} +exports.isBoolean = isBoolean; + +function isNull(arg) { + return arg === null; +} +exports.isNull = isNull; + +function isNullOrUndefined(arg) { + return arg == null; +} +exports.isNullOrUndefined = isNullOrUndefined; + +function isNumber(arg) { + return typeof arg === 'number'; +} +exports.isNumber = isNumber; + +function isString(arg) { + return typeof arg === 'string'; +} +exports.isString = isString; + +function isSymbol(arg) { + return typeof arg === 'symbol'; +} +exports.isSymbol = isSymbol; + +function isUndefined(arg) { + return arg === void 0; +} +exports.isUndefined = isUndefined; + +function isRegExp(re) { + return isObject(re) && objectToString(re) === '[object RegExp]'; +} +exports.isRegExp = isRegExp; + +function isObject(arg) { + return typeof arg === 'object' && arg !== null; +} +exports.isObject = isObject; + +function isDate(d) { + return isObject(d) && objectToString(d) === '[object Date]'; +} +exports.isDate = isDate; + +function isError(e) { + return isObject(e) && objectToString(e) === '[object Error]'; +} +exports.isError = isError; + +function isFunction(arg) { + return typeof arg === 'function'; +} +exports.isFunction = isFunction; + +function isPrimitive(arg) { + return arg === null || + typeof arg === 'boolean' || + typeof arg === 'number' || + typeof arg === 'string' || + typeof arg === 'symbol' || // ES6 symbol + typeof arg === 'undefined'; +} +exports.isPrimitive = isPrimitive; + +function isBuffer(arg) { + return arg instanceof Buffer; +} +exports.isBuffer = isBuffer; + +function objectToString(o) { + return Object.prototype.toString.call(o); +} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md new file mode 100644 index 00000000000..052a62b8d7b --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/README.md @@ -0,0 +1,54 @@ + +# isarray + +`Array#isArray` for older browsers. + +## Usage + +```js +var isArray = require('isarray'); + +console.log(isArray([])); // => true +console.log(isArray({})); // => false +``` + +## Installation + +With [npm](http://npmjs.org) do + +```bash +$ npm install isarray +``` + +Then bundle for the browser with +[browserify](https://github.com/substack/browserify). + +With [component](http://component.io) do + +```bash +$ component install juliangruber/isarray +``` + +## License + +(MIT) + +Copyright (c) 2013 Julian Gruber <julian@juliangruber.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/sha/node_modules/readable-stream/node_modules/isarray/build/build.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/build/build.js new file mode 100644 index 00000000000..ec58596aeeb --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/build/build.js @@ -0,0 +1,209 @@ + +/** + * Require the given path. + * + * @param {String} path + * @return {Object} exports + * @api public + */ + +function require(path, parent, orig) { + var resolved = require.resolve(path); + + // lookup failed + if (null == resolved) { + orig = orig || path; + parent = parent || 'root'; + var err = new Error('Failed to require "' + orig + '" from "' + parent + '"'); + err.path = orig; + err.parent = parent; + err.require = true; + throw err; + } + + var module = require.modules[resolved]; + + // perform real require() + // by invoking the module's + // registered function + if (!module.exports) { + module.exports = {}; + module.client = module.component = true; + module.call(this, module.exports, require.relative(resolved), module); + } + + return module.exports; +} + +/** + * Registered modules. + */ + +require.modules = {}; + +/** + * Registered aliases. + */ + +require.aliases = {}; + +/** + * Resolve `path`. + * + * Lookup: + * + * - PATH/index.js + * - PATH.js + * - PATH + * + * @param {String} path + * @return {String} path or null + * @api private + */ + +require.resolve = function(path) { + if (path.charAt(0) === '/') path = path.slice(1); + var index = path + '/index.js'; + + var paths = [ + path, + path + '.js', + path + '.json', + path + '/index.js', + path + '/index.json' + ]; + + for (var i = 0; i < paths.length; i++) { + var path = paths[i]; + if (require.modules.hasOwnProperty(path)) return path; + } + + if (require.aliases.hasOwnProperty(index)) { + return require.aliases[index]; + } +}; + +/** + * Normalize `path` relative to the current path. + * + * @param {String} curr + * @param {String} path + * @return {String} + * @api private + */ + +require.normalize = function(curr, path) { + var segs = []; + + if ('.' != path.charAt(0)) return path; + + curr = curr.split('/'); + path = path.split('/'); + + for (var i = 0; i < path.length; ++i) { + if ('..' == path[i]) { + curr.pop(); + } else if ('.' != path[i] && '' != path[i]) { + segs.push(path[i]); + } + } + + return curr.concat(segs).join('/'); +}; + +/** + * Register module at `path` with callback `definition`. + * + * @param {String} path + * @param {Function} definition + * @api private + */ + +require.register = function(path, definition) { + require.modules[path] = definition; +}; + +/** + * Alias a module definition. + * + * @param {String} from + * @param {String} to + * @api private + */ + +require.alias = function(from, to) { + if (!require.modules.hasOwnProperty(from)) { + throw new Error('Failed to alias "' + from + '", it does not exist'); + } + require.aliases[to] = from; +}; + +/** + * Return a require function relative to the `parent` path. + * + * @param {String} parent + * @return {Function} + * @api private + */ + +require.relative = function(parent) { + var p = require.normalize(parent, '..'); + + /** + * lastIndexOf helper. + */ + + function lastIndexOf(arr, obj) { + var i = arr.length; + while (i--) { + if (arr[i] === obj) return i; + } + return -1; + } + + /** + * The relative require() itself. + */ + + function localRequire(path) { + var resolved = localRequire.resolve(path); + return require(resolved, parent, path); + } + + /** + * Resolve relative to the parent. + */ + + localRequire.resolve = function(path) { + var c = path.charAt(0); + if ('/' == c) return path.slice(1); + if ('.' == c) return require.normalize(p, path); + + // resolve deps by returning + // the dep in the nearest "deps" + // directory + var segs = parent.split('/'); + var i = lastIndexOf(segs, 'deps') + 1; + if (!i) i = 0; + path = segs.slice(0, i + 1).join('/') + '/deps/' + path; + return path; + }; + + /** + * Check if module is defined at `path`. + */ + + localRequire.exists = function(path) { + return require.modules.hasOwnProperty(localRequire.resolve(path)); + }; + + return localRequire; +}; +require.register("isarray/index.js", function(exports, require, module){ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; + +}); +require.alias("isarray/index.js", "isarray/index.js"); + diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json new file mode 100644 index 00000000000..9e31b683889 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/component.json @@ -0,0 +1,19 @@ +{ + "name" : "isarray", + "description" : "Array#isArray for older browsers", + "version" : "0.0.1", + "repository" : "juliangruber/isarray", + "homepage": "https://github.com/juliangruber/isarray", + "main" : "index.js", + "scripts" : [ + "index.js" + ], + "dependencies" : {}, + "keywords": ["browser","isarray","array"], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT" +} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js new file mode 100644 index 00000000000..5f5ad45d46d --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/index.js @@ -0,0 +1,3 @@ +module.exports = Array.isArray || function (arr) { + return Object.prototype.toString.call(arr) == '[object Array]'; +}; diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json new file mode 100644 index 00000000000..fc7904b67b9 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/isarray/package.json @@ -0,0 +1,54 @@ +{ + "name": "isarray", + "description": "Array#isArray for older browsers", + "version": "0.0.1", + "repository": { + "type": "git", + "url": "git://github.com/juliangruber/isarray.git" + }, + "homepage": "https://github.com/juliangruber/isarray", + "main": "index.js", + "scripts": { + "test": "tap test/*.js" + }, + "dependencies": {}, + "devDependencies": { + "tap": "*" + }, + "keywords": [ + "browser", + "isarray", + "array" + ], + "author": { + "name": "Julian Gruber", + "email": "mail@juliangruber.com", + "url": "http://juliangruber.com" + }, + "license": "MIT", + "readme": "\n# isarray\n\n`Array#isArray` for older browsers.\n\n## Usage\n\n```js\nvar isArray = require('isarray');\n\nconsole.log(isArray([])); // => true\nconsole.log(isArray({})); // => false\n```\n\n## Installation\n\nWith [npm](http://npmjs.org) do\n\n```bash\n$ npm install isarray\n```\n\nThen bundle for the browser with\n[browserify](https://github.com/substack/browserify).\n\nWith [component](http://component.io) do\n\n```bash\n$ component install juliangruber/isarray\n```\n\n## License\n\n(MIT)\n\nCopyright (c) 2013 Julian Gruber <julian@juliangruber.com>\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\nof the Software, and to permit persons to whom the Software is furnished to do\nso, 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 THE\nSOFTWARE.\n", + "readmeFilename": "README.md", + "_id": "isarray@0.0.1", + "dist": { + "shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "tarball": "http://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz" + }, + "_from": "isarray@0.0.1", + "_npmVersion": "1.2.18", + "_npmUser": { + "name": "juliangruber", + "email": "julian@juliangruber.com" + }, + "maintainers": [ + { + "name": "juliangruber", + "email": "julian@juliangruber.com" + } + ], + "directories": {}, + "_shasum": "8a18acfca9a8f4177e09abfc6038939b05d1eedf", + "_resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "bugs": { + "url": "https://github.com/juliangruber/isarray/issues" + } +} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore new file mode 100644 index 00000000000..206320cc1d2 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/.npmignore @@ -0,0 +1,2 @@ +build +test diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE new file mode 100644 index 00000000000..6de584a48f5 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/LICENSE @@ -0,0 +1,20 @@ +Copyright Joyent, Inc. and other Node contributors. + +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/sha/node_modules/readable-stream/node_modules/string_decoder/README.md b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/README.md new file mode 100644 index 00000000000..4d2aa001501 --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/README.md @@ -0,0 +1,7 @@ +**string_decoder.js** (`require('string_decoder')`) from Node.js core + +Copyright Joyent, Inc. and other Node contributors. See LICENCE file for details. + +Version 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.** + +The *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. \ No newline at end of file diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js new file mode 100644 index 00000000000..2e44a03e15d --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/index.js @@ -0,0 +1,200 @@ +// Copyright Joyent, Inc. and other Node contributors. +// +// 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. + +var Buffer = require('buffer').Buffer; + +var isBufferEncoding = Buffer.isEncoding + || function(encoding) { + switch (encoding && encoding.toLowerCase()) { + case 'hex': case 'utf8': case 'utf-8': case 'ascii': case 'binary': case 'base64': case 'ucs2': case 'ucs-2': case 'utf16le': case 'utf-16le': case 'raw': return true; + default: return false; + } + } + + +function assertEncoding(encoding) { + if (encoding && !isBufferEncoding(encoding)) { + throw new Error('Unknown encoding: ' + encoding); + } +} + +var StringDecoder = exports.StringDecoder = function(encoding) { + this.encoding = (encoding || 'utf8').toLowerCase().replace(/[-_]/, ''); + assertEncoding(encoding); + switch (this.encoding) { + case 'utf8': + // CESU-8 represents each of Surrogate Pair by 3-bytes + this.surrogateSize = 3; + break; + case 'ucs2': + case 'utf16le': + // UTF-16 represents each of Surrogate Pair by 2-bytes + this.surrogateSize = 2; + this.detectIncompleteChar = utf16DetectIncompleteChar; + break; + case 'base64': + // Base-64 stores 3 bytes in 4 chars, and pads the remainder. + this.surrogateSize = 3; + this.detectIncompleteChar = base64DetectIncompleteChar; + break; + default: + this.write = passThroughWrite; + return; + } + + this.charBuffer = new Buffer(6); + this.charReceived = 0; + this.charLength = 0; +}; + + +StringDecoder.prototype.write = function(buffer) { + var charStr = ''; + var offset = 0; + + // if our last write ended with an incomplete multibyte character + while (this.charLength) { + // determine how many remaining bytes this buffer has to offer for this char + var i = (buffer.length >= this.charLength - this.charReceived) ? + this.charLength - this.charReceived : + buffer.length; + + // add the new bytes to the char buffer + buffer.copy(this.charBuffer, this.charReceived, offset, i); + this.charReceived += (i - offset); + offset = i; + + if (this.charReceived < this.charLength) { + // still not enough chars in this buffer? wait for more ... + return ''; + } + + // get the character that was split + charStr = this.charBuffer.slice(0, this.charLength).toString(this.encoding); + + // lead surrogate (D800-DBFF) is also the incomplete character + var charCode = charStr.charCodeAt(charStr.length - 1); + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + this.charLength += this.surrogateSize; + charStr = ''; + continue; + } + this.charReceived = this.charLength = 0; + + // if there are no more bytes in this buffer, just emit our char + if (i == buffer.length) return charStr; + + // otherwise cut off the characters end from the beginning of this buffer + buffer = buffer.slice(i, buffer.length); + break; + } + + var lenIncomplete = this.detectIncompleteChar(buffer); + + var end = buffer.length; + if (this.charLength) { + // buffer the incomplete character bytes we got + buffer.copy(this.charBuffer, 0, buffer.length - lenIncomplete, end); + this.charReceived = lenIncomplete; + end -= lenIncomplete; + } + + charStr += buffer.toString(this.encoding, 0, end); + + var end = charStr.length - 1; + var charCode = charStr.charCodeAt(end); + // lead surrogate (D800-DBFF) is also the incomplete character + if (charCode >= 0xD800 && charCode <= 0xDBFF) { + var size = this.surrogateSize; + this.charLength += size; + this.charReceived += size; + this.charBuffer.copy(this.charBuffer, size, 0, size); + this.charBuffer.write(charStr.charAt(charStr.length - 1), this.encoding); + return charStr.substring(0, end); + } + + // or just emit the charStr + return charStr; +}; + +StringDecoder.prototype.detectIncompleteChar = function(buffer) { + // determine how many bytes we have to check at the end of this buffer + var i = (buffer.length >= 3) ? 3 : buffer.length; + + // Figure out if one of the last i bytes of our buffer announces an + // incomplete char. + for (; i > 0; i--) { + var c = buffer[buffer.length - i]; + + // See http://en.wikipedia.org/wiki/UTF-8#Description + + // 110XXXXX + if (i == 1 && c >> 5 == 0x06) { + this.charLength = 2; + break; + } + + // 1110XXXX + if (i <= 2 && c >> 4 == 0x0E) { + this.charLength = 3; + break; + } + + // 11110XXX + if (i <= 3 && c >> 3 == 0x1E) { + this.charLength = 4; + break; + } + } + + return i; +}; + +StringDecoder.prototype.end = function(buffer) { + var res = ''; + if (buffer && buffer.length) + res = this.write(buffer); + + if (this.charReceived) { + var cr = this.charReceived; + var buf = this.charBuffer; + var enc = this.encoding; + res += buf.slice(0, cr).toString(enc); + } + + return res; +}; + +function passThroughWrite(buffer) { + return buffer.toString(this.encoding); +} + +function utf16DetectIncompleteChar(buffer) { + var incomplete = this.charReceived = buffer.length % 2; + this.charLength = incomplete ? 2 : 0; + return incomplete; +} + +function base64DetectIncompleteChar(buffer) { + var incomplete = this.charReceived = buffer.length % 3; + this.charLength = incomplete ? 3 : 0; + return incomplete; +} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json new file mode 100644 index 00000000000..2e827f5921f --- /dev/null +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/node_modules/string_decoder/package.json @@ -0,0 +1,53 @@ +{ + "name": "string_decoder", + "version": "0.10.25-1", + "description": "The string_decoder module from Node core", + "main": "index.js", + "dependencies": {}, + "devDependencies": { + "tap": "~0.4.8" + }, + "scripts": { + "test": "tap test/simple/*.js" + }, + "repository": { + "type": "git", + "url": "git://github.com/rvagg/string_decoder.git" + }, + "homepage": "https://github.com/rvagg/string_decoder", + "keywords": [ + "string", + "decoder", + "browser", + "browserify" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/rvagg/string_decoder/issues" + }, + "_id": "string_decoder@0.10.25-1", + "dist": { + "shasum": "f387babd95d23a2bb73b1fbf2cb3efab6f78baab", + "tarball": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz" + }, + "_from": "string_decoder@~0.10.x", + "_npmVersion": "1.3.24", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "substack", + "email": "mail@substack.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "directories": {}, + "_shasum": "f387babd95d23a2bb73b1fbf2cb3efab6f78baab", + "_resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.25-1.tgz", + "readme": "ERROR: No README data found!" +} diff --git a/deps/npm/node_modules/sha/node_modules/readable-stream/package.json b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json index 206b4806c18..8d8961b95aa 100644 --- a/deps/npm/node_modules/sha/node_modules/readable-stream/package.json +++ b/deps/npm/node_modules/sha/node_modules/readable-stream/package.json @@ -1,9 +1,14 @@ { "name": "readable-stream", - "version": "1.0.24", - "description": "An exploration of a new kind of readable streams for Node.js", + "version": "1.0.27-1", + "description": "Streams2, a user-land copy of the stream library from Node.js v0.10.x", "main": "readable.js", - "dependencies": {}, + "dependencies": { + "core-util-is": "~1.0.0", + "isarray": "0.0.1", + "string_decoder": "~0.10.x", + "inherits": "~2.0.1" + }, "devDependencies": { "tap": "~0.2.6" }, @@ -19,18 +24,46 @@ "stream", "pipe" ], + "browser": { + "util": false + }, "author": { "name": "Isaac Z. Schlueter", "email": "i@izs.me", "url": "http://blog.izs.me/" }, - "license": "BSD", - "readme": "# readable-stream\n\nA new class of streams for Node.js\n\nThis module provides the new Stream base classes introduced in Node\nv0.10, for use in Node v0.8. You can use it to have programs that\nhave to work with node v0.8, while being forward-compatible for v0.10\nand beyond. When you drop support for v0.8, you can remove this\nmodule, and only use the native streams.\n\nThis is almost exactly the same codebase as appears in Node v0.10.\nHowever:\n\n1. The exported object is actually the Readable class. Decorating the\n native `stream` module would be global pollution.\n2. In v0.10, you can safely use `base64` as an argument to\n `setEncoding` in Readable streams. However, in v0.8, the\n StringDecoder class has no `end()` method, which is problematic for\n Base64. So, don't use that, because it'll break and be weird.\n\nOther than that, the API is the same as `require('stream')` in v0.10,\nso the API docs are reproduced below.\n\n----------\n\n Stability: 2 - Unstable\n\nA stream is an abstract interface implemented by various objects in\nNode. For example a request to an HTTP server is a stream, as is\nstdout. Streams are readable, writable, or both. All streams are\ninstances of [EventEmitter][]\n\nYou can load the Stream base classes by doing `require('stream')`.\nThere are base classes provided for Readable streams, Writable\nstreams, Duplex streams, and Transform streams.\n\n## Compatibility\n\nIn earlier versions of Node, the Readable stream interface was\nsimpler, but also less powerful and less useful.\n\n* Rather than waiting for you to call the `read()` method, `'data'`\n events would start emitting immediately. If you needed to do some\n I/O to decide how to handle data, then you had to store the chunks\n in some kind of buffer so that they would not be lost.\n* The `pause()` method was advisory, rather than guaranteed. This\n meant that you still had to be prepared to receive `'data'` events\n even when the stream was in a paused state.\n\nIn Node v0.10, the Readable class described below was added. For\nbackwards compatibility with older Node programs, Readable streams\nswitch into \"old mode\" when a `'data'` event handler is added, or when\nthe `pause()` or `resume()` methods are called. The effect is that,\neven if you are not using the new `read()` method and `'readable'`\nevent, you no longer have to worry about losing `'data'` chunks.\n\nMost programs will continue to function normally. However, this\nintroduces an edge case in the following conditions:\n\n* No `'data'` event handler is added.\n* The `pause()` and `resume()` methods are never called.\n\nFor example, consider the following code:\n\n```javascript\n// WARNING! BROKEN!\nnet.createServer(function(socket) {\n\n // we add an 'end' method, but never consume the data\n socket.on('end', function() {\n // It will never get here.\n socket.end('I got your message (but didnt read it)\\n');\n });\n\n}).listen(1337);\n```\n\nIn versions of node prior to v0.10, the incoming message data would be\nsimply discarded. However, in Node v0.10 and beyond, the socket will\nremain paused forever.\n\nThe workaround in this situation is to call the `resume()` method to\ntrigger \"old mode\" behavior:\n\n```javascript\n// Workaround\nnet.createServer(function(socket) {\n\n socket.on('end', function() {\n socket.end('I got your message (but didnt read it)\\n');\n });\n\n // start the flow of data, discarding it.\n socket.resume();\n\n}).listen(1337);\n```\n\nIn addition to new Readable streams switching into old-mode, pre-v0.10\nstyle streams can be wrapped in a Readable class using the `wrap()`\nmethod.\n\n## Class: stream.Readable\n\n\n\nA `Readable Stream` has the following methods, members, and events.\n\nNote that `stream.Readable` is an abstract class designed to be\nextended with an underlying implementation of the `_read(size)`\nmethod. (See below.)\n\n### new stream.Readable([options])\n\n* `options` {Object}\n * `highWaterMark` {Number} The maximum number of bytes to store in\n the internal buffer before ceasing to read from the underlying\n resource. Default=16kb\n * `encoding` {String} If specified, then buffers will be decoded to\n strings using the specified encoding. Default=null\n * `objectMode` {Boolean} Whether this stream should behave\n as a stream of objects. Meaning that stream.read(n) returns\n a single value instead of a Buffer of size n\n\nIn classes that extend the Readable class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n### readable.\\_read(size)\n\n* `size` {Number} Number of bytes to read asynchronously\n\nNote: **This function should NOT be called directly.** It should be\nimplemented by child classes, and called by the internal Readable\nclass methods only.\n\nAll Readable stream implementations must provide a `_read` method\nto fetch data from the underlying resource.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\nWhen data is available, put it into the read queue by calling\n`readable.push(chunk)`. If `push` returns false, then you should stop\nreading. When `_read` is called again, you should start pushing more\ndata.\n\nThe `size` argument is advisory. Implementations where a \"read\" is a\nsingle call that returns data can use this to know how much data to\nfetch. Implementations where that is not relevant, such as TCP or\nTLS, may ignore this argument, and simply provide data whenever it\nbecomes available. There is no need, for example to \"wait\" until\n`size` bytes are available before calling `stream.push(chunk)`.\n\n### readable.push(chunk)\n\n* `chunk` {Buffer | null | String} Chunk of data to push into the read queue\n* return {Boolean} Whether or not more pushes should be performed\n\nNote: **This function should be called by Readable implementors, NOT\nby consumers of Readable subclasses.** The `_read()` function will not\nbe called again until at least one `push(chunk)` call is made. If no\ndata is available, then you MAY call `push('')` (an empty string) to\nallow a future `_read` call, without adding any data to the queue.\n\nThe `Readable` class works by putting data into a read queue to be\npulled out later by calling the `read()` method when the `'readable'`\nevent fires.\n\nThe `push()` method will explicitly insert some data into the read\nqueue. If it is called with `null` then it will signal the end of the\ndata.\n\nIn some cases, you may be wrapping a lower-level source which has some\nsort of pause/resume mechanism, and a data callback. In those cases,\nyou could wrap the low-level source object by doing something like\nthis:\n\n```javascript\n// source is an object with readStop() and readStart() methods,\n// and an `ondata` member that gets called when it has data, and\n// an `onend` member that gets called when the data is over.\n\nvar stream = new Readable();\n\nsource.ondata = function(chunk) {\n // if push() returns false, then we need to stop reading from source\n if (!stream.push(chunk))\n source.readStop();\n};\n\nsource.onend = function() {\n stream.push(null);\n};\n\n// _read will be called when the stream wants to pull more data in\n// the advisory size argument is ignored in this case.\nstream._read = function(n) {\n source.readStart();\n};\n```\n\n### readable.unshift(chunk)\n\n* `chunk` {Buffer | null | String} Chunk of data to unshift onto the read queue\n* return {Boolean} Whether or not more pushes should be performed\n\nThis is the corollary of `readable.push(chunk)`. Rather than putting\nthe data at the *end* of the read queue, it puts it at the *front* of\nthe read queue.\n\nThis is useful in certain use-cases where a stream is being consumed\nby a parser, which needs to \"un-consume\" some data that it has\noptimistically pulled out of the source.\n\n```javascript\n// A parser for a simple data protocol.\n// The \"header\" is a JSON object, followed by 2 \\n characters, and\n// then a message body.\n//\n// Note: This can be done more simply as a Transform stream. See below.\n\nfunction SimpleProtocol(source, options) {\n if (!(this instanceof SimpleProtocol))\n return new SimpleProtocol(options);\n\n Readable.call(this, options);\n this._inBody = false;\n this._sawFirstCr = false;\n\n // source is a readable stream, such as a socket or file\n this._source = source;\n\n var self = this;\n source.on('end', function() {\n self.push(null);\n });\n\n // give it a kick whenever the source is readable\n // read(0) will not consume any bytes\n source.on('readable', function() {\n self.read(0);\n });\n\n this._rawHeader = [];\n this.header = null;\n}\n\nSimpleProtocol.prototype = Object.create(\n Readable.prototype, { constructor: { value: SimpleProtocol }});\n\nSimpleProtocol.prototype._read = function(n) {\n if (!this._inBody) {\n var chunk = this._source.read();\n\n // if the source doesn't have data, we don't have data yet.\n if (chunk === null)\n return this.push('');\n\n // check if the chunk has a \\n\\n\n var split = -1;\n for (var i = 0; i < chunk.length; i++) {\n if (chunk[i] === 10) { // '\\n'\n if (this._sawFirstCr) {\n split = i;\n break;\n } else {\n this._sawFirstCr = true;\n }\n } else {\n this._sawFirstCr = false;\n }\n }\n\n if (split === -1) {\n // still waiting for the \\n\\n\n // stash the chunk, and try again.\n this._rawHeader.push(chunk);\n this.push('');\n } else {\n this._inBody = true;\n var h = chunk.slice(0, split);\n this._rawHeader.push(h);\n var header = Buffer.concat(this._rawHeader).toString();\n try {\n this.header = JSON.parse(header);\n } catch (er) {\n this.emit('error', new Error('invalid simple protocol data'));\n return;\n }\n // now, because we got some extra data, unshift the rest\n // back into the read queue so that our consumer will see it.\n var b = chunk.slice(split);\n this.unshift(b);\n\n // and let them know that we are done parsing the header.\n this.emit('header', this.header);\n }\n } else {\n // from there on, just provide the data to our consumer.\n // careful not to push(null), since that would indicate EOF.\n var chunk = this._source.read();\n if (chunk) this.push(chunk);\n }\n};\n\n// Usage:\nvar parser = new SimpleProtocol(source);\n// Now parser is a readable stream that will emit 'header'\n// with the parsed header data.\n```\n\n### readable.wrap(stream)\n\n* `stream` {Stream} An \"old style\" readable stream\n\nIf you are using an older Node library that emits `'data'` events and\nhas a `pause()` method that is advisory only, then you can use the\n`wrap()` method to create a Readable stream that uses the old stream\nas its data source.\n\nFor example:\n\n```javascript\nvar OldReader = require('./old-api-module.js').OldReader;\nvar oreader = new OldReader;\nvar Readable = require('stream').Readable;\nvar myReader = new Readable().wrap(oreader);\n\nmyReader.on('readable', function() {\n myReader.read(); // etc.\n});\n```\n\n### Event: 'readable'\n\nWhen there is data ready to be consumed, this event will fire.\n\nWhen this event emits, call the `read()` method to consume the data.\n\n### Event: 'end'\n\nEmitted when the stream has received an EOF (FIN in TCP terminology).\nIndicates that no more `'data'` events will happen. If the stream is\nalso writable, it may be possible to continue writing.\n\n### Event: 'data'\n\nThe `'data'` event emits either a `Buffer` (by default) or a string if\n`setEncoding()` was used.\n\nNote that adding a `'data'` event listener will switch the Readable\nstream into \"old mode\", where data is emitted as soon as it is\navailable, rather than waiting for you to call `read()` to consume it.\n\n### Event: 'error'\n\nEmitted if there was an error receiving data.\n\n### Event: 'close'\n\nEmitted when the underlying resource (for example, the backing file\ndescriptor) has been closed. Not all streams will emit this.\n\n### readable.setEncoding(encoding)\n\nMakes the `'data'` event emit a string instead of a `Buffer`. `encoding`\ncan be `'utf8'`, `'utf16le'` (`'ucs2'`), `'ascii'`, or `'hex'`.\n\nThe encoding can also be set by specifying an `encoding` field to the\nconstructor.\n\n### readable.read([size])\n\n* `size` {Number | null} Optional number of bytes to read.\n* Return: {Buffer | String | null}\n\nNote: **This function SHOULD be called by Readable stream users.**\n\nCall this method to consume data once the `'readable'` event is\nemitted.\n\nThe `size` argument will set a minimum number of bytes that you are\ninterested in. If not set, then the entire content of the internal\nbuffer is returned.\n\nIf there is no data to consume, or if there are fewer bytes in the\ninternal buffer than the `size` argument, then `null` is returned, and\na future `'readable'` event will be emitted when more is available.\n\nCalling `stream.read(0)` will always return `null`, and will trigger a\nrefresh of the internal buffer, but otherwise be a no-op.\n\n### readable.pipe(destination, [options])\n\n* `destination` {Writable Stream}\n* `options` {Object} Optional\n * `end` {Boolean} Default=true\n\nConnects this readable stream to `destination` WriteStream. Incoming\ndata on this stream gets written to `destination`. Properly manages\nback-pressure so that a slow destination will not be overwhelmed by a\nfast readable stream.\n\nThis function returns the `destination` stream.\n\nFor example, emulating the Unix `cat` command:\n\n process.stdin.pipe(process.stdout);\n\nBy default `end()` is called on the destination when the source stream\nemits `end`, so that `destination` is no longer writable. Pass `{ end:\nfalse }` as `options` to keep the destination stream open.\n\nThis keeps `writer` open so that \"Goodbye\" can be written at the\nend.\n\n reader.pipe(writer, { end: false });\n reader.on(\"end\", function() {\n writer.end(\"Goodbye\\n\");\n });\n\nNote that `process.stderr` and `process.stdout` are never closed until\nthe process exits, regardless of the specified options.\n\n### readable.unpipe([destination])\n\n* `destination` {Writable Stream} Optional\n\nUndo a previously established `pipe()`. If no destination is\nprovided, then all previously established pipes are removed.\n\n### readable.pause()\n\nSwitches the readable stream into \"old mode\", where data is emitted\nusing a `'data'` event rather than being buffered for consumption via\nthe `read()` method.\n\nCeases the flow of data. No `'data'` events are emitted while the\nstream is in a paused state.\n\n### readable.resume()\n\nSwitches the readable stream into \"old mode\", where data is emitted\nusing a `'data'` event rather than being buffered for consumption via\nthe `read()` method.\n\nResumes the incoming `'data'` events after a `pause()`.\n\n\n## Class: stream.Writable\n\n\n\nA `Writable` Stream has the following methods, members, and events.\n\nNote that `stream.Writable` is an abstract class designed to be\nextended with an underlying implementation of the\n`_write(chunk, encoding, cb)` method. (See below.)\n\n### new stream.Writable([options])\n\n* `options` {Object}\n * `highWaterMark` {Number} Buffer level when `write()` starts\n returning false. Default=16kb\n * `decodeStrings` {Boolean} Whether or not to decode strings into\n Buffers before passing them to `_write()`. Default=true\n\nIn classes that extend the Writable class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n### writable.\\_write(chunk, encoding, callback)\n\n* `chunk` {Buffer | String} The chunk to be written. Will always\n be a buffer unless the `decodeStrings` option was set to `false`.\n* `encoding` {String} If the chunk is a string, then this is the\n encoding type. Ignore chunk is a buffer. Note that chunk will\n **always** be a buffer unless the `decodeStrings` option is\n explicitly set to `false`.\n* `callback` {Function} Call this function (optionally with an error\n argument) when you are done processing the supplied chunk.\n\nAll Writable stream implementations must provide a `_write` method to\nsend data to the underlying resource.\n\nNote: **This function MUST NOT be called directly.** It should be\nimplemented by child classes, and called by the internal Writable\nclass methods only.\n\nCall the callback using the standard `callback(error)` pattern to\nsignal that the write completed successfully or with an error.\n\nIf the `decodeStrings` flag is set in the constructor options, then\n`chunk` may be a string rather than a Buffer, and `encoding` will\nindicate the sort of string that it is. This is to support\nimplementations that have an optimized handling for certain string\ndata encodings. If you do not explicitly set the `decodeStrings`\noption to `false`, then you can safely ignore the `encoding` argument,\nand assume that `chunk` will always be a Buffer.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\n\n### writable.write(chunk, [encoding], [callback])\n\n* `chunk` {Buffer | String} Data to be written\n* `encoding` {String} Optional. If `chunk` is a string, then encoding\n defaults to `'utf8'`\n* `callback` {Function} Optional. Called when this chunk is\n successfully written.\n* Returns {Boolean}\n\nWrites `chunk` to the stream. Returns `true` if the data has been\nflushed to the underlying resource. Returns `false` to indicate that\nthe buffer is full, and the data will be sent out in the future. The\n`'drain'` event will indicate when the buffer is empty again.\n\nThe specifics of when `write()` will return false, is determined by\nthe `highWaterMark` option provided to the constructor.\n\n### writable.end([chunk], [encoding], [callback])\n\n* `chunk` {Buffer | String} Optional final data to be written\n* `encoding` {String} Optional. If `chunk` is a string, then encoding\n defaults to `'utf8'`\n* `callback` {Function} Optional. Called when the final chunk is\n successfully written.\n\nCall this method to signal the end of the data being written to the\nstream.\n\n### Event: 'drain'\n\nEmitted when the stream's write queue empties and it's safe to write\nwithout buffering again. Listen for it when `stream.write()` returns\n`false`.\n\n### Event: 'close'\n\nEmitted when the underlying resource (for example, the backing file\ndescriptor) has been closed. Not all streams will emit this.\n\n### Event: 'finish'\n\nWhen `end()` is called and there are no more chunks to write, this\nevent is emitted.\n\n### Event: 'pipe'\n\n* `source` {Readable Stream}\n\nEmitted when the stream is passed to a readable stream's pipe method.\n\n### Event 'unpipe'\n\n* `source` {Readable Stream}\n\nEmitted when a previously established `pipe()` is removed using the\nsource Readable stream's `unpipe()` method.\n\n## Class: stream.Duplex\n\n\n\nA \"duplex\" stream is one that is both Readable and Writable, such as a\nTCP socket connection.\n\nNote that `stream.Duplex` is an abstract class designed to be\nextended with an underlying implementation of the `_read(size)`\nand `_write(chunk, encoding, callback)` methods as you would with a Readable or\nWritable stream class.\n\nSince JavaScript doesn't have multiple prototypal inheritance, this\nclass prototypally inherits from Readable, and then parasitically from\nWritable. It is thus up to the user to implement both the lowlevel\n`_read(n)` method as well as the lowlevel `_write(chunk, encoding, cb)` method\non extension duplex classes.\n\n### new stream.Duplex(options)\n\n* `options` {Object} Passed to both Writable and Readable\n constructors. Also has the following fields:\n * `allowHalfOpen` {Boolean} Default=true. If set to `false`, then\n the stream will automatically end the readable side when the\n writable side ends and vice versa.\n\nIn classes that extend the Duplex class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n## Class: stream.Transform\n\nA \"transform\" stream is a duplex stream where the output is causally\nconnected in some way to the input, such as a zlib stream or a crypto\nstream.\n\nThere is no requirement that the output be the same size as the input,\nthe same number of chunks, or arrive at the same time. For example, a\nHash stream will only ever have a single chunk of output which is\nprovided when the input is ended. A zlib stream will either produce\nmuch smaller or much larger than its input.\n\nRather than implement the `_read()` and `_write()` methods, Transform\nclasses must implement the `_transform()` method, and may optionally\nalso implement the `_flush()` method. (See below.)\n\n### new stream.Transform([options])\n\n* `options` {Object} Passed to both Writable and Readable\n constructors.\n\nIn classes that extend the Transform class, make sure to call the\nconstructor so that the buffering settings can be properly\ninitialized.\n\n### transform.\\_transform(chunk, encoding, callback)\n\n* `chunk` {Buffer | String} The chunk to be transformed. Will always\n be a buffer unless the `decodeStrings` option was set to `false`.\n* `encoding` {String} If the chunk is a string, then this is the\n encoding type. (Ignore if `decodeStrings` chunk is a buffer.)\n* `callback` {Function} Call this function (optionally with an error\n argument) when you are done processing the supplied chunk.\n\nNote: **This function MUST NOT be called directly.** It should be\nimplemented by child classes, and called by the internal Transform\nclass methods only.\n\nAll Transform stream implementations must provide a `_transform`\nmethod to accept input and produce output.\n\n`_transform` should do whatever has to be done in this specific\nTransform class, to handle the bytes being written, and pass them off\nto the readable portion of the interface. Do asynchronous I/O,\nprocess things, and so on.\n\nCall `transform.push(outputChunk)` 0 or more times to generate output\nfrom this input chunk, depending on how much data you want to output\nas a result of this chunk.\n\nCall the callback function only when the current chunk is completely\nconsumed. Note that there may or may not be output as a result of any\nparticular input chunk.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\n### transform.\\_flush(callback)\n\n* `callback` {Function} Call this function (optionally with an error\n argument) when you are done flushing any remaining data.\n\nNote: **This function MUST NOT be called directly.** It MAY be implemented\nby child classes, and if so, will be called by the internal Transform\nclass methods only.\n\nIn some cases, your transform operation may need to emit a bit more\ndata at the end of the stream. For example, a `Zlib` compression\nstream will store up some internal state so that it can optimally\ncompress the output. At the end, however, it needs to do the best it\ncan with what is left, so that the data will be complete.\n\nIn those cases, you can implement a `_flush` method, which will be\ncalled at the very end, after all the written data is consumed, but\nbefore emitting `end` to signal the end of the readable side. Just\nlike with `_transform`, call `transform.push(chunk)` zero or more\ntimes, as appropriate, and call `callback` when the flush operation is\ncomplete.\n\nThis method is prefixed with an underscore because it is internal to\nthe class that defines it, and should not be called directly by user\nprograms. However, you **are** expected to override this method in\nyour own extension classes.\n\n### Example: `SimpleProtocol` parser\n\nThe example above of a simple protocol parser can be implemented much\nmore simply by using the higher level `Transform` stream class.\n\nIn this example, rather than providing the input as an argument, it\nwould be piped into the parser, which is a more idiomatic Node stream\napproach.\n\n```javascript\nfunction SimpleProtocol(options) {\n if (!(this instanceof SimpleProtocol))\n return new SimpleProtocol(options);\n\n Transform.call(this, options);\n this._inBody = false;\n this._sawFirstCr = false;\n this._rawHeader = [];\n this.header = null;\n}\n\nSimpleProtocol.prototype = Object.create(\n Transform.prototype, { constructor: { value: SimpleProtocol }});\n\nSimpleProtocol.prototype._transform = function(chunk, encoding, done) {\n if (!this._inBody) {\n // check if the chunk has a \\n\\n\n var split = -1;\n for (var i = 0; i < chunk.length; i++) {\n if (chunk[i] === 10) { // '\\n'\n if (this._sawFirstCr) {\n split = i;\n break;\n } else {\n this._sawFirstCr = true;\n }\n } else {\n this._sawFirstCr = false;\n }\n }\n\n if (split === -1) {\n // still waiting for the \\n\\n\n // stash the chunk, and try again.\n this._rawHeader.push(chunk);\n } else {\n this._inBody = true;\n var h = chunk.slice(0, split);\n this._rawHeader.push(h);\n var header = Buffer.concat(this._rawHeader).toString();\n try {\n this.header = JSON.parse(header);\n } catch (er) {\n this.emit('error', new Error('invalid simple protocol data'));\n return;\n }\n // and let them know that we are done parsing the header.\n this.emit('header', this.header);\n\n // now, because we got some extra data, emit this first.\n this.push(b);\n }\n } else {\n // from there on, just provide the data to our consumer as-is.\n this.push(b);\n }\n done();\n};\n\nvar parser = new SimpleProtocol();\nsource.pipe(parser)\n\n// Now parser is a readable stream that will emit 'header'\n// with the parsed header data.\n```\n\n\n## Class: stream.PassThrough\n\nThis is a trivial implementation of a `Transform` stream that simply\npasses the input bytes across to the output. Its purpose is mainly\nfor examples and testing, but there are occasionally use cases where\nit can come in handy.\n\n\n[EventEmitter]: events.html#events_class_events_eventemitter\n", - "readmeFilename": "README.md", + "license": "MIT", "bugs": { "url": "https://github.com/isaacs/readable-stream/issues" }, "homepage": "https://github.com/isaacs/readable-stream", - "_id": "readable-stream@1.0.24", - "_from": "readable-stream@1.0" + "_id": "readable-stream@1.0.27-1", + "dist": { + "shasum": "6b67983c20357cefd07f0165001a16d710d91078", + "tarball": "http://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz" + }, + "_from": "readable-stream@1.0", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "rvagg", + "email": "rod@vagg.org" + }, + "maintainers": [ + { + "name": "isaacs", + "email": "i@izs.me" + }, + { + "name": "tootallnate", + "email": "nathan@tootallnate.net" + }, + { + "name": "rvagg", + "email": "rod@vagg.org" + } + ], + "directories": {}, + "_shasum": "6b67983c20357cefd07f0165001a16d710d91078", + "_resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.27-1.tgz", + "readme": "ERROR: No README data found!" } diff --git a/deps/npm/node_modules/sha/package.json b/deps/npm/node_modules/sha/package.json index af9aa7adaef..091919964a9 100644 --- a/deps/npm/node_modules/sha/package.json +++ b/deps/npm/node_modules/sha/package.json @@ -1,6 +1,6 @@ { "name": "sha", - "version": "1.2.3", + "version": "1.2.4", "description": "Check and get file hashes", "scripts": { "test": "mocha -R spec" @@ -11,22 +11,38 @@ }, "license": "BSD", "optionalDependencies": { - "graceful-fs": "2", + "graceful-fs": "2 || 3", "readable-stream": "1.0" }, "devDependencies": { "mocha": "~1.9.0" }, - "readme": "# sha\r\n\r\nCheck and get file hashes (using any algorithm)\r\n\r\n[![Build Status](https://travis-ci.org/ForbesLindesay/sha.png?branch=master)](https://travis-ci.org/ForbesLindesay/sha)\r\n[![Dependency Status](https://gemnasium.com/ForbesLindesay/sha.png)](https://gemnasium.com/ForbesLindesay/sha)\r\n[![NPM version](https://badge.fury.io/js/sha.png)](http://badge.fury.io/js/sha)\r\n\r\n## Installation\r\n\r\n $ npm install sha\r\n\r\n## API\r\n\r\n### check(fileName, expected, [options,] cb) / checkSync(filename, expected, [options])\r\n\r\nAsynchronously check that `fileName` has a \"hash\" of `expected`. The callback will be called with either `null` or an error (indicating that they did not match).\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n### get(fileName, [options,] cb) / getSync(filename, [options])\r\n\r\nAsynchronously get the \"hash\" of `fileName`. The callback will be called with an optional `error` object and the (lower cased) hex digest of the hash.\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n### stream(expected, [options])\r\n\r\nCheck the hash of a stream without ever buffering it. This is a pass through stream so you can do things like:\r\n\r\n```js\r\nfs.createReadStream('src')\r\n .pipe(sha.stream('expected'))\r\n .pipe(fs.createWriteStream('dest'))\r\n```\r\n\r\n`dest` will be a complete copy of `src` and an error will be emitted if the hash did not match `'expected'`.\r\n\r\nOptions:\r\n\r\n- algorithm: defaults to `sha1` and can be any of the algorithms supported by `crypto.createHash`\r\n\r\n## License\r\n\r\nYou may use this software under the BSD or MIT. Take your pick. If you want me to release it under another license, open a pull request.", - "readmeFilename": "README.md", "bugs": { "url": "https://github.com/ForbesLindesay/sha/issues" }, "homepage": "https://github.com/ForbesLindesay/sha", "dependencies": { - "graceful-fs": "2", + "graceful-fs": "2 || 3", "readable-stream": "1.0" }, - "_id": "sha@1.2.3", - "_from": "sha@~1.2.1" + "_id": "sha@1.2.4", + "dist": { + "shasum": "1f9a377f27b6fdee409b9b858e43da702be48a4d", + "tarball": "http://registry.npmjs.org/sha/-/sha-1.2.4.tgz" + }, + "_from": "sha@latest", + "_npmVersion": "1.4.3", + "_npmUser": { + "name": "forbeslindesay", + "email": "forbes@lindeay.co.uk" + }, + "maintainers": [ + { + "name": "forbeslindesay", + "email": "forbes@lindesay.co.uk" + } + ], + "directories": {}, + "_shasum": "1f9a377f27b6fdee409b9b858e43da702be48a4d", + "_resolved": "https://registry.npmjs.org/sha/-/sha-1.2.4.tgz" } diff --git a/deps/npm/node_modules/tar/README.md b/deps/npm/node_modules/tar/README.md index 5bcc82cd898..424a2782bf7 100644 --- a/deps/npm/node_modules/tar/README.md +++ b/deps/npm/node_modules/tar/README.md @@ -19,6 +19,8 @@ Returns a through stream. Use pack stream and you will receive tar archive data from the pack stream. +This only works with directories, it does not work with individual files. + The optional `properties` object are used to set properties in the tar 'Global Extended Header'. diff --git a/deps/npm/node_modules/tar/examples/packer.js b/deps/npm/node_modules/tar/examples/packer.js new file mode 100644 index 00000000000..ebe38926e1a --- /dev/null +++ b/deps/npm/node_modules/tar/examples/packer.js @@ -0,0 +1,10 @@ +var tar = require("../tar.js") + , fstream = require("fstream") + , fs = require("fs") + +var dir_destination = fs.createWriteStream('dir.tar') + +// This must be a "directory" +fstream.Reader({ path: __dirname, type: "Directory" }) + .pipe(tar.Pack({ noProprietary: true })) + .pipe(dir_destination) \ No newline at end of file diff --git a/deps/npm/node_modules/tar/lib/parse.js b/deps/npm/node_modules/tar/lib/parse.js index 884e73dbac0..009a85f4135 100644 --- a/deps/npm/node_modules/tar/lib/parse.js +++ b/deps/npm/node_modules/tar/lib/parse.js @@ -37,6 +37,7 @@ function Parse () { me.readable = true me._stream = new BlockStream(512) me.position = 0 + me._ended = false me._stream.on("error", function (e) { me.emit("error", e) @@ -118,13 +119,13 @@ Parse.prototype._process = function (c) { // so appending one tarball to another is technically valid. // ending without the eof null blocks is not allowed, however. if (zero) { - this._ended = this._eofStarted + if (this._eofStarted) + this._ended = true this._eofStarted = true } else { - this._ended = this._eofStarted = false + this._eofStarted = false this._startEntry(c) } - } this.position += 512 diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json index 4c69c4ba2cc..2f261b890d7 100644 --- a/deps/npm/node_modules/tar/package.json +++ b/deps/npm/node_modules/tar/package.json @@ -6,7 +6,7 @@ }, "name": "tar", "description": "tar for node", - "version": "0.1.19", + "version": "0.1.20", "repository": { "type": "git", "url": "git://github.com/isaacs/node-tar.git" @@ -16,25 +16,23 @@ "test": "tap test/*.js" }, "dependencies": { - "inherits": "2", "block-stream": "*", - "fstream": "~0.1.8" + "fstream": "~0.1.28", + "inherits": "2" }, "devDependencies": { "tap": "0.x", "rimraf": "1.x" }, "license": "BSD", - "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", + "readme": "# node-tar\n\nTar for Node.js.\n\n[![NPM](https://nodei.co/npm/tar.png)](https://nodei.co/npm/tar/)\n\n## API\n\nSee `examples/` for usage examples.\n\n### var tar = require('tar')\n\nReturns an object with `.Pack`, `.Extract` and `.Parse` methods.\n\n### tar.Pack([properties])\n\nReturns a through stream. Use\n[fstream](https://npmjs.org/package/fstream) to write files into the\npack stream and you will receive tar archive data from the pack\nstream.\n\nThis only works with directories, it does not work with individual files.\n\nThe optional `properties` object are used to set properties in the tar\n'Global Extended Header'.\n\n### tar.Extract([options])\n\nReturns a through stream. Write tar data to the stream and the files\nin the tarball will be extracted onto the filesystem.\n\n`options` can be:\n\n```js\n{\n path: '/path/to/extract/tar/into',\n strip: 0, // how many path segments to strip from the root when extracting\n}\n```\n\n`options` also get passed to the `fstream.Writer` instance that `tar`\nuses internally.\n\n### tar.Parse()\n\nReturns a writable stream. Write tar data to it and it will emit\n`entry` events for each entry parsed from the tarball. This is used by\n`tar.Extract`.\n", "readmeFilename": "README.md", + "gitHead": "b5931010907cd1ef5a186bc947954391050cbcce", "bugs": { "url": "https://github.com/isaacs/node-tar/issues" }, "homepage": "https://github.com/isaacs/node-tar", - "_id": "tar@0.1.19", - "dist": { - "shasum": "fe45941799e660ce1ea52d875d37481b4bf13eac" - }, - "_from": "tar@0.1.19", - "_resolved": "https://registry.npmjs.org/tar/-/tar-0.1.19.tgz" + "_id": "tar@0.1.20", + "_shasum": "42940bae5b5f22c74483699126f9f3f27449cb13", + "_from": "tar@~0.1.19" } diff --git a/deps/npm/node_modules/tar/test/extract.js b/deps/npm/node_modules/tar/test/extract.js index fff481816fd..a68144be982 100644 --- a/deps/npm/node_modules/tar/test/extract.js +++ b/deps/npm/node_modules/tar/test/extract.js @@ -1,3 +1,6 @@ +// Set the umask, so that it works the same everywhere. +process.umask(parseInt('22', 8)) + var tap = require("tap") , tar = require("../tar.js") , fs = require("fs") @@ -114,6 +117,13 @@ var tap = require("tap") size: 200, linkpath: undefined, nlink: 2 }, + { path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', + mode: '120755', + type: 'SymbolicLink', + depth: 1, + size: 200, + linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', + nlink: 1 }, { path: '/200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', mode: '100644', type: 'Link', @@ -121,13 +131,6 @@ var tap = require("tap") size: 200, linkpath: path.join(target, '200-hard'), nlink: 2 }, - { path: '/200LLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLL', - mode: '120777', - type: 'SymbolicLink', - depth: 1, - size: 200, - linkpath: '200ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc', - nlink: 1 }, { path: '/c.txt', mode: '100644', type: 'File', @@ -280,6 +283,12 @@ var tap = require("tap") // So, this is as much a test of fstream.Reader and fstream.Writer // as it is of tar.Extract, but it sort of makes sense. +tap.test("preclean", function (t) { + require("rimraf").sync(__dirname + "/tmp/extract-test") + t.pass("cleaned!") + t.end() +}) + tap.test("extract test", function (t) { var extract = tar.Extract(target) var inp = fs.createReadStream(file) diff --git a/deps/npm/package.json b/deps/npm/package.json index e496acddcf7..e4eba9bd5b4 100644 --- a/deps/npm/package.json +++ b/deps/npm/package.json @@ -1,5 +1,5 @@ { - "version": "1.4.14", + "version": "1.4.21", "name": "npm", "description": "A package manager for node", "keywords": [ @@ -32,7 +32,7 @@ "bin": "./bin/npm-cli.js", "dependencies": { "abbrev": "~1.0.5", - "ansi": "~0.2.1", + "ansi": "~0.3.0", "ansicolors": "~0.3.2", "ansistyles": "~0.1.3", "archy": "0", @@ -42,44 +42,44 @@ "chmodr": "~0.1.0", "chownr": "0", "cmd-shim": "~1.1.1", - "columnify": "~0.1.2", - "editor": "0.0.5", - "fstream": "~0.1.25", + "columnify": "~1.1.0", + "editor": "~0.1.0", + "fstream": "~0.1.28", "fstream-npm": "~0.1.7", "github-url-from-git": "1.1.1", - "github-url-from-username-repo": "~0.1.0", - "glob": "~3.2.10", - "graceful-fs": "~2.0.2", + "github-url-from-username-repo": "~0.2.0", + "glob": "~4.0.3", + "graceful-fs": "~3.0.0", "inflight": "~1.0.1", "ini": "~1.2.0", - "init-package-json": "0.0.17", + "init-package-json": "~0.1.0", "lockfile": "~0.4.0", "lru-cache": "~2.5.0", "minimatch": "~0.3.0", "mkdirp": "~0.3.5", "node-gyp": "~0.13.0", - "nopt": "~2.2.1", + "nopt": "~3.0.1", "npm-cache-filename": "~1.0.1", - "npm-install-checks": "~1.0.0", - "npm-registry-client": "~1.0.0", + "npm-install-checks": "~1.0.2", + "npm-registry-client": "~2.0.3", "npm-user-validate": "~0.1.0", - "npmconf": "~1.0.1", - "npmlog": "0.0.6", + "npmconf": "~1.1.4", + "npmlog": "~0.1.1", "once": "~1.3.0", "opener": "~1.3.0", - "osenv": "0", + "osenv": "~0.1.0", "path-is-inside": "~1.0.0", "read": "~1.0.4", - "read-installed": "~2.0.4", - "read-package-json": "~1.1.9", + "read-installed": "~2.0.5", + "read-package-json": "~1.2.2", "request": "~2.30.0", "retry": "~0.6.0", - "rimraf": "~2.2.5", + "rimraf": "~2.2.8", "semver": "~2.3.0", "sha": "~1.2.1", "slide": "~1.1.5", "sorted-object": "~1.0.0", - "tar": "~0.1.19", + "tar": "~0.1.20", "text-table": "~0.2.0", "uid-number": "0.0.5", "which": "1" @@ -141,6 +141,7 @@ ], "devDependencies": { "marked": "~0.3.2", + "npm-registry-couchapp": "~2.3.6", "npm-registry-mock": "~0.6.3", "ronn": "~0.3.6", "tap": "~0.4.9" @@ -154,7 +155,7 @@ "test": "tap --timeout 120 test/tap/*.js", "tap": "tap --timeout 120 test/tap/*.js", "test-all": "node ./test/run.js && tap test/tap/*.js", - "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test/*/*/node_modules && make -j32 doc", + "prepublish": "node bin/npm-cli.js prune --prefix=. --no-global && rm -rf test/*/*/node_modules && make -j8 doc", "dumpconf": "env | grep npm | sort | uniq" }, "license": "Artistic-2.0" diff --git a/deps/npm/scripts/doc-build.sh b/deps/npm/scripts/doc-build.sh index 98dfa82f606..18f4e6ca864 100755 --- a/deps/npm/scripts/doc-build.sh +++ b/deps/npm/scripts/doc-build.sh @@ -32,6 +32,32 @@ if ! [ -x node_modules/.bin/ronn ]; then fi fi +if ! [ -x node_modules/.bin/marked ]; then + ps=0 + if [ -f .building_marked ]; then + pid=$(cat .building_marked) + ps=$(ps -p $pid | grep $pid | wc -l) || true + fi + + if [ -f .building_marked ] && [ $ps != 0 ]; then + while [ -f .building_marked ]; do + sleep 1 + done + else + # a race to see which make process will be the one to install marked + echo $$ > .building_marked + sleep 1 + if [ $(cat .building_marked) == $$ ]; then + make node_modules/.bin/marked + rm .building_marked + else + while [ -f .building_marked ]; do + sleep 1 + done + fi + fi +fi + src=$1 dest=$2 name=$(basename ${src%.*}) diff --git a/deps/npm/test/tap/global-prefix-set-in-userconfig.js b/deps/npm/test/tap/global-prefix-set-in-userconfig.js new file mode 100644 index 00000000000..85fa4f610ab --- /dev/null +++ b/deps/npm/test/tap/global-prefix-set-in-userconfig.js @@ -0,0 +1,36 @@ +var common = require("../common-tap.js") +var test = require("tap").test +var rimraf = require("rimraf") +var prefix = __filename.replace(/\.js$/, "") +var rcfile = __filename.replace(/\.js$/, ".npmrc") +var fs = require("fs") +var conf = "prefix = " + prefix + "\n" + +test("setup", function (t) { + rimraf.sync(prefix) + fs.writeFileSync(rcfile, conf) + t.pass("ready") + t.end() +}) + +test("run command", function (t) { + var args = ["prefix", "-g", "--userconfig=" + rcfile] + common.npm(args, {env: {}}, function (er, code, so, se) { + if (er) throw er + t.equal(code, 0) + t.equal(so.trim(), prefix) + t.end() + }) +}) + +test("made dir", function (t) { + t.ok(fs.statSync(prefix).isDirectory()) + t.end() +}) + +test("cleanup", function (t) { + rimraf.sync(prefix) + rimraf.sync(rcfile) + t.pass("clean") + t.end() +}) diff --git a/deps/npm/test/tap/outdated-git.js b/deps/npm/test/tap/outdated-git.js index 933e3b0b492..11c20402270 100644 --- a/deps/npm/test/tap/outdated-git.js +++ b/deps/npm/test/tap/outdated-git.js @@ -14,12 +14,12 @@ test("dicovers new versions in outdated", function (t) { process.chdir(pkg) t.plan(5) npm.load({cache: pkg + "/cache", registry: common.registry}, function () { - npm.outdated(function (er, d) { + npm.commands.outdated([], function (er, d) { t.equal('git', d[0][3]) t.equal('git', d[0][4]) t.equal('git://github.com/robertkowalski/foo-private.git', d[0][5]) t.equal('git://user:pass@github.com/robertkowalski/foo-private.git', d[1][5]) - t.equal('git://github.com/robertkowalski/foo', d[2][5]) + t.equal('git+https://github.com/robertkowalski/foo', d[2][5]) }) }) }) diff --git a/deps/npm/test/tap/registry.js b/deps/npm/test/tap/registry.js new file mode 100644 index 00000000000..8ea1c2f2daf --- /dev/null +++ b/deps/npm/test/tap/registry.js @@ -0,0 +1,55 @@ +// Run all the tests in the `npm-registry-couchapp` suite +// This verifies that the server-side stuff still works. + +var test = require("tap").test + +var spawn = require("child_process").spawn +var npmExec = require.resolve("../../bin/npm-cli.js") +var path = require("path") +var ca = path.resolve(__dirname, "../../node_modules/npm-registry-couchapp") + +var which = require("which") +var hasCouch = false + +which("couchdb", function(er, couch) { + if (er) { + return test("need couchdb", function (t) { + t.fail("need couch to run test: " + er.message) + t.end() + }) + } else { + runTests() + } +}) + +function runTests () { + spawn(process.execPath, [ + npmExec, "install" + ], { + cwd: ca, + stdio: "inherit" + }).on("close", function (code, sig) { + if (code || sig) { + return test("need install to work", function (t) { + t.fail("install failed with: " (code || sig)) + t.end() + }) + + } else { + var env = {} + for (var i in process.env) env[i] = process.env[i] + env.npm = npmExec + + spawn(process.execPath, [ + npmExec, "test" + ], { + cwd: ca, + env: env, + stdio: "inherit" + }).on("close", function (code, sig) { + process.exit(code || sig) + }) + } + + }) +} diff --git a/doc/api/net.markdown b/doc/api/net.markdown index a4ab91d4822..08ffe023f32 100644 --- a/doc/api/net.markdown +++ b/doc/api/net.markdown @@ -53,9 +53,13 @@ Use `nc` to connect to a UNIX domain socket server: ## net.connect(options, [connectionListener]) ## net.createConnection(options, [connectionListener]) -Constructs a new socket object and opens the socket to the given location. +A factory method, which returns a new ['net.Socket'](#net_class_net_socket) +and connects to the supplied address and port. + When the socket is established, the ['connect'][] event will be emitted. +Has the same events as ['net.Socket'](#net_class_net_socket). + For TCP sockets, `options` argument should be an object which specifies: - `port`: Port the client should connect to (Required). @@ -111,6 +115,8 @@ Creates a TCP connection to `port` on `host`. If `host` is omitted, The `connectListener` parameter will be added as an listener for the ['connect'][] event. +Is a factory method which returns a new ['net.Socket'](#net_class_net_socket). + ## net.connect(path, [connectListener]) ## net.createConnection(path, [connectListener]) @@ -118,6 +124,8 @@ Creates unix socket connection to `path`. The `connectListener` parameter will be added as an listener for the ['connect'][] event. +A factory method which returns a new ['net.Socket'](#net_class_net_socket). + ## Class: net.Server This class is used to create a TCP or local server. diff --git a/doc/api/path.markdown b/doc/api/path.markdown index 3a4f56938b8..9446a4043aa 100644 --- a/doc/api/path.markdown +++ b/doc/api/path.markdown @@ -47,7 +47,7 @@ If `to` isn't already absolute `from` arguments are prepended in right to left order, until an absolute path is found. If after using all `from` paths still no absolute path is found, the current working directory is used as well. The resulting path is normalized, and trailing slashes are removed unless the path -gets resolved to the root directory. Non-string arguments are ignored. +gets resolved to the root directory. Non-string `from` arguments are ignored. Another way to think of it is as a sequence of `cd` commands in a shell. diff --git a/doc/api/stream.markdown b/doc/api/stream.markdown index bbd3801a797..e9f6e2c5024 100644 --- a/doc/api/stream.markdown +++ b/doc/api/stream.markdown @@ -207,6 +207,8 @@ descriptor) has been closed. Not all streams will emit this. #### Event: 'error' +* {Error Object} + Emitted if there was an error receiving data. #### readable.read([size]) @@ -617,6 +619,8 @@ reader.unpipe(writer); #### Event: 'error' +* {Error object} + Emitted if there was an error when writing or piping data. ### Class: stream.Duplex diff --git a/lib/_stream_readable.js b/lib/_stream_readable.js index 999195216c2..b1b89392a5b 100644 --- a/lib/_stream_readable.js +++ b/lib/_stream_readable.js @@ -770,7 +770,12 @@ Readable.prototype.wrap = function(stream) { debug('wrapped data'); if (state.decoder) chunk = state.decoder.write(chunk); - if (!chunk || !state.objectMode && !chunk.length) + + // don't skip over falsy values in objectMode + //if (state.objectMode && util.isNullOrUndefined(chunk)) + if (state.objectMode && (chunk === null || chunk === undefined)) + return; + else if (!state.objectMode && (!chunk || !chunk.length)) return; var ret = self.push(chunk); diff --git a/lib/fs.js b/lib/fs.js index c3ca3cf61ef..3301a6af847 100644 --- a/lib/fs.js +++ b/lib/fs.js @@ -328,7 +328,13 @@ fs.readFileSync = function(path, options) { if (size === 0) { buffers = []; } else { - buffer = new Buffer(size); + var threw = true; + try { + buffer = new Buffer(size); + threw = false; + } finally { + if (threw) fs.closeSync(fd); + } } var done = false; diff --git a/lib/module.js b/lib/module.js index c0902327d30..564f6c49d6c 100644 --- a/lib/module.js +++ b/lib/module.js @@ -519,8 +519,9 @@ Module._initPaths = function() { paths.unshift(path.resolve(homeDir, '.node_modules')); } - if (process.env['NODE_PATH']) { - paths = process.env['NODE_PATH'].split(path.delimiter).concat(paths); + var nodePath = process.env['NODE_PATH']; + if (nodePath) { + paths = nodePath.split(path.delimiter).concat(paths); } modulePaths = paths; diff --git a/node.gyp b/node.gyp index f8d4ba18a67..c6aebf473dc 100644 --- a/node.gyp +++ b/node.gyp @@ -184,6 +184,19 @@ # For tests './deps/openssl/openssl.gyp:openssl-cli', ], + # Do not let unused OpenSSL symbols to slip away + 'xcode_settings': { + 'OTHER_LDFLAGS': [ + '-Wl,-force_load,<(PRODUCT_DIR)/libopenssl.a', + ], + }, + 'conditions': [ + ['OS=="linux"', { + 'ldflags': [ + '-Wl,--whole-archive <(PRODUCT_DIR)/libopenssl.a -Wl,--no-whole-archive', + ], + }], + ], }]] }, { 'defines': [ 'HAVE_OPENSSL=0' ] diff --git a/test/common.js b/test/common.js index 40f70728327..6301db9eb37 100644 --- a/test/common.js +++ b/test/common.js @@ -39,6 +39,13 @@ if (process.platform === 'win32') { if (!fs.existsSync(exports.opensslCli)) exports.opensslCli = false; +if (process.platform === 'win32') { + exports.faketimeCli = false; +} else { + exports.faketimeCli = path.join(__dirname, "..", "tools", "faketime", "src", + "faketime"); +} + var util = require('util'); for (var i in util) exports[i] = util[i]; //for (var i in exports) global[i] = exports[i]; diff --git a/test/simple/test-child-process-fork-dgram.js b/test/simple/test-child-process-fork-dgram.js index 769d0fd6173..1c4e9acc3b7 100644 --- a/test/simple/test-child-process-fork-dgram.js +++ b/test/simple/test-child-process-fork-dgram.js @@ -19,6 +19,20 @@ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE // USE OR OTHER DEALINGS IN THE SOFTWARE. +/* + * The purpose of this test is to make sure that when forking a process, + * sending a fd representing a UDP socket to the child and sending messages + * to this endpoint, these messages are distributed to the parent and the + * child process. + * + * Because it's not really possible to predict how the messages will be + * distributed among the parent and the child processes, we keep sending + * messages until both the parent and the child received at least one + * message. The worst case scenario is when either one never receives + * a message. In this case the test runner will timeout after 60 secs + * and the test will fail. + */ + var dgram = require('dgram'); var fork = require('child_process').fork; var assert = require('assert'); @@ -38,12 +52,11 @@ if (process.argv[2] === 'child') { server = clusterServer; server.on('message', function () { - childCollected += 1; + process.send('gotMessage'); }); } else if (msg === 'stop') { server.close(); - process.send(childCollected); process.removeListener('message', removeMe); } }); @@ -52,48 +65,49 @@ if (process.argv[2] === 'child') { var server = dgram.createSocket('udp4'); var client = dgram.createSocket('udp4'); var child = fork(__filename, ['child']); + var msg = new Buffer('Some bytes'); - var parentCollected = 0; - var childCollected = 0; + var childGotMessage = false; + var parentGotMessage = false; + server.on('message', function (msg, rinfo) { - parentCollected += 1; + parentGotMessage = true; }); server.on('listening', function () { child.send('server', server); + child.once('message', function (msg) { + if (msg === 'gotMessage') { + childGotMessage = true; + } + }); + sendMessages(); }); var sendMessages = function () { - var wait = 0; - var send = 0; - var total = 100; - var timer = setInterval(function () { - send += 1; - if (send === total) { - clearInterval(timer); - } - client.send(msg, 0, msg.length, common.PORT, '127.0.0.1', function(err) { if (err) throw err; - - wait += 1; - if (wait === total) { - shutdown(); - } } ); + + /* + * Both the parent and the child got at least one message, + * test passed, clean up everyting. + */ + if (parentGotMessage && childGotMessage) { + clearInterval(timer); + shutdown(); + } + }, 1); }; var shutdown = function () { child.send('stop'); - child.once('message', function (collected) { - childCollected = collected; - }); server.close(); client.close(); @@ -102,7 +116,7 @@ if (process.argv[2] === 'child') { server.bind(common.PORT, '127.0.0.1'); process.once('exit', function () { - assert(childCollected > 0); - assert(parentCollected > 0); + assert(parentGotMessage); + assert(childGotMessage); }); } diff --git a/test/simple/test-stream2-readable-wrap.js b/test/simple/test-stream2-readable-wrap.js index 90eea016c7a..293774ca5c8 100644 --- a/test/simple/test-stream2-readable-wrap.js +++ b/test/simple/test-stream2-readable-wrap.js @@ -99,6 +99,9 @@ runTest(100, false, function(){ return new Buffer(100); }); runTest(10, false, function(){ return new Buffer('xxxxxxxxxx'); }); runTest(1, true, function(){ return { foo: 'bar' }; }); +var objectChunks = [ 5, 'a', false, 0, '', 'xyz', { x: 4 }, 7, [], 555 ]; +runTest(1, true, function(){ return objectChunks.shift() }); + process.on('exit', function() { assert.equal(testRuns, completedRuns); console.log('ok'); diff --git a/test/timers/test-timers-reliability.js b/test/timers/test-timers-reliability.js new file mode 100644 index 00000000000..c240a44685a --- /dev/null +++ b/test/timers/test-timers-reliability.js @@ -0,0 +1,53 @@ +// FaketimeFlags: --exclude-monotonic -f '2014-07-21 09:00:00' + +var common = require('../common'); + +var Timer = process.binding('timer_wrap').Timer; +var assert = require('assert'); + +var timerFired = false; +var intervalFired = false; + +/* + * This test case aims at making sure that timing utilities such + * as setTimeout and setInterval are not vulnerable to time + * drifting or inconsistent time changes (such as ntp time sync + * in the past, etc.). + * + * It is run using faketime so that we change how + * non-monotonic clocks perceive time movement. We freeze + * non-monotonic time, and check if setTimeout and setInterval + * work properly in that situation. + * + * We check this by setting a timer based on a monotonic clock + * to fire after setTimeout's callback is supposed to be called. + * This monotonic timer, by definition, is not subject to time drifting + * and inconsistent time changes, so it can be considered as a solid + * reference. + * + * When the monotonic timer fires, if the setTimeout's callback + * hasn't been called yet, it means that setTimeout's underlying timer + * is vulnerable to time drift or inconsistent time changes. + */ + +var monoTimer = new Timer(); +monoTimer.ontimeout = function () { + /* + * Make sure that setTimeout's and setInterval's callbacks have + * already fired, otherwise it means that they are vulnerable to + * time drifting or inconsistent time changes. + */ + assert(timerFired); + assert(intervalFired); +}; + +monoTimer.start(300, 0); + +var timer = setTimeout(function () { + timerFired = true; +}, 200); + +var interval = setInterval(function () { + intervalFired = true; + clearInterval(interval); +}, 200); diff --git a/test/timers/testcfg.py b/test/timers/testcfg.py new file mode 100644 index 00000000000..98653e47165 --- /dev/null +++ b/test/timers/testcfg.py @@ -0,0 +1,102 @@ +# Copyright 2008 the V8 project authors. All rights reserved. +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are +# met: +# +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above +# copyright notice, this list of conditions and the following +# disclaimer in the documentation and/or other materials provided +# with the distribution. +# * Neither the name of Google Inc. nor the names of its +# contributors may be used to endorse or promote products derived +# from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +# "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +# LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +# A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +# OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +# LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +# DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +# THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +import test +import os +import shutil +from shutil import rmtree +from os import mkdir +from glob import glob +from os.path import join, dirname, exists +import re +import shlex + +FAKETIME_FLAGS_PATTERN = re.compile(r"//\s+FaketimeFlags:(.*)") +FAKETIME_BIN_PATH = os.path.join("tools", "faketime", "src", "faketime") + +class TimersTestCase(test.TestCase): + + def __init__(self, path, file, mode, context, config): + super(TimersTestCase, self).__init__(context, path, mode) + self.file = file + self.config = config + self.mode = mode + + def GetLabel(self): + return "%s %s" % (self.mode, self.GetName()) + + def GetName(self): + return self.path[-1] + + def GetCommand(self): + result = [FAKETIME_BIN_PATH]; + + source = open(self.file).read() + faketime_flags_match = FAKETIME_FLAGS_PATTERN.search(source) + if faketime_flags_match: + result += shlex.split(faketime_flags_match.group(1).strip()) + + result += [self.config.context.GetVm(self.mode)] + result += [self.file] + + return result + + def GetSource(self): + return open(self.file).read() + + +class TimersTestConfiguration(test.TestConfiguration): + + def __init__(self, context, root): + super(TimersTestConfiguration, self).__init__(context, root) + + def Ls(self, path): + def SelectTest(name): + return name.startswith('test-') and name.endswith('.js') + return [f[:-3] for f in os.listdir(path) if SelectTest(f)] + + def ListTests(self, current_path, path, mode): + all_tests = [current_path + [t] for t in self.Ls(join(self.root))] + result = [] + for test in all_tests: + if self.Contains(path, test): + file_path = join(self.root, reduce(join, test[1:], "") + ".js") + result.append(TimersTestCase(test, file_path, mode, self.context, self)) + return result + + def GetBuildRequirements(self): + return ['sample', 'sample=shell'] + + def GetTestStatus(self, sections, defs): + status_file = join(self.root, 'simple.status') + if exists(status_file): + test.ReadConfigurationInto(status_file, sections, defs) + + + +def GetConfiguration(context, root): + return TimersTestConfiguration(context, root) diff --git a/tools/Makefile b/tools/Makefile new file mode 100644 index 00000000000..d627c149d67 --- /dev/null +++ b/tools/Makefile @@ -0,0 +1,20 @@ +FAKETIME_REPO := git://github.com/wolfcw/libfaketime.git +FAKETIME_LOCAL_REPO := $(CURDIR)/faketime +FAKETIME_BRANCH := master +FAKETIME_BINARY := $(FAKETIME_PREFIX)/bin/faketime + +.PHONY: faketime + +faketime: $(FAKETIME_BINARY) + +clean: + $(RM) -r $(FAKETIME_LOCAL_REPO) + +$(FAKETIME_BINARY): $(FAKETIME_LOCAL_REPO) + cd $(FAKETIME_LOCAL_REPO) && \ + git checkout $(FAKETIME_BRANCH) && \ + PREFIX=$(FAKETIME_LOCAL_REPO)/src make + +$(FAKETIME_LOCAL_REPO): + git clone $(FAKETIME_REPO) $(FAKETIME_LOCAL_REPO) + diff --git a/tools/node-release-post-build.sh b/tools/node-release-post-build.sh index 4e3555c4f0b..5b1a19ed707 100755 --- a/tools/node-release-post-build.sh +++ b/tools/node-release-post-build.sh @@ -39,7 +39,7 @@ make email.md ( echo "" echo "Shasums:" echo '```' - cat SHASUMS.txt + cat SHASUMS.txt.asc echo '```' ) >> email.md ( echo -n "date: " date