summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Dahl <ry@tinyclouds.org>2011-12-16 13:57:36 -0800
committerRyan Dahl <ry@tinyclouds.org>2011-12-16 13:57:36 -0800
commit1865b11dcb77b452ef84fac6970cc742b387dfab (patch)
tree4f7a6fd12041fc0598606188d68a1b036701bd70
parent67e12a0f84eb16bab804a6dde88154d66da9dba3 (diff)
parenta599aeb2a8159c48eafbe066466ea5bc90d0c71c (diff)
downloadnode-new-1865b11dcb77b452ef84fac6970cc742b387dfab.tar.gz
Merge remote branch 'origin/v0.6'
Conflicts: wscript
-rw-r--r--.gitignore3
-rw-r--r--AUTHORS9
-rw-r--r--ChangeLog25
-rw-r--r--Makefile22
-rw-r--r--deps/npm/.gitmodules18
-rw-r--r--deps/npm/.travis.yml4
-rw-r--r--deps/npm/Makefile2
-rwxr-xr-xdeps/npm/bin/npm-cli.js3
-rw-r--r--deps/npm/doc/cli/config.md25
-rw-r--r--deps/npm/doc/cli/developers.md4
-rw-r--r--deps/npm/doc/cli/search.md25
-rw-r--r--deps/npm/html/api/bin.html2
-rw-r--r--deps/npm/html/api/bugs.html2
-rw-r--r--deps/npm/html/api/commands.html2
-rw-r--r--deps/npm/html/api/config.html2
-rw-r--r--deps/npm/html/api/deprecate.html2
-rw-r--r--deps/npm/html/api/docs.html2
-rw-r--r--deps/npm/html/api/edit.html2
-rw-r--r--deps/npm/html/api/explore.html2
-rw-r--r--deps/npm/html/api/help-search.html2
-rw-r--r--deps/npm/html/api/init.html2
-rw-r--r--deps/npm/html/api/install.html2
-rw-r--r--deps/npm/html/api/link.html2
-rw-r--r--deps/npm/html/api/load.html2
-rw-r--r--deps/npm/html/api/ls.html2
-rw-r--r--deps/npm/html/api/npm.html4
-rw-r--r--deps/npm/html/api/outdated.html2
-rw-r--r--deps/npm/html/api/owner.html2
-rw-r--r--deps/npm/html/api/pack.html2
-rw-r--r--deps/npm/html/api/prefix.html2
-rw-r--r--deps/npm/html/api/prune.html2
-rw-r--r--deps/npm/html/api/publish.html2
-rw-r--r--deps/npm/html/api/rebuild.html2
-rw-r--r--deps/npm/html/api/restart.html2
-rw-r--r--deps/npm/html/api/root.html2
-rw-r--r--deps/npm/html/api/run-script.html2
-rw-r--r--deps/npm/html/api/search.html2
-rw-r--r--deps/npm/html/api/start.html2
-rw-r--r--deps/npm/html/api/stop.html2
-rw-r--r--deps/npm/html/api/submodule.html2
-rw-r--r--deps/npm/html/api/tag.html2
-rw-r--r--deps/npm/html/api/test.html2
-rw-r--r--deps/npm/html/api/uninstall.html2
-rw-r--r--deps/npm/html/api/unpublish.html2
-rw-r--r--deps/npm/html/api/update.html2
-rw-r--r--deps/npm/html/api/version.html2
-rw-r--r--deps/npm/html/api/view.html2
-rw-r--r--deps/npm/html/api/whoami.html2
-rw-r--r--deps/npm/html/doc/README.html2
-rw-r--r--deps/npm/html/doc/adduser.html2
-rw-r--r--deps/npm/html/doc/bin.html2
-rw-r--r--deps/npm/html/doc/bugs.html2
-rw-r--r--deps/npm/html/doc/build.html2
-rw-r--r--deps/npm/html/doc/bundle.html2
-rw-r--r--deps/npm/html/doc/cache.html2
-rw-r--r--deps/npm/html/doc/changelog.html2
-rw-r--r--deps/npm/html/doc/coding-style.html2
-rw-r--r--deps/npm/html/doc/completion.html2
-rw-r--r--deps/npm/html/doc/config.html22
-rw-r--r--deps/npm/html/doc/deprecate.html2
-rw-r--r--deps/npm/html/doc/developers.html6
-rw-r--r--deps/npm/html/doc/docs.html2
-rw-r--r--deps/npm/html/doc/edit.html2
-rw-r--r--deps/npm/html/doc/explore.html2
-rw-r--r--deps/npm/html/doc/faq.html2
-rw-r--r--deps/npm/html/doc/folders.html2
-rw-r--r--deps/npm/html/doc/help-search.html2
-rw-r--r--deps/npm/html/doc/help.html2
-rw-r--r--deps/npm/html/doc/index.html2
-rw-r--r--deps/npm/html/doc/init.html2
-rw-r--r--deps/npm/html/doc/install.html2
-rw-r--r--deps/npm/html/doc/json.html2
-rw-r--r--deps/npm/html/doc/link.html2
-rw-r--r--deps/npm/html/doc/list.html2
-rw-r--r--deps/npm/html/doc/npm.html4
-rw-r--r--deps/npm/html/doc/outdated.html2
-rw-r--r--deps/npm/html/doc/owner.html2
-rw-r--r--deps/npm/html/doc/pack.html2
-rw-r--r--deps/npm/html/doc/prefix.html2
-rw-r--r--deps/npm/html/doc/prune.html2
-rw-r--r--deps/npm/html/doc/publish.html2
-rw-r--r--deps/npm/html/doc/rebuild.html2
-rw-r--r--deps/npm/html/doc/registry.html2
-rw-r--r--deps/npm/html/doc/removing-npm.html2
-rw-r--r--deps/npm/html/doc/restart.html2
-rw-r--r--deps/npm/html/doc/root.html2
-rw-r--r--deps/npm/html/doc/run-script.html2
-rw-r--r--deps/npm/html/doc/scripts.html2
-rw-r--r--deps/npm/html/doc/search.html24
-rw-r--r--deps/npm/html/doc/semver.html2
-rw-r--r--deps/npm/html/doc/star.html2
-rw-r--r--deps/npm/html/doc/start.html2
-rw-r--r--deps/npm/html/doc/stop.html2
-rw-r--r--deps/npm/html/doc/submodule.html2
-rw-r--r--deps/npm/html/doc/tag.html2
-rw-r--r--deps/npm/html/doc/test.html2
-rw-r--r--deps/npm/html/doc/uninstall.html2
-rw-r--r--deps/npm/html/doc/unpublish.html2
-rw-r--r--deps/npm/html/doc/update.html2
-rw-r--r--deps/npm/html/doc/version.html2
-rw-r--r--deps/npm/html/doc/view.html2
-rw-r--r--deps/npm/html/doc/whoami.html2
-rw-r--r--deps/npm/lib/adduser.js8
-rw-r--r--deps/npm/lib/bugs.js4
-rw-r--r--deps/npm/lib/cache.js107
-rw-r--r--deps/npm/lib/init.js69
-rw-r--r--deps/npm/lib/install.js2
-rw-r--r--deps/npm/lib/npm.js4
-rw-r--r--deps/npm/lib/rebuild.js30
-rw-r--r--deps/npm/lib/search.js73
-rw-r--r--deps/npm/lib/substack.js10
-rw-r--r--deps/npm/lib/unpublish.js9
-rw-r--r--deps/npm/lib/utils/config-defs.js12
-rw-r--r--deps/npm/lib/utils/excludes.js42
-rw-r--r--deps/npm/lib/utils/fetch.js9
-rw-r--r--deps/npm/lib/utils/get-agent.js2
-rw-r--r--deps/npm/lib/utils/ini.js2
-rw-r--r--deps/npm/lib/utils/lifecycle.js5
-rw-r--r--deps/npm/lib/utils/log.js19
-rw-r--r--deps/npm/lib/utils/npm-registry-client/get.js11
-rw-r--r--deps/npm/lib/utils/npm-registry-client/publish.js11
-rw-r--r--deps/npm/lib/utils/npm-registry-client/request.js6
-rw-r--r--deps/npm/lib/utils/prompt.js69
-rw-r--r--deps/npm/lib/utils/relativize.js13
-rw-r--r--deps/npm/lib/utils/tar.js22
-rw-r--r--deps/npm/man/man1/config.140
-rw-r--r--deps/npm/man/man1/developers.13
-rw-r--r--deps/npm/man/man1/npm.12
-rw-r--r--deps/npm/man/man1/search.142
-rw-r--r--deps/npm/man/man3/npm.32
-rw-r--r--deps/npm/node_modules/fast-list/.npmignore1
-rw-r--r--deps/npm/node_modules/fast-list/.travis.yml4
-rw-r--r--deps/npm/node_modules/fast-list/bench.js55
-rw-r--r--deps/npm/node_modules/fstream/.npmignore3
-rw-r--r--deps/npm/node_modules/fstream/.travis.yml3
-rw-r--r--deps/npm/node_modules/fstream/lib/dir-reader.js12
-rw-r--r--deps/npm/node_modules/fstream/lib/reader.js7
-rw-r--r--deps/npm/node_modules/fstream/lib/socket-reader.js38
-rw-r--r--deps/npm/node_modules/fstream/package.json4
-rw-r--r--deps/npm/node_modules/graceful-fs/.npmignore1
-rw-r--r--deps/npm/node_modules/graceful-fs/graceful-fs.js29
-rw-r--r--deps/npm/node_modules/graceful-fs/package.json2
-rw-r--r--deps/npm/node_modules/lru-cache/.npmignore1
-rw-r--r--deps/npm/node_modules/lru-cache/LICENSE (renamed from deps/npm/node_modules/minimatch/node_modules/lru-cache/LICENSE)0
-rw-r--r--deps/npm/node_modules/lru-cache/README.md (renamed from deps/npm/node_modules/minimatch/node_modules/lru-cache/README.md)0
-rw-r--r--deps/npm/node_modules/lru-cache/lib/lru-cache.js (renamed from deps/npm/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js)95
-rw-r--r--deps/npm/node_modules/lru-cache/package.json13
-rw-r--r--deps/npm/node_modules/minimatch/.gitmodules3
-rw-r--r--deps/npm/node_modules/minimatch/.travis.yml4
-rw-r--r--deps/npm/node_modules/minimatch/README.md7
-rw-r--r--deps/npm/node_modules/minimatch/minimatch.js117
-rw-r--r--deps/npm/node_modules/minimatch/node_modules/lru-cache/package.json13
-rw-r--r--deps/npm/node_modules/minimatch/package.json5
-rw-r--r--deps/npm/node_modules/node-uuid/.npmignore2
-rw-r--r--deps/npm/node_modules/nopt/.npmignore0
-rw-r--r--deps/npm/node_modules/read/README.md43
-rw-r--r--deps/npm/node_modules/read/lib/read.js151
-rw-r--r--deps/npm/node_modules/read/package.json16
-rw-r--r--deps/npm/node_modules/tar/.npmignore5
-rw-r--r--deps/npm/node_modules/tar/.travis.yml3
-rw-r--r--deps/npm/node_modules/tar/lib/pack.js4
-rw-r--r--deps/npm/node_modules/tar/package.json4
-rw-r--r--deps/npm/package.json10
-rwxr-xr-x[-rw-r--r--]deps/npm/scripts/clean-old.sh0
-rwxr-xr-x[-rw-r--r--]deps/npm/scripts/index-build.js0
-rwxr-xr-x[-rw-r--r--]deps/npm/scripts/install.sh0
-rw-r--r--deps/npm/test/common.js7
-rw-r--r--deps/npm/test/packages/npm-test-blerg/package.json4
-rw-r--r--deps/npm/test/packages/npm-test-blerg/test.js5
-rw-r--r--deps/npm/test/packages/npm-test-env-reader/package.json14
-rwxr-xr-xdeps/npm/test/packages/npm-test-env-reader/test.sh3
-rw-r--r--deps/npm/test/packages/npm-test-ignore/.npmignore7
-rw-r--r--deps/npm/test/packages/npm-test-ignore/include40
-rw-r--r--deps/npm/test/packages/npm-test-ignore/package.json3
-rw-r--r--deps/npm/test/packages/npm-test-ignore/sub/include0
-rw-r--r--deps/npm/test/packages/npm-test-ignore/sub/include20
-rw-r--r--deps/npm/test/packages/npm-test-ignore/sub/include41
-rw-r--r--deps/npm/test/packages/npm-test-ignore/test.sh27
-rw-r--r--deps/npm/test/packages/npm-test-missing-bindir/package.json4
-rw-r--r--deps/npm/test/packages/npm-test-missing-bindir/test.js5
-rw-r--r--deps/npm/test/packages/npm-test-private/package.json4
-rw-r--r--deps/npm/test/packages/npm-test-test-package/package.json5
-rw-r--r--deps/npm/test/packages/npm-test-url-dep/package.json4
-rwxr-xr-xdeps/npm/test/run138
-rwxr-xr-xdeps/npm/test/update-test.sh59
-rw-r--r--doc/about/index.html126
-rw-r--r--doc/api/fs.markdown6
-rw-r--r--doc/api/http.markdown10
-rw-r--r--doc/api/util.markdown4
-rw-r--r--doc/close-downloads.pngbin0 -> 1232 bytes
-rw-r--r--doc/community/index.html161
-rw-r--r--doc/community/not-invented-here.pngbin0 -> 203717 bytes
-rw-r--r--doc/download-logo.pngbin0 -> 7614 bytes
-rw-r--r--doc/ebay-logo.pngbin0 -> 2354 bytes
-rw-r--r--doc/footer-logo.pngbin0 -> 2626 bytes
-rw-r--r--doc/full-white-stripe.bmpbin0 -> 461814 bytes
-rw-r--r--doc/icons.pngbin0 -> 2107 bytes
-rw-r--r--doc/index.html359
-rw-r--r--doc/linkedin-logo.pngbin0 -> 2346 bytes
-rw-r--r--doc/logo.pngbin5553 -> 5081 bytes
-rw-r--r--doc/logos/index.html111
-rw-r--r--doc/microsoft-logo.pngbin0 -> 2570 bytes
-rw-r--r--doc/pipe.css336
-rw-r--r--doc/platform-icons.pngbin0 -> 3593 bytes
-rw-r--r--doc/ryan-speaker.jpgbin0 -> 11971 bytes
-rw-r--r--doc/sh_vim-dark.css2
-rw-r--r--doc/template.html14
-rw-r--r--doc/thin-white-stripe.bmpbin0 -> 85894 bytes
-rw-r--r--doc/windows_banner_nodejs_installer_logo.jpgbin5031 -> 0 bytes
-rw-r--r--doc/windows_dialog_nodejs_installer_logo.jpgbin12170 -> 0 bytes
-rw-r--r--doc/yahoo-logo.pngbin0 -> 2581 bytes
-rw-r--r--lib/child_process.js18
-rw-r--r--lib/cluster.js26
-rw-r--r--lib/fs.js12
-rw-r--r--lib/net.js6
-rw-r--r--lib/os.js8
-rw-r--r--lib/sys.js11
-rw-r--r--lib/util.js16
-rw-r--r--src/fs_event_wrap.cc30
-rw-r--r--src/node_crypto.cc585
-rw-r--r--src/node_file.cc2
-rw-r--r--src/v8constants.h83
-rw-r--r--src/v8ustack.d626
-rw-r--r--test/simple/test-crypto.js13
-rw-r--r--test/simple/test-fs-read-stream.js9
-rw-r--r--test/simple/test-http-bind-twice.js47
-rw-r--r--test/simple/test-net-bind-twice.js46
-rw-r--r--tools/msvs/msi/nodemsi.wixproj28
-rw-r--r--tools/msvs/msi/product.wxs9
229 files changed, 3346 insertions, 1303 deletions
diff --git a/.gitignore b/.gitignore
index 48513041d2..6eb3b0a398 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,4 +1,5 @@
-
+core
+vgcore.*
.waf*
tags
.lock-wscript
diff --git a/AUTHORS b/AUTHORS
index 1fa19d3b27..51e0c7dba7 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -235,3 +235,12 @@ Jacob H.C. Kragh <jhckragh@gmail.com>
Benjamin Pasero <benjamin.pasero@gmail.com>
Scott Anderson <sanderson7@gmail.com>
Yoji SHIDARA <dara@shidara.net>
+Mathias Bynens <mathias@qiwi.be>
+Łukasz Walukiewicz <lukasz@walukiewicz.eu>
+Artur Adib <arturadib@gmail.com>
+E. Azer Koçulu <azer@kodfabrik.com>
+Roman Shtylman <shtylman@gmail.com>
+Kyle Robinson Young <kyle@dontkry.com>
+Tim Oxley <secoif@gmail.com>
+Ingmar Runge <ingmar@irsoft.de>
+Russ Bradberry <rbradberry@gmail.com>
diff --git a/ChangeLog b/ChangeLog
index 9a544f0ea1..cccdbf2a24 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,4 +1,27 @@
-2011.12.04, Version 0.6.5 (stable)
+2011.12.14, Version 0.6.6 (stable)
+
+* npm update to 1.1.0-beta-4 (Isaac Z. Schlueter)
+
+* cli: fix output of --help (Ben Noordhuis)
+
+* new website
+
+* pause/resume semantics for stdin (Isaac Z. Schlueter)
+
+* Travis CI integration (Maciej Małecki)
+
+* child_process: Fix bug regarding closed stdin (Ben Noordhuis)
+
+* Enable upgrades in MSI. (Igor Zinkovsky)
+
+* net: Fixes memory leak (Ben Noordhuis)
+
+* fs: handle fractional or NaN ReadStream buffer size (Ben Noordhuis)
+
+* crypto: fix memory leaks in PBKDF2 error path (Ben Noordhuis)
+
+
+2011.12.04, Version 0.6.5 (stable), 6cc94db653a2739ab28e33b2d6a63c51bd986a9f
* npm workaround Windows antivirus software (isaacs)
diff --git a/Makefile b/Makefile
index bf10701be3..b195f2e66a 100644
--- a/Makefile
+++ b/Makefile
@@ -62,7 +62,7 @@ test-internet: all
apidoc_sources = $(wildcard doc/api/*.markdown)
apidocs = $(addprefix out/,$(apidoc_sources:.markdown=.html))
-apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets
+apidoc_dirs = out/doc out/doc/api/ out/doc/api/assets out/doc/about out/doc/community out/doc/logos
apiassets = $(subst api_assets,api/assets,$(addprefix out/,$(wildcard doc/api_assets/*)))
@@ -75,8 +75,22 @@ website_files = \
out/doc/sh_vim-dark.css \
out/doc/logo.png \
out/doc/sponsored.png \
- out/doc/favicon.ico \
- out/doc/pipe.css
+ out/doc/favicon.ico \
+ out/doc/pipe.css \
+ out/doc/about/index.html \
+ out/doc/close-downloads.png \
+ out/doc/community/index.html \
+ out/doc/community/not-invented-here.png \
+ out/doc/download-logo.png \
+ out/doc/ebay-logo.png \
+ out/doc/footer-logo.png \
+ out/doc/icons.png \
+ out/doc/linkedin-logo.png \
+ out/doc/logos/index.html \
+ out/doc/microsoft-logo.png \
+ out/doc/platform-icons.png \
+ out/doc/ryan-speaker.jpg \
+ out/doc/yahoo-logo.png
doc: out/Release/node $(apidoc_dirs) $(website_files) $(apiassets) $(apidocs)
@@ -95,7 +109,7 @@ out/doc/api/%.html: doc/api/%.markdown out/Release/node $(apidoc_dirs) $(apiasse
out/doc/%:
website-upload: doc
- scp -r out/doc/* $(web_root)
+ rsync -r out/doc/ node@nodejs.org:~/web/nodejs.org/
docopen: out/doc/api/all.html
-google-chrome out/doc/api/all.html
diff --git a/deps/npm/.gitmodules b/deps/npm/.gitmodules
index c705633663..169c87505c 100644
--- a/deps/npm/.gitmodules
+++ b/deps/npm/.gitmodules
@@ -36,19 +36,25 @@
url = https://github.com/mikeal/request.git
[submodule "node_modules/tar"]
path = node_modules/tar
- url = git://github.com/isaacs/node-tar.git
+ url = https://github.com/isaacs/node-tar.git
[submodule "node_modules/fstream"]
path = node_modules/fstream
- url = git://github.com/isaacs/fstream.git
+ url = https://github.com/isaacs/fstream.git
[submodule "node_modules/inherits"]
path = node_modules/inherits
- url = git://github.com/isaacs/inherits.git
+ url = https://github.com/isaacs/inherits.git
[submodule "node_modules/block-stream"]
path = node_modules/block-stream
- url = git://github.com/isaacs/block-stream.git
+ url = https://github.com/isaacs/block-stream.git
[submodule "node_modules/mkdirp"]
path = node_modules/mkdirp
- url = git://github.com/isaacs/node-mkdirp.git
+ url = https://github.com/isaacs/node-mkdirp.git
[submodule "node_modules/fast-list"]
path = node_modules/fast-list
- url = git://github.com/isaacs/fast-list.git
+ url = https://github.com/isaacs/fast-list.git
+[submodule "node_modules/read"]
+ path = node_modules/read
+ url = https://github.com/isaacs/read.git
+[submodule "node_modules/lru-cache"]
+ path = node_modules/lru-cache
+ url = https://github.com/isaacs/node-lru-cache.git
diff --git a/deps/npm/.travis.yml b/deps/npm/.travis.yml
new file mode 100644
index 0000000000..698bc9abdf
--- /dev/null
+++ b/deps/npm/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+before_install: "make &>out || cat out; rm out"
+node_js:
+ - 0.6
diff --git a/deps/npm/Makefile b/deps/npm/Makefile
index e10381baf7..20686da009 100644
--- a/deps/npm/Makefile
+++ b/deps/npm/Makefile
@@ -110,7 +110,7 @@ version: link
publish: link
git tag -s -m v$(shell npm -v) v$(shell npm -v) &&\
- git push origin master --tags &&\
+ git push origin --tags &&\
npm publish &&\
make doc-publish
diff --git a/deps/npm/bin/npm-cli.js b/deps/npm/bin/npm-cli.js
index db6db2fbd2..e0b9f20bb8 100755
--- a/deps/npm/bin/npm-cli.js
+++ b/deps/npm/bin/npm-cli.js
@@ -12,6 +12,9 @@ if (typeof WScript !== "undefined") {
return
}
+
+process.title = "npm"
+
var log = require("../lib/utils/log.js")
log.waitForConfig()
log.info("ok", "it worked if it ends with")
diff --git a/deps/npm/doc/cli/config.md b/deps/npm/doc/cli/config.md
index e380e65eff..e70acc258a 100644
--- a/deps/npm/doc/cli/config.md
+++ b/deps/npm/doc/cli/config.md
@@ -225,6 +225,14 @@ The location of npm's cache directory. See `npm-cache(1)`
If false, never shows colors. If `"always"` then always shows colors.
If true, then only prints color codes for tty file descriptors.
+### coverage
+
+* Default: false
+* Type: Boolean
+
+A flag to tell test-harness to run with their coverage options enabled,
+if they respond to the `npm_config_coverage` environment variable.
+
### depth
* Default: Infinity
@@ -379,13 +387,16 @@ The location to write log output.
### loglevel
-* Default: "warn"
+* Default: "http"
* Type: String
-* Values: "silent", "win", "error", "warn", "info", "verbose", "silly"
+* Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly"
What level of logs to report. On failure, *all* logs are written to
`npm-debug.log` in the current working directory.
+Any logs of a higher level than the setting are shown.
+The default is "http", which shows http, warn, and error output.
+
### logprefix
* Default: true on Posix, false on Windows
@@ -537,6 +548,16 @@ Space-separated options that are always passed to search.
Space-separated options that limit the results from search.
+### searchsort
+
+* Default: "name"
+* Type: String
+* Values: "name", "-name", "date", "-date", "description",
+ "-description", "keywords", "-keywords"
+
+Indication of which field to sort search results by. Prefix with a `-`
+character to indicate reverse sort.
+
### shell
* Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
diff --git a/deps/npm/doc/cli/developers.md b/deps/npm/doc/cli/developers.md
index 0f0f94c588..9123f35a33 100644
--- a/deps/npm/doc/cli/developers.md
+++ b/deps/npm/doc/cli/developers.md
@@ -150,8 +150,8 @@ You can give publish a url to a tarball, or a filename of a tarball,
or a path to a folder.
Note that pretty much **everything in that folder will be exposed**
-by default. So, if you have secret stuff in there, use a `.npminclude`
-or `.npmignore` file to list out the globs to include/ignore, or publish
+by default. So, if you have secret stuff in there, use a
+`.npmignore` file to list out the globs to ignore, or publish
from a fresh checkout.
## Brag about it
diff --git a/deps/npm/doc/cli/search.md b/deps/npm/doc/cli/search.md
index 3b15e9b073..e9e408c677 100644
--- a/deps/npm/doc/cli/search.md
+++ b/deps/npm/doc/cli/search.md
@@ -9,28 +9,9 @@ npm-search(1) -- Search for packages
Search the registry for packages matching the search terms.
-## CONFIGURATION
-
-### description
-
-* Default: true
-* Type: Boolean
-
-Show the description in `npm search`
-
-### searchopts
-
-* Default: ""
-* Type: String
-
-Space-separated options that are always passed to search.
-
-### searchexclude
-
-* Default: ""
-* Type: String
-
-Space-separated options that limit the results from search.
+If a term starts with `/`, then it's interpreted as a regular expression.
+A trailing `/` will be ignored in this case. (Note that many regular
+expression characters must be escaped or quoted in most shells.)
## SEE ALSO
diff --git a/deps/npm/html/api/bin.html b/deps/npm/html/api/bin.html
index accd17cc85..599096912c 100644
--- a/deps/npm/html/api/bin.html
+++ b/deps/npm/html/api/bin.html
@@ -19,7 +19,7 @@
<p>This function should not be used programmatically. Instead, just refer
to the <code>npm.bin</code> member.</p>
</div>
-<p id="footer">bin &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">bin &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/bugs.html b/deps/npm/html/api/bugs.html
index 71f7da204e..b5828c3ddf 100644
--- a/deps/npm/html/api/bugs.html
+++ b/deps/npm/html/api/bugs.html
@@ -25,7 +25,7 @@ optional version number.</p>
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
-<p id="footer">bugs &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">bugs &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/commands.html b/deps/npm/html/api/commands.html
index 7102efdd14..d6c6615007 100644
--- a/deps/npm/html/api/commands.html
+++ b/deps/npm/html/api/commands.html
@@ -28,7 +28,7 @@ usage, or <code>man 3 npm-&lt;command&gt;</code> for programmatic usage.</p>
<ul><li><a href="../doc/index.html">index(1)</a></li></ul>
</div>
-<p id="footer">commands &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">commands &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/config.html b/deps/npm/html/api/config.html
index f91ef57a2f..88c015dcb2 100644
--- a/deps/npm/html/api/config.html
+++ b/deps/npm/html/api/config.html
@@ -33,7 +33,7 @@ functions instead.</p>
<ul><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
-<p id="footer">config &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">config &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/deprecate.html b/deps/npm/html/api/deprecate.html
index 0e77dbad48..b1da74ebd1 100644
--- a/deps/npm/html/api/deprecate.html
+++ b/deps/npm/html/api/deprecate.html
@@ -30,7 +30,7 @@ install the package.</p></li></ul>
<ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../api/unpublish.html">unpublish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
</div>
-<p id="footer">deprecate &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">deprecate &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/docs.html b/deps/npm/html/api/docs.html
index b2a5ca2693..e973071e45 100644
--- a/deps/npm/html/api/docs.html
+++ b/deps/npm/html/api/docs.html
@@ -25,7 +25,7 @@ optional version number.</p>
<p>This command will launch a browser, so this command may not be the most
friendly for programmatic use.</p>
</div>
-<p id="footer">docs &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">docs &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/edit.html b/deps/npm/html/api/edit.html
index 52c4830853..441c70d587 100644
--- a/deps/npm/html/api/edit.html
+++ b/deps/npm/html/api/edit.html
@@ -30,7 +30,7 @@ to open. The package can optionally have a version number attached.</p>
<p>Since this command opens an editor in a new process, be careful about where
and how this is used.</p>
</div>
-<p id="footer">edit &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">edit &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/explore.html b/deps/npm/html/api/explore.html
index bc052c55ce..b709dba409 100644
--- a/deps/npm/html/api/explore.html
+++ b/deps/npm/html/api/explore.html
@@ -24,7 +24,7 @@ sure to use <code>npm rebuild &lt;pkg&gt;</code> if you make any changes.</p>
<p>The first element in the 'args' parameter must be a package name. After that is the optional command, which can be any number of strings. All of the strings will be combined into one, space-delimited command.</p>
</div>
-<p id="footer">explore &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">explore &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/help-search.html b/deps/npm/html/api/help-search.html
index a603fe53f4..5d38243cae 100644
--- a/deps/npm/html/api/help-search.html
+++ b/deps/npm/html/api/help-search.html
@@ -32,7 +32,7 @@ Name of the file that matched</li></ul>
<p>The silent parameter is not neccessary not used, but it may in the future.</p>
</div>
-<p id="footer">help-search &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">help-search &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/init.html b/deps/npm/html/api/init.html
index e693070be3..dc92ab518b 100644
--- a/deps/npm/html/api/init.html
+++ b/deps/npm/html/api/init.html
@@ -35,7 +35,7 @@ then go ahead and use this programmatically.</p>
<p><a href="../doc/json.html">json(1)</a></p>
</div>
-<p id="footer">init &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">init &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/install.html b/deps/npm/html/api/install.html
index 135ac35575..6b1d32d35f 100644
--- a/deps/npm/html/api/install.html
+++ b/deps/npm/html/api/install.html
@@ -25,7 +25,7 @@ the name of a package to be installed.</p>
<p>Finally, 'callback' is a function that will be called when all packages have been
installed or when an error has been encountered.</p>
</div>
-<p id="footer">install &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">install &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/link.html b/deps/npm/html/api/link.html
index 70cb2adf4a..10e1850172 100644
--- a/deps/npm/html/api/link.html
+++ b/deps/npm/html/api/link.html
@@ -39,7 +39,7 @@ npm.commands.link('redis', cb) # link-install the package</code></pre>
<p>Now, any changes to the redis package will be reflected in
the package in the current working directory</p>
</div>
-<p id="footer">link &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">link &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/load.html b/deps/npm/html/api/load.html
index 985f8795ff..7ec5544ae5 100644
--- a/deps/npm/html/api/load.html
+++ b/deps/npm/html/api/load.html
@@ -32,7 +32,7 @@ config object.</p>
<p>For a list of all the available command-line configs, see <code>npm help config</code></p>
</div>
-<p id="footer">load &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">load &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/ls.html b/deps/npm/html/api/ls.html
index 3842221ce3..742459ea15 100644
--- a/deps/npm/html/api/ls.html
+++ b/deps/npm/html/api/ls.html
@@ -53,7 +53,7 @@ project.</p>
This means that if a submodule a same dependency as a parent module, then the
dependency will only be output once.</p>
</div>
-<p id="footer">ls &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">ls &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/npm.html b/deps/npm/html/api/npm.html
index 7121387d0a..2d6719322d 100644
--- a/deps/npm/html/api/npm.html
+++ b/deps/npm/html/api/npm.html
@@ -24,7 +24,7 @@ npm.load(configObject, function (er, npm) {
<h2 id="VERSION">VERSION</h2>
-<p>1.1.0-alpha-6</p>
+<p>1.1.0-beta-4</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@@ -91,7 +91,7 @@ method names. Use the <code>npm.deref</code> method to find the real name.</p>
<pre><code>var cmd = npm.deref("unp") // cmd === "unpublish"</code></pre>
</div>
-<p id="footer">npm &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">npm &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/outdated.html b/deps/npm/html/api/outdated.html
index 08258050b3..e6aa1db809 100644
--- a/deps/npm/html/api/outdated.html
+++ b/deps/npm/html/api/outdated.html
@@ -19,7 +19,7 @@ currently outdated.</p>
<p>If the 'packages' parameter is left out, npm will check all packages.</p>
</div>
-<p id="footer">outdated &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">outdated &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/owner.html b/deps/npm/html/api/owner.html
index dc5408dccb..1b7596f48a 100644
--- a/deps/npm/html/api/owner.html
+++ b/deps/npm/html/api/owner.html
@@ -34,7 +34,7 @@ that is not implemented at this time.</p>
<ul><li><a href="../api/publish.html">publish(3)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
</div>
-<p id="footer">owner &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">owner &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/pack.html b/deps/npm/html/api/pack.html
index d3a315998e..b35f889f3f 100644
--- a/deps/npm/html/api/pack.html
+++ b/deps/npm/html/api/pack.html
@@ -25,7 +25,7 @@ overwritten the second time.</p>
<p>If no arguments are supplied, then npm packs the current package folder.</p>
</div>
-<p id="footer">pack &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">pack &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/prefix.html b/deps/npm/html/api/prefix.html
index c184ea64fe..bbcf5f6222 100644
--- a/deps/npm/html/api/prefix.html
+++ b/deps/npm/html/api/prefix.html
@@ -21,7 +21,7 @@
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">prefix &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">prefix &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/prune.html b/deps/npm/html/api/prune.html
index 9358fb46e9..5bc4bcd29b 100644
--- a/deps/npm/html/api/prune.html
+++ b/deps/npm/html/api/prune.html
@@ -23,7 +23,7 @@
<p>Extraneous packages are packages that are not listed on the parent
package's dependencies list.</p>
</div>
-<p id="footer">prune &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">prune &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/publish.html b/deps/npm/html/api/publish.html
index 81e25707ee..4223f1e070 100644
--- a/deps/npm/html/api/publish.html
+++ b/deps/npm/html/api/publish.html
@@ -32,7 +32,7 @@ the registry. Overwrites when the "force" environment variable is set.</p>
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../api/owner.html">owner(3)</a></li></ul>
</div>
-<p id="footer">publish &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">publish &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/rebuild.html b/deps/npm/html/api/rebuild.html
index 05932ebcf5..57d11fef08 100644
--- a/deps/npm/html/api/rebuild.html
+++ b/deps/npm/html/api/rebuild.html
@@ -22,7 +22,7 @@ the new binary. If no 'packages' parameter is specify, every package will be reb
<p>See <code>npm help build</code></p>
</div>
-<p id="footer">rebuild &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">rebuild &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/restart.html b/deps/npm/html/api/restart.html
index f51bd12e16..de2844f2bc 100644
--- a/deps/npm/html/api/restart.html
+++ b/deps/npm/html/api/restart.html
@@ -27,7 +27,7 @@ in the <code>packages</code> parameter.</p>
<ul><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
</div>
-<p id="footer">restart &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">restart &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/root.html b/deps/npm/html/api/root.html
index b8ed4cd9d5..9326c87324 100644
--- a/deps/npm/html/api/root.html
+++ b/deps/npm/html/api/root.html
@@ -21,7 +21,7 @@
<p>This function is not useful programmatically.</p>
</div>
-<p id="footer">root &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">root &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/run-script.html b/deps/npm/html/api/run-script.html
index 9afd96da95..a81eabc4ad 100644
--- a/deps/npm/html/api/run-script.html
+++ b/deps/npm/html/api/run-script.html
@@ -29,7 +29,7 @@ assumed to be the command to run. All other elements are ignored.</p>
<ul><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../api/test.html">test(3)</a></li><li><a href="../api/start.html">start(3)</a></li><li><a href="../api/restart.html">restart(3)</a></li><li><a href="../api/stop.html">stop(3)</a></li></ul>
</div>
-<p id="footer">run-script &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">run-script &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/search.html b/deps/npm/html/api/search.html
index 3cf9710bce..1cb3de19ce 100644
--- a/deps/npm/html/api/search.html
+++ b/deps/npm/html/api/search.html
@@ -32,7 +32,7 @@ excluded term (the "searchexclude" config). The search is case insensitive
and doesn't try to read your mind (it doesn't do any verb tense matching or the
like).</p>
</div>
-<p id="footer">search &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">search &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/start.html b/deps/npm/html/api/start.html
index 8a6a2c6709..f9ec1c5460 100644
--- a/deps/npm/html/api/start.html
+++ b/deps/npm/html/api/start.html
@@ -19,7 +19,7 @@
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">start &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">start &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/stop.html b/deps/npm/html/api/stop.html
index a1a59313f7..5aa5f79903 100644
--- a/deps/npm/html/api/stop.html
+++ b/deps/npm/html/api/stop.html
@@ -19,7 +19,7 @@
<p>npm can run stop on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">stop &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">stop &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/submodule.html b/deps/npm/html/api/submodule.html
index 6ba9e46715..bd02214a9e 100644
--- a/deps/npm/html/api/submodule.html
+++ b/deps/npm/html/api/submodule.html
@@ -33,7 +33,7 @@ dependencies into the submodule folder.</p>
<ul><li>npm help json</li><li>git help submodule</li></ul>
</div>
-<p id="footer">submodule &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">submodule &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/tag.html b/deps/npm/html/api/tag.html
index 2921500ea0..937979e367 100644
--- a/deps/npm/html/api/tag.html
+++ b/deps/npm/html/api/tag.html
@@ -29,7 +29,7 @@ parameter is missing or falsey (empty), the default froom the config will be
used. For more information about how to set this config, check
<code>man 3 npm-config</code> for programmatic usage or <code>man npm-config</code> for cli usage.</p>
</div>
-<p id="footer">tag &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">tag &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/test.html b/deps/npm/html/api/test.html
index e1d1e6c771..979a93f3c1 100644
--- a/deps/npm/html/api/test.html
+++ b/deps/npm/html/api/test.html
@@ -22,7 +22,7 @@ true.</p>
<p>npm can run tests on multiple packages. Just specify multiple packages
in the <code>packages</code> parameter.</p>
</div>
-<p id="footer">test &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">test &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/uninstall.html b/deps/npm/html/api/uninstall.html
index 3508abb31b..e92806b2fa 100644
--- a/deps/npm/html/api/uninstall.html
+++ b/deps/npm/html/api/uninstall.html
@@ -22,7 +22,7 @@ the name of a package to be uninstalled.</p>
<p>Finally, 'callback' is a function that will be called when all packages have been
uninstalled or when an error has been encountered.</p>
</div>
-<p id="footer">uninstall &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">uninstall &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/unpublish.html b/deps/npm/html/api/unpublish.html
index 186eed8a56..2637ef13d6 100644
--- a/deps/npm/html/api/unpublish.html
+++ b/deps/npm/html/api/unpublish.html
@@ -26,7 +26,7 @@ is what is meant.</p>
<p>If no version is specified, or if all versions are removed then
the root package entry is removed from the registry entirely.</p>
</div>
-<p id="footer">unpublish &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">unpublish &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/update.html b/deps/npm/html/api/update.html
index c1f4c14b4e..4730b5f846 100644
--- a/deps/npm/html/api/update.html
+++ b/deps/npm/html/api/update.html
@@ -18,7 +18,7 @@
<p>The 'packages' argument is an array of packages to update. The 'callback' parameter will be called when done or when an error occurs.</p>
</div>
-<p id="footer">update &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">update &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/version.html b/deps/npm/html/api/version.html
index 174ec680d2..b7ad219d72 100644
--- a/deps/npm/html/api/version.html
+++ b/deps/npm/html/api/version.html
@@ -24,7 +24,7 @@ fail if the repo is not clean.</p>
parameter. The difference, however, is this function will fail if it does
not have exactly one element. The only element should be a version number.</p>
</div>
-<p id="footer">version &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">version &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/view.html b/deps/npm/html/api/view.html
index 5da1895485..6a76f0159a 100644
--- a/deps/npm/html/api/view.html
+++ b/deps/npm/html/api/view.html
@@ -99,7 +99,7 @@ the field name.</p>
<p>corresponding to the list of fields selected.</p>
</div>
-<p id="footer">view &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">view &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/api/whoami.html b/deps/npm/html/api/whoami.html
index 937ee8907c..baea7fbcf2 100644
--- a/deps/npm/html/api/whoami.html
+++ b/deps/npm/html/api/whoami.html
@@ -21,7 +21,7 @@
<p>This function is not useful programmatically</p>
</div>
-<p id="footer">whoami &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">whoami &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/README.html b/deps/npm/html/doc/README.html
index 2abe255459..e87af9ef31 100644
--- a/deps/npm/html/doc/README.html
+++ b/deps/npm/html/doc/README.html
@@ -267,7 +267,7 @@ will no doubt tell you to put the output in a gist or email.</p>
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/index.html">index(1)</a></li></ul>
</div>
-<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer"><a href="../doc/README.html">README</a> &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/adduser.html b/deps/npm/html/doc/adduser.html
index 2eefce6788..ad79fd8806 100644
--- a/deps/npm/html/doc/adduser.html
+++ b/deps/npm/html/doc/adduser.html
@@ -39,7 +39,7 @@ authorize on a new machine.</p>
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li><li><a href="../doc/whoami.html">whoami(1)</a></li></ul>
</div>
-<p id="footer">adduser &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">adduser &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/bin.html b/deps/npm/html/doc/bin.html
index 313f2fb036..1191a3834b 100644
--- a/deps/npm/html/doc/bin.html
+++ b/deps/npm/html/doc/bin.html
@@ -20,7 +20,7 @@
<ul><li><a href="../doc/prefix.html">prefix(1)</a></li><li><a href="../doc/root.html">root(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">bin &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">bin &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/bugs.html b/deps/npm/html/doc/bugs.html
index 4770f5f284..5d28622587 100644
--- a/deps/npm/html/doc/bugs.html
+++ b/deps/npm/html/doc/bugs.html
@@ -36,7 +36,7 @@ config param.</p>
<ul><li><a href="../doc/docs.html">docs(1)</a></li><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
</div>
-<p id="footer">bugs &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">bugs &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/build.html b/deps/npm/html/doc/build.html
index 2217e88a36..a3c50791eb 100644
--- a/deps/npm/html/doc/build.html
+++ b/deps/npm/html/doc/build.html
@@ -25,7 +25,7 @@ A folder containing a <code>package.json</code> file in its root.</li></ul>
<ul><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
</div>
-<p id="footer">build &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">build &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/bundle.html b/deps/npm/html/doc/bundle.html
index a582db8016..651d17252d 100644
--- a/deps/npm/html/doc/bundle.html
+++ b/deps/npm/html/doc/bundle.html
@@ -20,7 +20,7 @@ install packages into the local space.</p>
<ul><li><a href="../doc/install.html">install(1)</a></li></ul>
</div>
-<p id="footer">bundle &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">bundle &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/cache.html b/deps/npm/html/doc/cache.html
index f815ba3f6a..767657cd04 100644
--- a/deps/npm/html/doc/cache.html
+++ b/deps/npm/html/doc/cache.html
@@ -66,7 +66,7 @@ they do not make an HTTP request to the registry.</p>
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li></ul>
</div>
-<p id="footer">cache &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">cache &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/changelog.html b/deps/npm/html/doc/changelog.html
index dbaabca1bb..1279a1a126 100644
--- a/deps/npm/html/doc/changelog.html
+++ b/deps/npm/html/doc/changelog.html
@@ -34,7 +34,7 @@
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li></ul>
</div>
-<p id="footer">changelog &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">changelog &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/coding-style.html b/deps/npm/html/doc/coding-style.html
index 99e7254dfb..5617e16819 100644
--- a/deps/npm/html/doc/coding-style.html
+++ b/deps/npm/html/doc/coding-style.html
@@ -191,7 +191,7 @@ set to anything."</p>
<ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">coding-style &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">coding-style &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/completion.html b/deps/npm/html/doc/completion.html
index c0f2089803..0ba3d3c510 100644
--- a/deps/npm/html/doc/completion.html
+++ b/deps/npm/html/doc/completion.html
@@ -33,7 +33,7 @@ completions based on the arguments.</p>
<ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">completion &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">completion &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/config.html b/deps/npm/html/doc/config.html
index 724d4498cb..04f4a4a30a 100644
--- a/deps/npm/html/doc/config.html
+++ b/deps/npm/html/doc/config.html
@@ -207,6 +207,13 @@ to trust only that specific signing authority.</p>
<p>If false, never shows colors. If <code>"always"</code> then always shows colors.
If true, then only prints color codes for tty file descriptors.</p>
+<h3 id="coverage">coverage</h3>
+
+<ul><li>Default: false</li><li>Type: Boolean</li></ul>
+
+<p>A flag to tell test-harness to run with their coverage options enabled,
+if they respond to the <code>npm_config_coverage</code> environment variable.</p>
+
<h3 id="depth">depth</h3>
<ul><li>Default: Infinity</li><li>Type: Number</li></ul>
@@ -338,11 +345,14 @@ being installed locally.</li></ul>
<h3 id="loglevel">loglevel</h3>
-<ul><li>Default: "warn"</li><li>Type: String</li><li>Values: "silent", "win", "error", "warn", "info", "verbose", "silly"</li></ul>
+<ul><li>Default: "http"</li><li>Type: String</li><li>Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly"</li></ul>
<p>What level of logs to report. On failure, <em>all</em> logs are written to
<code>npm-debug.log</code> in the current working directory.</p>
+<p>Any logs of a higher level than the setting are shown.
+The default is "http", which shows http, warn, and error output.</p>
+
<h3 id="logprefix">logprefix</h3>
<ul><li>Default: true on Posix, false on Windows</li><li>Type: Boolean</li></ul>
@@ -474,6 +484,14 @@ this as true.</p>
<p>Space-separated options that limit the results from search.</p>
+<h3 id="searchsort">searchsort</h3>
+
+<ul><li>Default: "name"</li><li>Type: String</li><li>Values: "name", "-name", "date", "-date", "description",
+"-description", "keywords", "-keywords"</li></ul>
+
+<p>Indication of which field to sort search results by. Prefix with a <code>-</code>
+character to indicate reverse sort.</p>
+
<h3 id="shell">shell</h3>
<ul><li>Default: SHELL environment variable, or "bash" on Posix, or "cmd" on
@@ -597,7 +615,7 @@ then answer "no" to any prompt.</p>
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li></ul>
</div>
-<p id="footer">config &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">config &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/deprecate.html b/deps/npm/html/doc/deprecate.html
index 65af3e7869..69e5ad9129 100644
--- a/deps/npm/html/doc/deprecate.html
+++ b/deps/npm/html/doc/deprecate.html
@@ -29,7 +29,7 @@ something like this:</p>
<ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
</div>
-<p id="footer">deprecate &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">deprecate &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/developers.html b/deps/npm/html/doc/developers.html
index 9d48bbde0a..a69e36b923 100644
--- a/deps/npm/html/doc/developers.html
+++ b/deps/npm/html/doc/developers.html
@@ -136,8 +136,8 @@ bring in your module's main module.</p>
or a path to a folder.</p>
<p>Note that pretty much <strong>everything in that folder will be exposed</strong>
-by default. So, if you have secret stuff in there, use a <code>.npminclude</code>
-or <code>.npmignore</code> file to list out the globs to include/ignore, or publish
+by default. So, if you have secret stuff in there, use a
+<code>.npmignore</code> file to list out the globs to ignore, or publish
from a fresh checkout.</p>
<h2 id="Brag-about-it">Brag about it</h2>
@@ -150,7 +150,7 @@ from a fresh checkout.</p>
<ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li></ul>
</div>
-<p id="footer">developers &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">developers &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/docs.html b/deps/npm/html/doc/docs.html
index 6e600c6a03..a0f01c66f8 100644
--- a/deps/npm/html/doc/docs.html
+++ b/deps/npm/html/doc/docs.html
@@ -37,7 +37,7 @@ config param.</p>
<ul><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li></ul>
</div>
-<p id="footer">docs &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">docs &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/edit.html b/deps/npm/html/doc/edit.html
index c40072736c..2e8bbc9acb 100644
--- a/deps/npm/html/doc/edit.html
+++ b/deps/npm/html/doc/edit.html
@@ -37,7 +37,7 @@ or <code>"notepad"</code> on Windows.</li><li>Type: path</li></ul>
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/explore.html">explore(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">edit &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">edit &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/explore.html b/deps/npm/html/doc/explore.html
index 36b1aeb641..99727b2a37 100644
--- a/deps/npm/html/doc/explore.html
+++ b/deps/npm/html/doc/explore.html
@@ -40,7 +40,7 @@ Windows</li><li>Type: path</li></ul>
<ul><li><a href="../doc/submodule.html">submodule(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/edit.html">edit(1)</a></li><li><a href="../doc/rebuild.html">rebuild(1)</a></li><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
</div>
-<p id="footer">explore &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">explore &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/faq.html b/deps/npm/html/doc/faq.html
index 883f0df771..f256923e78 100644
--- a/deps/npm/html/doc/faq.html
+++ b/deps/npm/html/doc/faq.html
@@ -215,7 +215,7 @@ We'll have someone kick it or something.</p>
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li></ul>
</div>
-<p id="footer">faq &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">faq &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/folders.html b/deps/npm/html/doc/folders.html
index a5cff405e6..499593decc 100644
--- a/deps/npm/html/doc/folders.html
+++ b/deps/npm/html/doc/folders.html
@@ -205,7 +205,7 @@ cannot be found elsewhere. See <code><a href="../doc/json.html">json(1)</a></co
<ul><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/pack.html">pack(1)</a></li><li><a href="../doc/cache.html">cache(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li></ul>
</div>
-<p id="footer">folders &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">folders &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/help-search.html b/deps/npm/html/doc/help-search.html
index 3fa0d77710..34b32beee5 100644
--- a/deps/npm/html/doc/help-search.html
+++ b/deps/npm/html/doc/help-search.html
@@ -38,7 +38,7 @@ where the terms were found in the documentation.</p>
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/help.html">help(1)</a></li></ul>
</div>
-<p id="footer">help-search &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">help-search &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/help.html b/deps/npm/html/doc/help.html
index c79bfdb622..c88b9edf5d 100644
--- a/deps/npm/html/doc/help.html
+++ b/deps/npm/html/doc/help.html
@@ -36,7 +36,7 @@ matches are equivalent to specifying a topic name.</p>
<ul><li><a href="../doc/npm.html">npm(1)</a></li><li><a href="../doc/README.html">README</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/help-search.html">help-search(1)</a></li><li><a href="../doc/index.html">index(1)</a></li></ul>
</div>
-<p id="footer">help &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">help &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/index.html b/deps/npm/html/doc/index.html
index 84a5554337..a5c92210ac 100644
--- a/deps/npm/html/doc/index.html
+++ b/deps/npm/html/doc/index.html
@@ -372,7 +372,7 @@
<p> Display npm username</p>
</div>
-<p id="footer">index &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">index &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/init.html b/deps/npm/html/doc/init.html
index 3f9dbb1b91..bb01cf1277 100644
--- a/deps/npm/html/doc/init.html
+++ b/deps/npm/html/doc/init.html
@@ -29,7 +29,7 @@ without a really good reason to do so.</p>
<ul><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/version.html">version(1)</a></li></ul>
</div>
-<p id="footer">init &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">init &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/install.html b/deps/npm/html/doc/install.html
index 2aac71547f..714d9fe61a 100644
--- a/deps/npm/html/doc/install.html
+++ b/deps/npm/html/doc/install.html
@@ -134,7 +134,7 @@ affects a real use-case, it will be investigated.</p>
<ul><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/update.html">update(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/rebuild.html">rebuild(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/tag.html">tag(1)</a></li><li><a href="../doc/rm.html">rm(1)</a></li></ul>
</div>
-<p id="footer">install &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">install &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/json.html b/deps/npm/html/doc/json.html
index 3e360b791d..cb5b841f89 100644
--- a/deps/npm/html/doc/json.html
+++ b/deps/npm/html/doc/json.html
@@ -436,7 +436,7 @@ overridden.</p>
<ul><li><a href="../doc/semver.html">semver(1)</a></li><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/version.html">version(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/rm.html">rm(1)</a></li></ul>
</div>
-<p id="footer">json &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">json &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/link.html b/deps/npm/html/doc/link.html
index eafeb22ff6..96dabc862a 100644
--- a/deps/npm/html/doc/link.html
+++ b/deps/npm/html/doc/link.html
@@ -58,7 +58,7 @@ installation target into your project's <code>node_modules</code> folder.</p>
<ul><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">link &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">link &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/list.html b/deps/npm/html/doc/list.html
index 56d0e9fa70..18b6af8338 100644
--- a/deps/npm/html/doc/list.html
+++ b/deps/npm/html/doc/list.html
@@ -52,7 +52,7 @@ project.</p>
<ul><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/link.html">link(1)</a></li><li><a href="../doc/prune.html">prune(1)</a></li><li><a href="../doc/outdated.html">outdated(1)</a></li><li><a href="../doc/update.html">update(1)</a></li></ul>
</div>
-<p id="footer">list &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">list &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/npm.html b/deps/npm/html/doc/npm.html
index f83e3c008a..3b9cd6e4a1 100644
--- a/deps/npm/html/doc/npm.html
+++ b/deps/npm/html/doc/npm.html
@@ -14,7 +14,7 @@
<h2 id="VERSION">VERSION</h2>
-<p>1.1.0-alpha-6</p>
+<p>1.1.0-beta-4</p>
<h2 id="DESCRIPTION">DESCRIPTION</h2>
@@ -135,7 +135,7 @@ will no doubt tell you to put the output in a gist or email.</p>
<ul><li><a href="../doc/help.html">help(1)</a></li><li><a href="../doc/faq.html">faq(1)</a></li><li><a href="../doc/README.html">README</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/index.html">index(1)</a></li><li><a href="../api/npm.html">npm(3)</a></li></ul>
</div>
-<p id="footer">npm &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">npm &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/outdated.html b/deps/npm/html/doc/outdated.html
index d451098d9a..2d052bc1d1 100644
--- a/deps/npm/html/doc/outdated.html
+++ b/deps/npm/html/doc/outdated.html
@@ -21,7 +21,7 @@ packages are currently outdated.</p>
<ul><li><a href="../doc/update.html">update(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li></ul>
</div>
-<p id="footer">outdated &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">outdated &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/owner.html b/deps/npm/html/doc/owner.html
index 399a9d4d2d..d6b757e886 100644
--- a/deps/npm/html/doc/owner.html
+++ b/deps/npm/html/doc/owner.html
@@ -34,7 +34,7 @@ that is not implemented at this time.</p>
<ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li></ul>
</div>
-<p id="footer">owner &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">owner &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/pack.html b/deps/npm/html/doc/pack.html
index 72cdeae742..fbe39c6e07 100644
--- a/deps/npm/html/doc/pack.html
+++ b/deps/npm/html/doc/pack.html
@@ -29,7 +29,7 @@ overwritten the second time.</p>
<ul><li><a href="../doc/cache.html">cache(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">pack &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">pack &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/prefix.html b/deps/npm/html/doc/prefix.html
index c17b7e195e..d081d011a7 100644
--- a/deps/npm/html/doc/prefix.html
+++ b/deps/npm/html/doc/prefix.html
@@ -20,7 +20,7 @@
<ul><li><a href="../doc/root.html">root(1)</a></li><li><a href="../doc/bin.html">bin(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">prefix &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">prefix &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/prune.html b/deps/npm/html/doc/prune.html
index 710a84d542..ad7ccf8bb2 100644
--- a/deps/npm/html/doc/prune.html
+++ b/deps/npm/html/doc/prune.html
@@ -25,7 +25,7 @@ package's dependencies list.</p>
<ul><li><a href="../doc/rm.html">rm(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/list.html">list(1)</a></li></ul>
</div>
-<p id="footer">prune &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">prune &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/publish.html b/deps/npm/html/doc/publish.html
index b6046cd3b0..dfa0cb6902 100644
--- a/deps/npm/html/doc/publish.html
+++ b/deps/npm/html/doc/publish.html
@@ -29,7 +29,7 @@ the registry. Overwrites when the "--force" flag is set.</p>
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li><li><a href="../doc/deprecate.html">deprecate(1)</a></li><li><a href="../doc/tag.html">tag(1)</a></li></ul>
</div>
-<p id="footer">publish &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">publish &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/rebuild.html b/deps/npm/html/doc/rebuild.html
index 6cf2e5390e..4727860785 100644
--- a/deps/npm/html/doc/rebuild.html
+++ b/deps/npm/html/doc/rebuild.html
@@ -25,7 +25,7 @@ the new binary.</p>
<ul><li><a href="../doc/build.html">build(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
</div>
-<p id="footer">rebuild &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">rebuild &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/registry.html b/deps/npm/html/doc/registry.html
index c53c2343b3..a4fd408af0 100644
--- a/deps/npm/html/doc/registry.html
+++ b/deps/npm/html/doc/registry.html
@@ -97,7 +97,7 @@ ask for help on the <a href="mailto:npm-@googlegroups.com">npm-@googlegroups.com
<ul><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li></ul>
</div>
-<p id="footer">registry &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">registry &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/removing-npm.html b/deps/npm/html/doc/removing-npm.html
index 095fbca628..7a084186f3 100644
--- a/deps/npm/html/doc/removing-npm.html
+++ b/deps/npm/html/doc/removing-npm.html
@@ -58,7 +58,7 @@ modules. To track those down, you can do the following:</p>
<ul><li><a href="../doc/README.html">README</a></li><li><a href="../doc/rm.html">rm(1)</a></li><li><a href="../doc/prune.html">prune(1)</a></li></ul>
</div>
-<p id="footer">removing-npm &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">removing-npm &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/restart.html b/deps/npm/html/doc/restart.html
index 3eb4fd3a93..3bbbedd6fd 100644
--- a/deps/npm/html/doc/restart.html
+++ b/deps/npm/html/doc/restart.html
@@ -24,7 +24,7 @@ the "start" script.</p>
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
</div>
-<p id="footer">restart &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">restart &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/root.html b/deps/npm/html/doc/root.html
index c3d2610604..04e5e339ff 100644
--- a/deps/npm/html/doc/root.html
+++ b/deps/npm/html/doc/root.html
@@ -20,7 +20,7 @@
<ul><li><a href="../doc/prefix.html">prefix(1)</a></li><li><a href="../doc/bin.html">bin(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">root &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">root &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/run-script.html b/deps/npm/html/doc/run-script.html
index d2e018aa89..811c6c5d66 100644
--- a/deps/npm/html/doc/run-script.html
+++ b/deps/npm/html/doc/run-script.html
@@ -23,7 +23,7 @@ called directly, as well.</p>
<ul><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
</div>
-<p id="footer">run-script &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">run-script &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/scripts.html b/deps/npm/html/doc/scripts.html
index 759cca5a89..0230330689 100644
--- a/deps/npm/html/doc/scripts.html
+++ b/deps/npm/html/doc/scripts.html
@@ -164,7 +164,7 @@ will sudo the npm command in question.</li></ul>
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/developers.html">developers(1)</a></li><li><a href="../doc/install.html">install(1)</a></li></ul>
</div>
-<p id="footer">scripts &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">scripts &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/search.html b/deps/npm/html/doc/search.html
index c042d1e4d2..2ec8bfb9af 100644
--- a/deps/npm/html/doc/search.html
+++ b/deps/npm/html/doc/search.html
@@ -16,31 +16,15 @@
<p>Search the registry for packages matching the search terms.</p>
-<h2 id="CONFIGURATION">CONFIGURATION</h2>
-
-<h3 id="description">description</h3>
-
-<ul><li>Default: true</li><li>Type: Boolean</li></ul>
-
-<p>Show the description in <code>npm search</code></p>
-
-<h3 id="searchopts">searchopts</h3>
-
-<ul><li>Default: ""</li><li>Type: String</li></ul>
-
-<p>Space-separated options that are always passed to search.</p>
-
-<h3 id="searchexclude">searchexclude</h3>
-
-<ul><li>Default: ""</li><li>Type: String</li></ul>
-
-<p>Space-separated options that limit the results from search.</p>
+<p>If a term starts with <code>/</code>, then it's interpreted as a regular expression.
+A trailing <code>/</code> will be ignored in this case. (Note that many regular
+expression characters must be escaped or quoted in most shells.)</p>
<h2 id="SEE-ALSO">SEE ALSO</h2>
<ul><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/view.html">view(1)</a></li></ul>
</div>
-<p id="footer">search &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">search &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/semver.html b/deps/npm/html/doc/semver.html
index 3bd1954929..2d0a33aa11 100644
--- a/deps/npm/html/doc/semver.html
+++ b/deps/npm/html/doc/semver.html
@@ -104,7 +104,7 @@ that satisfies the range, or null if none of them do.</li></ul>
<ul><li><a href="../doc/json.html">json(1)</a></li></ul>
</div>
-<p id="footer">semver &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">semver &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/star.html b/deps/npm/html/doc/star.html
index dd3b07451e..fafcecfb02 100644
--- a/deps/npm/html/doc/star.html
+++ b/deps/npm/html/doc/star.html
@@ -26,7 +26,7 @@ a vaguely positive way to show that you care.</p>
<ul><li><a href="../doc/view.html">view(1)</a></li><li><a href="../doc/whoami.html">whoami(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li></ul>
</div>
-<p id="footer">star &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">star &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/start.html b/deps/npm/html/doc/start.html
index dae9352e7d..8bf98ef759 100644
--- a/deps/npm/html/doc/start.html
+++ b/deps/npm/html/doc/start.html
@@ -20,7 +20,7 @@
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
</div>
-<p id="footer">start &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">start &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/stop.html b/deps/npm/html/doc/stop.html
index 13c2c9fb17..4fae4454ca 100644
--- a/deps/npm/html/doc/stop.html
+++ b/deps/npm/html/doc/stop.html
@@ -20,7 +20,7 @@
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/test.html">test(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li></ul>
</div>
-<p id="footer">stop &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">stop &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/submodule.html b/deps/npm/html/doc/submodule.html
index bc61746c67..2bc43a192c 100644
--- a/deps/npm/html/doc/submodule.html
+++ b/deps/npm/html/doc/submodule.html
@@ -33,7 +33,7 @@ dependencies into the submodule folder.</p>
<ul><li><a href="../doc/json.html">json(1)</a></li><li>git help submodule</li></ul>
</div>
-<p id="footer">submodule &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">submodule &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/tag.html b/deps/npm/html/doc/tag.html
index 4662c1da34..700d7e6654 100644
--- a/deps/npm/html/doc/tag.html
+++ b/deps/npm/html/doc/tag.html
@@ -21,7 +21,7 @@
<ul><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">tag &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">tag &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/test.html b/deps/npm/html/doc/test.html
index e415cef390..cdc1c7f72b 100644
--- a/deps/npm/html/doc/test.html
+++ b/deps/npm/html/doc/test.html
@@ -23,7 +23,7 @@ true.</p>
<ul><li><a href="../doc/run-script.html">run-script(1)</a></li><li><a href="../doc/scripts.html">scripts(1)</a></li><li><a href="../doc/start.html">start(1)</a></li><li><a href="../doc/restart.html">restart(1)</a></li><li><a href="../doc/stop.html">stop(1)</a></li></ul>
</div>
-<p id="footer">test &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">test &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/uninstall.html b/deps/npm/html/doc/uninstall.html
index d262cfc1ea..7f199cfecd 100644
--- a/deps/npm/html/doc/uninstall.html
+++ b/deps/npm/html/doc/uninstall.html
@@ -22,7 +22,7 @@ on its behalf.</p>
<ul><li><a href="../doc/prune.html">prune(1)</a></li><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/config.html">config(1)</a></li></ul>
</div>
-<p id="footer">uninstall &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">uninstall &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/unpublish.html b/deps/npm/html/doc/unpublish.html
index 89b312ccca..cf4dd4896e 100644
--- a/deps/npm/html/doc/unpublish.html
+++ b/deps/npm/html/doc/unpublish.html
@@ -34,7 +34,7 @@ the root package entry is removed from the registry entirely.</p>
<ul><li><a href="../doc/deprecate.html">deprecate(1)</a></li><li><a href="../doc/publish.html">publish(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li><li><a href="../doc/owner.html">owner(1)</a></li></ul>
</div>
-<p id="footer">unpublish &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">unpublish &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/update.html b/deps/npm/html/doc/update.html
index b5e9d007c0..7a55fcddf4 100644
--- a/deps/npm/html/doc/update.html
+++ b/deps/npm/html/doc/update.html
@@ -23,7 +23,7 @@
<ul><li><a href="../doc/install.html">install(1)</a></li><li><a href="../doc/outdated.html">outdated(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/folders.html">folders(1)</a></li><li><a href="../doc/list.html">list(1)</a></li></ul>
</div>
-<p id="footer">update &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">update &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/version.html b/deps/npm/html/doc/version.html
index 9bc3ce49c6..7208deb13e 100644
--- a/deps/npm/html/doc/version.html
+++ b/deps/npm/html/doc/version.html
@@ -31,7 +31,7 @@ will use it as a commit message when creating a version commit.</p>
<ul><li><a href="../doc/init.html">init(1)</a></li><li><a href="../doc/json.html">json(1)</a></li><li><a href="../doc/semver.html">semver(1)</a></li></ul>
</div>
-<p id="footer">version &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">version &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/view.html b/deps/npm/html/doc/view.html
index f1ed5c4d29..4441f9d87a 100644
--- a/deps/npm/html/doc/view.html
+++ b/deps/npm/html/doc/view.html
@@ -88,7 +88,7 @@ the field name.</p>
<ul><li><a href="../doc/search.html">search(1)</a></li><li><a href="../doc/registry.html">registry(1)</a></li><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/docs.html">docs(1)</a></li></ul>
</div>
-<p id="footer">view &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">view &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/html/doc/whoami.html b/deps/npm/html/doc/whoami.html
index 30826d3846..e3f4ce9d0e 100644
--- a/deps/npm/html/doc/whoami.html
+++ b/deps/npm/html/doc/whoami.html
@@ -20,7 +20,7 @@
<ul><li><a href="../doc/config.html">config(1)</a></li><li><a href="../doc/adduser.html">adduser(1)</a></li></ul>
</div>
-<p id="footer">whoami &mdash; npm@1.1.0-alpha-6</p>
+<p id="footer">whoami &mdash; npm@1.1.0-beta-4</p>
<script>
;(function () {
var wrapper = document.getElementById("wrapper")
diff --git a/deps/npm/lib/adduser.js b/deps/npm/lib/adduser.js
index b6d08ed760..d65eed5952 100644
--- a/deps/npm/lib/adduser.js
+++ b/deps/npm/lib/adduser.js
@@ -5,7 +5,7 @@ var registry = require("./utils/npm-registry-client/index.js")
, ini = require("./utils/ini.js")
, log = require("./utils/log.js")
, npm = require("./npm.js")
- , prompt = require("./utils/prompt.js")
+ , read = require("read")
, promiseChain = require("./utils/promise-chain.js")
, crypto
@@ -26,15 +26,15 @@ function adduser (args, cb) {
, changed = false
promiseChain(cb)
- (prompt, ["Username: ", u.u], function (un) {
+ (read, [{prompt: "Username: ", default: u.u}], function (un) {
changed = u.u !== un
u.u = un
})
(function (cb) {
if (u.p && !changed) return cb(null, u.p)
- prompt("Password: ", u.p, true, cb)
+ read({prompt: "Password: ", default: u.p, silent: true}, cb)
}, [], function (pw) { u.p = pw })
- (prompt, ["Email: ", u.e], function (em) { u.e = em })
+ (read, [{prompt: "Email: ", default: u.e}], function (em) { u.e = em })
(function (cb) {
if (changed) npm.config.del("_auth")
registry.adduser(u.u, u.p, u.e, function (er) {
diff --git a/deps/npm/lib/bugs.js b/deps/npm/lib/bugs.js
index 1c52ffda0e..a3a017cc02 100644
--- a/deps/npm/lib/bugs.js
+++ b/deps/npm/lib/bugs.js
@@ -23,8 +23,8 @@ function bugs (args, cb) {
var bugs = d.bugs
, repo = d.repository || d.repositories
if (bugs) {
- if (typeof bugs === "string") return open(bugs, cb)
- if (bugs.url) return open(bugs.url, cb)
+ if (typeof bugs === "string") return open(bugs, cb)
+ if (bugs.url) return open(bugs.url, cb)
}
if (repo) {
if (Array.isArray(repo)) repo = repo.shift()
diff --git a/deps/npm/lib/cache.js b/deps/npm/lib/cache.js
index 7260ab61a3..a73a874621 100644
--- a/deps/npm/lib/cache.js
+++ b/deps/npm/lib/cache.js
@@ -105,9 +105,7 @@ function read (name, ver, forceBypass, cb) {
return cb(er, data)
}
- if (forceBypass
- && (npm.config.get("force")
- || process.platform === "cygwin")) {
+ if (forceBypass && npm.config.get("force")) {
log.verbose(true, "force found, skipping cache")
return addNamed(name, ver, c)
}
@@ -335,7 +333,7 @@ function addRemoteGit (u, parsed, name, cb_) {
// name@blah thing.
var inFlightNames = {}
function addNamed (name, x, cb_) {
- log.info([name, x], "addNamed")
+ log.verbose([name, x], "addNamed")
var k = name + "@" + x
if (!inFlightNames[k]) inFlightNames[k] = []
var iF = inFlightNames[k]
@@ -368,10 +366,11 @@ function addNameTag (name, tag, cb) {
engineFilter(data)
if (data["dist-tags"] && data["dist-tags"][tag]
&& data.versions[data["dist-tags"][tag]]) {
- return addNameVersion(name, data["dist-tags"][tag], cb)
+ var ver = data["dist-tags"][tag]
+ return addNameVersion(name, ver, data.versions[ver], cb)
}
if (!explicit && Object.keys(data.versions).length) {
- return addNameRange(name, "*", cb)
+ return addNameRange(name, "*", data, cb)
}
return cb(installTargetsError(tag, data))
})
@@ -393,24 +392,84 @@ function engineFilter (data) {
})
}
-function addNameRange (name, range, cb) {
+function addNameRange (name, range, data, cb) {
+ if (typeof cb !== "function") cb = data, data = null
+
range = semver.validRange(range)
if (range === null) return cb(new Error(
"Invalid version range: "+range))
- registry.get(name, function (er, data, json, response) {
+
+ log.silly([name, range, !!data], "name, range, hasData")
+
+ if (data) return next()
+ registry.get(name, function (er, d, json, response) {
if (er) return cb(er)
+ data = d
+ next()
+ })
+
+ function next () {
+ log.silly([name, range, !!data], "name, range, hasData 2")
engineFilter(data)
+
+ if (npm.config.get("registry")) return next_()
+
+ cachedFilter(data, range, function (er) {
+ if (er) return cb(er)
+ if (Object.keys(data.versions).length === 0) {
+ return cb(new Error( "Can't fetch, and not cached: "
+ + data.name + "@" + range))
+ }
+ next_()
+ })
+ }
+
+ function next_ () {
+ log.silly([data.name, Object.keys(data.versions)], "versions")
// if the tagged version satisfies, then use that.
var tagged = data["dist-tags"][npm.config.get("tag")]
if (tagged && data.versions[tagged] && semver.satisfies(tagged, range)) {
- return addNameVersion(name, tagged, cb)
+ return addNameVersion(name, tagged, data.versions[tagged], cb)
}
+
// find the max satisfying version.
var ms = semver.maxSatisfying(Object.keys(data.versions || {}), range)
if (!ms) {
return cb(installTargetsError(range, data))
}
- addNameVersion(name, ms, cb)
+
+ // if we don't have a registry connection, try to see if
+ // there's a cached copy that will be ok.
+ addNameVersion(name, ms, data.versions[ms], cb)
+ }
+}
+
+// filter the versions down based on what's already in cache.
+function cachedFilter (data, range, cb) {
+ log.silly(data.name, "cachedFilter")
+ ls_(data.name, 1, function (er, files) {
+ if (er) return log.er(cb, "Not in cache, can't fetch: "+data.name)(er)
+ files = files.map(function (f) {
+ return path.basename(f.replace(/(\\|\/)$/, ""))
+ }).filter(function (f) {
+ return semver.valid(f) && semver.satisfies(f, range)
+ })
+
+ if (files.length === 0) {
+ return cb(new Error("Not in cache, can't fetch: "+data.name+"@"+range))
+ }
+
+ log.silly([data.name, files], "cached")
+ Object.keys(data.versions).forEach(function (v) {
+ if (files.indexOf(v) === -1) delete data.versions[v]
+ })
+
+ if (Object.keys(data.versions).length === 0) {
+ return log.er(cb, "Not in cache, can't fetch: "+data.name)(er)
+ }
+
+ log.silly([data.name, Object.keys(data.versions)], "filtered")
+ cb(null, data)
})
}
@@ -430,11 +489,26 @@ function installTargetsError (requested, data) {
+ requested + "\n" + targets)
}
-function addNameVersion (name, ver, cb) {
+function addNameVersion (name, ver, data, cb) {
+ if (typeof cb !== "function") cb = data, data = null
+
ver = semver.valid(ver)
if (ver === null) return cb(new Error("Invalid version: "+ver))
- registry.get(name, ver, function (er, data, json, response) {
+
+ var response
+
+ if (data) {
+ response = null
+ return next()
+ }
+ registry.get(name, ver, function (er, d, json, resp) {
if (er) return cb(er)
+ data = d
+ response = resp
+ next()
+ })
+
+ function next () {
deprCheck(data)
var dist = data.dist
@@ -452,8 +526,7 @@ function addNameVersion (name, ver, cb) {
if (!dist.tarball) return cb(new Error(
"No dist.tarball in " + data._id + " package"))
- if (response.statusCode !== 304 || npm.config.get("force")
- || process.platform === "cygwin") {
+ if ((response && response.statusCode !== 304) || npm.config.get("force")) {
return fetchit()
}
@@ -469,6 +542,10 @@ function addNameVersion (name, ver, cb) {
})
function fetchit () {
+ if (!npm.config.get("registry")) {
+ return cb(new Error("Cannot fetch: "+dist.tarball))
+ }
+
// use the same protocol as the registry.
// https registry --> https tarballs.
var tb = url.parse(dist.tarball)
@@ -480,7 +557,7 @@ function addNameVersion (name, ver, cb) {
, name+"-"+ver
, cb )
}
- })
+ }
}
function addLocal (p, name, cb_) {
diff --git a/deps/npm/lib/init.js b/deps/npm/lib/init.js
index 950cb45885..ee7e8773af 100644
--- a/deps/npm/lib/init.js
+++ b/deps/npm/lib/init.js
@@ -3,7 +3,7 @@
module.exports = init
-var prompt = require("./utils/prompt.js")
+var read = require("read")
, path = require("path")
, readJson = require("./utils/read-json.js")
, fs = require("graceful-fs")
@@ -66,24 +66,26 @@ function init_ (data, folder, cb) {
,""
].join("\n"))
promiseChain(cb)
- ( prompt
- , ["Package name: ", defaultName(folder, data)]
+ ( read
+ , [{prompt: "Package name: ", default: defaultName(folder, data)}]
, function (n) { data.name = n }
)
- ( prompt
- , ["Description: ", data.description]
+ ( read
+ , [{prompt: "Description: ", default: data.description}]
, function (d) { data.description = d }
)
( defaultVersion, [folder, data], function (v) { data.version = v } )
(function (cb) {
- prompt("Package version: ", data.version, function (er, v) {
+ read( { prompt: "Package version: ", default: data.version }
+ , function (er, v) {
if (er) return cb(er)
data.version = v
cb()
})
}, [])
- ( prompt
- , ["Project homepage: ", data.homepage || data.url || "none"]
+ ( read
+ , [ { prompt: "Project homepage: "
+ , default: data.homepage || data.url || "none" } ]
, function (u) {
if (u === "none") return
data.homepage = u
@@ -92,40 +94,42 @@ function init_ (data, folder, cb) {
)
( defaultRepo, [folder, data], function (r) { data.repository = r } )
(function (cb) {
- prompt( "Project git repository: "
- , data.repository && data.repository.url || "none"
- , function (er, r) {
- if (er) return cb(er)
- if (r !== "none") {
- data.repository = (data.repository || {}).url = r
- }
- cb()
+ read( { prompt: "Project git repository: "
+ , default: data.repository && data.repository.url || "none" }
+ , function (er, r) {
+ if (er) return cb(er)
+ if (r !== "none") {
+ data.repository = (data.repository || {}).url = r
}
- )
+ cb()
+ }
+ )
}, [])
- ( prompt
- , ["Author name: ", data.author && data.author.name]
+ ( read
+ , [{ prompt: "Author name: ", default: data.author && data.author.name }]
, function (n) {
if (!n) return
(data.author = data.author || {}).name = n
}
)
- ( prompt
- , ["Author email: ", data.author && data.author.email || "none"]
+ ( read
+ , [ { prompt: "Author email: "
+ , default: data.author && data.author.email || "none" } ]
, function (n) {
if (n === "none") return
(data.author = data.author || {}).email = n
}
)
- ( prompt
- , ["Author url: ", data.author && data.author.url || "none"]
+ ( read
+ , [ { prompt: "Author url: "
+ , default: data.author && data.author.url || "none" } ]
, function (n) {
if (n === "none") return
(data.author = data.author || {}).url = n
}
)
- ( prompt
- , ["Main module/entry point: ", data.main || "none"]
+ ( read
+ , [ { prompt: "Main module/entry point: ", default: data.main || "none" } ]
, function (m) {
if (m === "none") {
delete data.main
@@ -134,18 +138,17 @@ function init_ (data, folder, cb) {
data.main = m
}
)
- ( prompt
- , ["Test command: ", data.scripts && data.scripts.test || "none"]
+ ( read
+ , [ { prompt: "Test command: "
+ , default: data.scripts && data.scripts.test || "none" } ]
, function (t) {
if (t === "none") return
(data.scripts = data.scripts || {}).test = t
}
)
- ( prompt
- , [ "What versions of node does it run on? "
- , data.engines && data.engines.node
- || (eng)
- ]
+ ( read
+ , [ { prompt: "What versions of node does it run on? "
+ , default: data.engines && data.engines.node || (eng) } ]
, function (nodever) {
(data.engines = data.engines || {}).node = nodever
}
@@ -167,7 +170,7 @@ function init_ (data, folder, cb) {
output.write(msg, cb)
})
(function (cb) {
- prompt("\nIs this ok? ", "yes", function (er, ok) {
+ read({ prompt: "\nIs this ok? ", default: "yes" }, function (er, ok) {
if (er) return cb(er)
if (ok.toLowerCase().charAt(0) !== "y") {
return cb(new Error("cancelled"))
diff --git a/deps/npm/lib/install.js b/deps/npm/lib/install.js
index 4d71b9a512..ca54585e03 100644
--- a/deps/npm/lib/install.js
+++ b/deps/npm/lib/install.js
@@ -565,7 +565,7 @@ function write (target, targetFolder, family, ancestors, cb_) {
// cache.unpack returns the data object, and all we care about
// is the list of installed packages from that last thing.
if (!er) return cb_(er, data)
- log.error(er, "error installing "+target._id)
+ log.error(target._id,"error installing")
if (false === npm.config.get("rollback")) return cb_(er)
npm.commands.unbuild([targetFolder], function (er2) {
if (er2) log.error(er2, "error rolling back "+target._id)
diff --git a/deps/npm/lib/npm.js b/deps/npm/lib/npm.js
index 51f7d64b88..44a687f99d 100644
--- a/deps/npm/lib/npm.js
+++ b/deps/npm/lib/npm.js
@@ -11,9 +11,6 @@ if (typeof WScript !== "undefined") {
}
-process.title = "npm"
-
-
// FIXME there really ought to be a path.split in node core
require("path").SPLIT_CHAR = process.platform === "win32" ? "\\" : "/"
@@ -166,6 +163,7 @@ var commandCache = {}
, plumbing = [ "build"
, "unbuild"
, "xmas"
+ , "substack"
]
, fullList = npm.fullList = cmdList.concat(aliasNames).filter(function (c) {
return plumbing.indexOf(c) === -1
diff --git a/deps/npm/lib/rebuild.js b/deps/npm/lib/rebuild.js
index f3f7596204..fc5f96825d 100644
--- a/deps/npm/lib/rebuild.js
+++ b/deps/npm/lib/rebuild.js
@@ -7,6 +7,9 @@ var readInstalled = require("./utils/read-installed.js")
, path = require("path")
, npm = require("./npm.js")
, output = require("./utils/output.js")
+ , asyncMap = require("slide").asyncMap
+ , fs = require("graceful-fs")
+ , exec = require("./utils/exec.js")
rebuild.usage = "npm rebuild [<name>[@<version>] [name[@<version>] ...]]"
@@ -22,6 +25,33 @@ function rebuild (args, cb) {
})
if (!folders.length) return cb()
log.silly(folders, "rebuild set")
+ cleanBuild(folders, set, cb)
+ })
+}
+
+function cleanBuild (folders, set, cb) {
+ // https://github.com/isaacs/npm/issues/1872
+ // If there's a makefile, try 'make clean'
+ // If there's a wscript, try 'node-waf clean'
+ // But don't die on either of those if they fail.
+ // Just a best-effort kind of deal.
+ asyncMap(folders, function (f, cb) {
+ fs.readdir(f, function (er, files) {
+ // everything should be a dir.
+ if (er) return cb(er)
+ if (files.indexOf("wscript") !== -1) {
+ exec("node-waf", ["clean"], null, false, f, thenBuild)
+ } else if (files.indexOf("Makefile") !== -1) {
+ exec("make", ["clean"], null, false, f, thenBuild)
+ } else thenBuild()
+ })
+ function thenBuild (er) {
+ // ignore error, just continue
+ // it could be that it's not configured yet or whatever.
+ cb()
+ }
+ }, function (er) {
+ if (er) return cb(er)
npm.commands.build(folders, function (er) {
if (er) return cb(er)
output.write(folders.map(function (f) {
diff --git a/deps/npm/lib/search.js b/deps/npm/lib/search.js
index 45e436a0c1..92f4319f58 100644
--- a/deps/npm/lib/search.js
+++ b/deps/npm/lib/search.js
@@ -82,13 +82,19 @@ function filter (data, args, notArgs) {
}
function stripData (data) {
- return { name:data.name
- , description:npm.config.get("description") ? data.description : ""
- , maintainers:(data.maintainers || []).map(function (m) {
+ return { name: data.name
+ , description: npm.config.get("description") ? data.description : ""
+ , maintainers: (data.maintainers || []).map(function (m) {
return "=" + m.name
})
- , url:!Object.keys(data.versions || {}).length ? data.url : null
- , keywords:data.keywords || []
+ , url: !Object.keys(data.versions || {}).length ? data.url : null
+ , keywords: data.keywords || []
+ , time: data.time
+ && data.time.modified
+ && (new Date(data.time.modified).toISOString()
+ .split("T").join(" ")
+ .replace(/:[0-9]{2}\.[0-9]{3}Z$/, ""))
+ || "(prehistoric)"
}
}
@@ -108,16 +114,23 @@ function getWords (data) {
function filterWords (data, args, notArgs) {
var words = data.words
for (var i = 0, l = args.length; i < l; i ++) {
- if (words.indexOf(args[i]) === -1) {
- return false
- }
+ if (!match(words, args[i])) return false
}
for (var i = 0, l = notArgs.length; i < l; i ++) {
- if (words.indexOf(notArgs[i]) !== -1) return false
+ if (match(words, notArgs[i])) return false
}
return true
}
+function match (words, arg) {
+ if (arg.charAt(0) === "/") {
+ arg = arg.replace(/\/$/, "")
+ arg = new RegExp(arg.substr(1, arg.length - 1))
+ return words.match(arg)
+ }
+ return words.indexOf(arg) !== -1
+}
+
function prettify (data, args) {
try {
var tty = require("tty")
@@ -130,14 +143,24 @@ function prettify (data, args) {
// name, desc, author, keywords
var longest = []
, spaces
- , maxLen = [20, 60, 20, Infinity]
- , headings = ["NAME", "DESCRIPTION", "AUTHOR", "KEYWORDS"]
+ , maxLen = npm.config.get("description")
+ ? [20, 60, 20, 20, Infinity]
+ : [20, 20, 20, Infinity]
+ , headings = npm.config.get("description")
+ ? ["NAME", "DESCRIPTION", "AUTHOR", "DATE", "KEYWORDS"]
+ : ["NAME", "AUTHOR", "DATE", "KEYWORDS"]
, lines
+ , searchsort = (npm.config.get("searchsort") || "NAME").toLowerCase()
+ , sortFields = { name: 0
+ , description: 1
+ , author: 2
+ , date: 3
+ , keywords: 4 }
+ , searchRev = searchsort.charAt(0) === "-"
+ , sortField = sortFields[searchsort.replace(/^\-+/, "")]
lines = Object.keys(data).map(function (d) {
return data[d]
- }).filter(function (data) {
- return data.name
}).map(function (data) {
// turn a pkg data into a string
// [name,who,desc,targets,keywords] tuple
@@ -149,6 +172,7 @@ function prettify (data, args) {
var l = [ data.name
, data.description || ""
, data.maintainers.join(" ")
+ , data.time
, (data.keywords || []).join(" ")
]
l.forEach(function (s, i) {
@@ -162,6 +186,13 @@ function prettify (data, args) {
l[i] = l[i].replace(/\s+/g, " ")
})
return l
+ }).sort(function (a, b) {
+ // a and b are "line" objects of [name, desc, maint, time, kw]
+ var aa = a[sortField].toLowerCase()
+ , bb = b[sortField].toLowerCase()
+ return aa === bb ? 0
+ : aa < bb ? (searchRev ? 1 : -1)
+ : (searchRev ? -1 : 1)
}).map(function (line) {
return line.map(function (s, i) {
spaces = spaces || longest.map(function (n) {
@@ -173,8 +204,6 @@ function prettify (data, args) {
}
return s + spaces[i].substr(len)
}).join(" ").substr(0, cols).trim()
- }).sort(function (a, b) {
- return a === b ? 0 : a > b ? 1 : -1
}).map(function (line) {
// colorize!
args.forEach(function (arg, i) {
@@ -201,8 +230,18 @@ function addColorMarker (str, arg, i) {
var m = i % cl + 1
, markStart = String.fromCharCode(m)
, markEnd = String.fromCharCode(0)
- , pieces = str.toLowerCase().split(arg.toLowerCase())
+
+ if (arg.charAt(0) === "/") {
+ //arg = arg.replace(/\/$/, "")
+ return str.replace( new RegExp(arg.substr(1, arg.length - 1), "gi")
+ , function (bit) { return markStart + bit + markEnd } )
+
+ }
+
+ // just a normal string, do the split/map thing
+ var pieces = str.toLowerCase().split(arg.toLowerCase())
, p = 0
+
return pieces.map(function (piece, i) {
piece = str.substr(p, piece.length)
var mark = markStart
@@ -211,8 +250,8 @@ function addColorMarker (str, arg, i) {
p += piece.length + arg.length
return piece + mark
}).join("")
- return str.split(arg).join(mark)
}
+
function colorize (line) {
for (var i = 0; i < cl; i ++) {
var m = i + 1
diff --git a/deps/npm/lib/substack.js b/deps/npm/lib/substack.js
new file mode 100644
index 0000000000..95a90f8246
--- /dev/null
+++ b/deps/npm/lib/substack.js
@@ -0,0 +1,10 @@
+module.exports = substack
+var npm = require("./npm.js")
+ , log = require("./utils/log.js")
+
+function substack (args, cb) {
+ console.log("\033[32mbeep \033[35mboop\033[m")
+ var c = args.shift()
+ if (c) npm.commands[c](args, cb)
+ else cb()
+}
diff --git a/deps/npm/lib/unpublish.js b/deps/npm/lib/unpublish.js
index 2945a7887f..b7f6cbec89 100644
--- a/deps/npm/lib/unpublish.js
+++ b/deps/npm/lib/unpublish.js
@@ -39,10 +39,19 @@ unpublish.completion = function (opts, cb) {
}
function unpublish (args, cb) {
+
+ if (args.length > 1) return cb(unpublish.usage)
+
var thing = args.length ? args.shift().split("@") : []
, project = thing.shift()
, version = thing.join("@")
+ if (!version && !npm.config.get("force")) {
+ return cb("Refusing to delete entire project.\n"
+ +"Run with --force to do this.\n"
+ +unpublish.usage)
+ }
+
if (!project || path.resolve(project) === npm.prefix) {
// if there's a package.json in the current folder, then
// read the package name and version out of that.
diff --git a/deps/npm/lib/utils/config-defs.js b/deps/npm/lib/utils/config-defs.js
index c0ed1fca88..c4663b5820 100644
--- a/deps/npm/lib/utils/config-defs.js
+++ b/deps/npm/lib/utils/config-defs.js
@@ -141,6 +141,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
: path.resolve( home || temp, ".npm")
, color : process.platform !== "win32" || winColor
+ , coverage: false
, depth: Infinity
, description : true
, dev : false
@@ -159,7 +160,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
, "init.author.url" : ""
, link: false
, logfd : 2
- , loglevel : "warn"
+ , loglevel : "http"
, logprefix : process.platform !== "win32" || winColor
, long : false
, message : "%s"
@@ -182,6 +183,7 @@ Object.defineProperty(exports, "defaults", {get: function () {
, save : false
, searchopts: ""
, searchexclude: null
+ , searchsort: "name"
, shell : process.platform === "win32"
? process.env.ComSpec || "cmd"
: process.env.SHELL || "bash"
@@ -216,6 +218,7 @@ exports.types =
, ca: [null, String]
, cache : path
, color : ["always", Boolean]
+ , coverage: Boolean
, depth : Number
, description : Boolean
, dev : Boolean
@@ -233,7 +236,7 @@ exports.types =
, "init.author.url" : ["", url]
, link: Boolean
, logfd : [Number, Stream]
- , loglevel : ["silent","win","error","warn","info","verbose","silly"]
+ , loglevel : ["silent","win","error","warn","http","info","verbose","silly"]
, logprefix : Boolean
, long : Boolean
, message: String
@@ -254,6 +257,11 @@ exports.types =
, save : Boolean
, searchopts : String
, searchexclude: [null, String]
+ , searchsort: [ "name", "-name"
+ , "description", "-description"
+ , "author", "-author"
+ , "date", "-date"
+ , "keywords", "-keywords" ]
, shell : String
, "strict-ssl": Boolean
, tag : String
diff --git a/deps/npm/lib/utils/excludes.js b/deps/npm/lib/utils/excludes.js
index 6df89ccaf4..9b407c9451 100644
--- a/deps/npm/lib/utils/excludes.js
+++ b/deps/npm/lib/utils/excludes.js
@@ -88,8 +88,8 @@ function addIgnoreFile (file, gitBase, list, dir, cb) {
// see if a file should be included or not, given those exclude lists.
function test (file, excludeList) {
if (path.basename(file) === "package.json") return true
- //log.warn(file, "test file")
- //log.warn(excludeList, "test list")
+ // log.warn(file, "test file")
+ // log.warn(excludeList, "test list")
var incRe = /^\!(\!\!)*/
, excluded = false
for (var i = 0, l = excludeList.length; i < l; i ++) {
@@ -98,13 +98,16 @@ function test (file, excludeList) {
// chop the filename down to be relative to excludeDir
var rf = relativize(file, dir, true)
- rf = rf.replace(/^\.\//, "")
+ rf = rf.replace(/^\.?\//, "")
+ if (file.slice(-1) === "/") rf += "/"
+
+ // log.warn([file, rf], "rf")
for (var ii = 0, ll = excludes.length; ii < ll; ii ++) {
- //log.warn(JSON.stringify(excludes[ii]), "ex")
- var ex = excludes[ii].replace(/^(!*)\.\//, "$1")
+ var ex = excludes[ii].replace(/^(!*)\//, "$1")
, inc = !!ex.match(incRe)
+ // log.warn([ex, rf], "ex, rf")
// excluding/including a dir excludes/includes all the files in it.
if (ex.slice(-1) === "/") ex += "**"
@@ -118,20 +121,27 @@ function test (file, excludeList) {
if (inc && !excluded) continue
// if it matches the pattern, then it should be excluded.
- excluded = !!minimatch(rf, ex, { baseMatch: true })
- //if (inc) excluded = !excluded
-
- //if (excluded) {
- // console.error("excluded %s %s", rf, ex)
- //}
+ excluded = !!minimatch(rf, ex, { matchBase: true })
+ // log.error([rf, ex, excluded], "rf, ex, excluded")
// if you include foo, then it also includes foo/bar.js
if (inc && excluded && ex.slice(-3) !== "/**") {
- excluded = minimatch(rf, ex + "/**", { baseMatch: true })
- // console.error(rf, ex + "/**", inc, excluded)
+ excluded = minimatch(rf, ex + "/**", { matchBase: true })
+ // log.warn([rf, ex + "/**", inc, excluded], "dir without /")
+ }
+
+ // if you exclude foo, then it also excludes foo/bar.js
+ if (!inc
+ && excluded
+ && ex.slice(-3) !== "/**"
+ && rf.slice(-1) === "/"
+ && excludes.indexOf(ex + "/**") === -1) {
+ // log.warn(ex + "/**", "adding dir-matching exclude pattern")
+ excludes.push(ex + "/**")
+ ll ++
}
}
- //log.warn([rf, excluded, excludes], "file, excluded, excludes")
+ // log.warn([rf, excluded, excludes], "rf, excluded, excludes")
}
// true if it *should* be included
// log.warn([file, excludeList, excluded], "file, excluded")
@@ -141,5 +151,7 @@ function test (file, excludeList) {
// returns a function suitable for Array#filter
function filter (dir, list) { return function (file) {
file = file.trim()
- return file && test(path.resolve(dir, file), list)
+ var testFile = path.resolve(dir, file)
+ if (file.slice(-1) === "/") testFile += "/"
+ return file && test(testFile, list)
}}
diff --git a/deps/npm/lib/utils/fetch.js b/deps/npm/lib/utils/fetch.js
index 726be8848b..fcb413986f 100644
--- a/deps/npm/lib/utils/fetch.js
+++ b/deps/npm/lib/utils/fetch.js
@@ -16,7 +16,6 @@ module.exports = fetch
function fetch (remote, local, headers, cb) {
if (typeof cb !== "function") cb = headers, headers = {}
- log.info(remote, "fetch")
log.verbose(local, "fetch to")
mkdir(path.dirname(local), function (er) {
if (er) return cb(er)
@@ -42,6 +41,7 @@ function fetch_ (remote, local, headers, cb) {
function makeRequest (remote, fstr, headers) {
remote = url.parse(remote)
+ log.http(remote.href, "GET")
regHost = regHost || url.parse(npm.config.get("registry")).host
if (remote.host === regHost && npm.config.get("always-auth")) {
@@ -58,5 +58,10 @@ function makeRequest (remote, fstr, headers) {
request({ url: remote
, proxy: proxy
, agent: getAgent(remote)
- , strictSSL: npm.config.get("strict-ssl") }).pipe(fstr)
+ , strictSSL: npm.config.get("strict-ssl")
+ , onResponse: onResponse }).pipe(fstr)
+ function onResponse (er, res) {
+ if (er) return cb(er)
+ log.http(res.statusCode + " " + remote.href)
+ }
}
diff --git a/deps/npm/lib/utils/get-agent.js b/deps/npm/lib/utils/get-agent.js
index b4a5738d2d..4bc074f29b 100644
--- a/deps/npm/lib/utils/get-agent.js
+++ b/deps/npm/lib/utils/get-agent.js
@@ -13,7 +13,7 @@ var npm = require("../npm.js")
, url = require("url")
, agents = {}
, isHttp2 = !!require("http").globalAgent
- , registry = url.parse(npm.config.get("registry"))
+ , registry = url.parse(npm.config.get("registry") || "")
, regCA = npm.config.get("ca")
function getAgent (remote) {
diff --git a/deps/npm/lib/utils/ini.js b/deps/npm/lib/utils/ini.js
index 7d7d4680ec..ac45c8bc5e 100644
--- a/deps/npm/lib/utils/ini.js
+++ b/deps/npm/lib/utils/ini.js
@@ -162,6 +162,8 @@ function parseEnv (env) {
Object.keys(env)
.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, "-")] = parseField(env[k], k)
diff --git a/deps/npm/lib/utils/lifecycle.js b/deps/npm/lib/utils/lifecycle.js
index 878fc88cf3..547bbef0eb 100644
--- a/deps/npm/lib/utils/lifecycle.js
+++ b/deps/npm/lib/utils/lifecycle.js
@@ -232,7 +232,10 @@ function makeEnv (data, prefix, env) {
if (i.charAt(0) === "_" && i.indexOf("_"+namePref) !== 0) {
return
}
- var value = String(ini.get(i))
+ var value = ini.get(i)
+ if (!value) value = ""
+ else if (typeof value !== "string") value = JSON.stringify(value)
+
value = -1 !== value.indexOf("\n")
? JSON.stringify(value)
: value
diff --git a/deps/npm/lib/utils/log.js b/deps/npm/lib/utils/log.js
index dece9e3d19..07867e3e96 100644
--- a/deps/npm/lib/utils/log.js
+++ b/deps/npm/lib/utils/log.js
@@ -1,21 +1,4 @@
-/*
-log levels:
-0,1,2,3
-verbose,info,warn,error
-
-Default setting for logs is "info"
-Default setting to show is "info"
-
-Possible values of level/loglevel:
-silly,verbose,info,warn,error,win,silent
-
-silent quiets everything
-
-
-*/
-
-
module.exports = log
var output = require("./output.js")
@@ -28,6 +11,7 @@ var l = -1
, LEVEL = { silly : l++
, verbose : l++
, info : l++
+ , "http" : l++
, WARN : l++
, "ERR!" : l++
, ERROR : "ERR!"
@@ -59,6 +43,7 @@ Object.keys(LEVEL).forEach(function (l) {
COLOR[LEVEL.silly] = 30
COLOR[LEVEL.verbose] = "34;40"
COLOR[LEVEL.info] = 32
+COLOR[LEVEL.http] = "32;40"
COLOR[LEVEL.warn] = "30;41"
COLOR[LEVEL.error] = "31;40"
for (var c in COLOR) COLOR[LEVEL[c]] = COLOR[c]
diff --git a/deps/npm/lib/utils/npm-registry-client/get.js b/deps/npm/lib/utils/npm-registry-client/get.js
index 062244df3a..375bb5f972 100644
--- a/deps/npm/lib/utils/npm-registry-client/get.js
+++ b/deps/npm/lib/utils/npm-registry-client/get.js
@@ -119,6 +119,13 @@ function get_ (uri, timeout, cache, stat, data, nofollow, staleOk, cb) {
}
GET(uri, etag, nofollow, 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) {
+ er = null
+ response = {statusCode: 304}
+ }
+
if (response) {
log.silly([response.statusCode, response.headers], "get cb")
if (response.statusCode === 304 && etag) {
@@ -128,6 +135,10 @@ function get_ (uri, timeout, cache, stat, data, nofollow, staleOk, cb) {
}
data = remoteData
+ if (!data) {
+ er = new Error("failed to fetch from registry: " + uri)
+ }
+
if (er) return cb(er, data, raw, response)
// just give the write the old college try. if it fails, whatever.
diff --git a/deps/npm/lib/utils/npm-registry-client/publish.js b/deps/npm/lib/utils/npm-registry-client/publish.js
index 86cfdc6a89..a196a3c072 100644
--- a/deps/npm/lib/utils/npm-registry-client/publish.js
+++ b/deps/npm/lib/utils/npm-registry-client/publish.js
@@ -13,7 +13,7 @@ var request = require("./request.js")
, url = require("url")
function publish (data, prebuilt, readme, cb) {
- if (typeof readme === "function") cb = readme, readme = null
+ if (typeof readme === "function") cb = readme, readme = ""
if (typeof prebuilt === "function") cb = prebuilt, prebuilt = null
// add the dist-url to the data, pointing at the tarball.
// if the {name} isn't there, then create it.
@@ -23,13 +23,15 @@ function publish (data, prebuilt, readme, cb) {
var registry = reg()
if (registry instanceof Error) return cb(registry)
+ readme = readme ? "" + readme : ""
+
var fullData =
{ _id : data.name
, name : data.name
, description : data.description
, "dist-tags" : {}
, versions : {}
- , readme: readme ? "" + readme : null
+ , readme: readme
, maintainers :
[ { name : npm.config.get("username")
, email : npm.config.get("email")
@@ -103,6 +105,11 @@ function publish (data, prebuilt, readme, cb) {
})
}
+ // this way, it'll also get attached to packages that were previously
+ // published with a version of npm that lacked this feature.
+ if (!fullData.readme) {
+ data.readme = readme
+ }
PUT(dataURI, data, function (er) {
if (er) {
if (er.message.indexOf("conflict Document update conflict.") === 0) {
diff --git a/deps/npm/lib/utils/npm-registry-client/request.js b/deps/npm/lib/utils/npm-registry-client/request.js
index d19e3ac31f..d98135e49e 100644
--- a/deps/npm/lib/utils/npm-registry-client/request.js
+++ b/deps/npm/lib/utils/npm-registry-client/request.js
@@ -23,8 +23,6 @@ function regRequest (method, where, what, etag, nofollow, cb_) {
if (typeof cb_ !== "function") cb_ = etag, etag = null
if (typeof cb_ !== "function") cb_ = what, what = null
- log.verbose(where||"/", method)
-
// Since there are multiple places where an error could occur,
// don't let the cb be called more than once.
var errState = null
@@ -119,6 +117,8 @@ function makeRequest (method, remote, where, what, etag, nofollow, cb) {
opts.followRedirect = false
}
+ log.http(remote.href || "/", method)
+
var req = request(opts, requestDone(method, where, cb))
var r = npm.config.get("registry")
if (!r) {
@@ -136,6 +136,8 @@ function makeRequest (method, remote, where, what, etag, nofollow, cb) {
function requestDone (method, where, cb) { return function (er, response, data) {
if (er) return cb(er)
+ log.http(response.statusCode + " " + url.parse(where).href)
+
var parsed
if (Buffer.isBuffer(data)) {
diff --git a/deps/npm/lib/utils/prompt.js b/deps/npm/lib/utils/prompt.js
deleted file mode 100644
index d23e4ac587..0000000000
--- a/deps/npm/lib/utils/prompt.js
+++ /dev/null
@@ -1,69 +0,0 @@
-
-module.exports = prompt
-
-var log = require("./log.js")
- , buffer = ""
- , tty = require("tty")
-
-function prompt (p, def, silent, cb) {
- if (!cb) cb = silent, silent = false
- if (!cb) cb = def, def = null
- if (def) p += "("+(silent ? "<hidden>" : def)+") "
- var r = (silent ? silentRead : read).bind(null, def, cb)
- if (!process.stdout.write(p)) process.stdout.on("drain", function D () {
- process.stdout.removeListener("drain", D)
- r()
- })
- else r()
-}
-
-function read (def, cb) {
- var stdin = process.openStdin()
- , val = ""
- stdin.resume()
- stdin.setEncoding("utf8")
- stdin.on("error", cb)
- stdin.on("data", function D (chunk) {
- val += buffer + chunk
- buffer = ""
- val = val.replace(/\r/g, '')
- if (val.indexOf("\n") !== -1) {
- if (val !== "\n") val = val.replace(/^\n+/, "")
- buffer = val.substr(val.indexOf("\n"))
- val = val.substr(0, val.indexOf("\n"))
- stdin.pause()
- stdin.removeListener("data", D)
- stdin.removeListener("error", cb)
- val = val.trim() || def
- cb(null, val)
- }
- })
-}
-
-function silentRead (def, cb) {
- var stdin = process.openStdin()
- , val = ""
- tty.setRawMode(true)
- stdin.resume()
- stdin.on("error", cb)
- stdin.on("data", function D (c) {
- c = "" + c
- switch (c) {
- case "\n": case "\r": case "\r\n": case "\u0004":
- tty.setRawMode(false)
- stdin.removeListener("data", D)
- stdin.removeListener("error", cb)
- val = val.trim() || def
- process.stdout.write("\n")
- stdin.pause()
- return cb(null, val)
- case "\u0003": case "\0":
- return cb("cancelled")
- break
- default:
- val += buffer + c
- buffer = ""
- break
- }
- })
-}
diff --git a/deps/npm/lib/utils/relativize.js b/deps/npm/lib/utils/relativize.js
index 74c45c5d3e..70f2032069 100644
--- a/deps/npm/lib/utils/relativize.js
+++ b/deps/npm/lib/utils/relativize.js
@@ -30,7 +30,18 @@ var split = process.platform === "win32" ? /[\/\\]/ : "/"
function isAbsolute (p) {
if (process.platform !== "win32") return p.charAt(0) === "/"
- return path.resolve(p) === p
+
+
+ // yanked from node/lib/path.js
+ var splitDeviceRe =
+ /^([a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/][^\\\/]+)?([\\\/])?([\s\S]*?)$/
+
+ var result = p.match(splitDeviceRe)
+ , device = result[1] || ""
+ , isUnc = device && device.charAt(1) !== ":"
+ , isAbs = !!result[2] || isUnc // UNC always absolute
+
+ return isAbs
}
if (module === require.main) {
diff --git a/deps/npm/lib/utils/tar.js b/deps/npm/lib/utils/tar.js
index 2c2b96f9a6..f315bbf961 100644
--- a/deps/npm/lib/utils/tar.js
+++ b/deps/npm/lib/utils/tar.js
@@ -29,7 +29,10 @@ exports.makeList = makeList
function pack (targetTarball, folder, pkg, dfc, cb) {
if (typeof cb !== "function") cb = dfc, dfc = true
- folder = path.resolve(process.cwd(), folder)
+ folder = path.resolve(folder)
+
+ log.verbose(folder, "pack")
+
if (typeof pkg === "function") {
cb = pkg, pkg = null
return readJson(path.resolve(folder, "package.json"), function (er, pkg) {
@@ -88,7 +91,22 @@ function packFiles (targetTarball, parent, files, pkg, cb_) {
// being installed from some wackey vm-mounted
// read-only filesystem.
this.props.mode = this.props.mode | 0200
- return -1 !== files.indexOf(this.path)
+ var inc = -1 !== files.indexOf(this.path)
+
+ // WARNING! Hackety hack!
+ // XXX Fix this in a better way.
+ // Rename .gitignore to .npmignore if there is not a
+ // .npmignore file there already, the better to lock
+ // down installed packages with git for deployment.
+ if (this.basename === ".gitignore") {
+ if (this.parent._entries.indexOf(".npmignore") !== -1) {
+ return false
+ }
+ var d = path.dirname(this.path)
+ this.basename = ".npmignore"
+ this.path = path.join(d, ".npmignore")
+ }
+ return inc
}
})
.on("error", log.er(cb, "error reading "+parent))
diff --git a/deps/npm/man/man1/config.1 b/deps/npm/man/man1/config.1
index 3cbbc72119..f63e155327 100644
--- a/deps/npm/man/man1/config.1
+++ b/deps/npm/man/man1/config.1
@@ -368,6 +368,20 @@ Type: Boolean or \fB"always"\fR
If false, never shows colors\. If \fB"always"\fR then always shows colors\.
If true, then only prints color codes for tty file descriptors\.
.
+.SS "coverage"
+.
+.IP "\(bu" 4
+Default: false
+.
+.IP "\(bu" 4
+Type: Boolean
+.
+.IP "" 0
+.
+.P
+A flag to tell test\-harness to run with their coverage options enabled,
+if they respond to the \fBnpm_config_coverage\fR environment variable\.
+.
.SS "depth"
.
.IP "\(bu" 4
@@ -645,19 +659,23 @@ The location to write log output\.
.SS "loglevel"
.
.IP "\(bu" 4
-Default: "warn"
+Default: "http"
.
.IP "\(bu" 4
Type: String
.
.IP "\(bu" 4
-Values: "silent", "win", "error", "warn", "info", "verbose", "silly"
+Values: "silent", "win", "error", "warn", "http", "info", "verbose", "silly"
.
.IP "" 0
.
.P
What level of logs to report\. On failure, \fIall\fR logs are written to \fBnpm\-debug\.log\fR in the current working directory\.
.
+.P
+Any logs of a higher level than the setting are shown\.
+The default is "http", which shows http, warn, and error output\.
+.
.SS "logprefix"
.
.IP "\(bu" 4
@@ -930,6 +948,24 @@ Type: String
.P
Space\-separated options that limit the results from search\.
.
+.SS "searchsort"
+.
+.IP "\(bu" 4
+Default: "name"
+.
+.IP "\(bu" 4
+Type: String
+.
+.IP "\(bu" 4
+Values: "name", "\-name", "date", "\-date", "description",
+"\-description", "keywords", "\-keywords"
+.
+.IP "" 0
+.
+.P
+Indication of which field to sort search results by\. Prefix with a \fB\-\fR
+character to indicate reverse sort\.
+.
.SS "shell"
.
.IP "\(bu" 4
diff --git a/deps/npm/man/man1/developers.1 b/deps/npm/man/man1/developers.1
index 8ef25dac2b..a2678d672b 100644
--- a/deps/npm/man/man1/developers.1
+++ b/deps/npm/man/man1/developers.1
@@ -222,8 +222,7 @@ or a path to a folder\.
.
.P
Note that pretty much \fBeverything in that folder will be exposed\fR
-by default\. So, if you have secret stuff in there, use a \fB\|\.npminclude\fR
-or \fB\|\.npmignore\fR file to list out the globs to include/ignore, or publish
+by default\. So, if you have secret stuff in there, use a \fB\|\.npmignore\fR file to list out the globs to ignore, or publish
from a fresh checkout\.
.
.SH "Brag about it"
diff --git a/deps/npm/man/man1/npm.1 b/deps/npm/man/man1/npm.1
index fd31e7ab0b..0a030a3cc5 100644
--- a/deps/npm/man/man1/npm.1
+++ b/deps/npm/man/man1/npm.1
@@ -14,7 +14,7 @@ npm <command> [args]
.fi
.
.SH "VERSION"
-1.1.0-alpha-6
+1.1.0-beta-4
.
.SH "DESCRIPTION"
npm is the package manager for the Node JavaScript platform\. It puts
diff --git a/deps/npm/man/man1/search.1 b/deps/npm/man/man1/search.1
index 21217986fb..39985a7205 100644
--- a/deps/npm/man/man1/search.1
+++ b/deps/npm/man/man1/search.1
@@ -16,46 +16,10 @@ npm search [search terms \.\.\.]
.SH "DESCRIPTION"
Search the registry for packages matching the search terms\.
.
-.SH "CONFIGURATION"
-.
-.SS "description"
-.
-.IP "\(bu" 4
-Default: true
-.
-.IP "\(bu" 4
-Type: Boolean
-.
-.IP "" 0
-.
-.P
-Show the description in \fBnpm search\fR
-.
-.SS "searchopts"
-.
-.IP "\(bu" 4
-Default: ""
-.
-.IP "\(bu" 4
-Type: String
-.
-.IP "" 0
-.
-.P
-Space\-separated options that are always passed to search\.
-.
-.SS "searchexclude"
-.
-.IP "\(bu" 4
-Default: ""
-.
-.IP "\(bu" 4
-Type: String
-.
-.IP "" 0
-.
.P
-Space\-separated options that limit the results from search\.
+If a term starts with \fB/\fR, then it\'s interpreted as a regular expression\.
+A trailing \fB/\fR will be ignored in this case\. (Note that many regular
+expression characters must be escaped or quoted in most shells\.)
.
.SH "SEE ALSO"
.
diff --git a/deps/npm/man/man3/npm.3 b/deps/npm/man/man3/npm.3
index b2242691d7..3f2e6bebfb 100644
--- a/deps/npm/man/man3/npm.3
+++ b/deps/npm/man/man3/npm.3
@@ -21,7 +21,7 @@ npm\.load(configObject, function (er, npm) {
.fi
.
.SH "VERSION"
-1.1.0-alpha-6
+1.1.0-beta-4
.
.SH "DESCRIPTION"
This is the API documentation for npm\.
diff --git a/deps/npm/node_modules/fast-list/.npmignore b/deps/npm/node_modules/fast-list/.npmignore
new file mode 100644
index 0000000000..c2658d7d1b
--- /dev/null
+++ b/deps/npm/node_modules/fast-list/.npmignore
@@ -0,0 +1 @@
+node_modules/
diff --git a/deps/npm/node_modules/fast-list/.travis.yml b/deps/npm/node_modules/fast-list/.travis.yml
new file mode 100644
index 0000000000..f1d0f13c8a
--- /dev/null
+++ b/deps/npm/node_modules/fast-list/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
diff --git a/deps/npm/node_modules/fast-list/bench.js b/deps/npm/node_modules/fast-list/bench.js
deleted file mode 100644
index f15450f22d..0000000000
--- a/deps/npm/node_modules/fast-list/bench.js
+++ /dev/null
@@ -1,55 +0,0 @@
-var bench = require("bench")
-
-var l = 1000
- , FastList = require("./fast-list.js")
-
-exports.countPerLap = l * 2
-
-exports.compare =
- { "[]": function () {
- var list = []
- for (var j = 0; j < l; j ++) {
- if (j % 2) list.push(j)
- else list.unshift(j)
- }
- for (var j = 0; j < l; j ++) {
- if (j % 2) list.shift(j)
- else list.pop(j)
- }
- }
- , "new Array()": function () {
- var list = new Array()
- for (var j = 0; j < l; j ++) {
- if (j % 2) list.push(j)
- else list.unshift(j)
- }
- for (var j = 0; j < l; j ++) {
- if (j % 2) list.shift(j)
- else list.pop(j)
- }
- }
- // , "FastList()": function () {
- // var list = FastList()
- // for (var j = 0; j < l; j ++) {
- // if (j % 2) list.push(j)
- // else list.unshift(j)
- // }
- // for (var j = 0; j < l; j ++) {
- // if (j % 2) list.shift(j)
- // else list.pop(j)
- // }
- // }
- , "new FastList()": function () {
- var list = new FastList()
- for (var j = 0; j < l; j ++) {
- if (j % 2) list.push(j)
- else list.unshift(j)
- }
- for (var j = 0; j < l; j ++) {
- if (j % 2) list.shift(j)
- else list.pop(j)
- }
- }
- }
-
-bench.runMain()
diff --git a/deps/npm/node_modules/fstream/.npmignore b/deps/npm/node_modules/fstream/.npmignore
new file mode 100644
index 0000000000..66880db1ab
--- /dev/null
+++ b/deps/npm/node_modules/fstream/.npmignore
@@ -0,0 +1,3 @@
+.*.swp
+examples/deep-copy
+node_modules/
diff --git a/deps/npm/node_modules/fstream/.travis.yml b/deps/npm/node_modules/fstream/.travis.yml
new file mode 100644
index 0000000000..2d26206d58
--- /dev/null
+++ b/deps/npm/node_modules/fstream/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - 0.6
diff --git a/deps/npm/node_modules/fstream/lib/dir-reader.js b/deps/npm/node_modules/fstream/lib/dir-reader.js
index dc991e358c..ab990d1501 100644
--- a/deps/npm/node_modules/fstream/lib/dir-reader.js
+++ b/deps/npm/node_modules/fstream/lib/dir-reader.js
@@ -115,8 +115,16 @@ DirReader.prototype._read = function () {
return me.once("resume", EMITCHILD)
}
- me.emit("entry", entry)
- me.emit("child", entry)
+ // skip over sockets. they can't be piped around properly,
+ // so there's really no sense even acknowledging them.
+ // if someone really wants to see them, they can listen to
+ // the "socket" events.
+ if (entry.type === "Socket") {
+ me.emit("socket", entry)
+ } else {
+ me.emit("entry", entry)
+ me.emit("child", entry)
+ }
})
var ended = false
diff --git a/deps/npm/node_modules/fstream/lib/reader.js b/deps/npm/node_modules/fstream/lib/reader.js
index 344766f8e5..6aa67ada78 100644
--- a/deps/npm/node_modules/fstream/lib/reader.js
+++ b/deps/npm/node_modules/fstream/lib/reader.js
@@ -15,6 +15,7 @@ inherits(Reader, Abstract)
var DirReader = require("./dir-reader.js")
, FileReader = require("./file-reader.js")
, LinkReader = require("./link-reader.js")
+ , SocketReader = require("./socket-reader.js")
, ProxyReader = require("./proxy-reader.js")
function Reader (props, currentStat) {
@@ -75,6 +76,10 @@ function Reader (props, currentStat) {
ClassType = LinkReader
break
+ case "Socket":
+ ClassType = SocketReader
+ break
+
case null:
ClassType = ProxyReader
break
@@ -230,6 +235,6 @@ Reader.prototype.resume = function (who) {
}
Reader.prototype._read = function () {
- me.warn("Cannot read unknown type: "+me.type)
+ this.error("Cannot read unknown type: "+this.type)
}
diff --git a/deps/npm/node_modules/fstream/lib/socket-reader.js b/deps/npm/node_modules/fstream/lib/socket-reader.js
new file mode 100644
index 0000000000..e89c1731aa
--- /dev/null
+++ b/deps/npm/node_modules/fstream/lib/socket-reader.js
@@ -0,0 +1,38 @@
+// Just get the stats, and then don't do anything.
+// You can't really "read" from a socket. You "connect" to it.
+// Mostly, this is here so that reading a dir with a socket in it
+// doesn't blow up.
+
+module.exports = SocketReader
+
+var fs = require("graceful-fs")
+ , fstream = require("../fstream.js")
+ , inherits = require("inherits")
+ , mkdir = require("mkdirp")
+ , Reader = require("./reader.js")
+
+inherits(SocketReader, Reader)
+
+function SocketReader (props) {
+ var me = this
+ if (!(me instanceof SocketReader)) throw new Error(
+ "SocketReader must be called as constructor.")
+
+ if (!(props.type === "Socket" && props.Socket)) {
+ throw new Error("Non-socket type "+ props.type)
+ }
+
+ Reader.call(me, props)
+}
+
+SocketReader.prototype._read = function () {
+ var me = this
+ if (me._paused) return
+ // basically just a no-op, since we got all the info we have
+ // from the _stat method
+ if (!me._ended) {
+ me.emit("end")
+ me.emit("close")
+ me._ended = true
+ }
+}
diff --git a/deps/npm/node_modules/fstream/package.json b/deps/npm/node_modules/fstream/package.json
index c2d8fdc026..2661624029 100644
--- a/deps/npm/node_modules/fstream/package.json
+++ b/deps/npm/node_modules/fstream/package.json
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "fstream",
"description": "Advanced file system stream things",
- "version": "0.1.5",
+ "version": "0.1.9",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream.git"
@@ -14,7 +14,7 @@
"dependencies": {
"rimraf": "~1.0.8",
"mkdirp": "~0.1.0",
- "graceful-fs": "~1.1.1",
+ "graceful-fs": "~1.1.2",
"inherits": "~1.0.0"
},
"devDependencies": {
diff --git a/deps/npm/node_modules/graceful-fs/.npmignore b/deps/npm/node_modules/graceful-fs/.npmignore
new file mode 100644
index 0000000000..c2658d7d1b
--- /dev/null
+++ b/deps/npm/node_modules/graceful-fs/.npmignore
@@ -0,0 +1 @@
+node_modules/
diff --git a/deps/npm/node_modules/graceful-fs/graceful-fs.js b/deps/npm/node_modules/graceful-fs/graceful-fs.js
index 13c312ccf6..7467f304a2 100644
--- a/deps/npm/node_modules/graceful-fs/graceful-fs.js
+++ b/deps/npm/node_modules/graceful-fs/graceful-fs.js
@@ -1,20 +1,27 @@
// this keeps a queue of opened file descriptors, and will make
// fs operations wait until some have closed before trying to open more.
+
var fs = require("fs")
- , FastList = require("fast-list")
+
+// there is such a thing as TOO graceful.
+if (fs.open === gracefulOpen) return
+
+var FastList = require("fast-list")
, queue = new FastList()
, curOpen = 0
, constants = require("constants")
+
exports = module.exports = fs
+
fs.MIN_MAX_OPEN = 64
fs.MAX_OPEN = 1024
-fs._open = fs.open
-fs._openSync = fs.openSync
-fs._close = fs.close
-fs._closeSync = fs.closeSync
+var originalOpen = fs.open
+ , originalOpenSync = fs.openSync
+ , originalClose = fs.close
+ , originalCloseSync = fs.closeSync
// prevent EMFILE errors
@@ -27,7 +34,9 @@ function OpenReq (path, flags, mode, cb) {
function noop () {}
-fs.open = function (path, flags, mode, cb) {
+fs.open = gracefulOpen
+
+function gracefulOpen (path, flags, mode, cb) {
if (typeof mode === "function") cb = mode, mode = null
if (typeof cb !== "function") cb = noop
@@ -51,7 +60,7 @@ fs.open = function (path, flags, mode, cb) {
function open (path, flags, mode, cb) {
cb = cb || noop
curOpen ++
- fs._open(path, flags, mode, function (er, fd) {
+ originalOpen.call(fs, path, flags, mode, function (er, fd) {
if (er) {
onclose()
}
@@ -62,7 +71,7 @@ function open (path, flags, mode, cb) {
fs.openSync = function (path, flags, mode) {
curOpen ++
- return fs._openSync(path, flags, mode)
+ return originalOpenSync.call(fs, path, flags, mode)
}
function onclose () {
@@ -81,7 +90,7 @@ function flush () {
fs.close = function (fd, cb) {
cb = cb || noop
- fs._close(fd, function (er) {
+ originalClose.call(fs, fd, function (er) {
onclose()
cb(er)
})
@@ -89,7 +98,7 @@ fs.close = function (fd, cb) {
fs.closeSync = function (fd) {
onclose()
- return fs._closeSync(fd)
+ return originalCloseSync.call(fs, fd)
}
diff --git a/deps/npm/node_modules/graceful-fs/package.json b/deps/npm/node_modules/graceful-fs/package.json
index 19f561112b..ec72affa13 100644
--- a/deps/npm/node_modules/graceful-fs/package.json
+++ b/deps/npm/node_modules/graceful-fs/package.json
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
"name": "graceful-fs",
"description": "fs monkey-patching to avoid EMFILE and other problems",
- "version": "1.1.1",
+ "version": "1.1.2",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-graceful-fs.git"
diff --git a/deps/npm/node_modules/lru-cache/.npmignore b/deps/npm/node_modules/lru-cache/.npmignore
new file mode 100644
index 0000000000..07e6e472cc
--- /dev/null
+++ b/deps/npm/node_modules/lru-cache/.npmignore
@@ -0,0 +1 @@
+/node_modules
diff --git a/deps/npm/node_modules/minimatch/node_modules/lru-cache/LICENSE b/deps/npm/node_modules/lru-cache/LICENSE
index 05a4010949..05a4010949 100644
--- a/deps/npm/node_modules/minimatch/node_modules/lru-cache/LICENSE
+++ b/deps/npm/node_modules/lru-cache/LICENSE
diff --git a/deps/npm/node_modules/minimatch/node_modules/lru-cache/README.md b/deps/npm/node_modules/lru-cache/README.md
index 1f5f155b7f..1f5f155b7f 100644
--- a/deps/npm/node_modules/minimatch/node_modules/lru-cache/README.md
+++ b/deps/npm/node_modules/lru-cache/README.md
diff --git a/deps/npm/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js b/deps/npm/node_modules/lru-cache/lib/lru-cache.js
index 39b6c2d88b..ca7a2b3c95 100644
--- a/deps/npm/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js
+++ b/deps/npm/node_modules/lru-cache/lib/lru-cache.js
@@ -1,5 +1,11 @@
+;(function () { // closure for web browsers
-module.exports = LRUCache
+if (module) {
+ module.exports = LRUCache
+} else {
+ // just set the global for non-node platforms.
+ ;(function () { return this })().LRUCache = LRUCache
+}
function hOP (obj, key) {
return Object.prototype.hasOwnProperty.call(obj, key)
@@ -27,12 +33,22 @@ function LRUCache (maxLength) {
, get : function () { return maxLength }
, enumerable : true
})
+
this.maxLength = maxLength
+
Object.defineProperty(this, "length",
{ get : function () { return length }
, enumerable : true
})
+ this.reset = function () {
+ cache = {}
+ lruList = {}
+ lru = 0
+ mru = 0
+ length = 0
+ }
+
this.set = function (key, value) {
if (hOP(cache, key)) {
this.get(key)
@@ -44,6 +60,7 @@ function LRUCache (maxLength) {
length ++
if (length > maxLength) trim()
}
+
this.get = function (key) {
if (!hOP(cache, key)) return undefined
var hit = cache[key]
@@ -53,6 +70,7 @@ function LRUCache (maxLength) {
lruList[hit.lu] = hit
return hit.value
}
+
this.del = function (key) {
if (!hOP(cache, key)) return undefined
var hit = cache[key]
@@ -61,10 +79,12 @@ function LRUCache (maxLength) {
if (hit.lu === lru) lruWalk()
length --
}
+
function lruWalk () {
// lru has been deleted, hop up to the next hit.
lru = Object.keys(lruList).shift()
}
+
function trim () {
if (length <= maxLength) return undefined
var prune = Object.keys(lruList).slice(0, length - maxLength)
@@ -77,75 +97,4 @@ function LRUCache (maxLength) {
}
}
-if (!process || !module || module !== process.mainModule) return undefined
-
-var l = LRUCache(3)
- , assert = require("assert")
-
-l.set(1, 1)
-l.set(2, 1)
-l.set(3, 1)
-l.set(4, 1)
-l.set(5, 1)
-l.set(6, 1)
-
-assert.equal(l.get(1), undefined)
-assert.equal(l.get(2), undefined)
-assert.equal(l.get(3), undefined)
-assert.equal(l.get(4), 1)
-assert.equal(l.get(5), 1)
-assert.equal(l.get(6), 1)
-
-// now keep re-getting the 6 so it remains the most recently used.
-// in this case, we'll have 6, 7, 8, 9, 10, 11, so the ending length = 5
-l.set(7, 1)
-l.get(6)
-l.set(8, 1)
-l.get(6)
-l.set(9, 1)
-l.get(6)
-l.set(10, 1)
-l.get(6)
-l.set(11, 1)
-assert.equal(l.length, 3)
-assert.equal(l.get(4), undefined)
-assert.equal(l.get(5), undefined)
-assert.equal(l.get(6), 1)
-assert.equal(l.get(7), undefined)
-assert.equal(l.get(8), undefined)
-assert.equal(l.get(9), undefined)
-assert.equal(l.get(10), 1)
-assert.equal(l.get(11), 1)
-
-// test changing the maxLength, verify that the LRU items get dropped.
-l.maxLength = 100
-for (var i = 0; i < 100; i ++) l.set(i, i)
-assert.equal(l.length, 100)
-for (var i = 0; i < 100; i ++) {
- assert.equal(l.get(i), i)
-}
-l.maxLength = 3
-assert.equal(l.length, 3)
-for (var i = 0; i < 97; i ++) {
- assert.equal(l.get(i), undefined)
-}
-for (var i = 98; i < 100; i ++) {
- assert.equal(l.get(i), i)
-}
-
-// now remove the maxLength restriction, and try again.
-l.maxLength = "hello"
-for (var i = 0; i < 100; i ++) l.set(i, i)
-assert.equal(l.length, 100)
-for (var i = 0; i < 100; i ++) {
- assert.equal(l.get(i), i)
-}
-// should trigger an immediate resize
-l.maxLength = 3
-assert.equal(l.length, 3)
-for (var i = 0; i < 97; i ++) {
- assert.equal(l.get(i), undefined)
-}
-for (var i = 98; i < 100; i ++) {
- assert.equal(l.get(i), i)
-}
+})()
diff --git a/deps/npm/node_modules/lru-cache/package.json b/deps/npm/node_modules/lru-cache/package.json
new file mode 100644
index 0000000000..676ec3a0eb
--- /dev/null
+++ b/deps/npm/node_modules/lru-cache/package.json
@@ -0,0 +1,13 @@
+{ "name": "lru-cache"
+, "description": "A cache object that deletes the least-recently-used items."
+, "version": "1.0.5"
+, "author": "Isaac Z. Schlueter <i@izs.me>"
+, "scripts": { "test": "tap test" }
+, "main": "lib/lru-cache.js"
+, "repository": "git://github.com/isaacs/node-lru-cache.git"
+, "devDependencies": { "tap": "0.1" }
+, "license":
+ { "type": "MIT"
+ , "url": "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE"
+ }
+}
diff --git a/deps/npm/node_modules/minimatch/.gitmodules b/deps/npm/node_modules/minimatch/.gitmodules
deleted file mode 100644
index 7e29c80651..0000000000
--- a/deps/npm/node_modules/minimatch/.gitmodules
+++ /dev/null
@@ -1,3 +0,0 @@
-[submodule "node_modules/lru-cache"]
- path = node_modules/lru-cache
- url = https://github.com/isaacs/node-lru-cache.git
diff --git a/deps/npm/node_modules/minimatch/.travis.yml b/deps/npm/node_modules/minimatch/.travis.yml
new file mode 100644
index 0000000000..f1d0f13c8a
--- /dev/null
+++ b/deps/npm/node_modules/minimatch/.travis.yml
@@ -0,0 +1,4 @@
+language: node_js
+node_js:
+ - 0.4
+ - 0.6
diff --git a/deps/npm/node_modules/minimatch/README.md b/deps/npm/node_modules/minimatch/README.md
index f17ec599d5..2664c085cb 100644
--- a/deps/npm/node_modules/minimatch/README.md
+++ b/deps/npm/node_modules/minimatch/README.md
@@ -1,3 +1,10 @@
+# minimatch
+
+A minimal matching utility.
+
+[![Build Status](https://secure.travis-ci.org/isaacs/minimatch.png)](http://travis-ci.org/isaacs/minimatch)
+
+
This is the matching library used internally by npm.
Eventually, it will replace the C binding in node-glob.
diff --git a/deps/npm/node_modules/minimatch/minimatch.js b/deps/npm/node_modules/minimatch/minimatch.js
index 76e7d6def0..c50ab71a5f 100644
--- a/deps/npm/node_modules/minimatch/minimatch.js
+++ b/deps/npm/node_modules/minimatch/minimatch.js
@@ -17,6 +17,7 @@ minimatch.filter = function (pattern, options) {
minimatch.match = function (list, pattern, options) {
if (!options) options = {}
var ret = list.filter(minimatch.filter(pattern, options))
+ if (options.debug) console.error("\nmatch: %s %j %j", pattern, list, ret)
// set the null flag to allow empty match sets
// Note that minimatch itself, and filter(), do not
@@ -47,7 +48,7 @@ function minimatch (p, pattern, options) {
if (pattern.trim().charAt(0) === "#") return false
// check the cache
- var re = cache.get(pattern)
+ var re = cache.get(pattern + "\n" + JSON.stringify(options))
if (!re && re !== false) {
cache.set(pattern, re = minimatch.makeRe(pattern, options))
}
@@ -93,18 +94,45 @@ minimatch.makeRe = makeRe
function makeRe (pattern, options) {
options = options || {}
+ function clearStateChar () {
+ if (stateChar) {
+ // we had some state-tracking character
+ // that wasn't consumed by this pass.
+ switch (stateChar) {
+ case "*":
+ re += oneStar
+ break
+ case "?":
+ re += "."
+ break
+ default:
+ re += "\\"+stateChar
+ break
+ }
+ stateChar = false
+ }
+ }
+
var braceDepth = 0
, re = ""
, escaping = false
- , oneStar = "[^\\/]*?"
- , twoStar = ".*?"
+ , oneStar = options.dot ? "[^\\/]*?"
+ : "(?:(?!(?:\\\/|^)\\.)[^\\/])*?"
+ , twoStar = options.dot ? ".*?"
+ // not a ^ or / followed by a dot,
+ // followed by anything, any number of times.
+ : "(?:(?!(?:\\\/|^)\\.).)*?"
, reSpecials = "().*{}+?[]^$/\\"
, patternListStack = []
, stateChar
, negate = false
, negating = false
, inClass = false
- , reClassStart = []
+ , reClassStart = -1
+ , classStart = -1
+ , classStartPattern = options.dot ? ""
+ : "(?:(?!(?:\\\/|^)\\.)"
+ , classEndPattern = options.dot ? "" : ")"
for ( var i = 0, len = pattern.length, c
; (i < len) && (c = pattern.charAt(i))
@@ -129,6 +157,7 @@ function makeRe (pattern, options) {
}
continue
+ // the various stateChar values
case "!":
if (i === 0 || negating) {
negate = !negate
@@ -213,21 +242,8 @@ function makeRe (pattern, options) {
// these are mostly the same in regexp and glob :)
case "[":
- if (stateChar) {
- // some state-tracking char was before the [
- switch (stateChar) {
- case "*":
- re += oneStar
- break
- case "?":
- re += "."
- break
- default:
- re += "\\"+stateChar
- break
- }
- stateChar = false
- }
+ // swallow any state-tracking char before the [
+ clearStateChar()
if (escaping || inClass) {
re += "\\" + c
@@ -236,6 +252,7 @@ function makeRe (pattern, options) {
inClass = true
classStart = i
reClassStart = re.length
+ re += classStartPattern
re += c
}
continue
@@ -252,7 +269,7 @@ function makeRe (pattern, options) {
escaping = false
} else {
inClass = false
- re += c
+ re += c + classEndPattern
}
continue
@@ -271,6 +288,8 @@ function makeRe (pattern, options) {
re += "\\}"
escaping = false
} else {
+ // swallow any state char that wasn't consumed
+ clearStateChar()
re += ")"
braceDepth --
}
@@ -281,27 +300,15 @@ function makeRe (pattern, options) {
re += ","
escaping = false
} else {
+ // swallow any state char that wasn't consumed
+ clearStateChar()
re += "|"
}
continue
default:
- if (stateChar) {
- // we had some state-tracking character
- // that wasn't consumed by this pass.
- switch (stateChar) {
- case "*":
- re += oneStar
- break
- case "?":
- re += "."
- break
- default:
- re += "\\"+stateChar
- break
- }
- stateChar = false
- }
+ // swallow any state char that wasn't consumed
+ clearStateChar()
if (escaping) {
// no need
@@ -321,20 +328,7 @@ function makeRe (pattern, options) {
// handle trailing things that only matter at the very end.
if (stateChar) {
- // we had some state-tracking character
- // that wasn't consumed by this pass.
- switch (stateChar) {
- case "*":
- re += oneStar
- break
- case "?":
- re += "."
- break
- default:
- re += "\\"+stateChar
- break
- }
- stateChar = false
+ clearStateChar()
} else if (escaping) {
re += "\\\\"
}
@@ -345,7 +339,7 @@ function makeRe (pattern, options) {
// this is a huge pita. We now have to re-walk
// the contents of the would-be class to re-translate
// any characters that were passed through as-is
- var cs = re.substr(reClassStart + 1)
+ var cs = re.substr(reClassStart + classStartPattern.length + 1)
, csOpts = Object.create(options)
csOpts.partial = true
@@ -355,11 +349,6 @@ function makeRe (pattern, options) {
if (options.partial) return re
- // don't match "." files unless pattern starts with "."
- if (!options.dot && pattern.charAt(0) !== ".") {
- re = "(?!\\.)" + re
- }
-
// must match entire pattern
// ending in a * or ** will make it less strict.
re = "^" + re + "$"
@@ -381,19 +370,3 @@ function makeRe (pattern, options) {
return false
}
}
-
-if (require.main === module) {
- // more tests in test/*.js
- var tests = ["{a,b{c,d}}"
- ,"a.*$?"
- ,"\\{a,b{c,d}}"
- ,"a/{c/,}d/{e/,f/{g,h,i}/}k"
- ,"!*.bak"
- ,"!!*.bak"
- ,"!!!*.bak"
- ,"\\a\\b\\c\\d"
- ]
- tests.forEach(function (t) {
- console.log([t,makeRe(t)])
- })
-}
diff --git a/deps/npm/node_modules/minimatch/node_modules/lru-cache/package.json b/deps/npm/node_modules/minimatch/node_modules/lru-cache/package.json
deleted file mode 100644
index 289f839d31..0000000000
--- a/deps/npm/node_modules/minimatch/node_modules/lru-cache/package.json
+++ /dev/null
@@ -1,13 +0,0 @@
-{ "name" : "lru-cache"
-, "description" : "A cache object that deletes the least-recently-used items."
-, "version" : "1.0.4"
-, "author" : "Isaac Z. Schlueter <i@izs.me>"
-, "scripts" : { "test" : "node lib/lru-cache.js" }
-, "main" : "lib/lru-cache"
-, "repository" : "git://github.com/isaacs/node-lru-cache.git"
-, "licenses" :
- [ { "type" : "MIT"
- , "url" : "http://github.com/isaacs/node-lru-cache/raw/master/LICENSE"
- }
- ]
-}
diff --git a/deps/npm/node_modules/minimatch/package.json b/deps/npm/node_modules/minimatch/package.json
index b83bebb91b..54ac959b6b 100644
--- a/deps/npm/node_modules/minimatch/package.json
+++ b/deps/npm/node_modules/minimatch/package.json
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
"name": "minimatch",
"description": "a glob matcher in javascript",
- "version": "0.0.4",
+ "version": "0.0.5",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/minimatch.git"
@@ -14,9 +14,6 @@
"engines": {
"node": "*"
},
- "bundleDependencies": [
- "lru-cache"
- ],
"dependencies": {
"lru-cache": "~1.0.2"
},
diff --git a/deps/npm/node_modules/node-uuid/.npmignore b/deps/npm/node_modules/node-uuid/.npmignore
new file mode 100644
index 0000000000..fd4f2b066b
--- /dev/null
+++ b/deps/npm/node_modules/node-uuid/.npmignore
@@ -0,0 +1,2 @@
+node_modules
+.DS_Store
diff --git a/deps/npm/node_modules/nopt/.npmignore b/deps/npm/node_modules/nopt/.npmignore
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/deps/npm/node_modules/nopt/.npmignore
diff --git a/deps/npm/node_modules/read/README.md b/deps/npm/node_modules/read/README.md
new file mode 100644
index 0000000000..9913b4df0a
--- /dev/null
+++ b/deps/npm/node_modules/read/README.md
@@ -0,0 +1,43 @@
+For reading user input from stdin.
+
+## USAGE
+
+```javascript
+var read = require("read")
+read(options, callback)
+```
+
+The callback gets called with either the user input, or the default
+specified, or an error, in the traditional `callback(error, result)`
+node style.
+
+## OPTIONS
+
+Every option is optional.
+
+* `prompt` What to write to stdout before reading input.
+* `silent` Don't echo the output as the user types it.
+* `num` Max number of chars to read from terminal.
+* `delim` The char that means we're done. Default: `"\n"`
+* `timeout` Number of ms to wait for user input before giving up.
+* `default` The default value if the user enters nothing.
+
+If silent is true, or num is set, or delim is something other than
+`"\n"`, then read will set raw mode, and read character by character.
+
+At this time, backspace and arrow keys are not supported in raw mode.
+It's probably not too hard to add support for this, perhaps using node's
+built-in readline module.
+
+## CONTRIBUTING
+
+Patches welcome.
+
+## BUGS
+
+In node 0.6.0 through 0.6.5, you must explicitly call
+`process.stdin.destroy()` or `process.exit()` when you know that your
+program is done reading, or else it will keep the event loop running
+forever.
+
+See: <https://github.com/joyent/node/issues/2257>
diff --git a/deps/npm/node_modules/read/lib/read.js b/deps/npm/node_modules/read/lib/read.js
new file mode 100644
index 0000000000..246044bcd9
--- /dev/null
+++ b/deps/npm/node_modules/read/lib/read.js
@@ -0,0 +1,151 @@
+
+module.exports = read
+
+var buffer = ""
+ , tty = require("tty")
+ , StringDecoder = require("string_decoder").StringDecoder
+
+function read (opts, cb) {
+ if (!cb) cb = opts, opts = {}
+
+ var p = opts.prompt || ""
+ , def = opts.default
+ , silent = opts.silent
+ , timeout = opts.timeout
+ , num = opts.num || null
+ , delim = opts.delim || "\n"
+
+ if (p && def) p += "("+(silent ? "<default hidden>" : def)+") "
+
+ // switching into raw mode is a little bit painful.
+ // avoid if possible.
+ var r = silent || num || delim !== "\n" ? rawRead : normalRead
+
+ if (timeout) {
+ cb = (function (cb) {
+ var called = false
+ var t = setTimeout(function () {
+ tty.setRawMode(false)
+ process.stdout.write("\n")
+ if (def) done(null, def)
+ else done(new Error("timeout"))
+ }, timeout)
+
+ function done (er, data) {
+ clearTimeout(t)
+ if (called) return
+ // stop reading!
+ stdin.pause()
+ called = true
+ cb(er, data)
+ }
+
+ return done
+ })(cb)
+ }
+
+ if (p && !process.stdout.write(p)) {
+ process.stdout.on("drain", function D () {
+ process.stdout.removeListener("drain", D)
+ r(def, timeout, delim, silent, num, cb)
+ })
+ } else {
+ process.nextTick(function () {
+ r(def, timeout, delim, silent, num, cb)
+ })
+ }
+}
+
+function normalRead (def, timeout, delim, silent, num, cb) {
+ var stdin = process.openStdin()
+ , val = ""
+ , decoder = new StringDecoder("utf8")
+
+ stdin.resume()
+ stdin.on("error", cb)
+ stdin.on("data", function D (chunk) {
+ // get the characters that are completed.
+ val += buffer + decoder.write(chunk)
+ buffer = ""
+
+ // \r has no place here.
+ // XXX But what if \r is the delim or something dumb like that?
+ // Meh. If anyone complains about this, deal with it.
+ val = val.replace(/\r/g, "")
+
+ // TODO Make delim configurable
+ if (val.indexOf(delim) !== -1) {
+ // pluck off any delims at the beginning.
+ if (val !== delim) {
+ var i, l
+ for (i = 0, l = val.length; i < l; i ++) {
+ if (val.charAt(i) !== delim) break
+ }
+ if (i !== 0) val = val.substr(i)
+ }
+
+ // buffer whatever might have come *after* the delimter
+ var delimIndex = val.indexOf(delim)
+ if (delimIndex !== -1) {
+ buffer = val.substr(delimIndex)
+ val = val.substr(0, delimIndex)
+ } else {
+ buffer = ""
+ }
+
+ stdin.pause()
+ stdin.removeListener("data", D)
+ stdin.removeListener("error", cb)
+
+ // read(1) trims
+ val = val.trim() || def
+ cb(null, val)
+ }
+ })
+}
+
+function rawRead (def, timeout, delim, silent, num, cb) {
+ var stdin = process.openStdin()
+ , val = ""
+ , decoder = new StringDecoder
+
+ tty.setRawMode(true)
+ stdin.resume()
+ stdin.on("error", cb)
+ stdin.on("data", function D (c) {
+ // \r is my enemy.
+ c = decoder.write(c).replace(/\r/g, "\n")
+
+ switch (c) {
+ case "": // probably just a \r that was ignored.
+ break
+
+ case "\u0004": // EOF
+ case delim:
+ tty.setRawMode(false)
+ stdin.removeListener("data", D)
+ stdin.removeListener("error", cb)
+ val = val.trim() || def
+ process.stdout.write("\n")
+ stdin.pause()
+ return cb(null, val)
+
+ case "\u0003": case "\0": // ^C or other signal abort
+ tty.setRawMode(false)
+ stdin.removeListener("data", D)
+ stdin.removeListener("error", cb)
+ stdin.pause()
+ return cb(new Error("cancelled"))
+ break
+
+ default: // just a normal char
+ val += buffer + c
+ buffer = ""
+ if (!silent) process.stdout.write(c)
+
+ // explicitly process a delim if we have enough chars.
+ if (num && val.length >= num) D(delim)
+ break
+ }
+ })
+}
diff --git a/deps/npm/node_modules/read/package.json b/deps/npm/node_modules/read/package.json
new file mode 100644
index 0000000000..bc05577aac
--- /dev/null
+++ b/deps/npm/node_modules/read/package.json
@@ -0,0 +1,16 @@
+{
+ "name": "read",
+ "version": "0.0.1",
+ "main": "lib/read.js",
+ "dependencies": {},
+ "devDependencies": {},
+ "engines": {
+ "node": ">=0.6"
+ },
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "description": "read(1) for node programs",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/read.git"
+ }
+}
diff --git a/deps/npm/node_modules/tar/.npmignore b/deps/npm/node_modules/tar/.npmignore
new file mode 100644
index 0000000000..856407ebed
--- /dev/null
+++ b/deps/npm/node_modules/tar/.npmignore
@@ -0,0 +1,5 @@
+.*.swp
+node_modules
+examples/extract/
+test/tmp/
+test/fixtures/symlink
diff --git a/deps/npm/node_modules/tar/.travis.yml b/deps/npm/node_modules/tar/.travis.yml
new file mode 100644
index 0000000000..2d26206d58
--- /dev/null
+++ b/deps/npm/node_modules/tar/.travis.yml
@@ -0,0 +1,3 @@
+language: node_js
+node_js:
+ - 0.6
diff --git a/deps/npm/node_modules/tar/lib/pack.js b/deps/npm/node_modules/tar/lib/pack.js
index 0de7c16b04..c713c57c75 100644
--- a/deps/npm/node_modules/tar/lib/pack.js
+++ b/deps/npm/node_modules/tar/lib/pack.js
@@ -148,6 +148,10 @@ Pack.prototype._process = function () {
}
switch (wprops.type) {
+ // sockets not supported
+ case "Socket":
+ return
+
case "Directory":
wprops.path += "/"
wprops.size = 0
diff --git a/deps/npm/node_modules/tar/package.json b/deps/npm/node_modules/tar/package.json
index a736fe770b..6877cf27ca 100644
--- a/deps/npm/node_modules/tar/package.json
+++ b/deps/npm/node_modules/tar/package.json
@@ -2,7 +2,7 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "tar",
"description": "tar for node",
- "version": "0.1.7",
+ "version": "0.1.9",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-tar.git"
@@ -17,7 +17,7 @@
"dependencies": {
"inherits": "1.x",
"block-stream": "*",
- "fstream": "~0.1.5"
+ "fstream": "~0.1.8"
},
"devDependencies": {
"tap": "0.x",
diff --git a/deps/npm/package.json b/deps/npm/package.json
index f1e6fd6934..3d2f4bc603 100644
--- a/deps/npm/package.json
+++ b/deps/npm/package.json
@@ -2,7 +2,7 @@
, "publishConfig": { "tag": "alpha", "proprietary-attribs": false }
, "description": "A package manager for node"
, "keywords": [ "package manager", "modules", "install", "package.json" ]
-, "version": "1.1.0-alpha-6"
+, "version": "1.1.0-beta-4"
, "preferGlobal": true
, "config": { "publishtest": false }
, "homepage": "http://npmjs.org/"
@@ -24,6 +24,7 @@
, "bin": { "npm": "./bin/npm-cli.js"
, "npm_g": "./bin/npm-cli.js"
, "npm-g": "./bin/npm-cli.js" }
+
, "dependencies":
{ "semver": "1"
, "ini": "1"
@@ -43,7 +44,10 @@
, "inherits": "1"
, "mkdirp": "0.1"
, "fast-list": "~1.0.1"
+ , "read": "0"
+ , "lru-cache": "1"
}
+
, "bundleDependencies":
[ "slide"
, "ini"
@@ -63,9 +67,13 @@
, "inherits"
, "mkdirp"
, "fast-list"
+ , "read"
+ , "lru-cache"
]
+
, "devDependencies":
{ "ronn": "https://github.com/isaacs/ronnjs/tarball/master" }
+
, "engines": { "node": "0.6 || 0.7 || 0.8", "npm": "1" }
, "scripts": { "test": "./test/run"
, "prepublish": "make -j4 doc"
diff --git a/deps/npm/scripts/clean-old.sh b/deps/npm/scripts/clean-old.sh
index cda80f2f48..cda80f2f48 100644..100755
--- a/deps/npm/scripts/clean-old.sh
+++ b/deps/npm/scripts/clean-old.sh
diff --git a/deps/npm/scripts/index-build.js b/deps/npm/scripts/index-build.js
index b3c19a03a1..b3c19a03a1 100644..100755
--- a/deps/npm/scripts/index-build.js
+++ b/deps/npm/scripts/index-build.js
diff --git a/deps/npm/scripts/install.sh b/deps/npm/scripts/install.sh
index 16fbfe618b..16fbfe618b 100644..100755
--- a/deps/npm/scripts/install.sh
+++ b/deps/npm/scripts/install.sh
diff --git a/deps/npm/test/common.js b/deps/npm/test/common.js
new file mode 100644
index 0000000000..2755056b1b
--- /dev/null
+++ b/deps/npm/test/common.js
@@ -0,0 +1,7 @@
+
+// whatever, it's just tests.
+;["util","assert"].forEach(function (thing) {
+ thing = require("thing")
+ for (var i in thing) global[i] = thing[i]
+}
+
diff --git a/deps/npm/test/packages/npm-test-blerg/package.json b/deps/npm/test/packages/npm-test-blerg/package.json
new file mode 100644
index 0000000000..374b4432b2
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-blerg/package.json
@@ -0,0 +1,4 @@
+{ "name":"npm-test-blerg"
+, "version" : "0.0.0"
+, "scripts" : { "test" : "node test.js" }
+}
diff --git a/deps/npm/test/packages/npm-test-blerg/test.js b/deps/npm/test/packages/npm-test-blerg/test.js
new file mode 100644
index 0000000000..f548458ac0
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-blerg/test.js
@@ -0,0 +1,5 @@
+
+var assert = require("assert")
+assert.equal(undefined, process.env.npm_config__password, "password exposed!")
+assert.equal(undefined, process.env.npm_config__auth, "auth exposed!")
+assert.equal(undefined, process.env.npm_config__authCrypt, "authCrypt exposed!")
diff --git a/deps/npm/test/packages/npm-test-env-reader/package.json b/deps/npm/test/packages/npm-test-env-reader/package.json
new file mode 100644
index 0000000000..ddd5c91abd
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-env-reader/package.json
@@ -0,0 +1,14 @@
+{ "name":"npm-test-env-reader"
+, "version" : "1.2.3"
+, "scripts" :
+ { "install" : "./test.sh"
+ , "preinstall" : "./test.sh"
+ , "preuninstall" : "./test.sh"
+ , "postuninstall" : "./test.sh"
+ , "test" : "./test.sh"
+ , "stop" : "./test.sh"
+ , "start" : "./test.sh"
+ , "restart" : "./test.sh"
+ , "foo" : "./test.sh"
+ }
+}
diff --git a/deps/npm/test/packages/npm-test-env-reader/test.sh b/deps/npm/test/packages/npm-test-env-reader/test.sh
new file mode 100755
index 0000000000..b4ca4374ed
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-env-reader/test.sh
@@ -0,0 +1,3 @@
+#!/usr/bin/env sh
+env | grep npm | sort | uniq
+echo PATH=$PATH
diff --git a/deps/npm/test/packages/npm-test-ignore/.npmignore b/deps/npm/test/packages/npm-test-ignore/.npmignore
new file mode 100644
index 0000000000..c7d927d0a2
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-ignore/.npmignore
@@ -0,0 +1,7 @@
+/sub/ignore1
+./sub/include2
+ignore3
+./include4
+ignoredir1
+ignoredir2/
+*.tgz
diff --git a/deps/npm/test/packages/npm-test-ignore/include4 b/deps/npm/test/packages/npm-test-ignore/include4
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-ignore/include4
diff --git a/deps/npm/test/packages/npm-test-ignore/package.json b/deps/npm/test/packages/npm-test-ignore/package.json
new file mode 100644
index 0000000000..6d492de780
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-ignore/package.json
@@ -0,0 +1,3 @@
+{ "name":"npm-test-ignore"
+, "version":"1.2.5"
+, "scripts":{"test":"bash test.sh"}}
diff --git a/deps/npm/test/packages/npm-test-ignore/sub/include b/deps/npm/test/packages/npm-test-ignore/sub/include
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-ignore/sub/include
diff --git a/deps/npm/test/packages/npm-test-ignore/sub/include2 b/deps/npm/test/packages/npm-test-ignore/sub/include2
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-ignore/sub/include2
diff --git a/deps/npm/test/packages/npm-test-ignore/sub/include4 b/deps/npm/test/packages/npm-test-ignore/sub/include4
new file mode 100644
index 0000000000..d16969cd18
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-ignore/sub/include4
@@ -0,0 +1 @@
+This file should be in the package.
diff --git a/deps/npm/test/packages/npm-test-ignore/test.sh b/deps/npm/test/packages/npm-test-ignore/test.sh
new file mode 100644
index 0000000000..cdf47f211a
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-ignore/test.sh
@@ -0,0 +1,27 @@
+x=`find . | grep ignore | grep -v npmignore`
+if [ "$x" != "" ]; then
+ echo "ignored files included: $x"
+ exit 1
+fi
+
+x=`find . | grep -v ignore | sort`
+y=".
+./include4
+./package.json
+./sub
+./sub/include
+./sub/include2
+./sub/include4
+./test.sh"
+if [ "$x" != "$y" ]; then
+ echo "missing included files"
+ echo "got:"
+ echo "==="
+ echo "$x"
+ echo "==="
+ echo "wanted:"
+ echo "==="
+ echo "$y"
+ echo "==="
+ exit 1
+fi
diff --git a/deps/npm/test/packages/npm-test-missing-bindir/package.json b/deps/npm/test/packages/npm-test-missing-bindir/package.json
new file mode 100644
index 0000000000..49e26742df
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-missing-bindir/package.json
@@ -0,0 +1,4 @@
+{ "name":"npm-test-missing-bindir"
+, "version" : "0.0.0"
+, "scripts" : { "test" : "node test.js" }
+, "directories": { "bin" : "./not-found" } }
diff --git a/deps/npm/test/packages/npm-test-missing-bindir/test.js b/deps/npm/test/packages/npm-test-missing-bindir/test.js
new file mode 100644
index 0000000000..f548458ac0
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-missing-bindir/test.js
@@ -0,0 +1,5 @@
+
+var assert = require("assert")
+assert.equal(undefined, process.env.npm_config__password, "password exposed!")
+assert.equal(undefined, process.env.npm_config__auth, "auth exposed!")
+assert.equal(undefined, process.env.npm_config__authCrypt, "authCrypt exposed!")
diff --git a/deps/npm/test/packages/npm-test-private/package.json b/deps/npm/test/packages/npm-test-private/package.json
new file mode 100644
index 0000000000..3d95a37af1
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-private/package.json
@@ -0,0 +1,4 @@
+{"name":"npm-test-private"
+,"version":"9.9.9-9"
+,"homepage":"http://www.youtube.com/watch?v=1MLry6Cn_D4"
+,"private":"true"}
diff --git a/deps/npm/test/packages/npm-test-test-package/package.json b/deps/npm/test/packages/npm-test-test-package/package.json
new file mode 100644
index 0000000000..c5c5aeabc1
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-test-package/package.json
@@ -0,0 +1,5 @@
+{ "name":"npm-test-test-package"
+, "author" : "Testy McMock"
+, "version" : "1.2.3-99-b"
+, "description" : "This is a test package used for debugging. It has some random data and that's all."
+}
diff --git a/deps/npm/test/packages/npm-test-url-dep/package.json b/deps/npm/test/packages/npm-test-url-dep/package.json
new file mode 100644
index 0000000000..72a139e547
--- /dev/null
+++ b/deps/npm/test/packages/npm-test-url-dep/package.json
@@ -0,0 +1,4 @@
+{ "name":"npm-test-url-dep"
+, "version" : "1.2.3"
+, "dependencies" :
+ { "dnode" : "https://github.com/substack/dnode/tarball/master" } }
diff --git a/deps/npm/test/run b/deps/npm/test/run
new file mode 100755
index 0000000000..09e6e4aee7
--- /dev/null
+++ b/deps/npm/test/run
@@ -0,0 +1,138 @@
+#!/bin/bash
+
+if [ "$DEBUG" != "" ]; then
+ set -x
+fi
+
+
+# the "npm" command is set to a custom function here so that we can
+# test the code in this repo, rather than whichever version of npm
+# happens to be installed.
+
+main () {
+ # setup
+ FAILURES=0
+
+ cd "$TESTDIR"
+
+ npm config ls
+
+ # install
+ npm install "$NPMPKG" || exit 1
+
+ # used in test later
+ npm config set package-config:foo boo || exit 1
+
+ npm install $( ls packages | awk '{print "packages/" $1 }' ) || exit 1
+ (ls packages | while read pkg; do
+ npm test "$pkg"
+ done) || exit 1
+ if [ "$FAILURES" == "0" ]; then
+ npm rm $(ls packages) npm || exit 1
+ fi
+ cleanup
+
+ if ! [ "$npm_package_config_publishtest" == "true" ]; then
+ echo_err "To test publishing: npm config set npm:publishtest true"
+ else
+ # attempt to publish and unpublish each of them.
+ npm install "$NPMPKG" || exit 1
+
+ (ls packages | grep -v 'npm-test-private' | while read pkg; do
+ npm publish packages/$pkg || exit 1
+ npm install $pkg || exit 1
+ npm unpublish $pkg --force || exit 1
+ done) || exit 1
+
+ # verify that the private package can't be published
+ # bypass the test-harness npm function.
+ "$NPMCLI" publish packages/npm-test-private && (
+ npm unpublish npm-test-private --force
+ exit 1000
+ )
+ if [ $? -eq 1000 ]; then
+ fail "Private package shouldn't be publishable" >&2
+ fi
+
+ if [ "$FAILURES" == "0" ]; then
+ npm rm $(ls packages) npm || exit 1
+ fi
+ cleanup
+
+ fi
+
+ if [ $FAILURES -eq 0 ]; then
+ echo_err "ok"
+ rm -rf $TMP
+ else
+ echo_err "FAILED: $FAILURES"
+ fi
+ exit $FAILURES
+}
+
+
+
+####################
+# Test Harness below
+
+# fake functions
+npm () {
+ echo -e "npm $@"
+ "$NPMCLI" "$@" \
+ || fail npm "$@"
+}
+
+# get the absolute path of the executable
+SELF_PATH="$0"
+if [ "${SELF_PATH:0:1}" != "." ] && [ "${SELF_PATH:0:1}" != "/" ]; then
+ SELF_PATH=./"$SELF_PATH"
+fi
+SELF_PATH=$( cd -P -- "$(dirname -- "$SELF_PATH")" \
+ && pwd -P \
+ ) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
+# resolve symlinks
+while [ -h "$SELF_PATH" ]; do
+ DIR=$(dirname -- "$SELF_PATH")
+ SYM=$(readlink -- "$SELF_PATH")
+ SELF_PATH=$( cd -- "$DIR" \
+ && cd -- $(dirname -- "$SYM") \
+ && pwd \
+ )/$(basename -- "$SYM")
+done
+NPMPKG="$(dirname -- "$(dirname -- "$SELF_PATH")")"
+NPMCLI="$NPMPKG/cli.js"
+TESTDIR="$NPMPKG/test/"
+TMP=${TMPDIR:-/tmp}
+rm -rf $TMP/npm*
+TMP=$TMP/npm-test-$$
+echo "Testing in $TMP ..."
+ROOTDIR="$TMP/root"
+
+cleanup () {
+ if [ "$FAILURES" != "0" ] && [ "$FAILURES" != "" ]; then
+ return
+ fi
+ [ -d "$ROOTDIR" ] && rm -rf -- "$ROOTDIR"
+ mkdir -p -- "$ROOTDIR"
+}
+
+export npm_config_prefix="$ROOTDIR"
+export npm_config_color="always"
+export npm_config_global=true
+# have to set this to false, or it'll try to test itself forever
+export npm_config_npat=false
+export PATH="$PATH":"$ROOTDIR/bin":"$ROOTDIR/node_modules/.bin"
+export NODE_PATH="$ROOTDIR/node_modules"
+
+echo_err () {
+ echo "$@" >&2
+}
+fail () {
+ let 'FAILURES += 1'
+ echo_err ""
+ echo_err -e "\033[33mFailure: $@\033[m"
+ exit 1
+}
+
+cleanup
+main
diff --git a/deps/npm/test/update-test.sh b/deps/npm/test/update-test.sh
new file mode 100755
index 0000000000..f72c90dd98
--- /dev/null
+++ b/deps/npm/test/update-test.sh
@@ -0,0 +1,59 @@
+#!/bin/bash
+
+SELF_PATH="$0"
+if [ "${SELF_PATH:0:1}" != "." ] && [ "${SELF_PATH:0:1}" != "/" ]; then
+ SELF_PATH=./"$SELF_PATH"
+fi
+SELF_PATH=$( cd -P -- "$(dirname -- "$SELF_PATH")" \
+ && pwd -P \
+ ) && SELF_PATH=$SELF_PATH/$(basename -- "$0")
+
+# resolve symlinks
+while [ -h "$SELF_PATH" ]; do
+ DIR=$(dirname -- "$SELF_PATH")
+ SYM=$(readlink -- "$SELF_PATH")
+ SELF_PATH=$( cd -- "$DIR" \
+ && cd -- $(dirname -- "$SYM") \
+ && pwd \
+ )/$(basename -- "$SYM")
+done
+DIR=$( dirname -- "$SELF_PATH" )
+
+export npm_config_root=$DIR/root
+export npm_config_binroot=$DIR/bin
+
+rm -rf $DIR/{root,bin}
+mkdir -p $DIR/root
+mkdir -p $DIR/bin
+npm ls installed 2>/dev/null | grep -v npm | awk '{print $1}' | xargs npm rm &>/dev/null
+npm install \
+ base64@1.0.0 \
+ eyes@0.1.1 \
+ vows@0.2.5 \
+ websocket-server@1.0.5 &>/dev/null
+npm install ./test/packages/blerg &>/dev/null
+npm install vows@0.3.0 &>/dev/null
+
+echo ""
+echo "##"
+echo "## starting update"
+echo "##"
+echo ""
+
+npm update
+
+echo ""
+echo "##"
+echo "## update done, all should be 'latest'"
+echo "##"
+echo ""
+
+list=$( npm ls installed remote 2>/dev/null )
+echo "$list"
+notlatest=$( echo "$list" | grep -v latest )
+if [ "$notlatest" != "" ]; then
+ echo "Failed: not latest"
+ echo $notlatest
+else
+ echo "ok"
+fi
diff --git a/doc/about/index.html b/doc/about/index.html
new file mode 100644
index 0000000000..68759de08c
--- /dev/null
+++ b/doc/about/index.html
@@ -0,0 +1,126 @@
+<!doctype html>
+<html>
+ <head>
+ <style type="text/css">
+ ul {
+ padding: 0;
+ margin: 0;
+ }
+ </style>
+ <link type="image/x-icon" rel="icon" href="../favicon.ico">
+ <link type="image/x-icon" rel="shortcut icon" href="../favicon.ico">
+ <link type="text/css" rel="stylesheet" href="../pipe.css">
+ <link type="text/css" rel="stylesheet" href="../sh_vim-dark.css">
+ <link rel="alternate"
+ type="application/rss+xml"
+ title="node blog"
+ href="http://feeds.feedburner.com/nodejs/123123123">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>node.js</title>
+ </head>
+ <body>
+ <div id="intro">
+ <img id="logo" src="../logo.png" alt="node.js">
+ </div>
+ <div id="content" class="clearfix">
+ <div id="column1" class="interior">
+ <h2>About</h2>
+
+ <pre>
+var http = require('http');
+http.createServer(function (req, res) {
+ res.writeHead(200, {'Content-Type': 'text/plain'});
+ res.end('Hello World\n');
+}).listen(1337, "127.0.0.1");
+console.log('Server running at http://127.0.0.1:1337/');</pre>
+
+ <p>Node's goal is to provide an easy way to build scalable
+ network programs. In the "hello world" web server example
+ above, many client connections can be handled concurrently.
+ Node tells the operating system (through <code>epoll</code>,
+ <code>kqueue</code>, <code>/dev/poll</code>, or
+ <code>select</code>) that it should be notified when a new
+ connection is made, and then it goes to sleep. If someone new
+ connects, then it executes the callback. Each connection is
+ only a small heap allocation.</p>
+
+ <p>This is in contrast to today's more common concurrency
+ model where OS threads are employed. Thread-based networking
+ is relatively inefficient and very difficult to use. See: <a
+ href="http://www.kegel.com/c10k.html">this</a> and <a
+ href="http://bulk.fefe.de/scalable-networking.pdf">this</a>.
+ Node will show much better memory efficiency under high-loads
+ than systems which allocate 2mb thread stacks for each
+ connection. Furthermore, users of Node are free from worries
+ of dead-locking the process—there are no locks. Almost no
+ function in Node directly performs I/O, so the process never
+ blocks. Because nothing blocks, less-than-expert programmers
+ are able to develop fast systems.</p>
+
+ <p>Node is similar in design to and influenced by systems like
+ Ruby's <a href="http://rubyeventmachine.com/">Event
+ Machine</a> or Python's <a
+ href="http://twistedmatrix.com/">Twisted</a>. Node takes the
+ event model a bit further—it presents the event loop as a
+ language construct instead of as a library. In other systems
+ there is always a blocking call to start the event-loop.
+ Typically one defines behavior through callbacks at the
+ beginning of a script and at the end starts a server through a
+ blocking call like <code>EventMachine::run()</code>. In Node
+ there is no such start-the-event-loop call. Node simply enters
+ the event loop after executing the input script. Node exits
+ the event loop when there are no more callbacks to perform.
+ This behavior is like browser javascript—the event loop is
+ hidden from the user.</p>
+
+ <p>HTTP is a first class protocol in Node. Node's HTTP library
+ has grown out of the author's experiences developing and
+ working with web servers. For example, streaming data through
+ most web frameworks is impossible. Node attempts to correct
+ these problems in its HTTP <a
+ href="https://github.com/joyent/http-parser/tree/master">parser</a>
+ and API. Coupled with Node's purely evented infrastructure, it
+ makes a good foundation for web libraries or frameworks.</p>
+
+ <p>But what about multiple-processor concurrency? Aren't
+ threads necessary to scale programs to multi-core computers?
+ You can start new processes via <code><a
+ href="http://nodejs.org/docs/latest/api/child_processes.html#child_process.fork">child_process.fork()</a></code>
+ these other processes will be scheduled in parallel. For load
+ balancing incoming connections across multiple processes use
+ <a href="http://nodejs.org/docs/latest/api/cluster.html">the
+ cluster module</a>.</p>
+
+ <p>See also:</p>
+ <ul>
+ <li><a href="http://s3.amazonaws.com/four.livejournal/20091117/jsconf.pdf">Slides from JSConf 2009</a></li>
+ <li><a href="http://nodejs.org/jsconf2010.pdf">Slides from JSConf 2010</a></li>
+ <li><a href="http://www.yuiblog.com/blog/2010/05/20/video-dahl/">Video from a talk at Yahoo in May 2010</a></li>
+ </ul>
+ <p><a href="/">Go back to the home page</a></p>
+ </div>
+ <div id="column2" class="interior">
+ </div>
+</div>
+ <div id="footer">
+ <p>Copyright <a href="http://joyent.com">Joyent, Inc</a>, Node.js
+ is a <a href="trademark-policy.pdf">trademark of Joyent, Inc</a>.
+ </div>
+
+ <script type="text/javascript" src="../sh_main.js"></script>
+ <script type="text/javascript" src="../sh_javascript.min.js"></script>
+ <script type="text/javascript">highlight(undefined, undefined, 'pre');</script>
+
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ?
+ "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try {
+ var pageTracker = _gat._getTracker("UA-10874194-2");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+ </body>
+</html>
diff --git a/doc/api/fs.markdown b/doc/api/fs.markdown
index 76ae6a2463..445fd59c2b 100644
--- a/doc/api/fs.markdown
+++ b/doc/api/fs.markdown
@@ -170,12 +170,14 @@ the completion callback.
Synchronous link(2).
-### fs.symlink(linkdata, path, [callback])
+### fs.symlink(linkdata, path, [type], [callback])
Asynchronous symlink(2). No arguments other than a possible exception are given
to the completion callback.
+`type` argument can be either `'dir'` or `'file'` (default is `'file'`). It is only
+used on Windows (ignored on other platforms).
-### fs.symlinkSync(linkdata, path)
+### fs.symlinkSync(linkdata, path, [type])
Synchronous symlink(2).
diff --git a/doc/api/http.markdown b/doc/api/http.markdown
index 8ed79ebc1c..330ea27710 100644
--- a/doc/api/http.markdown
+++ b/doc/api/http.markdown
@@ -103,16 +103,18 @@ IPv4 address (`INADDR_ANY`).
To listen to a unix socket, supply a filename instead of port and hostname.
-This function is asynchronous. The last parameter `callback` will be called
-when the server has been bound to the port.
+This function is asynchronous. The last parameter `callback` will be added as
+a listener for the ['listening'](net.html#event_listening_) event.
+See also [net.Server.listen()](net.html#server.listen).
### server.listen(path, [callback])
Start a UNIX socket server listening for connections on the given `path`.
-This function is asynchronous. The last parameter `callback` will be called
-when the server has been bound.
+This function is asynchronous. The last parameter `callback` will be added as
+a listener for the ['listening'](net.html#event_listening_) event.
+See also [net.Server.listen()](net.html#server.listen).
### server.close()
diff --git a/doc/api/util.markdown b/doc/api/util.markdown
index 2430d8a70d..ee0622ae5e 100644
--- a/doc/api/util.markdown
+++ b/doc/api/util.markdown
@@ -50,7 +50,7 @@ Output with timestamp on `stdout`.
require('util').log('Timestamped message.');
-### util.inspect(object, showHidden=false, depth=2)
+### util.inspect(object, showHidden=false, depth=2, colors=false)
Return a string representation of `object`, which is useful for debugging.
@@ -63,6 +63,8 @@ formatting the object. This is useful for inspecting large complicated objects.
The default is to only recurse twice. To make it recurse indefinitely, pass
in `null` for `depth`.
+If `colors` is `true`, the output will be styled with ANSI color codes.
+
Example of inspecting all properties of the `util` object:
var util = require('util');
diff --git a/doc/close-downloads.png b/doc/close-downloads.png
new file mode 100644
index 0000000000..ba72523f7b
--- /dev/null
+++ b/doc/close-downloads.png
Binary files differ
diff --git a/doc/community/index.html b/doc/community/index.html
new file mode 100644
index 0000000000..5348c875d9
--- /dev/null
+++ b/doc/community/index.html
@@ -0,0 +1,161 @@
+<!doctype html>
+<html>
+ <head>
+ <style type="text/css">
+ ul {
+ padding: 0;
+ margin: 0;
+ }
+ </style>
+ <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js?ver=3.1.3'></script>
+ <script type="text/javascript" src="../sh_main.js"></script>
+ <script type="text/javascript" src="../sh_javascript.min.js"></script>
+ <link type="image/x-icon" rel="icon" href="../favicon.ico">
+ <link type="image/x-icon" rel="shortcut icon" href="../favicon.ico">
+ <link type="text/css" rel="stylesheet" href="../pipe.css">
+ <link type="text/css" rel="stylesheet" href="../sh_vim-dark.css">
+ <link rel="alternate"
+ type="application/rss+xml"
+ title="node blog"
+ href="http://feeds.feedburner.com/nodejs/123123123">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>node.js</title>
+ </head>
+ <body>
+ <div id="intro">
+ <img id="logo" src="../logo.png" alt="node.js">
+ </div>
+ <div id="content" class="clearfix">
+ <div id="column1" class="interior">
+ <p>Node's most valuable feature is the friendly and colorful community of developers. There are many places where this group congregates on the internet. This page attempts to highlight the best forums.</p>
+
+ <h2>Periodicals</h2>
+
+ <p> <a
+ href="http://planetnodejs.com">Planet Node</a> is an
+ aggregator of Node developer blogs. <a
+ href="http://nodeup.com/">NodeUp</a>
+ is a podcast covering the latest Node news in the
+ community. </p>
+
+ <h2>Docs</h2>
+
+ <p>
+ Besides the <a href="http://nodejs.org/docs/latest/api">official API
+ docs</a> there are a number of sites new users should be
+ aware of. <A href="http://docs.nodejitsu.com/">docs.nodejitsu.com</A>
+ answers many of the common problems people come across.
+ <a href="http://howtonode.org/">How To Node</a> has a
+ growing number of useful tutorials.
+ The <a href="http://stackoverflow.com/questions/tagged/node.js">Stack
+ Overflow node.js tag</a> is collecting new information
+ every day.
+
+
+ <h2>GitHub</h2>
+ <p>All development takes place at <a
+ href="http://github.com/joyent/node">http://github.com/joyent/node</a>.
+ The comments on commit messages are often source of heated
+ discussion regarding core development. The <a
+ href="http://github.com/joyent/node/wiki">GitHub Node
+ wiki</a> is full of useful links for newcomers. Don't
+ miss <a
+ href="https://github.com/joyent/node/wiki/Projects,-Applications,-and-Companies-Using-Node">Projects,
+ Applications, and Companies Using Node</a> or the <a
+ href="https://github.com/joyent/node/wiki/modules">very
+ long list of Node modules</a>, many of which are
+ published in the <a href="http://search.npmjs.org/">npm
+ registry</a>.</p>
+
+ <p><a href="http://notinventedhe.re/on/2011-7-26"><img
+ src="not-invented-here.png" width="100%"></a> Bugs
+ should be reported to <a
+ href="https://github.com/joyent/node/issues">https://github.com/joyent/node/issues</a>.
+ Fixes to the code are welcome! Please see our <a
+ href="https://github.com/joyent/node/wiki/Contributing">contirbuting
+ guidelines</a> for information on how to submit a
+ patch.</p>
+
+ <h2>Mailing Lists</h2>
+
+ <p>The <a
+ href="http://groups.google.com/group/nodejs">user
+ mailing list</a> is used for announcements, discussion,
+ and flame wars about Node. The <a
+ href="http://groups.google.com/group/nodejs-dev">internal
+ development mailing list</a> is used for discussion of
+ internal design and feature proposals.</p>
+
+ <h2>IRC</h2>
+
+ <p>For real-time chat about Node development go to
+ <code>irc.freenode.net</code> in the <code>#node.js</code>
+ channel with an <a href="http://www.mirc.com">IRC</a> <a
+ href="http://colloquy.info/">client</a> or connect in
+ your web browser to the channel using <a
+ href="http://webchat.freenode.net/?channels=node.js">freenode's
+ WebChat</a>. Felix Geisendörfer keeps <a
+ href="http://nodejs.debuggable.com/">logs of the
+ channel</a> for those who miss a day.</p>
+
+ <h2>Conferences</h2>
+
+ <p><a href="http://www.nodeconf.com/">NodeConf</a>
+ conferences are the main event in the United States; they
+ are organized by <a href="http://www.mikealrogers.com/">Mikeal Rogers</a>.
+ <a href="http://nodefest.jp/">NodeFest (東京Node学園祭)</a>
+ is organized by the <a href="http://nodejs.jp">Node.js
+ Japan user group</a>. <a
+ href="http://nodecamp.de/">NodeCamp.de</a> in Cologne,
+ Germany is organized by <a href="railslove.de">Rails
+ Love</a>. An <a href="http://nodejsconf.it/">Italian
+ Node.js Conference</a> exists as well. <a
+ href="http://nodesummit.com/">Node Summit</a> is a
+ conference in San Francisco focusing on the adoption of
+ Node in larger companies. <a
+ href="http://jsconf.com/">JSConf</a> organizes the main
+ JavaScript conferences.</p>
+
+ <h2>Localized Sites</h2>
+
+ <p><code>nodejs.org</code> does not maintain any
+ translations into other languages. However there are
+ community websites in various languages with mailing lists
+ and translations of the website.</p>
+
+ <p><a href="http://nodejs.ru/">nodejs.ru</a> Russian blog.
+ <br>
+ <a href="http://nodejs.ir">nodejs.ir</a> Iran group in Persian
+ <br>
+ <a href="http://nodejs.jp/">nodejs.jp</a> Japan user group
+ <br>
+ <a href="http://cnodejs.org">CNodeJS.org</a> Chinese community
+ <br>
+ <a href="http://nodejs.co.il">nodejs.co.il</a> Israeli wiki
+ <br>
+ <a href="http://nodejs.hk">HKNoJ</a> Hong Kong community
+ <br>
+ <a href="http://nodejs.tw">nodejs.tw</a> Taiwan community</p>
+ <p><a href="/">Go back to the home page</a></p>
+ </div>
+ <div id="column2" class="interior">
+ </div>
+</div>
+ <div id="footer">
+ <p>Copyright <a href="http://joyent.com">Joyent, Inc</a>, Node.js
+ is a <a href="trademark-policy.pdf">trademark of Joyent, Inc</a>.
+ </div>
+
+ <script type="text/javascript">
+ var gaJsHost = (("https:" == document.location.protocol) ?
+ "https://ssl." : "http://www.");
+ document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
+ </script>
+ <script type="text/javascript">
+ try {
+ var pageTracker = _gat._getTracker("UA-10874194-2");
+ pageTracker._trackPageview();
+ } catch(err) {}
+ </script>
+
+</body></html>
diff --git a/doc/community/not-invented-here.png b/doc/community/not-invented-here.png
new file mode 100644
index 0000000000..5d4efa0532
--- /dev/null
+++ b/doc/community/not-invented-here.png
Binary files differ
diff --git a/doc/download-logo.png b/doc/download-logo.png
new file mode 100644
index 0000000000..253235f4c3
--- /dev/null
+++ b/doc/download-logo.png
Binary files differ
diff --git a/doc/ebay-logo.png b/doc/ebay-logo.png
new file mode 100644
index 0000000000..8cb3db006d
--- /dev/null
+++ b/doc/ebay-logo.png
Binary files differ
diff --git a/doc/footer-logo.png b/doc/footer-logo.png
new file mode 100644
index 0000000000..19a4eaadcb
--- /dev/null
+++ b/doc/footer-logo.png
Binary files differ
diff --git a/doc/full-white-stripe.bmp b/doc/full-white-stripe.bmp
new file mode 100644
index 0000000000..bb2bf9c493
--- /dev/null
+++ b/doc/full-white-stripe.bmp
Binary files differ
diff --git a/doc/icons.png b/doc/icons.png
new file mode 100644
index 0000000000..421dfdaf11
--- /dev/null
+++ b/doc/icons.png
Binary files differ
diff --git a/doc/index.html b/doc/index.html
index d0829b83a3..95c3aeeb77 100644
--- a/doc/index.html
+++ b/doc/index.html
@@ -1,5 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
+<!doctype html>
+<html>
<head>
<style type="text/css">
ul {
@@ -7,76 +7,163 @@
margin: 0;
}
</style>
- <script type="text/javascript" src="sh_main.js"></script>
- <script type="text/javascript" src="sh_javascript.min.js"></script>
- <link type="image/x-icon" rel="icon" href="favicon.ico" />
- <link type="image/x-icon" rel="shortcut icon" href="favicon.ico" />
- <link type="text/css" rel="stylesheet" href="pipe.css" />
- <link type="text/css" rel="stylesheet" href="sh_vim-dark.css" />
+ <link type="image/x-icon" rel="icon" href="favicon.ico">
+ <link type="image/x-icon" rel="shortcut icon" href="favicon.ico">
+ <link type="text/css" rel="stylesheet" href="pipe.css">
+ <link type="text/css" rel="stylesheet" href="sh_vim-dark.css">
<link rel="alternate"
type="application/rss+xml"
title="node blog"
- href="http://feeds.feedburner.com/nodejs/123123123"/>
- <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+ href="http://feeds.feedburner.com/nodejs/123123123">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>node.js</title>
</head>
<body>
- <div id="toc">
- <ol>
- <li><a href="#download">Download</a></li>
- <li><a href="https://github.com/joyent/node/wiki/ChangeLog">ChangeLog</a></li>
- <li><a href="#about">About</a></li>
- <li><a href="http://nodejs.org/docs/v0.6.5/api">v0.6.5 docs</a></li>
- <br/>
- <li><a href="https://github.com/joyent/node/wiki">Wiki</a></li>
- <li><a href="http://blog.nodejs.org/">Blog</a></li>
- <li><a href="https://github.com/joyent/node/wiki/Community">Community</a></li>
- <li><a href="http://chat.nodejs.org/">Demo</a></li>
- <li><a href="/logos/">Logos</a></li>
- <li><a href="http://jobs.nodejs.org/">Jobs</a></li>
- <ol><!-- JOBS --><!-- JOBS --></ol>
- </ol>
- </div>
- <div id="content">
+ <div id="intro">
+ <img id="logo" src="logo.png" alt="node.js">
- <!-- <h1><a href="http://nodejs.org/">Node</a></h1> -->
- <br /><br />
- <img id="logo" src="logo.png" alt="node.js"/>
+ <p>Node.js is a platform built on <a
+ href="http://code.google.com/p/v8/">Chrome's JavaScript runtime</a>
+ for easily building fast, scalable network applications. Node.js
+ uses an event-driven, non-blocking I/O model that makes it
+ lightweight and efficient, perfect for data-intensive real-time
+ applications that run across distributed devices.</p>
- <p id="introduction">
- Evented I/O for
- <a href="http://code.google.com/p/v8/">V8 JavaScript</a>.
- </p>
+ <a href="#download" id="downloadbutton">Download</a>
+ </div>
+ <div id="quotes" class="clearfix">
+ <h2>Node.js in the Industry</h2>
+ <ul>
+ <li class="microsoft"><img src="microsoft-logo.png">
+ <p>Node gives Azure users the first end-to-end JavaScript
+ experience for the development of a whole new class of real-time
+ applications.
+ <br>
+ <a href="http://blogs.msdn.com/b/interoperability/">Claudio Caldato</a>
+ <br>
+ <span>Principal Program Manager, Interoperability Strategy</span></p></li>
+
+ <li class="ebay"><img src="ebay-logo.png">
+ <p>Node’s evented I/O model freed us from worrying about locking
+ and concurrency issues that are common with multithreaded async
+ I/O.
+ <br>
+ <a href="http://www.ebaytechblog.com/2011/11/30/announcing-ql-io/">Subbu Allamarju</a>
+ <br>
+ <span>Principal Member, Technical Staff</span></p></li>
+
+ <li class="linkedin"><img src="linkedin-logo.png">
+ <p>On the server side, our entire mobile software stack is
+ completely built in Node. One reason was scale. The second is
+ Node showed us huge performance gains.
+ <br>
+ <a href="http://venturebeat.com/2011/08/16/linkedin-node/">Kiran Prasad</a>
+ <br>
+ <span>Director of Engineering, Mobile</span></p></li>
+
+ <li class="yahoo"><img src="yahoo-logo.png">
+ <p>Node.js is the execution core of Manhattan. Allowing
+ developers to build one code base using one language – that is
+ the nirvana for developers.
+ <br>
+ <a href="http://developer.yahoo.com/blogs/ydn/posts/2011/11/yahoo-announces-cocktails-%E2%80%93-shaken-not-stirred/">Renaud Waldura</a>
+ <br>
+ <span>Sr. Product Manger, Cocktail</span></p></li>
+ </ul>
+ </div>
- <p>
- An example of a web server written in Node which responds with
- "Hello World" for every request.
- </p>
+ <div id="download">
+ <a href="#" id="download-close">X</a>
+ <img id="download-logo" src="download-logo.png" alt="node.js">
+ <ul id="installers" class="clearfix">
+ <li><a href="http://nodejs.org/dist/v0.6.6/node-v0.6.6.msi">Windows Installer</a><br>node-v0.6.6.msi</li>
+ <li><a href="http://nodejs.org/dist/v0.6.6/node-v0.6.6.pkg">Macintosh Installer</a><br>node-v0.6.6.pkg</li>
+ <li id="source"><a href="http://nodejs.org/dist/v0.6.6/node-v0.6.6.tar.gz">Source Code</a><br>node-v0.6.6.tar.gz</li>
+ </ul>
+ <ul id="documentation">
+ <li><a href="https://raw.github.com/joyent/node/v0.6.6/ChangeLog">Change Log</a></li>
+ <li><a href="http://nodejs.org/docs/v0.6.6/api/index.html">Documentation</a></li>
+ <li><a href="http://nodejs.org/dist/v0.6.6">Other release files</a></li>
+ <li><a href="https://raw.github.com/joyent/node/v0.6.6/LICENSE">License</a></li>
+ <li><a href="https://github.com/joyent/node">Git Repository</a></li>
+ </ul>
+ </div>
- <pre>
+ <script>;(function() {
+ // attach as soon as the required elements are in the DOM.
+ // don't need to wait for entire document to be ready, since we're
+ // not adding any *new* nodes to the <body>, so there's no threat
+ // of 'Invalid operation' errors in old MSIE 6.
+ document.getElementById('downloadbutton').onclick = function(e) {
+ e = e || window.event;
+ e.stopPropagation && e.stopPropagation();
+ e.cancelBubble = true;
+ // need to give the hash a tick to update
+ setTimeout(downloadDialogUpdate, 0);
+ };
+
+ document.getElementById('download-close').onclick =
+ document.documentElement.onclick = function(e) {
+ e = e || window.event;
+ if (location.hash === '#download') location.hash = '';
+ downloadDialogUpdate();
+ };
+
+ document.getElementById('download').onclick = function(e) {
+ e = e || window.event;
+ e.stopPropagation && e.stopPropagation();
+ e.cancelBubble = true;
+ };
+
+ // I keep expecting <Esc> to close the dialog...
+ document.documentElement.onkeydown = function(e) {
+ e = e || window.event;
+ var k = e.which || e.keyCode || e.keyIdentifier;
+ if (typeof k === 'string') k = k.charCodeAt(0);
+ if (k === 27) document.documentElement.onclick(e);
+ };
+
+ // hacky workaround for old ie browsers that don't support :target css.
+ function downloadDialogUpdate () {
+ var div = document.getElementById('download');
+ if (!div) return;
+ var expect = location.hash === '#download' ? 'block' : 'none';
+ var actual = div.currentStyle ? div.currentStyle.display
+ : window.getComputedStyle
+ ? document.defaultView.getComputedStyle(div, null).getPropertyValue('display')
+ : null;
+
+ // it looks like a string, but it might not actually be a string.
+ // explicitly cast for MSIE 6 and 7.
+ actual = '' + actual;
+ expect = '' + expect;
+ if (actual !== expect) {
+ div.style.display = expect;
+ }
+ }
+ downloadDialogUpdate();
+ })();</script>
+
+ <div id="content" class="clearfix">
+ <div id="column1">
+ <h2>An example: Webserver</h2>
+ <p>This simple web server written in Node responds with "Hello World" for every request.</p>
+ <pre>
var http = require('http');
http.createServer(function (req, res) {
res.writeHead(200, {'Content-Type': 'text/plain'});
res.end('Hello World\n');
}).listen(1337, "127.0.0.1");
-console.log('Server running at http://127.0.0.1:1337/');
-</pre>
-
- <p>
- To run the server, put the code into a file
- <code>example.js</code> and execute it with the <code>node</code>
- program:
- </p>
- <pre class="sh_none">
+console.log('Server running at http://127.0.0.1:1337/');</pre>
+
+ <p>To run the server, put the code into a file <code>example.js</code> and execute it with the <code>node</code> program:</p>
+ <pre class="sh_none">
% node example.js
Server running at http://127.0.0.1:1337/</pre>
- <p>
- Here is an example of a simple TCP server which listens on port 1337
- and echoes whatever you send it:
- </p>
+ <p>Here is an example of a simple TCP server which listens on port 1337 and echoes whatever you send it:</p>
- <pre>
+ <pre>
var net = require('net');
var server = net.createServer(function (socket) {
@@ -84,146 +171,36 @@ var server = net.createServer(function (socket) {
socket.pipe(socket);
});
-server.listen(1337, "127.0.0.1");
-</pre>
-
- <p>
- See the <a href="/docs/latest/api/">API documentation</a> for more
- examples.
- </p>
-
-
- <p>
- Go to <a href="https://github.com/joyent/node/wiki">the Wiki</a> for lots more information.
- </p>
-
- <h2 id="video">Introduction</h2>
-
- <iframe title="YouTube video player" width="640" height="390"
- src="http://www.youtube.com/embed/jo_B4LTHi3I" frameborder="0"
- allowfullscreen></iframe>
-
- <h2 id="download">Download</h2>
-
- <p>2011.12.04 v0.6.5
- <ul class="release">
- <li><a href="http://nodejs.org/dist/v0.6.5/node-v0.6.5.tar.gz"><code>node-v0.6.5.tar.gz</code>
- Source code</a> (<a href="https://github.com/joyent/node/wiki/Installation">build instructions</a>)
- <li><a href="http://nodejs.org/dist/v0.6.5/node-v0.6.5.msi"><code>node-v0.6.5.msi</code> Windows installer</a>
- <li><a href="http://nodejs.org/dist/v0.6.5/node-v0.6.5.pkg"><code>node-v0.6.5.pkg</code> Macintosh installer</a>
- <li><a href="http://nodejs.org/docs/v0.6.5/api/index.html">Documentation</a>
- <li><a href="https://raw.github.com/joyent/node/v0.6.5/LICENSE">License</a>
- <li><a href="http://nodejs.org/dist/v0.6.5">Other release files
- (like <code>.exe</code> and <code>.pdb</code>)</a>
- </ul>
-
-
- <p>Historical: <a href="http://nodejs.org/dist">versions</a>, <a href="http://nodejs.org/docs">docs</a></p>
-
- <p>
- <a href="https://github.com/joyent/node/tree/master">git repository</a>
- </p>
-
-
- <h2 id="about">About</h2>
-
- <p>
- Node's goal is to provide an easy way to build scalable network
- programs. In the "hello world" web server example above, many
- client connections can be handled concurrently. Node tells the
- operating system (through <code>epoll</code>, <code>kqueue</code>,
- <code class="sh_none">/dev/poll</code>, or <code>select</code>)
- that it should be notified when a new connection is made, and
- then it goes to sleep. If someone new connects, then it executes
- the callback. Each connection is only a small heap allocation.
- </p>
-
- <p>
- This is in contrast to today's more common concurrency model where
- OS threads are employed. Thread-based networking is relatively
- inefficient and very difficult to use. See:
- <a href="http://www.kegel.com/c10k.html">this</a> and
- <a href="http://bulk.fefe.de/scalable-networking.pdf">this.</a>
-
- Node will show much better memory efficiency under high-loads
- <!-- TODO benchmark -->
- than systems which allocate 2mb thread stacks for each connection.
-
- Furthermore, users of Node are free from worries of dead-locking
- the process&mdash;there are no locks. Almost no function in Node
- directly performs I/O, so the process never blocks. Because
- nothing blocks, less-than-expert programmers are able to develop
- fast systems.
- </p>
-
- <p>
- Node is similar in design to and influenced by systems like Ruby's <a
- href="http://rubyeventmachine.com/">Event Machine</a> or Python's <a
- href="http://twistedmatrix.com/">Twisted</a>. Node takes the event
- model a bit further&mdash;it presents the event loop as a language
- construct instead of as a library. In other systems there is always
- a blocking call to start the event-loop. Typically one defines
- behavior through callbacks at the beginning of a script and at the
- end starts a server through a blocking call like
- <code>EventMachine::run()</code>. In Node there is no such
- start-the-event-loop call. Node simply enters the event loop after
- executing the input script. Node exits the event loop when there are
- no more callbacks to perform. This behavior is like browser
- javascript&mdash;the event loop is hidden from the user.
- </p>
-
- <p>
- HTTP is a first class protocol in Node. Node's HTTP library has
- grown out of the author's experiences developing and working with
- web servers. For example, streaming data through most web frameworks
- is impossible. Node attempts to correct these problems in its HTTP
- <a href="https://github.com/joyent/http-parser/tree/master">parser</a>
- and API. Coupled with Node's purely evented infrastructure, it makes
- a good foundation for web libraries or frameworks.
- </p>
-
- <p>
- <i>
- But what about multiple-processor concurrency? Aren't threads
- necessary to scale programs to multi-core computers?
- </i>
- You can start new processes via
- <a href="http://nodejs.org/docs/latest/api/child_processes.html#child_process.fork"><code>child_process.fork()</code></a>
- these other processes will be scheduled in parallel.
- For load balancing incoming connections across multiple processes
- use <a href="http://nodejs.org/docs/latest/api/cluster.html">the
- cluster module</a>
- </p>
-
- <p>
- See also:
- <ul>
- <li><a href="http://s3.amazonaws.com/four.livejournal/20091117/jsconf.pdf">slides</a> from JSConf 2009</li>
- <li><a href="http://nodejs.org/jsconf2010.pdf">slides</a> from JSConf 2010</li>
- <li><a href="http://www.yuiblog.com/blog/2010/05/20/video-dahl/">video</a> from a talk at Yahoo in May 2010</li>
- </ul>
- </p>
-
-
+server.listen(1337, "127.0.0.1");</pre>
+
+ <!-- <p>Ready to dig in? <a href="">Download the latest version</a> of node.js or learn how other organizations are <a href="">using the technology</a>.</p> -->
+ </div>
+ <div id="column2">
+ <h2>Featured</h2>
+ <a href="http://www.youtube.com/watch?v=jo_B4LTHi3I"><img src="ryan-speaker.jpg"></a>
+ A guided introduction to Node
+
+ <h2>Explore Node.js</h2>
+ <ul id="explore">
+ <li><a href="about/" class="explore">About</a><br><span>Technical overview</span></li>
+ <li><a href="http://search.npmjs.org/" class="explore">npm Registry</a><br><span>Modules, resources and more</span></li>
+ <li><a href="http://nodejs.org/docs/latest/api/index.html" class="explore">Documentation</a><br><span>API Specifications</span></li>
+ <li><a href="http://blog.nodejs.org" class="explore">Node.js Blog</a><br><span>Insight, perspective and events</span></li>
+ <li><a href="community/" class="explore">Community</a><br><span>Mailing lists, blogs, and more</span></li>
+ <li><a href="logos/" class="explore">Logos</a><br><span>Logo and desktop background</span></li>
+ <li><a href="http://jobs.nodejs.org/" class="explore">Jobs</a><br><ol class="jobs"><!-- JOBS --><!-- JOBS --></ol></li>
+ </ul>
</div>
+</div>
- <div style="float: right;">
- <a
- href='https://developer.mozilla.org/en/JavaScript/Reference/Global_Objects/String'
- title='JS String match'><img
- src='http://static.jsconf.us/promotejsh.gif' height='150' width='180'
- alt='JS String match'/></a>
+ <div id="footer">
+ <p>Copyright <a href="http://joyent.com">Joyent, Inc</a>, Node.js
+ is a <a href="trademark-policy.pdf">trademark of Joyent, Inc</a>.
</div>
- <a href="http://no.de/"><img src="sponsored.png" height="58" width="120"/></a>
-
- <div style="clear: both; font-size: 8pt">
- Copyright 2010 Joyent, Inc
- <br/>
- Node.js is a trademark of Joyent, Inc.
- See the <a href="trademark-policy.pdf">trademark policy</a>
- for more information.
- </div>
+ <script type="text/javascript" src="sh_main.js"></script>
+ <script type="text/javascript" src="sh_javascript.min.js"></script>
+ <script type="text/javascript">highlight(undefined, undefined, 'pre');</script>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ?
@@ -234,7 +211,7 @@ server.listen(1337, "127.0.0.1");
try {
var pageTracker = _gat._getTracker("UA-10874194-2");
pageTracker._trackPageview();
- } catch(err) {}</script>
- <script type="text/javascript">highlight(undefined, undefined, 'pre');</script>
+ } catch(err) {}
+ </script>
</body>
</html>
diff --git a/doc/linkedin-logo.png b/doc/linkedin-logo.png
new file mode 100644
index 0000000000..2ad9fb2c0c
--- /dev/null
+++ b/doc/linkedin-logo.png
Binary files differ
diff --git a/doc/logo.png b/doc/logo.png
index 4ca766d486..ef3494efa8 100644
--- a/doc/logo.png
+++ b/doc/logo.png
Binary files differ
diff --git a/doc/logos/index.html b/doc/logos/index.html
index 0d9d2a3f91..250cd72750 100644
--- a/doc/logos/index.html
+++ b/doc/logos/index.html
@@ -1,82 +1,79 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml"><head>
+<!doctype html>
+<html>
+ <head>
<style type="text/css">
ul {
padding: 0;
margin: 0;
}
</style>
+ <script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.5/jquery.min.js?ver=3.1.3'></script>
<script type="text/javascript" src="../sh_main.js"></script>
- <script type="text/javascript" src="../sh_javascript.js"></script>
- <link type="image/x-icon" rel="icon" href="http://nodejs.org/favicon.ico">
- <link type="image/x-icon" rel="shortcut icon" href="../node-favicon.png">
+ <script type="text/javascript" src="../sh_javascript.min.js"></script>
+ <link type="image/x-icon" rel="icon" href="../favicon.ico">
+ <link type="image/x-icon" rel="shortcut icon" href="../favicon.ico">
<link type="text/css" rel="stylesheet" href="../pipe.css">
<link type="text/css" rel="stylesheet" href="../sh_vim-dark.css">
- <link rel="alternate" type="application/rss+xml" title="node blog" href="http://feeds.feedburner.com/nodejs/123123123">
- <meta http-equiv="content-type" content="text/html; charset=UTF-8">
- <title>Node.js Logos</title>
+ <link rel="alternate"
+ type="application/rss+xml"
+ title="node blog"
+ href="http://feeds.feedburner.com/nodejs/123123123">
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>node.js</title>
</head>
-<body>
- <div id="content">
-
- <!-- <h1><a href="http://nodejs.org/">Node</a></h1> -->
- <br />
- <br />
- <img src="../logo.png" alt="node.js" width="420" height="111" id="logo">
- <p>To echo the evolutionary nature of Node, we've added some punch and playfulness to its identity. All it needs now is a good home with you, download and have fun!</p>
- <h2>Logo Downloads</h2>
- <table border="0" cellspacing="0" cellpadding="10">
- <tr>
- <td bgcolor="#FFFFFF"><a href="nodejs-light.eps"><img src="nodejs.png" alt="Node.js dark" width="212" height="114" border="0" /></a></td>
- <td bgcolor="#46483E"><a href="nodejs-dark.eps"><img src="nodejs-dark.png" alt="Node.js dark" width="212" height="114" border="0" /></a></td>
- </tr>
- <tr>
- <td><a href="nodejs-light.eps">Node.js standard EPS</a></td>
- <td><a href="nodejs-dark.eps">Node.js reversed EPS</a></td>
- </tr>
- <tr>
- <td bgcolor="#8BC84B"><a href="nodejs-green.eps"><img src="nodejs-green.png" alt="Node.js dark" width="212" height="114" border="0" /></a><a href="nodejs-dark.eps"></a></td>
- <td bgcolor="#ffffff"><a href="nodejs-black.eps"><img src="nodejs-black.png" alt="Node.js dark" width="212" height="114" border="0" /></a></td>
- </tr>
- <tr>
- <td><a href="nodejs-green.eps">Node.js bright EPS</a></td>
- <td><a href="nodejs-black.eps">Node.js 1 color EPS</a></td>
- </tr>
- </table>
- <h2>Desktop Background</h2>
- <p><img src="monitor.png" width="525" height="398" alt="Screensavers" /></p>
- <p>Select your screen resolution:<a href="nodejs-1024x768.png"><br />
- <span class="desktops">1024 x 768</span></a><span class="desktops"> | <a href="nodejs-1280x1024.png">1280 x 1024</a> | <a href="nodejs-1440x900.png">1440 x 900</a> | <a href="nodejs-1920x1200.png">1920 x 1200</a> | <a href="nodejs-2560x1440.png">2560 x 1440</a></span></p>
-
- <h2 id="video">&nbsp;</h2>
-<p></p>
-
-
+ <body>
+ <div id="intro">
+ <img id="logo" src="../logo.png" alt="node.js">
</div>
+ <div id="content" class="clearfix">
+ <div id="column1" class="interior">
+ <p>To echo the evolutionary nature of Node, we've added some punch and playfulness to its identity. All it needs now is a good home with you, download and have fun!</p>
+ <h2>Logo Downloads</h2>
+ <table border="0" cellspacing="0" cellpadding="10">
+ <tr>
+ <td bgcolor="#FFFFFF"><a href="nodejs-light.eps"><img src="nodejs.png" alt="Node.js dark" width="212" height="114" border="0"></a></td>
+ <td bgcolor="#46483E"><a href="nodejs-dark.eps"><img src="nodejs-dark.png" alt="Node.js dark" width="212" height="114" border="0"></a></td>
+ </tr>
+ <tr>
+ <td><a href="nodejs-light.eps">Node.js standard EPS</a></td>
+ <td><a href="nodejs-dark.eps">Node.js reversed EPS</a></td>
+ </tr>
+ <tr>
+ <td bgcolor="#8BC84B"><a href="nodejs-green.eps"><img src="nodejs-green.png" alt="Node.js dark" width="212" height="114" border="0"></a><a href="nodejs-dark.eps"></a></td>
+ <td bgcolor="#ffffff"><a href="nodejs-black.eps"><img src="nodejs-black.png" alt="Node.js dark" width="212" height="114" border="0"></a></td>
+ </tr>
+ <tr>
+ <td><a href="nodejs-green.eps">Node.js bright EPS</a></td>
+ <td><a href="nodejs-black.eps">Node.js 1 color EPS</a></td>
+ </tr>
+ </table>
+ <h2>Desktop Background</h2>
+ <p><img src="monitor.png" width="525" height="398" alt="Screensavers"></p>
+ <p>Select your screen resolution:<a href="nodejs-1024x768.png"><br>
+ <span class="desktops">1024 x 768</span></a><span class="desktops"> | <a href="nodejs-1280x1024.png">1280 x 1024</a> | <a href="nodejs-1440x900.png">1440 x 900</a> | <a href="nodejs-1920x1200.png">1920 x 1200</a> | <a href="nodejs-2560x1440.png">2560 x 1440</a></span></p>
- <div style="float: right;"></div>
+ <p><a href="/">Go back to the home page</a></p>
+ </div>
+ <div id="column2" class="interior">
+ </div>
+</div>
+ <div id="footer">
+ <p>Copyright <a href="http://joyent.com">Joyent, Inc</a>., Node.js is a <a href="trademark-policy.pdf">trademark of Joyent, Inc</a>., <a href="https://raw.github.com/joyent/node/v0.6.6/LICENSE">View License</a></p>
+ </div>
- <a href="http://no.de/"><img src="../sponsored.png" height="58" width="120"></a>
- <div style="clear: both; font-size: 8pt">
- Copyright 2010 Joyent, Inc
- <br>
- Node.js is a trademark of Joyent, Inc.
- See the <a href="http://nodejs.org/trademark-policy.pdf">trademark policy</a>
- for more information.
- </div>
<script type="text/javascript">
var gaJsHost = (("https:" == document.location.protocol) ?
"https://ssl." : "http://www.");
document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));
- </script><script src="../ga.js" type="text/javascript"></script>
+ </script>
<script type="text/javascript">
try {
var pageTracker = _gat._getTracker("UA-10874194-2");
pageTracker._trackPageview();
- } catch(err) {}</script>
- <script type="text/javascript">highlight(undefined, undefined, 'pre');</script>
-
+ } catch(err) {}
+ </script>
+
</body></html>
diff --git a/doc/microsoft-logo.png b/doc/microsoft-logo.png
new file mode 100644
index 0000000000..6dac0f39b6
--- /dev/null
+++ b/doc/microsoft-logo.png
Binary files differ
diff --git a/doc/pipe.css b/doc/pipe.css
index 4f576e7aea..b1ed7584a1 100644
--- a/doc/pipe.css
+++ b/doc/pipe.css
@@ -3,80 +3,313 @@ html {
}
body {
- background: #353129;
+ background: #46483e;
color: #eee;
- font-size: 14pt;
- line-height: 150%;
- font-family: Georgia, "Times New Roman", Times, serif;
- max-width: 30em;
- margin: 0 0 5em 9em;
+ font-size: 12px;
+ line-height: 180%;
+ font-family: "Lucida Grande", "Lucida Sans Unicode", "Lucida Sans", Verdana, Tahoma, sans-serif;
+ margin: 0;
+ padding-top: 40px;
+ border-top: 6px #8cc84b solid;
}
+
img {
border: 0;
}
-#toc {
- position: absolute;
- top: 2em;
- left: 0;
- width: 10em;
- font-family: Helvetica, Arial, sans-serif;
- font-size: 12pt;
- line-height: 150%;
-}
@media all and (min-height: 650px) { #toc { position: fixed; }}
#toctitle {
display: none;
}
-#toc ol {
- list-style: none;
-}
-#toc ol, .toclevel2 {
- margin: 0;
- padding: 0;
- padding-left: 1em;
-}
-#toc ol li {
- margin: 0;
- padding: 0;
-}
-#toc a {
- color: #8BC84B;
-}
-
h1, h2, h3, h4 {
- color: #CCD2BC;
+ color: #d2d8ba;
font-family: Helvetica, Arial, sans-serif;
margin-top: 2em;
margin-right: 0;
margin-bottom: 10px;
margin-left: 0;
+ text-transform: uppercase;
+}
+
+h2 {
+ font-size: 12px;
+ font-weight: normal;
+}
+
+h1 code, h2 code, h3 code, h4 code,
+h1 a, h2 a, h3 a, h4 a
+{
+ color: inherit;
+ font-size: inherit;
+}
+
+#intro {
+ width: 775px;
+ margin: 0 auto;
+ text-align: center;
+ color: #d2d8ba;
+
+ /* preload platform-icons.png */
+ background-image: url(platform-icons.png);
+ background-repeat: no-repeat;
+ background-position: -1000px -1000px;
+}
+
+#intro p {
+ width: 680px;
+ line-height: 180%;
+ padding-top: 30px;
+ margin: 0 auto 30px auto;
+ font-size: 14px;
+}
+
+#intro #downloadbutton {
+ background-color: #8BC84B;
+ color: #46483e;
+ font-weight: bold;
+ font-size: 14px;
+ text-transform: uppercase;
+ padding: 7px 10px;
+ -webkit-border-radius: 4px;
+ -moz-border-radius: 4px;
+ border-radius: 4px;
+}
+
+
+#intro #downloadbutton:hover {
+ text-decoration: none;
+ background-color: #73a53e;
+}
+
+#quotes {
+ text-align: center;
+ width: 100%;
+ background-color: #33342d;
+ margin-top: 40px;
+ padding-top: 20px;
+ padding-bottom: 20px;
+}
+
+#quotes h2 {
+ margin-top: 0;
+}
+
+#quotes ul {
+ display: block;
+ width: 775px;
+ margin: 0 auto;
+ padding-top: 20px;
+}
+
+#quotes ul li {
+ display: block;
+ text-align: left;
+ width: 180px;
+ float: left;
+ padding-right: 15px;
+ font-size: 11px;
+}
+
+#quotes ul li.ebay {
+ margin-top: -10px;
+}
+
+#quotes ul li.linkedin {
+ margin-top: -4px;
+}
+
+#quotes ul li.yahoo {
+ margin-top: -4px;
+ padding-right: 0;
+}
+
+#quotes ul li p span {
+ font-size: 10px;
+}
+
+#content {
+ width: 775px;
+ margin: 0 auto;
+}
+
+#content #column1 {
+ width: 420px;
+ float: left;
+}
+
+#content #column2 {
+ width: 260px;
+ float: right;
+}
+
+#content #column1.interior {
+ width: 510px;
+ float: right;
}
-#toc ol ol {
- font-size: 8pt;
- line-height: 110%;
- list-style: circle;
+#content #column2.interior {
}
-h1 code, h2 code, h3 code, h4 code,
-h1 a, h2 a, h3 a, h4 a
-{
- color: inherit;
- font-size: inherit;
+#explore {
+ background: url(icons.png) no-repeat left 15px;
+}
+
+#explore li {
+ list-style-type: none;
+ color: #d2d8ba;
+ line-height: 14px;
+ padding: 10px 0 10px 40px;
+ border-top: 1px solid #626557;
+}
+
+#explore li span {
+}
+
+#explore li a.explore {
+ text-transform: uppercase;
+}
+
+#explore ol.jobs {
+ padding: 0;
+}
+
+#explore ol.jobs li {
+ display: inline;
+ padding: 0;
+ border: none;
+}
+
+#explore ol.jobs li:after {
+ content: ', ';
+}
+
+#explore ol.jobs li:last-child:after {
+ content: '';
+}
+
+#footer {
+ width: 775px;
+ border-top: 1px solid #626557;
+ margin: 50px auto 30px auto;
+ padding-top: 15px;
+}
+
+#footer p {
+ color: #8BC84B;
+ height: 32px;
+ padding-top: 3px;
+ background: url(footer-logo.png) left top no-repeat;
+ padding-left: 130px;
+}
+
+#footer p a {
+ text-decoration: underline;
+}
+
+div#download {
+ position: absolute;
+ width: 580px;
+ text-align: center;
+ top: 0;
+ left: 50%;
+ margin-left: -290px;
+ -webkit-border-bottom-right-radius: 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -moz-border-radius-bottomright: 4px;
+ -moz-border-radius-bottomleft: 4px;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+ padding-top: 40px;
+ -webkit-box-shadow: 0 0 32px #000;
+ -moz-box-shadow: 0 0 32px #000;
+ box-shadow: 0 0 32px #000;
+ background:white;
+ display: none;
+}
+
+div#download:target {
+ display: block;
+}
+
+#download-close {
+ background: url(close-downloads.png) no-repeat top right;
+ width: 64px;
+ height: 64px;
+ position: absolute;
+ display: block;
+ top:0;
+ right:0;
+ text-indent:-999em;
+}
+
+div#download ul#installers {
+ width: 550px;
+ text-align: center;
+ margin: 0 auto;
+ background: url(platform-icons.png) no-repeat top center;
+ padding-top: 65px;
+ padding-bottom: 50px;
+}
+
+div#download ul#installers li {
+ list-style-type: none;
+ width: 165px;
+ padding-left: 18px;
+ float: left;
+ display: block;
+ color: #33342d;
+ font-size: 10px;
+}
+
+div#download ul#installers li#source {
+ padding-left: 0;
+}
+
+div#download ul#installers li a {
+ font-size: 16px;
+ padding-top: 50px;
+ margin-top: -50px;
+}
+
+div#download ul#documentation {
+ background-color: #d4d7c3;
+ padding: 20px 0 20px 40px;
+ -webkit-border-bottom-right-radius: 4px;
+ -webkit-border-bottom-left-radius: 4px;
+ -moz-border-radius-bottomright: 4px;
+ -moz-border-radius-bottomleft: 4px;
+ border-bottom-right-radius: 4px;
+ border-bottom-left-radius: 4px;
+}
+
+div#download ul#documentation li {
+ margin-left: 40px;
+ text-align: left;
+ color: #33342d;
+ font-size: 14px;
+ font-weight: bold;
+ padding-bottom: 5px;
+}
+
+div#download ul#documentation li a {
+ color: #76a83f;
+}
+
+#download-logo {
+ margin-bottom: 37px;
}
pre, code {
font-family: Monaco, 'Andale Mono', 'Lucida Console', 'Bitstream Vera Sans Mono', 'Courier New', monospace, serif;
- ;
- font-size: 11pt;
- color: #C3CC88;
+ font-size: 12px;
+ color: #d2d8ba;
}
pre {
padding-left: 1em;
+ margin-left: -1em;
border-left-width: 1px;
border-left-style: solid;
- border-left-color: #8BC84B;
+ border-left-color: #626557;
}
dd {
@@ -95,9 +328,20 @@ a:hover { text-decoration: underline; }
padding: 0.2em 0;
}
.desktops {
- font-size: 14px;
+ font-size: 12px;
}
.release {
margin: 0 0 0 2em;
}
+
+/* simpler clearfix */
+.clearfix {
+ /* be an independent layout island */
+ overflow:hidden;
+ /* but don't actually cut anything off */
+ height:auto;
+ /* trigger hasLayout in IE */
+ zoom:1;
+ /* fin. */
+}
diff --git a/doc/platform-icons.png b/doc/platform-icons.png
new file mode 100644
index 0000000000..d6624a5a64
--- /dev/null
+++ b/doc/platform-icons.png
Binary files differ
diff --git a/doc/ryan-speaker.jpg b/doc/ryan-speaker.jpg
new file mode 100644
index 0000000000..c0f6263441
--- /dev/null
+++ b/doc/ryan-speaker.jpg
Binary files differ
diff --git a/doc/sh_vim-dark.css b/doc/sh_vim-dark.css
index 34a526c533..59b3021572 100644
--- a/doc/sh_vim-dark.css
+++ b/doc/sh_vim-dark.css
@@ -15,7 +15,7 @@
.sh_sourceCode .sh_string, .sh_sourceCode .sh_regexp, .sh_sourceCode .sh_number,
.sh_sourceCode .sh_specialchar
{
- color: #B9CCC5;
+ color: #a0c874;
}
.sh_sourceCode .sh_comment {
diff --git a/doc/template.html b/doc/template.html
index 377cae8b3c..60826dcab2 100644
--- a/doc/template.html
+++ b/doc/template.html
@@ -1,20 +1,20 @@
<!DOCTYPE html>
<html>
<head>
- <meta charset="UTF-8" />
- <title>{{section}}Node.js v0.6.5 Manual &amp; Documentation</title>
- <link rel="stylesheet" href="assets/style.css" />
- <link rel="stylesheet" href="assets/sh.css" />
- <link rel="canonical" href="http://nodejs.org/docs/latest/api/{{filename}}.html"/>
+ <meta charset="UTF-8">
+ <title>{{section}}Node.js v0.6.6 Manual &amp; Documentation</title>
+ <link rel="stylesheet" href="assets/style.css">
+ <link rel="stylesheet" href="assets/sh.css">
+ <link rel="canonical" href="http://nodejs.org/docs/latest/api/{{filename}}.html">
</head>
<body>
<div id="container">
<header>
- <h1>Node.js v0.6.5 Manual &amp; Documentation</h1>
+ <h1>Node.js v0.6.6 Manual &amp; Documentation</h1>
<div id="gtoc">
<p><a href="index.html">Index</a> | <a href="all.html">View on single page</a></p>
</div>
- <hr />
+ <hr>
</header>
{{content}}
</div>
diff --git a/doc/thin-white-stripe.bmp b/doc/thin-white-stripe.bmp
new file mode 100644
index 0000000000..8130a843c4
--- /dev/null
+++ b/doc/thin-white-stripe.bmp
Binary files differ
diff --git a/doc/windows_banner_nodejs_installer_logo.jpg b/doc/windows_banner_nodejs_installer_logo.jpg
deleted file mode 100644
index 2dfb59a647..0000000000
--- a/doc/windows_banner_nodejs_installer_logo.jpg
+++ /dev/null
Binary files differ
diff --git a/doc/windows_dialog_nodejs_installer_logo.jpg b/doc/windows_dialog_nodejs_installer_logo.jpg
deleted file mode 100644
index 716791d647..0000000000
--- a/doc/windows_dialog_nodejs_installer_logo.jpg
+++ /dev/null
Binary files differ
diff --git a/doc/yahoo-logo.png b/doc/yahoo-logo.png
new file mode 100644
index 0000000000..05d75b3513
--- /dev/null
+++ b/doc/yahoo-logo.png
Binary files differ
diff --git a/lib/child_process.js b/lib/child_process.js
index dcff85ab3e..a34313f61e 100644
--- a/lib/child_process.js
+++ b/lib/child_process.js
@@ -25,7 +25,6 @@ var Process = process.binding('process_wrap').Process;
var inherits = require('util').inherits;
var constants; // if (!constants) constants = process.binding('constants');
-var LF = '\n'.charCodeAt(0);
var Pipe;
@@ -76,8 +75,8 @@ function setupChannel(target, channel) {
if (isWindows) {
var setSimultaneousAccepts = function(handle) {
- var simultaneousAccepts = (process.env.NODE_MANY_ACCEPTS
- && process.env.NODE_MANY_ACCEPTS != '0') ? true : false;
+ var simultaneousAccepts = (process.env.NODE_MANY_ACCEPTS &&
+ process.env.NODE_MANY_ACCEPTS != '0') ? true : false;
if (handle._simultaneousAccepts != simultaneousAccepts) {
handle.setSimultaneousAccepts(simultaneousAccepts);
@@ -101,7 +100,7 @@ function setupChannel(target, channel) {
var message = JSON.parse(json);
target.emit('message', message, recvHandle);
- start = i+1;
+ start = i + 1;
}
jsonBuffer = jsonBuffer.slice(start);
@@ -112,7 +111,7 @@ function setupChannel(target, channel) {
};
target.send = function(message, sendHandle) {
- if (!target._channel) throw new Error("channel closed");
+ if (!target._channel) throw new Error('channel closed');
// For overflow protection don't write if channel queue is too deep.
if (channel.writeQueueSize > 1024 * 1024) {
@@ -129,7 +128,7 @@ function setupChannel(target, channel) {
var writeReq = channel.write(buffer, 0, buffer.length, sendHandle);
if (!writeReq) {
- throw new Error(errno + " cannot write to IPC channel.");
+ throw new Error(errno + 'cannot write to IPC channel.');
}
writeReq.oncomplete = nop;
@@ -151,16 +150,16 @@ exports.fork = function(modulePath, args, options) {
args.unshift(modulePath);
if (options.stdinStream) {
- throw new Error("stdinStream not allowed for fork()");
+ throw new Error('stdinStream not allowed for fork()');
}
if (options.customFds) {
- throw new Error("customFds not allowed for fork()");
+ throw new Error('customFds not allowed for fork()');
}
// Leave stdin open for the IPC channel. stdout and stderr should be the
// same as the parent's.
- options.customFds = [ -1, 1, 2 ];
+ options.customFds = [-1, 1, 2];
// Just need to set this - child process won't actually use the fd.
// For backwards compat - this can be changed to 'NODE_CHANNEL' before v0.6.
@@ -331,7 +330,6 @@ var spawn = exports.spawn = function(file, args, options) {
var env = (options ? options.env : null) || process.env;
var envPairs = [];
- var keys = Object.keys(env);
for (var key in env) {
envPairs.push(key + '=' + env[key]);
}
diff --git a/lib/cluster.js b/lib/cluster.js
index cc2f98cd5b..6c7d2dfa83 100644
--- a/lib/cluster.js
+++ b/lib/cluster.js
@@ -81,11 +81,11 @@ function startMaster() {
// Quickly try to kill all the workers.
// TODO: be session leader - will cause auto SIGHUP to the children.
eachWorker(function(worker) {
- debug("kill worker " + worker.pid);
+ debug('kill worker ' + worker.pid);
worker.kill();
- })
+ });
- console.error("Exception in cluster master process: " +
+ console.error('Exception in cluster master process: ' +
e.message + '\n' + e.stack);
process.exit(1);
});
@@ -96,21 +96,21 @@ function handleWorkerMessage(worker, message) {
// This can only be called from the master.
assert(cluster.isMaster);
- debug("recv " + JSON.stringify(message));
+ debug('recv ' + JSON.stringify(message));
switch (message.cmd) {
case 'online':
- debug("Worker " + worker.pid + " online");
+ debug('Worker ' + worker.pid + ' online');
worker.online = true;
break;
case 'queryServer':
- var key = message.address + ":" +
- message.port + ":" +
+ var key = message.address + ':' +
+ message.port + ':' +
message.addressType;
var response = { _queryId: message._queryId };
- if (key in servers == false) {
+ if (!(key in servers)) {
// Create a new server.
debug('create new server ' + key);
servers[key] = net._createServerHandle(message.address,
@@ -136,7 +136,7 @@ function eachWorker(cb) {
cb(workers[id]);
}
}
-};
+}
cluster.fork = function() {
@@ -176,19 +176,19 @@ cluster.fork = function() {
// Internal function. Called from src/node.js when worker process starts.
cluster._startWorker = function() {
assert(cluster.isWorker);
- workerId = parseInt(process.env.NODE_WORKER_ID);
+ workerId = parseInt(process.env.NODE_WORKER_ID, 10);
queryMaster({ cmd: 'online' });
// Make callbacks from queryMaster()
process.on('message', function(msg, handle) {
- debug("recv " + JSON.stringify(msg));
+ debug('recv ' + JSON.stringify(msg));
if (msg._queryId && msg._queryId in queryCallbacks) {
var cb = queryCallbacks[msg._queryId];
if (typeof cb == 'function') {
cb(msg, handle);
}
- delete queryCallbacks[msg._queryId]
+ delete queryCallbacks[msg._queryId];
}
});
};
@@ -219,7 +219,7 @@ cluster._getServer = function(address, port, addressType, cb) {
assert(cluster.isWorker);
queryMaster({
- cmd: "queryServer",
+ cmd: 'queryServer',
address: address,
port: port,
addressType: addressType
diff --git a/lib/fs.js b/lib/fs.js
index e9efece32b..7b61c8984c 100644
--- a/lib/fs.js
+++ b/lib/fs.js
@@ -422,17 +422,17 @@ fs.readlinkSync = function(path) {
return binding.readlink(pathModule._makeLong(path));
};
-fs.symlink = function(destination, path, mode_, callback) {
- var mode = (typeof(mode_) == 'string' ? mode_ : null);
+fs.symlink = function(destination, path, type_, callback) {
+ var type = (typeof(type_) == 'string' ? type_ : null);
var callback_ = arguments[arguments.length - 1];
callback = (typeof(callback_) == 'function' ? callback_ : null);
binding.symlink(pathModule._makeLong(destination),
- pathModule._makeLong(path), mode, callback);
+ pathModule._makeLong(path), type, callback);
};
-fs.symlinkSync = function(destination, path, mode) {
+fs.symlinkSync = function(destination, path, type) {
return binding.symlink(pathModule._makeLong(destination),
- pathModule._makeLong(path), mode);
+ pathModule._makeLong(path), type);
};
fs.link = function(srcpath, dstpath, callback) {
@@ -1092,7 +1092,7 @@ ReadStream.prototype._read = function() {
// thread pool another read() finishes up the pool, and allocates a new
// one.
var thisPool = pool;
- var toRead = Math.min(pool.length - pool.used, this.bufferSize);
+ var toRead = Math.min(pool.length - pool.used, ~~this.bufferSize);
var start = pool.used;
if (this.pos !== undefined) {
diff --git a/lib/net.js b/lib/net.js
index 19858e80df..e182173953 100644
--- a/lib/net.js
+++ b/lib/net.js
@@ -465,7 +465,11 @@ function afterWrite(status, handle, req, buffer) {
if (self.destroyed) {
return;
}
- // TODO check status.
+
+ if (status) {
+ self.destroy(errnoException(errno, 'write'));
+ return;
+ }
timers.active(this);
diff --git a/lib/os.js b/lib/os.js
index fa8ac01513..f226e3ecbf 100644
--- a/lib/os.js
+++ b/lib/os.js
@@ -37,12 +37,8 @@ exports.platform = function() {
return process.platform;
};
-var warnNetworkInterfaces = true;
exports.getNetworkInterfaces = function() {
- if (warnNetworkInterfaces) {
- console.error("os.getNetworkInterfaces() is deprecated - use os.networkInterfaces()");
- console.trace();
- warnNetworkInterfaces = false;
- }
+ require('util')._deprecationWarning('os',
+ 'os.getNetworkInterfaces() is deprecated - use os.networkInterfaces()');
return exports.networkInterfaces();
};
diff --git a/lib/sys.js b/lib/sys.js
index d53a3dd95e..0039b89d20 100644
--- a/lib/sys.js
+++ b/lib/sys.js
@@ -21,15 +21,8 @@
var util = require('util');
-var sysWarning;
-if (!sysWarning) {
- sysWarning = 'The "sys" module is now called "util". ' +
- 'It should have a similar interface.';
- if (process.env.NODE_DEBUG && process.env.NODE_DEBUG.indexOf('sys') != -1)
- console.trace(sysWarning);
- else
- console.error(sysWarning);
-}
+util._deprecationWarning('sys',
+ 'The "sys" module is now called "util". It should have a similar interface.');
exports.print = util.print;
exports.puts = util.puts;
diff --git a/lib/util.js b/lib/util.js
index b00da2de9d..cd4cc0e964 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -518,3 +518,19 @@ exports.inherits = function(ctor, superCtor) {
}
});
};
+
+var deprecationWarnings;
+
+exports._deprecationWarning = function(moduleId, message) {
+ if (!deprecationWarnings)
+ deprecationWarnings = {};
+ else if (message in deprecationWarnings)
+ return;
+
+ deprecationWarnings[message] = true;
+
+ if ((new RegExp('\\b' + moduleId + '\\b')).test(process.env.NODE_DEBUG))
+ console.trace(message);
+ else
+ console.error(message);
+};
diff --git a/src/fs_event_wrap.cc b/src/fs_event_wrap.cc
index a18a148a55..48cdabc00e 100644
--- a/src/fs_event_wrap.cc
+++ b/src/fs_event_wrap.cc
@@ -133,18 +133,30 @@ void FSEventWrap::OnEvent(uv_fs_event_t* handle, const char* filename,
assert(wrap->object_.IsEmpty() == false);
+ // We're in a bind here. libuv can set both UV_RENAME and UV_CHANGE but
+ // the Node API only lets us pass a single event to JS land.
+ //
+ // The obvious solution is to run the callback twice, once for each event.
+ // However, since the second event is not allowed to fire if the handle is
+ // closed after the first event, and since there is no good way to detect
+ // closed handles, that option is out.
+ //
+ // For now, ignore the UV_CHANGE event if UV_RENAME is also set. Make the
+ // assumption that a rename implicitly means an attribute change. Not too
+ // unreasonable, right? Still, we should revisit this before v1.0.
if (status) {
SetErrno(uv_last_error(uv_default_loop()));
eventStr = String::Empty();
- } else {
- switch (events) {
- case UV_RENAME:
- eventStr = String::New("rename");
- break;
- case UV_CHANGE:
- eventStr = String::New("change");
- break;
- }
+ }
+ else if (events & UV_RENAME) {
+ eventStr = String::New("rename");
+ }
+ else if (events & UV_CHANGE) {
+ eventStr = String::New("change");
+ }
+ else {
+ assert(0 && "bad fs events flag");
+ abort();
}
Local<Value> argv[3] = {
diff --git a/src/node_crypto.cc b/src/node_crypto.cc
index 83a66e3122..eb040ebc8c 100644
--- a/src/node_crypto.cc
+++ b/src/node_crypto.cc
@@ -1683,9 +1683,20 @@ static void HexEncode(unsigned char *md_value,
int* md_hex_len) {
*md_hex_len = (2*(md_len));
*md_hexdigest = new char[*md_hex_len + 1];
- for (int i = 0; i < md_len; i++) {
- snprintf((char *)(*md_hexdigest + (i*2)), 3, "%02x", md_value[i]);
+
+ char* buff = *md_hexdigest;
+ const int len = *md_hex_len;
+ for (int i = 0; i < len; i += 2) {
+ // nibble nibble
+ const int index = i / 2;
+ const char msb = (md_value[index] >> 4) & 0x0f;
+ const char lsb = md_value[index] & 0x0f;
+
+ buff[i] = (msb < 10) ? msb + '0' : (msb - 10) + 'a';
+ buff[i + 1] = (lsb < 10) ? lsb + '0' : (lsb - 10) + 'a';
}
+ // null terminator
+ buff[*md_hex_len] = '\0';
}
#define hex2i(c) ((c) <= '9' ? ((c) - '0') : (c) <= 'Z' ? ((c) - 'A' + 10) \
@@ -2092,54 +2103,49 @@ class Cipher : public ObjectWrap {
if (out_len==0) {
outString=String::New("");
} else {
- if (args.Length() <= 2 || !args[2]->IsString()) {
- // Binary
- outString = Encode(out, out_len, BINARY);
- } else {
- char* out_hexdigest;
- int out_hex_len;
- String::Utf8Value encoding(args[2]->ToString());
- if (strcasecmp(*encoding, "hex") == 0) {
- // Hex encoding
- HexEncode(out, out_len, &out_hexdigest, &out_hex_len);
- outString = Encode(out_hexdigest, out_hex_len, BINARY);
- delete [] out_hexdigest;
- } else if (strcasecmp(*encoding, "base64") == 0) {
- // Base64 encoding
- // Check to see if we need to add in previous base64 overhang
- if (cipher->incomplete_base64!=NULL){
- unsigned char* complete_base64 = new unsigned char[out_len+cipher->incomplete_base64_len+1];
- memcpy(complete_base64, cipher->incomplete_base64, cipher->incomplete_base64_len);
- memcpy(&complete_base64[cipher->incomplete_base64_len], out, out_len);
- delete [] out;
-
- delete [] cipher->incomplete_base64;
- cipher->incomplete_base64=NULL;
-
- out=complete_base64;
- out_len += cipher->incomplete_base64_len;
- }
+ char* out_hexdigest;
+ int out_hex_len;
+ enum encoding enc = ParseEncoding(args[2], BINARY);
+ if (enc == HEX) {
+ // Hex encoding
+ HexEncode(out, out_len, &out_hexdigest, &out_hex_len);
+ outString = Encode(out_hexdigest, out_hex_len, BINARY);
+ delete [] out_hexdigest;
+ } else if (enc == BASE64) {
+ // Base64 encoding
+ // Check to see if we need to add in previous base64 overhang
+ if (cipher->incomplete_base64!=NULL){
+ unsigned char* complete_base64 = new unsigned char[out_len+cipher->incomplete_base64_len+1];
+ memcpy(complete_base64, cipher->incomplete_base64, cipher->incomplete_base64_len);
+ memcpy(&complete_base64[cipher->incomplete_base64_len], out, out_len);
+ delete [] out;
- // Check to see if we need to trim base64 stream
- if (out_len%3!=0){
- cipher->incomplete_base64_len = out_len%3;
- cipher->incomplete_base64 = new char[cipher->incomplete_base64_len+1];
- memcpy(cipher->incomplete_base64,
- &out[out_len-cipher->incomplete_base64_len],
- cipher->incomplete_base64_len);
- out_len -= cipher->incomplete_base64_len;
- out[out_len]=0;
- }
+ delete [] cipher->incomplete_base64;
+ cipher->incomplete_base64=NULL;
- base64(out, out_len, &out_hexdigest, &out_hex_len);
- outString = Encode(out_hexdigest, out_hex_len, BINARY);
- delete [] out_hexdigest;
- } else if (strcasecmp(*encoding, "binary") == 0) {
- outString = Encode(out, out_len, BINARY);
- } else {
- fprintf(stderr, "node-crypto : Cipher .update encoding "
- "can be binary, hex or base64\n");
+ out=complete_base64;
+ out_len += cipher->incomplete_base64_len;
+ }
+
+ // Check to see if we need to trim base64 stream
+ if (out_len%3!=0){
+ cipher->incomplete_base64_len = out_len%3;
+ cipher->incomplete_base64 = new char[cipher->incomplete_base64_len+1];
+ memcpy(cipher->incomplete_base64,
+ &out[out_len-cipher->incomplete_base64_len],
+ cipher->incomplete_base64_len);
+ out_len -= cipher->incomplete_base64_len;
+ out[out_len]=0;
}
+
+ base64(out, out_len, &out_hexdigest, &out_hex_len);
+ outString = Encode(out_hexdigest, out_hex_len, BINARY);
+ delete [] out_hexdigest;
+ } else if (enc == BINARY) {
+ outString = Encode(out, out_len, BINARY);
+ } else {
+ fprintf(stderr, "node-crypto : Cipher .update encoding "
+ "can be binary, hex or base64\n");
}
}
@@ -2168,40 +2174,36 @@ class Cipher : public ObjectWrap {
return scope.Close(String::New(""));
}
- if (args.Length() == 0 || !args[0]->IsString()) {
- // Binary
+ enum encoding enc = ParseEncoding(args[0], BINARY);
+ if (enc == HEX) {
+ // Hex encoding
+ HexEncode(out_value, out_len, &out_hexdigest, &out_hex_len);
+ outString = Encode(out_hexdigest, out_hex_len, BINARY);
+ delete [] out_hexdigest;
+ } else if (enc == BASE64) {
+ // Check to see if we need to add in previous base64 overhang
+ if (cipher->incomplete_base64!=NULL){
+ unsigned char* complete_base64 = new unsigned char[out_len+cipher->incomplete_base64_len+1];
+ memcpy(complete_base64, cipher->incomplete_base64, cipher->incomplete_base64_len);
+ memcpy(&complete_base64[cipher->incomplete_base64_len], out_value, out_len);
+ delete [] out_value;
+
+ delete [] cipher->incomplete_base64;
+ cipher->incomplete_base64=NULL;
+
+ out_value=complete_base64;
+ out_len += cipher->incomplete_base64_len;
+ }
+ base64(out_value, out_len, &out_hexdigest, &out_hex_len);
+ outString = Encode(out_hexdigest, out_hex_len, BINARY);
+ delete [] out_hexdigest;
+ } else if (enc == BINARY) {
outString = Encode(out_value, out_len, BINARY);
} else {
- String::Utf8Value encoding(args[0]->ToString());
- if (strcasecmp(*encoding, "hex") == 0) {
- // Hex encoding
- HexEncode(out_value, out_len, &out_hexdigest, &out_hex_len);
- outString = Encode(out_hexdigest, out_hex_len, BINARY);
- delete [] out_hexdigest;
- } else if (strcasecmp(*encoding, "base64") == 0) {
- // Check to see if we need to add in previous base64 overhang
- if (cipher->incomplete_base64!=NULL){
- unsigned char* complete_base64 = new unsigned char[out_len+cipher->incomplete_base64_len+1];
- memcpy(complete_base64, cipher->incomplete_base64, cipher->incomplete_base64_len);
- memcpy(&complete_base64[cipher->incomplete_base64_len], out_value, out_len);
- delete [] out_value;
-
- delete [] cipher->incomplete_base64;
- cipher->incomplete_base64=NULL;
-
- out_value=complete_base64;
- out_len += cipher->incomplete_base64_len;
- }
- base64(out_value, out_len, &out_hexdigest, &out_hex_len);
- outString = Encode(out_hexdigest, out_hex_len, BINARY);
- delete [] out_hexdigest;
- } else if (strcasecmp(*encoding, "binary") == 0) {
- outString = Encode(out_value, out_len, BINARY);
- } else {
- fprintf(stderr, "node-crypto : Cipher .final encoding "
- "can be binary, hex or base64\n");
- }
+ fprintf(stderr, "node-crypto : Cipher .final encoding "
+ "can be binary, hex or base64\n");
}
+
delete [] out_value;
return scope.Close(outString);
}
@@ -2243,8 +2245,8 @@ class Decipher : public ObjectWrap {
NODE_SET_PROTOTYPE_METHOD(t, "init", DecipherInit);
NODE_SET_PROTOTYPE_METHOD(t, "initiv", DecipherInitIv);
NODE_SET_PROTOTYPE_METHOD(t, "update", DecipherUpdate);
- NODE_SET_PROTOTYPE_METHOD(t, "final", DecipherFinal);
- NODE_SET_PROTOTYPE_METHOD(t, "finaltol", DecipherFinalTolerate);
+ NODE_SET_PROTOTYPE_METHOD(t, "final", DecipherFinal<false>);
+ NODE_SET_PROTOTYPE_METHOD(t, "finaltol", DecipherFinal<true>);
target->Set(String::NewSymbol("Decipher"), t->GetFunction());
}
@@ -2314,7 +2316,12 @@ class Decipher : public ObjectWrap {
}
int DecipherUpdate(char* data, int len, unsigned char** out, int* out_len) {
- if (!initialised_) return 0;
+ if (!initialised_) {
+ *out_len = 0;
+ *out = NULL;
+ return 0;
+ }
+
*out_len=len+EVP_CIPHER_CTX_block_size(&ctx);
*out= new unsigned char[*out_len];
@@ -2323,10 +2330,16 @@ class Decipher : public ObjectWrap {
}
// coverity[alloc_arg]
- int DecipherFinal(unsigned char** out, int *out_len, bool tolerate_padding) {
- if (!initialised_) return 0;
+ template <bool TOLERATE_PADDING>
+ int DecipherFinal(unsigned char** out, int *out_len) {
+ if (!initialised_) {
+ *out_len = 0;
+ *out = NULL;
+ return 0;
+ }
+
*out = new unsigned char[EVP_CIPHER_CTX_block_size(&ctx)];
- if (tolerate_padding) {
+ if (TOLERATE_PADDING) {
local_EVP_DecryptFinal_ex(&ctx,*out,out_len);
} else {
EVP_CipherFinal_ex(&ctx,*out,out_len);
@@ -2469,56 +2482,52 @@ class Decipher : public ObjectWrap {
char* ciphertext;
int ciphertext_len;
- if (args.Length() <= 1 || !args[1]->IsString()) {
- // Binary - do nothing
- } else {
- String::Utf8Value encoding(args[1]->ToString());
- if (strcasecmp(*encoding, "hex") == 0) {
- // Hex encoding
- // Do we have a previous hex carry over?
- if (cipher->incomplete_hex_flag) {
- char* complete_hex = new char[len+2];
- memcpy(complete_hex, &cipher->incomplete_hex, 1);
- memcpy(complete_hex+1, buf, len);
- if (alloc_buf) {
- delete [] buf;
- alloc_buf = false;
- }
- buf = complete_hex;
- len += 1;
- }
- // Do we have an incomplete hex stream?
- if ((len>0) && (len % 2 !=0)) {
- len--;
- cipher->incomplete_hex=buf[len];
- cipher->incomplete_hex_flag=true;
- buf[len]=0;
- }
- HexDecode((unsigned char*)buf, len, (char **)&ciphertext, &ciphertext_len);
-
- if (alloc_buf) {
- delete [] buf;
- }
- buf = ciphertext;
- len = ciphertext_len;
- alloc_buf = true;
-
- } else if (strcasecmp(*encoding, "base64") == 0) {
- unbase64((unsigned char*)buf, len, (char **)&ciphertext, &ciphertext_len);
+ enum encoding enc = ParseEncoding(args[1], BINARY);
+ if (enc == HEX) {
+ // Hex encoding
+ // Do we have a previous hex carry over?
+ if (cipher->incomplete_hex_flag) {
+ char* complete_hex = new char[len+2];
+ memcpy(complete_hex, &cipher->incomplete_hex, 1);
+ memcpy(complete_hex+1, buf, len);
if (alloc_buf) {
delete [] buf;
+ alloc_buf = false;
}
- buf = ciphertext;
- len = ciphertext_len;
- alloc_buf = true;
+ buf = complete_hex;
+ len += 1;
+ }
+ // Do we have an incomplete hex stream?
+ if ((len>0) && (len % 2 !=0)) {
+ len--;
+ cipher->incomplete_hex=buf[len];
+ cipher->incomplete_hex_flag=true;
+ buf[len]=0;
+ }
+ HexDecode((unsigned char*)buf, len, (char **)&ciphertext, &ciphertext_len);
- } else if (strcasecmp(*encoding, "binary") == 0) {
- // Binary - do nothing
+ if (alloc_buf) {
+ delete [] buf;
+ }
+ buf = ciphertext;
+ len = ciphertext_len;
+ alloc_buf = true;
- } else {
- fprintf(stderr, "node-crypto : Decipher .update encoding "
- "can be binary, hex or base64\n");
+ } else if (enc == BASE64) {
+ unbase64((unsigned char*)buf, len, (char **)&ciphertext, &ciphertext_len);
+ if (alloc_buf) {
+ delete [] buf;
}
+ buf = ciphertext;
+ len = ciphertext_len;
+ alloc_buf = true;
+
+ } else if (enc == BINARY) {
+ // Binary - do nothing
+
+ } else {
+ fprintf(stderr, "node-crypto : Decipher .update encoding "
+ "can be binary, hex or base64\n");
}
unsigned char *out=0;
@@ -2534,10 +2543,8 @@ class Decipher : public ObjectWrap {
Local<Value> outString;
if (out_len==0) {
outString=String::New("");
- } else if (args.Length() <= 2 || !args[2]->IsString()) {
- outString = Encode(out, out_len, BINARY);
} else {
- enum encoding enc = ParseEncoding(args[2]);
+ enum encoding enc = ParseEncoding(args[2], BINARY);
if (enc == UTF8) {
// See if we have any overhang from last utf8 partial ending
if (cipher->incomplete_utf8!=NULL) {
@@ -2572,6 +2579,7 @@ class Decipher : public ObjectWrap {
}
+ template <bool TOLERATE_PADDING>
static Handle<Value> DecipherFinal(const Arguments& args) {
HandleScope scope;
@@ -2581,16 +2589,16 @@ class Decipher : public ObjectWrap {
int out_len = -1;
Local<Value> outString;
- int r = cipher->DecipherFinal(&out_value, &out_len, false);
+ int r = cipher->DecipherFinal<TOLERATE_PADDING>(&out_value, &out_len);
assert(out_value != NULL);
assert(out_len != -1);
if (out_len == 0 || r == 0) {
+ delete[] out_value;
return scope.Close(String::New(""));
}
-
if (args.Length() == 0 || !args[0]->IsString()) {
outString = Encode(out_value, out_len, BINARY);
} else {
@@ -2618,51 +2626,6 @@ class Decipher : public ObjectWrap {
return scope.Close(outString);
}
- static Handle<Value> DecipherFinalTolerate(const Arguments& args) {
- Decipher *cipher = ObjectWrap::Unwrap<Decipher>(args.This());
-
- HandleScope scope;
-
- unsigned char* out_value;
- int out_len;
- Local<Value> outString ;
-
- out_value = NULL;
- int r = cipher->DecipherFinal(&out_value, &out_len, true);
-
- if (out_len == 0 || r == 0) {
- delete [] out_value;
- return scope.Close(String::New(""));
- }
-
-
- if (args.Length() == 0 || !args[0]->IsString()) {
- outString = Encode(out_value, out_len, BINARY);
- } else {
- enum encoding enc = ParseEncoding(args[0]);
- if (enc == UTF8) {
- // See if we have any overhang from last utf8 partial ending
- if (cipher->incomplete_utf8!=NULL) {
- char* complete_out = new char[cipher->incomplete_utf8_len + out_len];
- memcpy(complete_out, cipher->incomplete_utf8, cipher->incomplete_utf8_len);
- memcpy((char *)complete_out+cipher->incomplete_utf8_len, out_value, out_len);
-
- delete [] cipher->incomplete_utf8;
- cipher->incomplete_utf8 = NULL;
-
- outString = Encode(complete_out, cipher->incomplete_utf8_len+out_len, enc);
- delete [] complete_out;
- } else {
- outString = Encode(out_value, out_len, enc);
- }
- } else {
- outString = Encode(out_value, out_len, enc);
- }
- }
- delete [] out_value;
- return scope.Close(outString);
- }
-
Decipher () : ObjectWrap () {
initialised_ = false;
}
@@ -2845,26 +2808,21 @@ class Hmac : public ObjectWrap {
return scope.Close(String::New(""));
}
- if (args.Length() == 0 || !args[0]->IsString()) {
- // Binary
+ enum encoding enc = ParseEncoding(args[0], BINARY);
+ if (enc == HEX) {
+ // Hex encoding
+ HexEncode(md_value, md_len, &md_hexdigest, &md_hex_len);
+ outString = Encode(md_hexdigest, md_hex_len, BINARY);
+ delete [] md_hexdigest;
+ } else if (enc == BASE64) {
+ base64(md_value, md_len, &md_hexdigest, &md_hex_len);
+ outString = Encode(md_hexdigest, md_hex_len, BINARY);
+ delete [] md_hexdigest;
+ } else if (enc == BINARY) {
outString = Encode(md_value, md_len, BINARY);
} else {
- String::Utf8Value encoding(args[0]->ToString());
- if (strcasecmp(*encoding, "hex") == 0) {
- // Hex encoding
- HexEncode(md_value, md_len, &md_hexdigest, &md_hex_len);
- outString = Encode(md_hexdigest, md_hex_len, BINARY);
- delete [] md_hexdigest;
- } else if (strcasecmp(*encoding, "base64") == 0) {
- base64(md_value, md_len, &md_hexdigest, &md_hex_len);
- outString = Encode(md_hexdigest, md_hex_len, BINARY);
- delete [] md_hexdigest;
- } else if (strcasecmp(*encoding, "binary") == 0) {
- outString = Encode(md_value, md_len, BINARY);
- } else {
- fprintf(stderr, "node-crypto : Hmac .digest encoding "
- "can be binary, hex or base64\n");
- }
+ fprintf(stderr, "node-crypto : Hmac .digest encoding "
+ "can be binary, hex or base64\n");
}
delete [] md_value;
return scope.Close(outString);
@@ -3001,30 +2959,25 @@ class Hash : public ObjectWrap {
Local<Value> outString;
- if (args.Length() == 0 || !args[0]->IsString()) {
- // Binary
+ enum encoding enc = ParseEncoding(args[0], BINARY);
+ if (enc == HEX) {
+ // Hex encoding
+ char* md_hexdigest;
+ int md_hex_len;
+ HexEncode(md_value, md_len, &md_hexdigest, &md_hex_len);
+ outString = Encode(md_hexdigest, md_hex_len, BINARY);
+ delete [] md_hexdigest;
+ } else if (enc == BASE64) {
+ char* md_hexdigest;
+ int md_hex_len;
+ base64(md_value, md_len, &md_hexdigest, &md_hex_len);
+ outString = Encode(md_hexdigest, md_hex_len, BINARY);
+ delete [] md_hexdigest;
+ } else if (enc == BINARY) {
outString = Encode(md_value, md_len, BINARY);
} else {
- String::Utf8Value encoding(args[0]->ToString());
- if (strcasecmp(*encoding, "hex") == 0) {
- // Hex encoding
- char* md_hexdigest;
- int md_hex_len;
- HexEncode(md_value, md_len, &md_hexdigest, &md_hex_len);
- outString = Encode(md_hexdigest, md_hex_len, BINARY);
- delete [] md_hexdigest;
- } else if (strcasecmp(*encoding, "base64") == 0) {
- char* md_hexdigest;
- int md_hex_len;
- base64(md_value, md_len, &md_hexdigest, &md_hex_len);
- outString = Encode(md_hexdigest, md_hex_len, BINARY);
- delete [] md_hexdigest;
- } else if (strcasecmp(*encoding, "binary") == 0) {
- outString = Encode(md_value, md_len, BINARY);
- } else {
- fprintf(stderr, "node-crypto : Hash .digest encoding "
- "can be binary, hex or base64\n");
- }
+ fprintf(stderr, "node-crypto : Hash .digest encoding "
+ "can be binary, hex or base64\n");
}
return scope.Close(outString);
@@ -3212,27 +3165,22 @@ class Sign : public ObjectWrap {
return scope.Close(String::New(""));
}
- if (args.Length() == 1 || !args[1]->IsString()) {
- // Binary
+ enum encoding enc = ParseEncoding(args[1], BINARY);
+ if (enc == HEX) {
+ // Hex encoding
+ HexEncode(md_value, md_len, &md_hexdigest, &md_hex_len);
+ outString = Encode(md_hexdigest, md_hex_len, BINARY);
+ delete [] md_hexdigest;
+ } else if (enc == BASE64) {
+ base64(md_value, md_len, &md_hexdigest, &md_hex_len);
+ outString = Encode(md_hexdigest, md_hex_len, BINARY);
+ delete [] md_hexdigest;
+ } else if (enc == BINARY) {
outString = Encode(md_value, md_len, BINARY);
} else {
- String::Utf8Value encoding(args[1]->ToString());
- if (strcasecmp(*encoding, "hex") == 0) {
- // Hex encoding
- HexEncode(md_value, md_len, &md_hexdigest, &md_hex_len);
- outString = Encode(md_hexdigest, md_hex_len, BINARY);
- delete [] md_hexdigest;
- } else if (strcasecmp(*encoding, "base64") == 0) {
- base64(md_value, md_len, &md_hexdigest, &md_hex_len);
- outString = Encode(md_hexdigest, md_hex_len, BINARY);
- delete [] md_hexdigest;
- } else if (strcasecmp(*encoding, "binary") == 0) {
- outString = Encode(md_value, md_len, BINARY);
- } else {
- outString = String::New("");
- fprintf(stderr, "node-crypto : Sign .sign encoding "
- "can be binary, hex or base64\n");
- }
+ outString = String::New("");
+ fprintf(stderr, "node-crypto : Sign .sign encoding "
+ "can be binary, hex or base64\n");
}
delete [] md_value;
@@ -3468,27 +3416,22 @@ class Verify : public ObjectWrap {
int r=-1;
- if (args.Length() == 2 || !args[2]->IsString()) {
- // Binary
+ enum encoding enc = ParseEncoding(args[2], BINARY);
+ if (enc == HEX) {
+ // Hex encoding
+ HexDecode(hbuf, hlen, (char **)&dbuf, &dlen);
+ r = verify->VerifyFinal(kbuf, klen, dbuf, dlen);
+ delete [] dbuf;
+ } else if (enc == BASE64) {
+ // Base64 encoding
+ unbase64(hbuf, hlen, (char **)&dbuf, &dlen);
+ r = verify->VerifyFinal(kbuf, klen, dbuf, dlen);
+ delete [] dbuf;
+ } else if (enc == BINARY) {
r = verify->VerifyFinal(kbuf, klen, hbuf, hlen);
} else {
- String::Utf8Value encoding(args[2]->ToString());
- if (strcasecmp(*encoding, "hex") == 0) {
- // Hex encoding
- HexDecode(hbuf, hlen, (char **)&dbuf, &dlen);
- r = verify->VerifyFinal(kbuf, klen, dbuf, dlen);
- delete [] dbuf;
- } else if (strcasecmp(*encoding, "base64") == 0) {
- // Base64 encoding
- unbase64(hbuf, hlen, (char **)&dbuf, &dlen);
- r = verify->VerifyFinal(kbuf, klen, dbuf, dlen);
- delete [] dbuf;
- } else if (strcasecmp(*encoding, "binary") == 0) {
- r = verify->VerifyFinal(kbuf, klen, hbuf, hlen);
- } else {
- fprintf(stderr, "node-crypto : Verify .verify encoding "
- "can be binary, hex or base64\n");
- }
+ fprintf(stderr, "node-crypto : Verify .verify encoding "
+ "can be binary, hex or base64\n");
}
delete [] kbuf;
@@ -3565,8 +3508,7 @@ class DiffieHellman : public ObjectWrap {
if (args.Length() > 0) {
if (args[0]->IsInt32()) {
- diffieHellman->Init(args[0]->Int32Value());
- initialized = true;
+ initialized = diffieHellman->Init(args[0]->Int32Value());
} else {
if (args[0]->IsString()) {
char* buf;
@@ -3582,16 +3524,15 @@ class DiffieHellman : public ObjectWrap {
return ThrowException(Exception::Error(
String::New("Invalid argument")));
} else {
- diffieHellman->Init(reinterpret_cast<unsigned char*>(buf), len);
+ initialized = diffieHellman->Init(
+ reinterpret_cast<unsigned char*>(buf), len);
delete[] buf;
- initialized = true;
}
} else if (Buffer::HasInstance(args[0])) {
Local<Object> buffer = args[0]->ToObject();
- diffieHellman->Init(
+ initialized = diffieHellman->Init(
reinterpret_cast<unsigned char*>(Buffer::Data(buffer)),
Buffer::Length(buffer));
- initialized = true;
}
}
}
@@ -3964,23 +3905,23 @@ class DiffieHellman : public ObjectWrap {
return len;
}
- static int DecodeWithEncoding(Handle<Value> str, Handle<Value> enc,
+ static int DecodeWithEncoding(Handle<Value> str, Handle<Value> encoding_v,
char** buf) {
int len = DecodeBinary(str, buf);
if (len == -1) {
return len;
}
- String::Utf8Value encoding(enc->ToString());
+ enum encoding enc = ParseEncoding(encoding_v, (enum encoding) -1);
char* retbuf = 0;
int retlen;
- if (strcasecmp(*encoding, "hex") == 0) {
+ if (enc == HEX) {
HexDecode((unsigned char*)*buf, len, &retbuf, &retlen);
- } else if (strcasecmp(*encoding, "base64") == 0) {
+ } else if (enc == BASE64) {
unbase64((unsigned char*)*buf, len, &retbuf, &retlen);
- } else if (strcasecmp(*encoding, "binary") == 0) {
+ } else if (enc == BINARY) {
// Binary - do nothing
} else {
fprintf(stderr, "node-crypto : Diffie-Hellman parameter encoding "
@@ -3996,24 +3937,25 @@ class DiffieHellman : public ObjectWrap {
return len;
}
- static Local<Value> EncodeWithEncoding(Handle<Value> enc, char* buf,
+ static Local<Value> EncodeWithEncoding(Handle<Value> encoding_v, char* buf,
int len) {
HandleScope scope;
Local<Value> outString;
- String::Utf8Value encoding(enc->ToString());
+ enum encoding enc = ParseEncoding(encoding_v, (enum encoding) -1);
char* retbuf;
int retlen;
- if (strcasecmp(*encoding, "hex") == 0) {
+
+ if (enc == HEX) {
// Hex encoding
HexEncode(reinterpret_cast<unsigned char*>(buf), len, &retbuf, &retlen);
outString = Encode(retbuf, retlen, BINARY);
delete [] retbuf;
- } else if (strcasecmp(*encoding, "base64") == 0) {
+ } else if (enc == BASE64) {
base64(reinterpret_cast<unsigned char*>(buf), len, &retbuf, &retlen);
outString = Encode(retbuf, retlen, BINARY);
delete [] retbuf;
- } else if (strcasecmp(*encoding, "binary") == 0) {
+ } else if (enc == BINARY) {
outString = Encode(buf, len, BINARY);
} else {
fprintf(stderr, "node-crypto : Diffie-Hellman parameter encoding "
@@ -4090,43 +4032,79 @@ Handle<Value>
PBKDF2(const Arguments& args) {
HandleScope scope;
- if (args.Length() != 5)
- return ThrowException(Exception::TypeError(String::New("Bad parameter")));
+ const char* type_error = NULL;
+ char* pass = NULL;
+ char* salt = NULL;
+ char* key = NULL;
+ ssize_t passlen = -1;
+ ssize_t saltlen = -1;
+ ssize_t keylen = -1;
+ ssize_t pass_written = -1;
+ ssize_t salt_written = -1;
+ ssize_t iter = -1;
+ Local<Function> callback;
+ pbkdf2_req* request = NULL;
+ uv_work_t* req = NULL;
+
+ if (args.Length() != 5) {
+ type_error = "Bad parameter";
+ goto err;
+ }
ASSERT_IS_STRING_OR_BUFFER(args[0]);
- ssize_t passlen = DecodeBytes(args[0], BINARY);
- if (passlen < 0)
- return ThrowException(Exception::TypeError(String::New("Bad password")));
- char* pass = new char[passlen];
- ssize_t pass_written = DecodeWrite(pass, passlen, args[0], BINARY);
+ passlen = DecodeBytes(args[0], BINARY);
+ if (passlen < 0) {
+ type_error = "Bad password";
+ goto err;
+ }
+
+ pass = new char[passlen];
+ pass_written = DecodeWrite(pass, passlen, args[0], BINARY);
assert(pass_written == passlen);
ASSERT_IS_STRING_OR_BUFFER(args[1]);
- ssize_t saltlen = DecodeBytes(args[1], BINARY);
- if (saltlen < 0)
- return ThrowException(Exception::TypeError(String::New("Bad salt")));
- char* salt = new char[saltlen];
- ssize_t salt_written = DecodeWrite(salt, saltlen, args[1], BINARY);
+ saltlen = DecodeBytes(args[1], BINARY);
+ if (saltlen < 0) {
+ type_error = "Bad salt";
+ goto err;
+ }
+
+ salt = new char[saltlen];
+ salt_written = DecodeWrite(salt, saltlen, args[1], BINARY);
assert(salt_written == saltlen);
- if (!args[2]->IsNumber())
- return ThrowException(Exception::TypeError(String::New("Iterations not a number")));
- ssize_t iter = args[2]->Int32Value();
- if (iter < 0)
- return ThrowException(Exception::TypeError(String::New("Bad iterations")));
+ if (!args[2]->IsNumber()) {
+ type_error = "Iterations not a number";
+ goto err;
+ }
+
+ iter = args[2]->Int32Value();
+ if (iter < 0) {
+ type_error = "Bad iterations";
+ goto err;
+ }
+
+ if (!args[3]->IsNumber()) {
+ type_error = "Key length not a number";
+ goto err;
+ }
+
+ keylen = args[3]->Int32Value();
+ if (keylen < 0) {
+ type_error = "Bad key length";
+ goto err;
+ }
+
+ key = new char[keylen];
- if (!args[3]->IsNumber())
- return ThrowException(Exception::TypeError(String::New("Key length not a number")));
- ssize_t keylen = args[3]->Int32Value();
- if (keylen < 0)
- return ThrowException(Exception::TypeError(String::New("Bad key length")));
- char* key = new char[keylen];
+ if (!args[4]->IsFunction()) {
+ type_error = "Callback not a function";
+ goto err;
+ }
- if (!args[4]->IsFunction())
- return ThrowException(Exception::TypeError(String::New("Callback not a function")));
- Local<Function> callback = Local<Function>::Cast(args[4]);
+ callback = Local<Function>::Cast(args[4]);
- pbkdf2_req* request = new pbkdf2_req;
+ request = new pbkdf2_req;
request->err = 0;
request->pass = pass;
request->passlen = passlen;
@@ -4137,11 +4115,16 @@ PBKDF2(const Arguments& args) {
request->keylen = keylen;
request->callback = Persistent<Function>::New(callback);
- uv_work_t* req = new uv_work_t();
+ req = new uv_work_t();
req->data = request;
uv_queue_work(uv_default_loop(), req, EIO_PBKDF2, EIO_PBKDF2After);
-
return Undefined();
+
+err:
+ delete[] key;
+ delete[] salt;
+ delete[] pass;
+ return ThrowException(Exception::TypeError(String::New(type_error)));
}
diff --git a/src/node_file.cc b/src/node_file.cc
index 7c46f3dd78..4913b699c3 100644
--- a/src/node_file.cc
+++ b/src/node_file.cc
@@ -773,7 +773,7 @@ static Handle<Value> Read(const Arguments& args) {
len = args[3]->Int32Value();
if (off + len > buffer_length) {
return ThrowException(Exception::Error(
- String::New("Length is extends beyond buffer")));
+ String::New("Length extends beyond buffer")));
}
pos = GET_OFFSET(args[4]);
diff --git a/src/v8constants.h b/src/v8constants.h
new file mode 100644
index 0000000000..70c26a208f
--- /dev/null
+++ b/src/v8constants.h
@@ -0,0 +1,83 @@
+/*
+ * The following offsets are derived from the V8 3.6.6.14 source. A future
+ * version of this helper will automatically generate this file based on the
+ * debug metadata included in libv8. See v8ustack.d for details on how these
+ * values are used.
+ */
+
+#ifndef V8_CONSTANTS_H
+#define V8_CONSTANTS_H
+
+#if defined(__i386)
+
+/*
+ * Frame pointer offsets
+ */
+#define V8_OFF_FP_FUNC (-0x8)
+#define V8_OFF_FP_CONTEXT (-0x4)
+#define V8_OFF_FP_MARKER (-0x8)
+
+/*
+ * Heap class->field offsets
+ */
+#define V8_OFF_HEAP(off) ((off) - 1)
+
+#define V8_OFF_FUNC_SHARED V8_OFF_HEAP(0x14)
+#define V8_OFF_SHARED_NAME V8_OFF_HEAP(0x4)
+#define V8_OFF_SHARED_INFERRED V8_OFF_HEAP(0x24)
+#define V8_OFF_SHARED_SCRIPT V8_OFF_HEAP(0x1c)
+#define V8_OFF_SHARED_FUNTOK V8_OFF_HEAP(0x4c)
+#define V8_OFF_SCRIPT_NAME V8_OFF_HEAP(0x8)
+#define V8_OFF_SCRIPT_LENDS V8_OFF_HEAP(0x28)
+#define V8_OFF_STR_LENGTH V8_OFF_HEAP(0x4)
+#define V8_OFF_STR_CHARS V8_OFF_HEAP(0xc)
+#define V8_OFF_CONSSTR_CAR V8_OFF_HEAP(0xc)
+#define V8_OFF_CONSSTR_CDR V8_OFF_HEAP(0x10)
+#define V8_OFF_EXTSTR_RSRC V8_OFF_HEAP(0xc)
+#define V8_OFF_FA_SIZE V8_OFF_HEAP(0x4)
+#define V8_OFF_FA_DATA V8_OFF_HEAP(0x8)
+#define V8_OFF_HEAPOBJ_MAP V8_OFF_HEAP(0x0)
+#define V8_OFF_MAP_ATTRS V8_OFF_HEAP(0x8)
+
+#define NODE_OFF_EXTSTR_DATA 0x4
+
+/*
+ * Stack frame types
+ */
+#define V8_FT_ENTRY 0x1
+#define V8_FT_ENTRYCONSTRUCT 0x2
+#define V8_FT_EXIT 0x3
+#define V8_FT_JAVASCRIPT 0x4
+#define V8_FT_OPTIMIZED 0x5
+#define V8_FT_INTERNAL 0x6
+#define V8_FT_CONSTRUCT 0x7
+#define V8_FT_ADAPTOR 0x8
+
+/*
+ * Instance types
+ */
+#define V8_IT_FIXEDARRAY 0x9f
+
+/*
+ * Identification masks and tags
+ */
+#define V8_SmiTagMask 0x1
+#define V8_SmiTag 0x0
+#define V8_SmiValueShift V8_SmiTagMask
+
+#define V8_IsNotStringMask 0x80
+#define V8_StringTag 0x0
+
+#define V8_StringEncodingMask 0x4
+#define V8_AsciiStringTag 0x4
+
+#define V8_StringRepresentationMask 0x3
+#define V8_SeqStringTag 0x0
+#define V8_ConsStringTag 0x1
+#define V8_ExternalStringTag 0x2
+
+#else
+#error "only i386 is supported for DTrace ustack helper"
+#endif
+
+#endif /* V8_CONSTANTS_H */
diff --git a/src/v8ustack.d b/src/v8ustack.d
new file mode 100644
index 0000000000..d559523556
--- /dev/null
+++ b/src/v8ustack.d
@@ -0,0 +1,626 @@
+/*
+ * V8 DTrace ustack helper for annotating native stack traces with JavaScript
+ * function names. We start with a frame pointer (arg1) and emit a string
+ * describing the current function. We do this by chasing pointers to extract
+ * the function's name (if any) and the filename and line number where the
+ * function is defined.
+ *
+ * To use the helper, run node, then use the jstack() DTrace action to capture
+ * a JavaScript stacktrace. You may need to tune the dtrace_helper_actions_max
+ * kernel variable to 128.
+ */
+
+#include <v8constants.h>
+
+/*
+ * V8 represents small integers (SMI) using the upper 31 bits of a 32-bit
+ * value. To extract the actual integer value, we must shift it over.
+ */
+#define IS_SMI(value) ((value & V8_SmiTagMask) == V8_SmiTag)
+#define SMI_VALUE(value) ((int32_t)(value) >> V8_SmiValueShift)
+
+/*
+ * Determine the encoding and representation of a V8 string.
+ */
+#define V8_TYPE_STRING(type) (((type) & V8_IsNotStringMask) == V8_StringTag)
+
+#define V8_STRENC_ASCII(type) \
+ (((type) & V8_StringEncodingMask) == V8_AsciiStringTag)
+
+#define V8_STRREP_SEQ(type) \
+ (((type) & V8_StringRepresentationMask) == V8_SeqStringTag)
+#define V8_STRREP_CONS(type) \
+ (((type) & V8_StringRepresentationMask) == V8_ConsStringTag)
+#define V8_STRREP_EXT(type) \
+ (((type) & V8_StringRepresentationMask) == V8_ExternalStringTag)
+
+/*
+ * String type predicates
+ */
+#define ASCII_SEQSTR(value) \
+ (V8_TYPE_STRING(value) && V8_STRENC_ASCII(value) && V8_STRREP_SEQ(value))
+
+#define ASCII_CONSSTR(value) \
+ (V8_TYPE_STRING(value) && V8_STRENC_ASCII(value) && V8_STRREP_CONS(value))
+
+#define ASCII_EXTSTR(value) \
+ (V8_TYPE_STRING(value) && V8_STRENC_ASCII(value) && V8_STRREP_EXT(value))
+
+/*
+ * General helper macros
+ */
+#define COPYIN_UINT8(addr) (*(uint8_t *)copyin((addr), sizeof (uint8_t)))
+#define COPYIN_UINT32(addr) (*(uint32_t *)copyin((addr), sizeof (uint32_t)))
+
+#define APPEND_CHR(c) (this->buf[this->off++] = (c))
+
+#define APPEND_DGT(i, d) \
+ (((i) / (d)) ? APPEND_CHR('0' + ((i)/(d) % 10)) : 0)
+
+#define APPEND_NUM(i) \
+ APPEND_DGT((i), 10000); \
+ APPEND_DGT((i), 1000); \
+ APPEND_DGT((i), 100); \
+ APPEND_DGT((i), 10); \
+ APPEND_DGT((i), 1);
+
+/*
+ * The following macros are used to output ASCII SeqStrings, ConsStrings, and
+ * Node.js ExternalStrings. To represent each string, we use three fields:
+ *
+ * "str": a pointer to the string itself
+ *
+ * "len": the string length
+ *
+ * "attrs": the type identifier for the string, which indicates the
+ * encoding and representation. We're only interested in ASCII
+ * encoded strings whose representation is one of:
+ *
+ * SeqString stored directly as a char array inside the object
+ *
+ * ConsString pointer to two strings that should be concatenated
+ *
+ * ExternalString pointer to a char* outside the V8 heap
+ */
+
+/*
+ * Load "len" and "attrs" for the given "str".
+ */
+#define LOAD_STRFIELDS(str, len, attrs) \
+ len = SMI_VALUE(COPYIN_UINT32(str + V8_OFF_STR_LENGTH)); \
+ this->map = COPYIN_UINT32(str + V8_OFF_HEAPOBJ_MAP); \
+ attrs = COPYIN_UINT8(this->map + V8_OFF_MAP_ATTRS);
+
+/*
+ * Print out the given SeqString, or do nothing if the string is not an ASCII
+ * SeqString.
+ */
+#define APPEND_SEQSTR(str, len, attrs) \
+dtrace:helper:ustack: \
+/!this->done && len > 0 && ASCII_SEQSTR(attrs)/ \
+{ \
+ copyinto(str + V8_OFF_STR_CHARS, len, this->buf + this->off); \
+ this->off += len; \
+}
+
+/*
+ * Print out the given Node.js ExternalString, or do nothing if the string is
+ * not an ASCII ExternalString.
+ */
+#define APPEND_NODESTR(str, len, attrs) \
+dtrace:helper:ustack: \
+/!this->done && len > 0 && ASCII_EXTSTR(attrs)/ \
+{ \
+ this->resource = COPYIN_UINT32(str + V8_OFF_EXTSTR_RSRC); \
+ this->dataptr = COPYIN_UINT32(this->resource + NODE_OFF_EXTSTR_DATA); \
+ copyinto(this->dataptr, len, this->buf + this->off); \
+ this->off += len; \
+}
+
+/*
+ * Recall that each ConsString points to two other strings which are
+ * semantically concatenated. Of course, these strings may themselves by
+ * ConsStrings, but in D we can only expand this recursion to a finite level.
+ * Thankfully, function and script names are generally not more than a few
+ * levels deep, so we unroll the expansion up to three levels. Even this is
+ * pretty hairy: we use strings "s0", ..., "s13", (each with "str", "len", and
+ * "attr" fields -- see above) to store the expanded strings. We expand the
+ * original string into s0 and s7, then s0 into s1 and s4, etc:
+ *
+ *
+ * +---- str ----+
+ * / \ <-- 1st expansion
+ * / \
+ * s0 s7
+ * / \ / \
+ * / \ / \ <-- 2nd expansion
+ * / \ / \
+ * s1 s4 s8 s11
+ * / \ / \ / \ / \ <-- 3rd expansion
+ * s2 s3 s5 s6 s9 s10 s12 s13
+ *
+ * Of course, for a given string, any of these expansions may not be needed.
+ * For example, we may expand str and find that s0 is already a SeqString,
+ * while s7 requires further expansion. So when we expand a ConsString, we
+ * zero the length of the string itself, and then at the end we print out
+ * all non-zero-length strings in order (including both internal nodes and
+ * leafs in the tree above) to get the final output.
+ */
+#define EXPAND_START() \
+dtrace:helper:ustack: \
+/!this->done/ \
+{ \
+ this->s0str = this->s1str = this->s2str = 0; \
+ this->s3str = this->s4str = this->s5str = 0; \
+ this->s6str = this->s7str = this->s8str = 0; \
+ this->s9str = this->s10str = this->s11str = 0; \
+ this->s12str = this->s13str = 0; \
+ \
+ this->s0len = this->s1len = this->s2len = 0; \
+ this->s3len = this->s4len = this->s5len = 0; \
+ this->s6len = this->s7len = this->s8len = 0; \
+ this->s9len = this->s10len = this->s11len = 0; \
+ this->s12len = this->s13len = 0; \
+ \
+ this->s0attrs = this->s1attrs = this->s2attrs = 0; \
+ this->s3attrs = this->s4attrs = this->s5attrs = 0; \
+ this->s6attrs = this->s7attrs = this->s8attrs = 0; \
+ this->s9attrs = this->s10attrs = this->s11attrs = 0; \
+ this->s12attrs = this->s13attrs = 0; \
+}
+
+/*
+ * Expand the ConsString "str" (represensted by "str", "len", and "attrs") into
+ * strings "s1" (represented by "s1s", "s1l", and "s1a") and "s2" (represented
+ * by "s2s", "s2l", "s2a"). If "str" is not a ConsString, do nothing.
+ */
+#define EXPAND_STR(str, len, attrs, s1s, s1l, s1a, s2s, s2l, s2a) \
+dtrace:helper:ustack: \
+/!this->done && len > 0 && ASCII_CONSSTR(attrs)/ \
+{ \
+ len = 0; \
+ \
+ s1s = COPYIN_UINT32(str + V8_OFF_CONSSTR_CAR); \
+ LOAD_STRFIELDS(s1s, s1l, s1a) \
+ \
+ s2s = COPYIN_UINT32(str + V8_OFF_CONSSTR_CDR); \
+ LOAD_STRFIELDS(s2s, s2l, s2a) \
+}
+
+/*
+ * Print out a ConsString by expanding it up to three levels and printing out
+ * the resulting SeqStrings.
+ */
+#define APPEND_CONSSTR(str, len, attrs) \
+ EXPAND_START() \
+ EXPAND_STR(str, len, attrs, \
+ this->s0str, this->s0len, this->s0attrs, \
+ this->s7str, this->s7len, this->s7attrs) \
+ EXPAND_STR(this->s0str, this->s0len, this->s0attrs, \
+ this->s1str, this->s1len, this->s1attrs, \
+ this->s4str, this->s4len, this->s4attrs) \
+ EXPAND_STR(this->s1str, this->s1len, this->s1attrs, \
+ this->s2str, this->s2len, this->s2attrs, \
+ this->s3str, this->s3len, this->s3attrs) \
+ EXPAND_STR(this->s4str, this->s4len, this->s4attrs, \
+ this->s5str, this->s5len, this->s5attrs, \
+ this->s6str, this->s6len, this->s6attrs) \
+ EXPAND_STR(this->s7str, this->s7len, this->s7attrs, \
+ this->s8str, this->s8len, this->s8attrs, \
+ this->s11str, this->s11len, this->s11attrs) \
+ EXPAND_STR(this->s8str, this->s8len, this->s8attrs, \
+ this->s9str, this->s9len, this->s9attrs, \
+ this->s10str, this->s10len, this->s10attrs) \
+ EXPAND_STR(this->s11str, this->s11len, this->s11attrs, \
+ this->s12str, this->s12len, this->s12attrs, \
+ this->s13str, this->s13len, this->s13attrs) \
+ \
+ APPEND_SEQSTR(str, len, attrs) \
+ APPEND_SEQSTR(this->s0str, this->s0len, this->s0attrs) \
+ APPEND_SEQSTR(this->s1str, this->s1len, this->s1attrs) \
+ APPEND_SEQSTR(this->s2str, this->s2len, this->s2attrs) \
+ APPEND_SEQSTR(this->s3str, this->s3len, this->s3attrs) \
+ APPEND_SEQSTR(this->s4str, this->s4len, this->s4attrs) \
+ APPEND_SEQSTR(this->s5str, this->s5len, this->s5attrs) \
+ APPEND_SEQSTR(this->s6str, this->s6len, this->s6attrs) \
+ APPEND_SEQSTR(this->s7str, this->s7len, this->s7attrs) \
+ APPEND_SEQSTR(this->s8str, this->s8len, this->s8attrs) \
+ APPEND_SEQSTR(this->s9str, this->s9len, this->s9attrs) \
+ APPEND_SEQSTR(this->s10str, this->s10len, this->s10attrs) \
+ APPEND_SEQSTR(this->s11str, this->s11len, this->s11attrs) \
+ APPEND_SEQSTR(this->s12str, this->s12len, this->s12attrs) \
+ APPEND_SEQSTR(this->s13str, this->s13len, this->s13attrs) \
+
+
+/*
+ * Print out the given SeqString, ConsString, or ExternalString.
+ * APPEND_CONSSTR implicitly handles SeqStrings as the degenerate case of an
+ * expanded ConsString.
+ */
+#define APPEND_V8STR(str, len, attrs) \
+ APPEND_CONSSTR(str, len, attrs) \
+ APPEND_NODESTR(str, len, attrs)
+
+/*
+ * In this first clause we initialize all variables. We must explicitly clear
+ * them because they may contain values left over from previous iterations.
+ */
+dtrace:helper:ustack:
+{
+ /* input */
+ this->fp = arg1;
+
+ /* output/flow control */
+ this->buf = (char *)alloca(128);
+ this->off = 0;
+ this->done = 0;
+
+ /* program state */
+ this->ctx = 0;
+ this->marker = 0;
+ this->func = 0;
+ this->shared = 0;
+ this->map = 0;
+ this->funcnamestr = 0;
+ this->funcnamelen = 0;
+ this->funcnameattrs = 0;
+ this->script = 0;
+ this->scriptnamestr = 0;
+ this->scriptnamelen = 0;
+ this->scriptnameattrs = 0;
+ this->position = 0;
+ this->line_ends = 0;
+ this->le_attrs = 0;
+
+ /* binary search fields */
+ this->bsearch_min = 0;
+ this->bsearch_max = 0;
+ this->ii = 0;
+}
+
+/*
+ * Like V8, we first check if we've got an ArgumentsAdaptorFrame. We've got
+ * nothing to add for such frames, so we bail out quickly.
+ */
+dtrace:helper:ustack:
+{
+ this->ctx = COPYIN_UINT32(this->fp + V8_OFF_FP_CONTEXT);
+}
+
+dtrace:helper:ustack:
+/IS_SMI(this->ctx) && SMI_VALUE(this->ctx) == V8_FT_ADAPTOR/
+{
+ this->done = 1;
+ APPEND_CHR('<');
+ APPEND_CHR('<');
+ APPEND_CHR(' ');
+ APPEND_CHR('a');
+ APPEND_CHR('d');
+ APPEND_CHR('a');
+ APPEND_CHR('p');
+ APPEND_CHR('t');
+ APPEND_CHR('o');
+ APPEND_CHR('r');
+ APPEND_CHR(' ');
+ APPEND_CHR('>');
+ APPEND_CHR('>');
+ APPEND_CHR('\0');
+ stringof(this->buf);
+}
+
+/*
+ * Check for other common frame types for which we also have nothing to add.
+ */
+dtrace:helper:ustack:
+/!this->done/
+{
+ this->marker = COPYIN_UINT32(this->fp + V8_OFF_FP_MARKER);
+}
+
+dtrace:helper:ustack:
+/!this->done && IS_SMI(this->marker) &&
+ SMI_VALUE(this->marker) == V8_FT_ENTRY/
+{
+ this->done = 1;
+ APPEND_CHR('<');
+ APPEND_CHR('<');
+ APPEND_CHR(' ');
+ APPEND_CHR('e');
+ APPEND_CHR('n');
+ APPEND_CHR('t');
+ APPEND_CHR('r');
+ APPEND_CHR('y');
+ APPEND_CHR(' ');
+ APPEND_CHR('>');
+ APPEND_CHR('>');
+ APPEND_CHR('\0');
+ stringof(this->buf);
+}
+
+dtrace:helper:ustack:
+/!this->done && IS_SMI(this->marker) &&
+ SMI_VALUE(this->marker) == V8_FT_ENTRYCONSTRUCT/
+{
+ this->done = 1;
+ APPEND_CHR('<');
+ APPEND_CHR('<');
+ APPEND_CHR(' ');
+ APPEND_CHR('e');
+ APPEND_CHR('n');
+ APPEND_CHR('t');
+ APPEND_CHR('r');
+ APPEND_CHR('y');
+ APPEND_CHR('_');
+ APPEND_CHR('c');
+ APPEND_CHR('o');
+ APPEND_CHR('n');
+ APPEND_CHR('s');
+ APPEND_CHR('t');
+ APPEND_CHR('r');
+ APPEND_CHR('u');
+ APPEND_CHR('c');
+ APPEND_CHR('t');
+ APPEND_CHR(' ');
+ APPEND_CHR('>');
+ APPEND_CHR('>');
+ APPEND_CHR('\0');
+ stringof(this->buf);
+}
+
+dtrace:helper:ustack:
+/!this->done && IS_SMI(this->marker) &&
+ SMI_VALUE(this->marker) == V8_FT_EXIT/
+{
+ this->done = 1;
+ APPEND_CHR('<');
+ APPEND_CHR('<');
+ APPEND_CHR(' ');
+ APPEND_CHR('e');
+ APPEND_CHR('x');
+ APPEND_CHR('i');
+ APPEND_CHR('t');
+ APPEND_CHR(' ');
+ APPEND_CHR('>');
+ APPEND_CHR('>');
+ APPEND_CHR('\0');
+ stringof(this->buf);
+}
+
+dtrace:helper:ustack:
+/!this->done && IS_SMI(this->marker) &&
+ SMI_VALUE(this->marker) == V8_FT_INTERNAL/
+{
+ this->done = 1;
+ APPEND_CHR('<');
+ APPEND_CHR('<');
+ APPEND_CHR(' ');
+ APPEND_CHR('i');
+ APPEND_CHR('n');
+ APPEND_CHR('t');
+ APPEND_CHR('e');
+ APPEND_CHR('r');
+ APPEND_CHR('n');
+ APPEND_CHR('a');
+ APPEND_CHR('l');
+ APPEND_CHR(' ');
+ APPEND_CHR('>');
+ APPEND_CHR('>');
+ APPEND_CHR('\0');
+ stringof(this->buf);
+}
+
+dtrace:helper:ustack:
+/!this->done && IS_SMI(this->marker) &&
+ SMI_VALUE(this->marker) == V8_FT_CONSTRUCT/
+{
+ this->done = 1;
+ APPEND_CHR('<');
+ APPEND_CHR('<');
+ APPEND_CHR(' ');
+ APPEND_CHR('c');
+ APPEND_CHR('o');
+ APPEND_CHR('n');
+ APPEND_CHR('s');
+ APPEND_CHR('t');
+ APPEND_CHR('r');
+ APPEND_CHR('u');
+ APPEND_CHR('c');
+ APPEND_CHR('t');
+ APPEND_CHR('o');
+ APPEND_CHR('r');
+ APPEND_CHR(' ');
+ APPEND_CHR('>');
+ APPEND_CHR('>');
+ APPEND_CHR('\0');
+ stringof(this->buf);
+}
+
+/*
+ * At this point, we're either looking at a JavaScriptFrame or an
+ * OptimizedFrame. For now, we assume JavaScript and start by grabbing the
+ * function name.
+ */
+dtrace:helper:ustack:
+/!this->done/
+{
+ this->func = COPYIN_UINT32(this->fp + V8_OFF_FP_FUNC);
+ this->shared = COPYIN_UINT32(this->func + V8_OFF_FUNC_SHARED);
+ this->funcnamestr = COPYIN_UINT32(this->shared + V8_OFF_SHARED_NAME);
+ LOAD_STRFIELDS(this->funcnamestr, this->funcnamelen,
+ this->funcnameattrs);
+}
+
+dtrace:helper:ustack:
+/!this->done && this->funcnamelen == 0/
+{
+ /*
+ * This is an anonymous function, but if it was invoked as a method of
+ * some object then V8 will have computed an inferred name that we can
+ * include in the stack trace.
+ */
+ APPEND_CHR('(');
+ APPEND_CHR('a');
+ APPEND_CHR('n');
+ APPEND_CHR('o');
+ APPEND_CHR('n');
+ APPEND_CHR(')');
+ APPEND_CHR(' ');
+ APPEND_CHR('a');
+ APPEND_CHR('s');
+ APPEND_CHR(' ');
+
+ this->funcnamestr = COPYIN_UINT32(this->shared + V8_OFF_SHARED_INFERRED);
+ LOAD_STRFIELDS(this->funcnamestr, this->funcnamelen,
+ this->funcnameattrs);
+}
+
+dtrace:helper:ustack:
+/!this->done && this->funcnamelen == 0/
+{
+ APPEND_CHR('(');
+ APPEND_CHR('a');
+ APPEND_CHR('n');
+ APPEND_CHR('o');
+ APPEND_CHR('n');
+ APPEND_CHR(')');
+}
+
+APPEND_V8STR(this->funcnamestr, this->funcnamelen, this->funcnameattrs)
+
+/*
+ * Now look for the name of the script where the function was defined.
+ */
+dtrace:helper:ustack:
+/!this->done/
+{
+ this->script = COPYIN_UINT32(this->shared + V8_OFF_SHARED_SCRIPT);
+ this->scriptnamestr = COPYIN_UINT32(this->script +
+ V8_OFF_SCRIPT_NAME);
+ LOAD_STRFIELDS(this->scriptnamestr, this->scriptnamelen,
+ this->scriptnameattrs);
+
+ APPEND_CHR(' ');
+ APPEND_CHR('a');
+ APPEND_CHR('t');
+ APPEND_CHR(' ');
+}
+
+APPEND_V8STR(this->scriptnamestr, this->scriptnamelen, this->scriptnameattrs)
+
+/*
+ * Now look for file position and line number information.
+ */
+dtrace:helper:ustack:
+/!this->done/
+{
+ this->position = COPYIN_UINT32(this->shared + V8_OFF_SHARED_FUNTOK);
+ this->line_ends = COPYIN_UINT32(this->script + V8_OFF_SCRIPT_LENDS);
+ this->map = COPYIN_UINT32(this->line_ends + V8_OFF_HEAPOBJ_MAP);
+ this->le_attrs = COPYIN_UINT8(this->map + V8_OFF_MAP_ATTRS);
+}
+
+dtrace:helper:ustack:
+/!this->done && this->le_attrs != V8_IT_FIXEDARRAY/
+{
+ /*
+ * If the line number array was not a valid FixedArray, it's probably
+ * undefined because V8 has not had to compute it yet. In this case we
+ * just show the raw position and call it a day.
+ */
+ APPEND_CHR(' ');
+ APPEND_CHR('p');
+ APPEND_CHR('o');
+ APPEND_CHR('s');
+ APPEND_CHR('i');
+ APPEND_CHR('t');
+ APPEND_CHR('i');
+ APPEND_CHR('o');
+ APPEND_CHR('n');
+ APPEND_CHR(' ');
+ APPEND_NUM(this->position);
+ APPEND_CHR('\0');
+ this->done = 1;
+ stringof(this->buf);
+}
+
+/*
+ * At this point, we've got both a position in the script and an array
+ * describing where each line of the file ends. We can use this to compute the
+ * line number by binary searching the array. (This is also what V8 does when
+ * computing stack traces.)
+ */
+dtrace:helper:ustack:
+/!this->done/
+{
+ /* initialize binary search */
+ this->bsearch_line = this->position < COPYIN_UINT32(
+ this->line_ends + V8_OFF_FA_DATA) ? 1 : 0;
+ this->bsearch_min = 0;
+ this->bsearch_max = this->bsearch_line != 0 ? 0 :
+ SMI_VALUE(COPYIN_UINT32(this->line_ends + V8_OFF_FA_SIZE)) - 1;
+}
+
+/*
+ * Of course, we can't iterate the binary search indefinitely, so we hardcode 15
+ * iterations. That's enough to precisely identify the line number in files up
+ * to 32768 lines of code.
+ */
+#define BSEARCH_LOOP \
+dtrace:helper:ustack: \
+/!this->done && this->bsearch_max >= 1/ \
+{ \
+ this->ii = (this->bsearch_min + this->bsearch_max) >> 1; \
+} \
+ \
+dtrace:helper:ustack: \
+/!this->done && this->bsearch_max >= 1 && \
+ this->position > COPYIN_UINT32(this->line_ends + V8_OFF_FA_DATA + \
+ this->ii * sizeof (uint32_t))/ \
+{ \
+ this->bsearch_min = this->ii + 1; \
+} \
+ \
+dtrace:helper:ustack: \
+/!this->done && this->bsearch_max >= 1 && \
+ this->position <= COPYIN_UINT32(this->line_ends + V8_OFF_FA_DATA + \
+ (this->ii - 1) * sizeof (uint32_t))/ \
+{ \
+ this->bsearch_max = this->ii - 1; \
+}
+
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+BSEARCH_LOOP
+
+dtrace:helper:ustack:
+/!this->done && !this->bsearch_line/
+{
+ this->bsearch_line = this->ii + 1;
+}
+
+dtrace:helper:ustack:
+/!this->done/
+{
+ APPEND_CHR(' ');
+ APPEND_CHR('l');
+ APPEND_CHR('i');
+ APPEND_CHR('n');
+ APPEND_CHR('e');
+ APPEND_CHR(' ');
+ APPEND_NUM(this->bsearch_line);
+ APPEND_CHR('\0');
+ this->done = 1;
+ stringof(this->buf);
+}
diff --git a/test/simple/test-crypto.js b/test/simple/test-crypto.js
index 1469b11166..cbccc72dad 100644
--- a/test/simple/test-crypto.js
+++ b/test/simple/test-crypto.js
@@ -385,6 +385,14 @@ var secret3 = dh3.computeSecret(key2, 'hex', 'base64');
assert.equal(secret1, secret3);
+// https://github.com/joyent/node/issues/2338
+assert.throws(function() {
+ var p = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74' +
+ '020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437' +
+ '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' +
+ 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF';
+ crypto.createDiffieHellman(p, 'hex');
+});
// Test RSA key signing/verification
var rsaSign = crypto.createSign('RSA-SHA1');
@@ -474,3 +482,8 @@ crypto.pbkdf2('passwordPASSWORDpassword', 'saltSALTsaltSALTsaltSALTsaltSALTsalt'
crypto.pbkdf2('pass\0word', 'sa\0lt', 4096, 16, function(err, result) {
assert.equal(result, '\x56\xfa\x6a\xa7\x55\x48\x09\x9d\xcc\x37\xd7\xf0\x34\x25\xe0\xc3', 'pbkdf1 test vector 6');
});
+
+// Error path should not leak memory (check with valgrind).
+assert.throws(function() {
+ crypto.pbkdf2('password', 'salt', 1, 20, null);
+});
diff --git a/test/simple/test-fs-read-stream.js b/test/simple/test-fs-read-stream.js
index 63e9b1ae41..dbb5fbf847 100644
--- a/test/simple/test-fs-read-stream.js
+++ b/test/simple/test-fs-read-stream.js
@@ -133,6 +133,15 @@ file5.on('end', function() {
assert.equal(file5.data, 'yz\n');
});
+// https://github.com/joyent/node/issues/2320
+var file6 = fs.createReadStream(rangeFile, {bufferSize: 1.23, start: 1});
+file6.data = '';
+file6.on('data', function(data) {
+ file6.data += data.toString('utf-8');
+});
+file6.on('end', function() {
+ assert.equal(file6.data, 'yz\n');
+});
assert.throws(function() {
fs.createReadStream(rangeFile, {start: 10, end: 2});
diff --git a/test/simple/test-http-bind-twice.js b/test/simple/test-http-bind-twice.js
new file mode 100644
index 0000000000..59d69efaa2
--- /dev/null
+++ b/test/simple/test-http-bind-twice.js
@@ -0,0 +1,47 @@
+// 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 common = require('../common');
+var assert = require('assert');
+var http = require('http');
+
+var gotError = false;
+
+process.on('exit', function() {
+ assert(gotError);
+});
+
+function dontCall() {
+ assert(false);
+}
+
+var server1 = http.createServer(dontCall);
+server1.listen(common.PORT, '127.0.0.1', function() {});
+
+var server2 = http.createServer(dontCall);
+server2.listen(common.PORT, '127.0.0.1', dontCall);
+
+server2.on('error', function(e) {
+ assert.equal(e.code, 'EADDRINUSE');
+ server1.close();
+ gotError = true;
+});
+
diff --git a/test/simple/test-net-bind-twice.js b/test/simple/test-net-bind-twice.js
new file mode 100644
index 0000000000..58086cc966
--- /dev/null
+++ b/test/simple/test-net-bind-twice.js
@@ -0,0 +1,46 @@
+// 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 common = require('../common');
+var assert = require('assert');
+var net = require('net');
+
+var gotError = false;
+
+process.on('exit', function() {
+ assert(gotError);
+});
+
+function dontCall() {
+ assert(false);
+}
+
+var server1 = net.createServer(dontCall);
+server1.listen(common.PORT, '127.0.0.1', function() {});
+
+var server2 = net.createServer(dontCall);
+server2.listen(common.PORT, '127.0.0.1', dontCall);
+
+server2.on('error', function(e) {
+ assert.equal(e.code, 'EADDRINUSE');
+ server1.close();
+ gotError = true;
+});
diff --git a/tools/msvs/msi/nodemsi.wixproj b/tools/msvs/msi/nodemsi.wixproj
index e45372457b..d7a3b62dd5 100644
--- a/tools/msvs/msi/nodemsi.wixproj
+++ b/tools/msvs/msi/nodemsi.wixproj
@@ -33,13 +33,25 @@
<Name>WixUIExtension</Name>
</WixExtension>
</ItemGroup>
+ <UsingTask TaskName="GenerateProductId" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
+ <ParameterGroup>
+ <ProductId ParameterType="System.String" Output="true" />
+ </ParameterGroup>
+ <Task>
+ <Code Type="Fragment" Language="cs">
+ <![CDATA[
+ this.ProductId = System.Guid.NewGuid().ToString().ToUpper();
+ ]]>
+ </Code>
+ </Task>
+ </UsingTask>
<Import Project="$(WixTargetsPath)" />
- <!--
- To modify your build process, add your task inside one of the targets below and uncomment it.
- Other similar extension points exist, see Wix.targets.
- <Target Name="BeforeBuild">
- </Target>
- <Target Name="AfterBuild">
- </Target>
- -->
+ <Target Name="BeforeBuild">
+ <GenerateProductId>
+ <Output PropertyName="NodeProductId" TaskParameter="ProductId"/>
+ </GenerateProductId>
+ <CreateProperty Value="$(DefineConstants);ProductId=$(NodeProductId)">
+ <Output TaskParameter="Value" PropertyName="DefineConstants" />
+ </CreateProperty>
+ </Target>
</Project>
diff --git a/tools/msvs/msi/product.wxs b/tools/msvs/msi/product.wxs
index d924a4dfef..bdf28a587a 100644
--- a/tools/msvs/msi/product.wxs
+++ b/tools/msvs/msi/product.wxs
@@ -4,7 +4,7 @@
<?define repoDir="$(var.ProjectDir)..\..\..\" ?>
<?define sourcedir="$(var.repoDir)\$(var.Configuration)\" ?>
- <Product Id="cc6c176e-e26c-48ec-8970-f58bd1d046cf"
+ <Product Id="$(var.ProductId)"
Name="node.js"
Language="1033"
Version="$(var.ProductVersion)"
@@ -14,6 +14,9 @@
<Package InstallerVersion="200" Compressed="yes" Platform="x86" />
<Media Id="1" Cabinet="media1.cab" EmbedCab="yes" />
+
+ <MajorUpgrade AllowSameVersionUpgrades="yes"
+ DowngradeErrorMessage="A later version of node.js is already installed. Setup will now exit." />
<Directory Id="TARGETDIR" Name="SourceDir">
<Directory Id="ProgramFilesFolder">
@@ -111,8 +114,8 @@
</UI>
<UIRef Id="WixUI_Common" />
- <WixVariable Id="WixUIBannerBmp" Value="..\..\..\doc\windows_banner_nodejs_installer_logo.jpg" />
- <WixVariable Id="WixUIDialogBmp" Value="..\..\..\doc\windows_dialog_nodejs_installer_logo.jpg" />
+ <WixVariable Id="WixUIBannerBmp" Value="..\..\..\doc\thin-white-stripe.bmp" />
+ <WixVariable Id="WixUIDialogBmp" Value="..\..\..\doc\full-white-stripe.bmp" />
</Product>
</Wix>