Permalink
Browse files

Merge branch 'v0.6'

Conflicts:
	Makefile
	src/node_version.h
	test/simple/test-http-response-no-headers.js
  • Loading branch information...
2 parents 1db9a2a + b159c6d commit cffd0bb68d4b72601539b1f3cf2b7ff50def897c @piscisaureus piscisaureus committed Nov 25, 2011
Showing with 2,234 additions and 6,953 deletions.
  1. +2 −0 .gitignore
  2. +37 −11 ChangeLog
  3. +3 −0 deps/npm/.gitmodules
  4. +4 −4 deps/npm/doc/cli/coding-style.md
  5. +1 −1 deps/npm/lib/completion.js
  6. +4 −8 deps/npm/lib/utils/tar.js
  7. +23 −0 deps/npm/node_modules/abbrev/LICENSE
  8. +3 −0 deps/npm/node_modules/abbrev/package.json
  9. +0 −68 deps/npm/node_modules/block-stream/bench/block-stream.js
  10. +0 −70 deps/npm/node_modules/block-stream/bench/dropper-pause.js
  11. +0 −68 deps/npm/node_modules/block-stream/bench/dropper.js
  12. +0 −27 deps/npm/node_modules/block-stream/test/basic.js
  13. +0 −68 deps/npm/node_modules/block-stream/test/nopad-thorough.js
  14. +0 −57 deps/npm/node_modules/block-stream/test/nopad.js
  15. +0 −73 deps/npm/node_modules/block-stream/test/pause-resume.js
  16. +0 −68 deps/npm/node_modules/block-stream/test/thorough.js
  17. +111 −0 deps/npm/node_modules/fast-list/README.md
  18. +55 −0 deps/npm/node_modules/fast-list/bench.js
  19. +90 −0 deps/npm/node_modules/fast-list/fast-list.js
  20. +20 −0 deps/npm/node_modules/fast-list/package.json
  21. +0 −113 deps/npm/node_modules/fstream/examples/pipe.js
  22. +0 −29 deps/npm/node_modules/fstream/examples/reader.js
  23. +0 −9 deps/npm/node_modules/fstream/examples/symlink-write.js
  24. +1 −11 deps/npm/node_modules/fstream/lib/writer.js
  25. +3 −3 deps/npm/node_modules/fstream/package.json
  26. +184 −34 deps/npm/node_modules/graceful-fs/graceful-fs.js
  27. +5 −3 deps/npm/node_modules/graceful-fs/package.json
  28. +0 −18 deps/npm/node_modules/ini/test/fixtures/foo.ini
  29. +0 −40 deps/npm/node_modules/ini/test/foo.js
  30. +0 −141 deps/npm/node_modules/minimatch/test/basic.js
  31. +0 −6 deps/npm/node_modules/mkdirp/examples/pow.js
  32. +0 −39 deps/npm/node_modules/mkdirp/test/chmod.js
  33. +0 −37 deps/npm/node_modules/mkdirp/test/clobber.js
  34. +0 −28 deps/npm/node_modules/mkdirp/test/mkdirp.js
  35. +0 −41 deps/npm/node_modules/mkdirp/test/race.js
  36. +0 −32 deps/npm/node_modules/mkdirp/test/rel.js
  37. +2 −0 deps/npm/node_modules/node-uuid/.gitignore
  38. +162 −67 deps/npm/node_modules/node-uuid/README.md
  39. +53 −0 deps/npm/node_modules/node-uuid/benchmark/README.md
  40. +175 −0 deps/npm/node_modules/node-uuid/benchmark/bench.gnu
  41. +34 −0 deps/npm/node_modules/node-uuid/benchmark/bench.sh
  42. 0 deps/npm/node_modules/node-uuid/{test → benchmark}/benchmark-native.c
  43. +52 −0 deps/npm/node_modules/node-uuid/benchmark/benchmark.js
  44. +5 −3 deps/npm/node_modules/node-uuid/package.json
  45. +0 −27 deps/npm/node_modules/node-uuid/test/benchmark.js
  46. +0 −14 deps/npm/node_modules/node-uuid/test/test.html
  47. +0 −83 deps/npm/node_modules/node-uuid/test/test.js
  48. +231 −56 deps/npm/node_modules/node-uuid/uuid.js
  49. +3 −1 deps/npm/node_modules/nopt/README.md
  50. +0 −30 deps/npm/node_modules/nopt/examples/my-program.js
  51. +92 −0 deps/npm/node_modules/request/README.md
  52. +113 −9 deps/npm/node_modules/request/main.js
  53. +23 −0 deps/npm/node_modules/request/oauth.js
  54. +1 −1 deps/npm/node_modules/request/package.json
  55. BIN deps/npm/node_modules/request/tests/googledoodle.png
  56. +0 −6 deps/npm/node_modules/request/tests/run.sh
  57. +0 −57 deps/npm/node_modules/request/tests/server.js
  58. +0 −90 deps/npm/node_modules/request/tests/test-body.js
  59. +0 −30 deps/npm/node_modules/request/tests/test-errors.js
  60. +0 −167 deps/npm/node_modules/request/tests/test-pipes.js
  61. +0 −87 deps/npm/node_modules/request/tests/test-timeout.js
  62. +19 −0 deps/npm/node_modules/request/uuid.js
  63. +57 −0 deps/npm/node_modules/request/vendor/cookie/index.js
  64. +72 −0 deps/npm/node_modules/request/vendor/cookie/jar.js
  65. +0 −10 deps/npm/node_modules/rimraf/test/run.sh
  66. +0 −47 deps/npm/node_modules/rimraf/test/setup.sh
  67. +0 −5 deps/npm/node_modules/rimraf/test/test-async.js
  68. +0 −15 deps/npm/node_modules/rimraf/test/test-fiber.js
  69. +0 −3 deps/npm/node_modules/rimraf/test/test-sync.js
  70. +0 −397 deps/npm/node_modules/semver/test.js
  71. +0 −11 deps/npm/node_modules/tar/examples/extracter.js
  72. +0 −36 deps/npm/node_modules/tar/examples/reader.js
  73. +3 −0 deps/npm/node_modules/tar/lib/entry-writer.js
  74. +17 −3 deps/npm/node_modules/tar/lib/extended-header-writer.js
  75. +0 −1 deps/npm/node_modules/tar/old/README.md
  76. +0 −24 deps/npm/node_modules/tar/old/doc/example.js
  77. +0 −387 deps/npm/node_modules/tar/old/generator.js
  78. +0 −344 deps/npm/node_modules/tar/old/parser.js
  79. +0 −74 deps/npm/node_modules/tar/old/tar.js
  80. +0 −13 deps/npm/node_modules/tar/old/test/test-generator.js
  81. BIN deps/npm/node_modules/tar/old/test/test-generator.tar
  82. BIN deps/npm/node_modules/tar/old/test/test-generator.txt
  83. +0 −28 deps/npm/node_modules/tar/old/test/test-parser.js
  84. BIN deps/npm/node_modules/tar/old/test/test-tar.tar
  85. BIN deps/npm/node_modules/tar/old/test/test-tar.txt
  86. +2 −2 deps/npm/node_modules/tar/package.json
  87. +0 −406 deps/npm/node_modules/tar/test/extract.js
  88. BIN deps/npm/node_modules/tar/test/fixtures/200.tar
  89. +0 −50 deps/npm/node_modules/tar/test/fixtures/200L.hex
  90. +0 −1 ...ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  91. BIN deps/npm/node_modules/tar/test/fixtures/200longlink.tar
  92. BIN deps/npm/node_modules/tar/test/fixtures/200longname.tar
  93. +0 −14 deps/npm/node_modules/tar/test/fixtures/a.hex
  94. BIN deps/npm/node_modules/tar/test/fixtures/a.tar
  95. +0 −1 deps/npm/node_modules/tar/test/fixtures/a.txt
  96. +0 −14 deps/npm/node_modules/tar/test/fixtures/b.hex
  97. BIN deps/npm/node_modules/tar/test/fixtures/b.tar
  98. +0 −1 deps/npm/node_modules/tar/test/fixtures/b.txt
  99. +0 −74 deps/npm/node_modules/tar/test/fixtures/c.hex
  100. BIN deps/npm/node_modules/tar/test/fixtures/c.tar
  101. +0 −1 deps/npm/node_modules/tar/test/fixtures/c.txt
  102. +0 −1 deps/npm/node_modules/tar/test/fixtures/cc.txt
  103. +0 −14 deps/npm/node_modules/tar/test/fixtures/foo.hex
  104. +0 −1 deps/npm/node_modules/tar/test/fixtures/foo.js
  105. BIN deps/npm/node_modules/tar/test/fixtures/foo.tar
  106. +0 −1 deps/npm/node_modules/tar/test/fixtures/hardlink-1
  107. +0 −1 deps/npm/node_modules/tar/test/fixtures/hardlink-2
  108. +0 −22 deps/npm/node_modules/tar/test/fixtures/omega.hex
  109. BIN deps/npm/node_modules/tar/test/fixtures/omega.tar
  110. +0 −1 deps/npm/node_modules/tar/test/fixtures/omega.txt
  111. BIN deps/npm/node_modules/tar/test/fixtures/omegapax.tar
  112. +0 −1 deps/npm/node_modules/tar/test/fixtures/packtest/omega.txt
  113. +0 −1,184 deps/npm/node_modules/tar/test/fixtures/packtest/star.4.html
  114. +0 −1 deps/npm/node_modules/tar/test/fixtures/packtest/Ω.txt
  115. +0 −1 ...ccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc
  116. +0 −1 deps/npm/node_modules/tar/test/fixtures/symlink
  117. +0 −1 deps/npm/node_modules/tar/test/fixtures/Ω.txt
  118. +0 −183 deps/npm/node_modules/tar/test/header.js
  119. +0 −953 deps/npm/node_modules/tar/test/pack.js
  120. +0 −359 deps/npm/node_modules/tar/test/parse.js
  121. +7 −5 deps/npm/package.json
  122. +0 −7 deps/npm/test/common.js
  123. +0 −4 deps/npm/test/disabled/bundlerecurs/package.json
  124. +0 −5 deps/npm/test/disabled/failer/package.json
  125. +0 −9 deps/npm/test/disabled/fast/package.json
  126. +0 −4 deps/npm/test/disabled/package-config/package.json
  127. +0 −17 deps/npm/test/disabled/package-config/test.js
  128. +0 −9 deps/npm/test/disabled/slow/package.json
  129. +0 −3 deps/npm/test/disabled/startstop/package.json
  130. +0 −4 deps/npm/test/packages/npm-test-blerg/package.json
  131. +0 −5 deps/npm/test/packages/npm-test-blerg/test.js
  132. +0 −14 deps/npm/test/packages/npm-test-env-reader/package.json
  133. +0 −3 deps/npm/test/packages/npm-test-env-reader/test.sh
  134. +0 −4 deps/npm/test/packages/npm-test-missing-bindir/package.json
  135. +0 −5 deps/npm/test/packages/npm-test-missing-bindir/test.js
  136. +0 −4 deps/npm/test/packages/npm-test-private/package.json
  137. +0 −5 deps/npm/test/packages/npm-test-test-package/package.json
  138. +0 −4 deps/npm/test/packages/npm-test-url-dep/package.json
  139. +0 −138 deps/npm/test/run
  140. +0 −59 deps/npm/test/update-test.sh
  141. +0 −1 deps/uv/include/uv.h
  142. +1 −0 deps/uv/src/unix/cygwin.c
  143. +1 −1 deps/uv/src/unix/fs.c
  144. +4 −0 deps/uv/src/unix/internal.h
  145. +1 −0 deps/uv/src/win/error.c
  146. +25 −3 deps/uv/src/win/fs.c
  147. +11 −7 deps/uv/src/win/getaddrinfo.c
  148. +28 −12 deps/uv/src/win/udp.c
  149. +3 −1 deps/uv/src/win/winsock.c
  150. +1 −1 doc/api/dgram.markdown
  151. +7 −7 doc/index.html
  152. +2 −2 doc/template.html
  153. BIN doc/windows_banner_nodejs_installer_logo.jpg
  154. BIN doc/windows_dialog_nodejs_installer_logo.jpg
  155. +1 −1 lib/dgram.js
  156. +72 −42 lib/fs.js
  157. +33 −16 lib/path.js
  158. +75 −1 src/node.cc
  159. +16 −2 src/node_file.cc
  160. +1 −0 src/node_version.h
  161. +0 −4 test/fixtures/echo.js
  162. +9 −3 test/pummel/testcfg.py
  163. +81 −0 test/simple/test-dgram-send-error.js
  164. +75 −12 test/simple/test-fs-chmod.js
  165. +49 −0 test/simple/test-fs-long-path.js
  166. +7 −3 test/simple/test-http-response-no-headers.js
  167. +38 −0 test/simple/test-path-makelong.js
  168. +5 −3 tools/msvs/msi/nodemsi.wixproj
  169. +9 −0 tools/msvs/msi/product.wxs
  170. +10 −1 vcbuild.bat
View
2 .gitignore
@@ -34,3 +34,5 @@ ipch/
*-nodegyp*
/gyp-mac-tool
/dist-osx
+/npm.wxs
+/tools/msvs/npm.wixobj
View
48 ChangeLog
@@ -1,4 +1,30 @@
-2011.11.18, Version 0.6.2 (stable)
+2011.11.25, Version 0.6.3 (stable)
+
+* #2083 Land NPM in Node. It is included in packages/installers and installed
+ on `make install`.
+
+* #2076 Add logos to windows installer.
+
+* #1711 Correctly handle http requests without headers. (Ben Noordhuis,
+ Felix Geisendörfer)
+
+* TLS: expose more openssl SSL context options and constants. (Ben Noordhuis)
+
+* #2177 Windows: don't kill UDP socket when a packet fails to reach its
+ destination. (Bert Belder)
+
+* Windows: support paths longer than 260 characters. (Igor Zinkovsky)
+
+* Windows: correctly resolve drive-relative paths. (Bert Belder)
+
+* #2166 Don't leave file descriptor open after lchmod. (Isaac Schlueter)
+
+* #2084 Add OS X .pkg build script to make file.
+
+* #2160 Documentation improvements. (Ben Noordhuis)
+
+
+2011.11.18, Version 0.6.2 (stable), a4402f0b2e410b19375a1d5c5fb7fe7f66f3c7f8
* doc improvements (Artur Adib, Trevor Burnham, Ryan Emery, Trent Mick)
@@ -23,7 +49,7 @@
* Upgrade V8 to 3.6.6.8
-2011.11.11, Version 0.6.1 (stable)
+2011.11.11, Version 0.6.1 (stable), 170f2addb2dd0c625bc4a6d461e89a31ad68b79b
* doc improvements (Eric Lovett, Ben Noordhuis, Scott Anderson, Yoji SHIDARA)
@@ -114,7 +140,7 @@
* Documentation improvments (Igor Zinkovsky, Bert Belder, Ilya Dmitrichenko,
koichik, Maciej Małecki, Guglielmo Ferri, isaacs)
-* Performance improvements (Daniel Ennis, Bert Belder, Ben Noordhuis)
+* Performance improvements (Daniel Ennis, Bert Belder, Ben Noordhuis)
* Long process.title support (Ben Noordhuis)
@@ -370,7 +396,7 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs)
* Fixes https host header default port handling. (Mikeal Rogers)
-* #1440 strip byte order marker when loading *.js and *.json files
+* #1440 strip byte order marker when loading *.js and *.json files
(Ben Noordhuis)
* #1434 Improve util.format() compatibility with browser. (Koichi Kobayashi)
@@ -581,9 +607,9 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs)
* #829 Backport r8577 from V8 (Ben Noordhuis)
-* #877 Don't wait for HTTP Agent socket pool to establish connections.
+* #877 Don't wait for HTTP Agent socket pool to establish connections.
-* #915 Find kqueue on FreeBSD correctly (Brett Kiefer)
+* #915 Find kqueue on FreeBSD correctly (Brett Kiefer)
* #1085 HTTP: Fix race in abort/dispatch code (Stefan Rusu)
@@ -980,7 +1006,7 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs)
* HTTPS server
-* Built in debugger 'node debug script.js'
+* Built in debugger 'node debug script.js'
* realpath files during module load (Mihai Călin Bazon)
@@ -1122,7 +1148,7 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs)
* fs bugfixes (Tj Holowaychuk, Tobie Langel, Marco Rogers, isaacs)
-* http bug fixes (Fedor Indutny, Mikeal Rogers)
+* http bug fixes (Fedor Indutny, Mikeal Rogers)
* Faster buffers; breaks C++ API (Tim-Smart, Stéphan Kochen)
@@ -1291,7 +1317,7 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs)
* Upgrade http-parser, V8 to 2.2.21
-2010.06.21, Version 0.1.99, a620b7298f68f68a855306437a3b60b650d61d78
+2010.06.21, Version 0.1.99, a620b7298f68f68a855306437a3b60b650d61d78
* Datagram sockets (Paul Querna)
@@ -1397,7 +1423,7 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs)
2010.05.06, Version 0.1.94, f711d5343b29d1e72e87107315708e40951a7826
-* Look in /usr/local/lib/node for modules, so that there's a way
+* Look in /usr/local/lib/node for modules, so that there's a way
to install modules globally (Issac Schlueter)
* SSL improvements (Rhys Jones, Paulo Matias)
@@ -1417,7 +1443,7 @@ koichik, Maciej Małecki, Guglielmo Ferri, isaacs)
* Bugfix: destroy() instead of end() http connection at end of
pipeline
-* Bugfix: http.Client may be prematurely released back to the
+* Bugfix: http.Client may be prematurely released back to the
free pool. (Thomas Lee)
* Upgrade V8 to 2.2.8
View
3 deps/npm/.gitmodules
@@ -49,3 +49,6 @@
[submodule "node_modules/mkdirp"]
path = node_modules/mkdirp
url = git://github.com/isaacs/node-mkdirp.git
+[submodule "node_modules/fast-list"]
+ path = node_modules/fast-list
+ url = git://github.com/isaacs/fast-list.git
View
8 deps/npm/doc/cli/coding-style.md
@@ -155,16 +155,16 @@ Use appropriate log levels. The default log() function logs at the
## Case, naming, etc.
-Use lowerCamelCase for multiword identifiers when they refer to objects,
+Use `lowerCamelCase` for multiword identifiers when they refer to objects,
functions, methods, members, or anything not specified in this section.
-Use UpperCamelCase for class names (things that you'd pass to "new").
+Use `UpperCamelCase` for class names (things that you'd pass to "new").
-Use all-lower-hyphen-css-case for multiword filenames and config keys.
+Use `all-lower-hyphen-css-case` for multiword filenames and config keys.
Use named functions. They make stack traces easier to follow.
-Use CAPS_SNAKE_CASE for constants, things that should never change
+Use `CAPS_SNAKE_CASE` for constants, things that should never change
and are rarely used.
Use a single uppercase letter for function names where the function
View
2 deps/npm/lib/completion.js
@@ -20,7 +20,7 @@ var output = require("./utils/output.js")
completion.completion = function (opts, cb) {
if (opts.w > 3) return cb()
- var fs = require("fs")
+ var fs = require("graceful-fs")
, path = require("path")
, bashExists = null
, zshExists = null
View
12 deps/npm/lib/utils/tar.js
@@ -76,16 +76,10 @@ function packFiles (targetTarball, parent, files, pkg, cb) {
, path: parent
, filter: function () {
return -1 !== files.indexOf(this.path)
- // || (this.type === "Directory" &&
- // this.basename !== ".git")
-
}
})
.on("error", log.er(cb, "error reading "+parent))
- .on("entry", function E (entry) {
- entry.on("entry", E)
- })
- .pipe(tar.Pack({}))
+ .pipe(tar.Pack())
.on("error", log.er(cb, "tar creation error "+targetTarball))
.pipe(zlib.Gzip())
.on("error", log.er(cb, "gzip error "+targetTarball))
@@ -155,8 +149,9 @@ function gunzTarPerm (tarball, tmp, dMode, fMode, uid, gid, cb) {
log.silly([dMode.toString(8), fMode.toString(8)], "gunzTarPerm modes")
fs.createReadStream(tarball)
+ .on("error", log.er(cb, "error reading "+tarball))
.pipe(zlib.Unzip())
- .on("error", log.er(cb, "unzip error"))
+ .on("error", log.er(cb, "unzip error "+tarball))
.pipe(tar.Extract({ type: "Directory", path: tmp }))
.on("error", log.er(cb, "Failed unpacking "+tarball))
.on("close", afterUntar)
@@ -165,6 +160,7 @@ function gunzTarPerm (tarball, tmp, dMode, fMode, uid, gid, cb) {
// XXX Do all this in an Extract filter.
//
function afterUntar (er) {
+ log.silly(er, "afterUntar")
// if we're not doing ownership management,
// then we're done now.
if (er) return log.er(cb, "Failed unpacking "+tarball)(er)
View
23 deps/npm/node_modules/abbrev/LICENSE
@@ -0,0 +1,23 @@
+Copyright 2009, 2010, 2011 Isaac Z. Schlueter.
+All rights reserved.
+
+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.
View
3 deps/npm/node_modules/abbrev/package.json
@@ -5,4 +5,7 @@
, "main" : "./lib/abbrev.js"
, "scripts" : { "test" : "node lib/abbrev.js" }
, "repository" : "http://github.com/isaacs/abbrev-js"
+, "license" :
+ { "type" : "MIT"
+ , "url" : "https://github.com/isaacs/abbrev-js/raw/master/LICENSE" }
}
View
68 deps/npm/node_modules/block-stream/bench/block-stream.js
@@ -1,68 +0,0 @@
-var BlockStream = require("../block-stream.js")
-
-var blockSizes = [16, 25, 1024]
- , writeSizes = [4, 8, 15, 16, 17, 64, 100]
- , writeCounts = [1, 10, 100]
- , tap = require("tap")
-
-writeCounts.forEach(function (writeCount) {
-blockSizes.forEach(function (blockSize) {
-writeSizes.forEach(function (writeSize) {
- tap.test("writeSize=" + writeSize +
- " blockSize="+blockSize +
- " writeCount="+writeCount, function (t) {
- var f = new BlockStream(blockSize, {nopad: true })
-
- var actualChunks = 0
- var actualBytes = 0
- var timeouts = 0
-
- f.on("data", function (c) {
- timeouts ++
-
- actualChunks ++
- actualBytes += c.length
-
- // make sure that no data gets corrupted, and basic sanity
- var before = c.toString()
- // simulate a slow write operation
- setTimeout(function () {
- timeouts --
-
- var after = c.toString()
- t.equal(after, before, "should not change data")
-
- // now corrupt it, to find leaks.
- for (var i = 0; i < c.length; i ++) {
- c[i] = "x".charCodeAt(0)
- }
- }, 100)
- })
-
- f.on("end", function () {
- // round up to the nearest block size
- var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize)
- var expectBytes = writeSize * writeCount * 2
- t.equal(actualBytes, expectBytes,
- "bytes=" + expectBytes + " writeSize=" + writeSize)
- t.equal(actualChunks, expectChunks,
- "chunks=" + expectChunks + " writeSize=" + writeSize)
-
- // wait for all the timeout checks to finish, then end the test
- setTimeout(function WAIT () {
- if (timeouts > 0) return setTimeout(WAIT)
- t.end()
- }, 100)
- })
-
- for (var i = 0; i < writeCount; i ++) {
- var a = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0)
- var b = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0)
- f.write(a)
- f.write(b)
- }
- f.end()
- })
-}) }) })
View
70 deps/npm/node_modules/block-stream/bench/dropper-pause.js
@@ -1,70 +0,0 @@
-var BlockStream = require("dropper")
-
-var blockSizes = [16, 25, 1024]
- , writeSizes = [4, 8, 15, 16, 17, 64, 100]
- , writeCounts = [1, 10, 100]
- , tap = require("tap")
-
-writeCounts.forEach(function (writeCount) {
-blockSizes.forEach(function (blockSize) {
-writeSizes.forEach(function (writeSize) {
- tap.test("writeSize=" + writeSize +
- " blockSize="+blockSize +
- " writeCount="+writeCount, function (t) {
- var f = new BlockStream(blockSize, {nopad: true })
-
- var actualChunks = 0
- var actualBytes = 0
- var timeouts = 0
-
- f.on("data", function (c) {
- timeouts ++
-
- actualChunks ++
- actualBytes += c.length
-
- // make sure that no data gets corrupted, and basic sanity
- var before = c.toString()
- // simulate a slow write operation
- f.pause()
- setTimeout(function () {
- timeouts --
-
- var after = c.toString()
- t.equal(after, before, "should not change data")
-
- // now corrupt it, to find leaks.
- for (var i = 0; i < c.length; i ++) {
- c[i] = "x".charCodeAt(0)
- }
- f.resume()
- }, 100)
- })
-
- f.on("end", function () {
- // round up to the nearest block size
- var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize)
- var expectBytes = writeSize * writeCount * 2
- t.equal(actualBytes, expectBytes,
- "bytes=" + expectBytes + " writeSize=" + writeSize)
- t.equal(actualChunks, expectChunks,
- "chunks=" + expectChunks + " writeSize=" + writeSize)
-
- // wait for all the timeout checks to finish, then end the test
- setTimeout(function WAIT () {
- if (timeouts > 0) return setTimeout(WAIT)
- t.end()
- }, 100)
- })
-
- for (var i = 0; i < writeCount; i ++) {
- var a = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0)
- var b = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0)
- f.write(a)
- f.write(b)
- }
- f.end()
- })
-}) }) })
View
68 deps/npm/node_modules/block-stream/bench/dropper.js
@@ -1,68 +0,0 @@
-var BlockStream = require("dropper")
-
-var blockSizes = [16, 25, 1024]
- , writeSizes = [4, 8, 15, 16, 17, 64, 100]
- , writeCounts = [1, 10, 100]
- , tap = require("tap")
-
-writeCounts.forEach(function (writeCount) {
-blockSizes.forEach(function (blockSize) {
-writeSizes.forEach(function (writeSize) {
- tap.test("writeSize=" + writeSize +
- " blockSize="+blockSize +
- " writeCount="+writeCount, function (t) {
- var f = new BlockStream(blockSize, {nopad: true })
-
- var actualChunks = 0
- var actualBytes = 0
- var timeouts = 0
-
- f.on("data", function (c) {
- timeouts ++
-
- actualChunks ++
- actualBytes += c.length
-
- // make sure that no data gets corrupted, and basic sanity
- var before = c.toString()
- // simulate a slow write operation
- setTimeout(function () {
- timeouts --
-
- var after = c.toString()
- t.equal(after, before, "should not change data")
-
- // now corrupt it, to find leaks.
- for (var i = 0; i < c.length; i ++) {
- c[i] = "x".charCodeAt(0)
- }
- }, 100)
- })
-
- f.on("end", function () {
- // round up to the nearest block size
- var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize)
- var expectBytes = writeSize * writeCount * 2
- t.equal(actualBytes, expectBytes,
- "bytes=" + expectBytes + " writeSize=" + writeSize)
- t.equal(actualChunks, expectChunks,
- "chunks=" + expectChunks + " writeSize=" + writeSize)
-
- // wait for all the timeout checks to finish, then end the test
- setTimeout(function WAIT () {
- if (timeouts > 0) return setTimeout(WAIT)
- t.end()
- }, 100)
- })
-
- for (var i = 0; i < writeCount; i ++) {
- var a = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0)
- var b = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0)
- f.write(a)
- f.write(b)
- }
- f.end()
- })
-}) }) })
View
27 deps/npm/node_modules/block-stream/test/basic.js
@@ -1,27 +0,0 @@
-var tap = require("tap")
- , BlockStream = require("../block-stream.js")
-
-tap.test("basic test", function (t) {
- var b = new BlockStream(16)
- var fs = require("fs")
- var fstr = fs.createReadStream(__filename, {encoding: "utf8"})
- fstr.pipe(b)
-
- var stat
- t.doesNotThrow(function () {
- stat = fs.statSync(__filename)
- }, "stat should not throw")
-
- var totalBytes = 0
- b.on("data", function (c) {
- t.equal(c.length, 16, "chunks should be 16 bytes long")
- t.type(c, Buffer, "chunks should be buffer objects")
- totalBytes += c.length
- })
- b.on("end", function () {
- var expectedBytes = stat.size + (16 - stat.size % 16)
- t.equal(totalBytes, expectedBytes, "Should be multiple of 16")
- t.end()
- })
-
-})
View
68 deps/npm/node_modules/block-stream/test/nopad-thorough.js
@@ -1,68 +0,0 @@
-var BlockStream = require("../block-stream.js")
-
-var blockSizes = [16, 25, 1024]
- , writeSizes = [4, 8, 15, 16, 17, 64, 100]
- , writeCounts = [1, 10, 100]
- , tap = require("tap")
-
-writeCounts.forEach(function (writeCount) {
-blockSizes.forEach(function (blockSize) {
-writeSizes.forEach(function (writeSize) {
- tap.test("writeSize=" + writeSize +
- " blockSize="+blockSize +
- " writeCount="+writeCount, function (t) {
- var f = new BlockStream(blockSize, {nopad: true })
-
- var actualChunks = 0
- var actualBytes = 0
- var timeouts = 0
-
- f.on("data", function (c) {
- timeouts ++
-
- actualChunks ++
- actualBytes += c.length
-
- // make sure that no data gets corrupted, and basic sanity
- var before = c.toString()
- // simulate a slow write operation
- setTimeout(function () {
- timeouts --
-
- var after = c.toString()
- t.equal(after, before, "should not change data")
-
- // now corrupt it, to find leaks.
- for (var i = 0; i < c.length; i ++) {
- c[i] = "x".charCodeAt(0)
- }
- }, 100)
- })
-
- f.on("end", function () {
- // round up to the nearest block size
- var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize)
- var expectBytes = writeSize * writeCount * 2
- t.equal(actualBytes, expectBytes,
- "bytes=" + expectBytes + " writeSize=" + writeSize)
- t.equal(actualChunks, expectChunks,
- "chunks=" + expectChunks + " writeSize=" + writeSize)
-
- // wait for all the timeout checks to finish, then end the test
- setTimeout(function WAIT () {
- if (timeouts > 0) return setTimeout(WAIT)
- t.end()
- }, 100)
- })
-
- for (var i = 0; i < writeCount; i ++) {
- var a = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0)
- var b = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0)
- f.write(a)
- f.write(b)
- }
- f.end()
- })
-}) }) })
View
57 deps/npm/node_modules/block-stream/test/nopad.js
@@ -1,57 +0,0 @@
-var BlockStream = require("../")
-var tap = require("tap")
-
-
-tap.test("don't pad, small writes", function (t) {
- var f = new BlockStream(16, { nopad: true })
- t.plan(1)
-
- f.on("data", function (c) {
- t.equal(c.toString(), "abc", "should get 'abc'")
- })
-
- f.on("end", function () { t.end() })
-
- f.write(new Buffer("a"))
- f.write(new Buffer("b"))
- f.write(new Buffer("c"))
- f.end()
-})
-
-tap.test("don't pad, exact write", function (t) {
- var f = new BlockStream(16, { nopad: true })
- t.plan(1)
-
- var first = true
- f.on("data", function (c) {
- if (first) {
- first = false
- t.equal(c.toString(), "abcdefghijklmnop", "first chunk")
- } else {
- t.fail("should only get one")
- }
- })
-
- f.on("end", function () { t.end() })
-
- f.end(new Buffer("abcdefghijklmnop"))
-})
-
-tap.test("don't pad, big write", function (t) {
- var f = new BlockStream(16, { nopad: true })
- t.plan(2)
-
- var first = true
- f.on("data", function (c) {
- if (first) {
- first = false
- t.equal(c.toString(), "abcdefghijklmnop", "first chunk")
- } else {
- t.equal(c.toString(), "q")
- }
- })
-
- f.on("end", function () { t.end() })
-
- f.end(new Buffer("abcdefghijklmnopq"))
-})
View
73 deps/npm/node_modules/block-stream/test/pause-resume.js
@@ -1,73 +0,0 @@
-var BlockStream = require("../block-stream.js")
-
-var blockSizes = [16]
- , writeSizes = [15, 16, 17]
- , writeCounts = [1, 10, 100]
- , tap = require("tap")
-
-writeCounts.forEach(function (writeCount) {
-blockSizes.forEach(function (blockSize) {
-writeSizes.forEach(function (writeSize) {
- tap.test("writeSize=" + writeSize +
- " blockSize="+blockSize +
- " writeCount="+writeCount, function (t) {
- var f = new BlockStream(blockSize)
-
- var actualChunks = 0
- var actualBytes = 0
- var timeouts = 0
- var paused = false
-
- f.on("data", function (c) {
- timeouts ++
- t.notOk(paused, "should not be paused when emitting data")
-
- actualChunks ++
- actualBytes += c.length
-
- // make sure that no data gets corrupted, and basic sanity
- var before = c.toString()
- // simulate a slow write operation
- paused = true
- f.pause()
- process.nextTick(function () {
- var after = c.toString()
- t.equal(after, before, "should not change data")
-
- // now corrupt it, to find leaks.
- for (var i = 0; i < c.length; i ++) {
- c[i] = "x".charCodeAt(0)
- }
- paused = false
- f.resume()
- timeouts --
- })
- })
-
- f.on("end", function () {
- // round up to the nearest block size
- var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize)
- var expectBytes = expectChunks * blockSize
- t.equal(actualBytes, expectBytes,
- "bytes=" + expectBytes + " writeSize=" + writeSize)
- t.equal(actualChunks, expectChunks,
- "chunks=" + expectChunks + " writeSize=" + writeSize)
-
- // wait for all the timeout checks to finish, then end the test
- setTimeout(function WAIT () {
- if (timeouts > 0) return setTimeout(WAIT)
- t.end()
- }, 200)
- })
-
- for (var i = 0; i < writeCount; i ++) {
- var a = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0)
- var b = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0)
- f.write(a)
- f.write(b)
- }
- f.end()
- })
-}) }) })
View
68 deps/npm/node_modules/block-stream/test/thorough.js
@@ -1,68 +0,0 @@
-var BlockStream = require("../block-stream.js")
-
-var blockSizes = [16, 25, 1024]
- , writeSizes = [4, 8, 15, 16, 17, 64, 100]
- , writeCounts = [1, 10, 100]
- , tap = require("tap")
-
-writeCounts.forEach(function (writeCount) {
-blockSizes.forEach(function (blockSize) {
-writeSizes.forEach(function (writeSize) {
- tap.test("writeSize=" + writeSize +
- " blockSize="+blockSize +
- " writeCount="+writeCount, function (t) {
- var f = new BlockStream(blockSize)
-
- var actualChunks = 0
- var actualBytes = 0
- var timeouts = 0
-
- f.on("data", function (c) {
- timeouts ++
-
- actualChunks ++
- actualBytes += c.length
-
- // make sure that no data gets corrupted, and basic sanity
- var before = c.toString()
- // simulate a slow write operation
- setTimeout(function () {
- timeouts --
-
- var after = c.toString()
- t.equal(after, before, "should not change data")
-
- // now corrupt it, to find leaks.
- for (var i = 0; i < c.length; i ++) {
- c[i] = "x".charCodeAt(0)
- }
- }, 100)
- })
-
- f.on("end", function () {
- // round up to the nearest block size
- var expectChunks = Math.ceil(writeSize * writeCount * 2 / blockSize)
- var expectBytes = expectChunks * blockSize
- t.equal(actualBytes, expectBytes,
- "bytes=" + expectBytes + " writeSize=" + writeSize)
- t.equal(actualChunks, expectChunks,
- "chunks=" + expectChunks + " writeSize=" + writeSize)
-
- // wait for all the timeout checks to finish, then end the test
- setTimeout(function WAIT () {
- if (timeouts > 0) return setTimeout(WAIT)
- t.end()
- }, 100)
- })
-
- for (var i = 0; i < writeCount; i ++) {
- var a = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) a[j] = "a".charCodeAt(0)
- var b = new Buffer(writeSize);
- for (var j = 0; j < writeSize; j ++) b[j] = "b".charCodeAt(0)
- f.write(a)
- f.write(b)
- }
- f.end()
- })
-}) }) })
View
111 deps/npm/node_modules/fast-list/README.md
@@ -0,0 +1,111 @@
+# The Problem
+
+You've got some thing where you need to push a bunch of stuff into a
+queue and then shift it out. Or, maybe it's a stack, and you're just
+pushing and popping it.
+
+Arrays work for this, but are a bit costly performance-wise.
+
+# The Solution
+
+A linked-list implementation that takes advantage of what v8 is good at:
+creating objects with a known shape.
+
+This is faster for this use case. How much faster? About 50%.
+
+ $ node bench.js
+ benchmarking /Users/isaacs/dev-src/js/fast-list/bench.js
+ Please be patient.
+ { node: '0.6.2-pre',
+ v8: '3.6.6.8',
+ ares: '1.7.5-DEV',
+ uv: '0.1',
+ openssl: '0.9.8l' }
+ Scores: (bigger is better)
+
+ new FastList()
+ Raw:
+ > 22556.39097744361
+ > 23054.755043227666
+ > 22770.398481973436
+ > 23414.634146341465
+ > 23099.133782483157
+ Average (mean) 22979.062486293868
+
+ []
+ Raw:
+ > 12195.121951219513
+ > 12184.508268059182
+ > 12173.91304347826
+ > 12216.404886561955
+ > 12184.508268059182
+ Average (mean) 12190.891283475617
+
+ new Array()
+ Raw:
+ > 12131.715771230503
+ > 12184.508268059182
+ > 12216.404886561955
+ > 12195.121951219513
+ > 11940.298507462687
+ Average (mean) 12133.609876906768
+
+ Winner: new FastList()
+ Compared with next highest ([]), it's:
+ 46.95% faster
+ 1.88 times as fast
+ 0.28 order(s) of magnitude faster
+
+ Compared with the slowest (new Array()), it's:
+ 47.2% faster
+ 1.89 times as fast
+ 0.28 order(s) of magnitude faster
+
+This lacks a lot of features that arrays have:
+
+1. You can't specify the size at the outset.
+2. It's not indexable.
+3. There's no join, concat, etc.
+
+If any of this matters for your use case, you're probably better off
+using an Array object.
+
+## Installing
+
+```
+npm install fast-list
+```
+
+## API
+
+```javascript
+var FastList = require("fast-list")
+var list = new FastList()
+list.push("foo")
+list.unshift("bar")
+list.push("baz")
+console.log(list.length) // 2
+console.log(list.pop()) // baz
+console.log(list.shift()) // bar
+console.log(list.shift()) // foo
+```
+
+### Methods
+
+* `push`: Just like Array.push, but only can take a single entry
+* `pop`: Just like Array.pop
+* `shift`: Just like Array.shift
+* `unshift`: Just like Array.unshift, but only can take a single entry
+* `drop`: Drop all entries
+* `item(n)`: Retrieve the nth item in the list. This involves a walk
+ every time. It's very slow. If you find yourself using this,
+ consider using a normal Array instead.
+* `slice(start, end)`: Retrieve an array of the items at this position.
+ This involves a walk every time. It's very slow. If you find
+ yourself using this, consider using a normal Array instead.
+
+### Members
+
+* `length`: The number of things in the list. Note that, unlike
+ Array.length, this is not a getter/setter, but rather a counter that
+ is internally managed. Setting it can only cause harm.
View
55 deps/npm/node_modules/fast-list/bench.js
@@ -0,0 +1,55 @@
+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()
View
90 deps/npm/node_modules/fast-list/fast-list.js
@@ -0,0 +1,90 @@
+;(function() { // closure for web browsers
+
+function Item (data, prev, next) {
+ this.next = next
+ if (next) next.prev = this
+ this.prev = prev
+ if (prev) prev.next = this
+ this.data = data
+}
+
+function FastList () {
+ if (!(this instanceof FastList)) return new FastList
+ this._head = null
+ this._tail = null
+ this.length = 0
+}
+
+FastList.prototype =
+{ push: function (data) {
+ this._tail = new Item(data, this._tail, null)
+ if (!this._head) this._head = this._tail
+ this.length ++
+ }
+, pop: function () {
+ if (this.length === 0) return undefined
+ var t = this._tail
+ this._tail = t.prev
+ if (t.prev) {
+ t.prev = this._tail.next = null
+ }
+ this.length --
+ if (this.length === 1) this._head = this._tail
+ else if (this.length === 0) this._head = this._tail = null
+ return t.data
+ }
+, unshift: function (data) {
+ this._head = new Item(data, null, this._head)
+ if (!this._tail) this._tail = this._head
+ this.length ++
+ }
+, shift: function () {
+ if (this.length === 0) return undefined
+ var h = this._head
+ this._head = h.next
+ if (h.next) {
+ h.next = this._head.prev = null
+ }
+ this.length --
+ if (this.length === 1) this._tail = this._head
+ else if (this.length === 0) this._head = this._tail = null
+ return h.data
+ }
+, item: function (n) {
+ if (n < 0) n = this.length + n
+ var h = this._head
+ while (n-- > 0 && h) h = h.next
+ return h ? h.data : undefined
+ }
+, slice: function (n, m) {
+ if (!n) n = 0
+ if (!m) m = this.length
+ if (m < 0) m = this.length + m
+ if (n < 0) n = this.length + n
+
+ if (m <= n) {
+ throw new Error("invalid offset: "+n+","+m)
+ }
+
+ var len = m - n
+ , ret = new Array(len)
+ , i = 0
+ , h = this._head
+ while (n-- > 0 && h) h = h.next
+ while (i < len && h) {
+ ret[i++] = h.data
+ h = h.next
+ }
+ return ret
+ }
+, drop: function () {
+ FastList.call(this)
+ }
+}
+
+if ("undefined" !== typeof(exports)) module.exports = FastList
+else if ("function" === typeof(define) && define.amd) {
+ define("FastList", function() { return FastList })
+} else (function () { return this })().FastList = FastList
+
+})()
View
20 deps/npm/node_modules/fast-list/package.json
@@ -0,0 +1,20 @@
+{
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "name": "fast-list",
+ "description": "A fast linked list (good for queues, stacks, etc.)",
+ "version": "1.0.1",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/isaacs/fast-list.git"
+ },
+ "main": "fast-list.js",
+ "dependencies": {},
+ "devDependencies": {
+ "bench": "~0.3.2",
+ "tap": "~0.1.0"
+ },
+ "scripts": {
+ "test": "node test.js",
+ "bench": "node bench.js"
+ }
+}
View
113 deps/npm/node_modules/fstream/examples/pipe.js
@@ -1,113 +0,0 @@
-var fstream = require("../fstream.js")
-var path = require("path")
-
-var r = fstream.Reader({ path: path.dirname(__dirname)
- , filter: function () {
- return !this.basename.match(/^\./) &&
- !this.basename.match(/^node_modules$/)
- !this.basename.match(/^deep-copy$/)
- }
- })
-
-var w = fstream.Writer({ path: path.resolve(__dirname, "deep-copy")
- , type: "Directory"
- })
-
-var indent = ""
-var escape = {}
-
-r.on("entry", appears)
-//r.on("ready", function () {
-// appears(r)
-//})
-
-function appears (entry) {
- console.error(indent + "a %s appears!", entry.type, entry.basename)
- if (foggy) {
- console.error("FOGGY!")
- var p = entry
- do {
- console.error(p.depth, p.path, p._paused)
- } while (p = p.parent)
-
- throw new Error("\033[mshould not have entries while foggy")
- }
- indent += "\t"
- entry.on("data", missile(entry))
- entry.on("end", runaway(entry))
- entry.on("entry", appears)
-}
-
-var foggy
-function missile (entry) {
- if (entry.type === "Directory") {
- var ended = false
- entry.once("end", function () { ended = true })
- return function (c) {
- // throw in some pathological pause()/resume() behavior
- // just for extra fun.
- process.nextTick(function () {
- if (!foggy && !ended) { // && Math.random() < 0.3) {
- console.error(indent +"%s casts a spell", entry.basename)
- console.error("\na slowing fog comes over the battlefield...\n\033[32m")
- entry.pause()
- entry.once("resume", liftFog)
- foggy = setTimeout(liftFog, 10)
-
- function liftFog (who) {
- if (!foggy) return
- if (who) {
- console.error("%s breaks the spell!", who && who.path)
- } else {
- console.error("the spell expires!")
- }
- console.error("\033[mthe fog lifts!\n")
- clearTimeout(foggy)
- foggy = null
- if (entry._paused) entry.resume()
- }
-
- }
- })
- }
- }
-
- return function (c) {
- var e = Math.random() < 0.5
- console.error(indent + "%s %s for %d damage!",
- entry.basename,
- e ? "is struck" : "fires a chunk",
- c.length)
- }
-}
-
-function runaway (entry) { return function () {
- var e = Math.random() < 0.5
- console.error(indent + "%s %s",
- entry.basename,
- e ? "turns to flee" : "is vanquished!")
- indent = indent.slice(0, -1)
-}}
-
-
-w.on("entry", attacks)
-//w.on("ready", function () { attacks(w) })
-function attacks (entry) {
- console.error(indent + "%s %s!", entry.basename,
- entry.type === "Directory" ? "calls for backup" : "attacks")
- entry.on("entry", attacks)
-}
-
-ended = false
-r.on("end", function () {
- if (foggy) clearTimeout(foggy)
- console.error("\033[mIT'S OVER!!")
- console.error("A WINNAR IS YOU!")
- ended = true
-})
-
-process.on("exit", function () {
- console.error("ended? "+ended)
-})
-r.pipe(w)
-
View
29 deps/npm/node_modules/fstream/examples/reader.js
@@ -1,29 +0,0 @@
-var fstream = require("../fstream.js")
-var path = require("path")
-
-var r = fstream.Reader({ path: path.dirname(__dirname)
- , filter: function () {
- return !this.basename.match(/^\./)
- }
- })
-
-console.error(r instanceof fstream.Reader)
-console.error(r instanceof require("stream").Stream)
-console.error(r instanceof require("events").EventEmitter)
-console.error(r.on)
-
-r.on("stat", function () {
- console.error("a %s !!!\t", r.type, r.path)
-})
-
-r.on("entries", function (entries) {
- console.error("\t" + entries.join("\n\t"))
-})
-
-r.on("entry", function (entry) {
- console.error("a %s !!!\t", entry.type, entry.path)
-})
-
-r.on("end", function () {
- console.error("IT'S OVER!!")
-})
View
9 deps/npm/node_modules/fstream/examples/symlink-write.js
@@ -1,9 +0,0 @@
-var fstream = require("../fstream.js")
-
-fstream
- .Writer({ path: "path/to/symlink"
- , linkpath: "./file"
- , isSymbolicLink: true
- , mode: "0755" // octal strings supported
- })
- .end()
View
12 deps/npm/node_modules/fstream/lib/writer.js
@@ -246,17 +246,7 @@ Writer.prototype._finish = function () {
? "utimes" : "lutimes"
if (utimes === "lutimes" && !fs[utimes]) {
- if (!fs.futimes) fs.ltimes = function (a, b, c, cb) { return cb() }
- else fs.lutimes = function (path, atime, mtime, cb) {
- var c = require("constants")
- fs.open(path, c.O_SYMLINK, function (er, fd) {
- if (er) return cb(er)
- fs.futimes(fd, atime, mtime, function (er) {
- if (er) return cb(er)
- fs.close(fd, cb)
- })
- })
- }
+ utimes = "utimes"
}
var curA = current.atime
View
6 deps/npm/node_modules/fstream/package.json
@@ -2,19 +2,19 @@
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
"name": "fstream",
"description": "Advanced file system stream things",
- "version": "0.0.1",
+ "version": "0.1.1",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/fstream.git"
},
"main": "fstream.js",
"engines": {
- "node": "0.5 || 0.6"
+ "node": "0.5 || 0.6 || 0.7"
},
"dependencies": {
"rimraf": "~1.0.8",
"mkdirp": "~0.1.0",
- "graceful-fs": "~1.0.1",
+ "graceful-fs": "1.1",
"inherits": "~1.0.0"
},
"devDependencies": {}
View
218 deps/npm/node_modules/graceful-fs/graceful-fs.js
@@ -1,39 +1,189 @@
-// wrapper around the non-sync fs functions to gracefully handle
-// having too many file descriptors open. Note that this is
-// *only* possible because async patterns let one interject timeouts
-// and other cleverness anywhere in the process without disrupting
-// anything else.
+// 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")
- , timeout = 0
-
-Object.keys(fs)
- .forEach(function (i) {
- exports[i] = (typeof fs[i] !== "function") ? fs[i]
- : (i.match(/^[A-Z]|^create|Sync$/)) ? function () {
- return fs[i].apply(fs, arguments)
- }
- : graceful(fs[i])
+ , FastList = require("fast-list")
+ , queue = new FastList()
+ , curOpen = 0
+ , constants = require("constants")
+
+exports = module.exports = fs
+
+fs.MAX_OPEN = 256
+
+fs._open = fs.open
+fs._openSync = fs.openSync
+fs._close = fs.close
+fs._closeSync = fs.closeSync
+
+
+// lstat on windows, missing from early 0.5 versions
+if (process.platform === "win32" && !process.binding("fs").lstat) {
+ fs.lstat = fs.stat
+ fs.lstatSync = fs.statSync
+}
+
+// lutimes
+var constants = require("constants")
+if (!fs.lutimes) fs.lutimes = function (path, at, mt, cb) {
+ fs.open(path, constants.O_SYMLINK, function (er, fd) {
+ cb = cb || noop
+ if (er) return cb(er)
+ fs.futimes(fd, at, mt, function (er) {
+ if (er) {
+ fs.close(fd, function () {})
+ return cb(er)
+ }
+ fs.close(fd, cb)
+ })
+ })
+}
+
+if (!fs.lutimesSync) fs.lutimesSync = function (path, at, mt) {
+ var fd = fs.openSync(path, constants.O_SYMLINK)
+ fs.futimesSync(fd, at, mt)
+ fs.closeSync(fd)
+}
+
+
+// prevent EMFILE errors
+function OpenReq (path, flags, mode, cb) {
+ this.path = path
+ this.flags = flags
+ this.mode = mode
+ this.cb = cb
+}
+
+function noop () {}
+
+fs.open = function (path, flags, mode, cb) {
+ if (typeof mode === "function") cb = mode, mode = null
+ if (typeof cb !== "function") cb = noop
+
+ if (curOpen >= fs.MAX_OPEN) {
+ queue.push(new OpenReq(path, flags, mode, cb))
+ setTimeout(flush)
+ return
+ }
+ open(path, flags, mode, cb)
+}
+
+function open (path, flags, mode, cb) {
+ cb = cb || noop
+ curOpen ++
+ fs._open(path, flags, mode, function (er, fd) {
+ if (er) {
+ onclose()
+ }
+
+ cb(er, fd)
+ })
+}
+
+fs.openSync = function (path, flags, mode) {
+ curOpen ++
+ return fs._openSync(path, flags, mode)
+}
+
+function onclose () {
+ curOpen --
+ flush()
+}
+
+function flush () {
+ while (curOpen < fs.MAX_OPEN) {
+ var req = queue.shift()
+ if (!req) break
+ open(req.path, req.flags, req.mode, req.cb)
+ }
+ if (queue.length === 0) return
+}
+
+fs.close = function (fd, cb) {
+ cb = cb || noop
+ fs._close(fd, function (er) {
+ onclose()
+ cb(er)
})
+}
+
+fs.closeSync = function (fd) {
+ onclose()
+ return fs._closeSync(fd)
+}
-if (process.platform === "win32"
- && !process.binding("fs").lstat) {
- exports.lstat = exports.stat
- exports.lstatSync = exports.statSync
-}
-
-function graceful (fn) { return function GRACEFUL () {
- var args = Array.prototype.slice.call(arguments)
- , cb_ = args.pop()
- args.push(cb)
- function cb (er) {
- if (er && er.message.match(/^EMFILE, Too many open files/)) {
- setTimeout(function () {
- GRACEFUL.apply(fs, args)
- }, timeout ++)
- return
+// lchmod, broken prior to 0.6.2
+// back-port the fix here.
+if (constants.hasOwnProperty('O_SYMLINK') &&
+ process.version.match(/^v0\.6\.[0-2]|^v0\.5\./)) {
+ fs.lchmod = function(path, mode, callback) {
+ callback = callback || noop;
+ fs.open(path, constants.O_WRONLY | constants.O_SYMLINK, function(err, fd) {
+ if (err) {
+ callback(err);
+ return;
+ }
+ // prefer to return the chmod error, if one occurs,
+ // but still try to close, and report closing errors if they occur.
+ fs.fchmod(fd, mode, function(err) {
+ fs.close(fd, function(err2) {
+ callback(err || err2);
+ });
+ });
+ });
+ };
+
+ fs.lchmodSync = function(path, mode) {
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK);
+
+ // prefer to return the chmod error, if one occurs,
+ // but still try to close, and report closing errors if they occur.
+ var err, err2;
+ try {
+ var ret = fs.fchmodSync(fd, mode);
+ } catch (er) {
+ err = er;
+ }
+ try {
+ fs.closeSync(fd);
+ } catch (er) {
+ err2 = er;
}
- timeout = 0
- cb_.apply(null, arguments)
+ if (err || err2) throw (err || err2);
+ return ret;
+ };
+}
+
+// lutimes, not yet implemented in node
+if (constants.hasOwnProperty('O_SYMLINK') && !fs.lutimes) {
+ fs.lutimes = function (path, atime, mtime, cb) {
+ cb = cb || noop
+ fs.open(path, constants.O_SYMLINK | constants.O_WRONLY, function (er, fd) {
+ if (er) return cb(er)
+ fs.futimes(fd, atime, mtime, function (er) {
+ fs.close(fd, function (er2) {
+ cb(er || er2)
+ })
+ })
+ })
}
- fn.apply(fs, args)
-}}
+
+ fs.lutimesSync = function(path, atime, mtime) {
+ var fd = fs.openSync(path, constants.O_WRONLY | constants.O_SYMLINK)
+
+ // prefer to return the chmod error, if one occurs,
+ // but still try to close, and report closing errors if they occur.
+ var err, err2
+ try {
+ var ret = fs.futimesSync(fd, atime, mtime)
+ } catch (er) {
+ err = er
+ }
+ try {
+ fs.closeSync(fd)
+ } catch (er) {
+ err2 = er
+ }
+ if (err || err2) throw (err || err2)
+ return ret
+ }
+}
View
8 deps/npm/node_modules/graceful-fs/package.json
@@ -1,8 +1,8 @@
{
"author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me)",
"name": "graceful-fs",
- "description": "fs with incremental backoff on EMFILE",
- "version": "1.0.1",
+ "description": "fs monkey-patching to avoid EMFILE and other problems",
+ "version": "1.1.0",
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-graceful-fs.git"
@@ -11,6 +11,8 @@
"engines": {
"node": "0.4 || 0.5 || 0.6"
},
- "dependencies": {},
+ "dependencies": {
+ "fast-list": "1"
+ },
"devDependencies": {}
}
View
18 deps/npm/node_modules/ini/test/fixtures/foo.ini
@@ -1,18 +0,0 @@
-o = p
-
- a with spaces = b c
-
-; wrap in quotes to JSON-decode and preserve spaces
-" xa n p " = "\"\r\nyoyoyo\r\r\n"
-
-; a section
-[a]
-av = a val
-e = { o: p, a: { av: a val, b: { c: { e: "this value" } } } }
-j = "{ o: "p", a: { av: "a val", b: { c: { e: "this value" } } } }"
-
-; nested child without middle parent
-; should create otherwise-empty a.b
-[a.b.c]
-e = 1
-j = 2
View
40 deps/npm/node_modules/ini/test/foo.js
@@ -1,40 +0,0 @@
-var i = require("../")
- , tap = require("tap")
- , test = tap.test
- , fs = require("fs")
- , path = require("path")
- , fixture = path.resolve(__dirname, "./fixtures/foo.ini")
- , data = fs.readFileSync(fixture, "utf8")
- , d
- , expectE = 'o = p\n'
- + 'a with spaces = b c\n'
- + '" xa n p " = "\\"\\r\\nyoyoyo\\r\\r\\n"\n'
- + '[a]\n'
- + 'av = a val\n'
- + 'e = { o: p, a: '
- + '{ av: a val, b: { c: { e: "this value" '
- + '} } } }\nj = "\\"{ o: \\"p\\", a: { av:'
- + ' \\"a val\\", b: { c: { e: \\"this value'
- + '\\" } } } }\\""\n[a.b.c]\ne = 1\nj = 2\n'
- , expectD =
- { o: 'p',
- 'a with spaces': 'b c',
- " xa n p ":'"\r\nyoyoyo\r\r\n',
- a:
- { av: 'a val',
- e: '{ o: p, a: { av: a val, b: { c: { e: "this value" } } } }',
- j: '"{ o: "p", a: { av: "a val", b: { c: { e: "this value" } } } }"',
- b: { c: { e: '1', j: '2' } } }
- }
-
-test("decode from file", function (t) {
- d = i.decode(data)
- t.deepEqual(d, expectD)
- t.end()
-})
-
-test("encode from data", function (t) {
- e = i.encode(expectD)
- t.deepEqual(e, expectE)
- t.end()
-})
View
141 deps/npm/node_modules/minimatch/test/basic.js
@@ -1,141 +0,0 @@
-// http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test
-
-var tap = require("tap")
- , mm = require("../")
- , files = [ "a", "b", "c", "d", "abc"
- , "abd", "abe", "bb", "bcd"
- , "ca", "cb", "dd", "de"
- , "bdir/", "bdir/cfile"]
- , next = files.concat([ "a-b", "aXb"
- , ".x", ".y" ])
-
-tap.test("basic tests", function (t) {
- // [ pattern, [matches], MM opts, files, TAP opts]
- ; [ "http://www.bashcookbook.com/bashinfo" +
- "/source/bash-1.14.7/tests/glob-test"
- , ["a*", ["a", "abc", "abd", "abe"]]
- , ["X*", ["X*"]]
- // allow null glob expansion
- , ["X*", [], { null: true }]
-
- // isaacs: Slightly different than bash/sh/ksh
- // \\* is not un-escaped to literal "*" in a failed match,
- // but it does make it get treated as a literal star
- , ["\\*", ["\\*"]]
- , ["\\**", ["\\**"]]
-
- , ["b*/", ["bdir/"]]
- , ["c*", ["c", "ca", "cb"]]
- , ["**", files]
-
-
- , ["\\.\\./*/", ["\\.\\./*/"]]
- , ["s/\\..*//", ["s/\\..*//"]]
-
- // legendary larry crashes bashes
- , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"
- , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\\1/"]]
- , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"
- , ["/^root:/{s/^[^:]*:[^:]*:\([^:]*\).*$/\1/"]]
-
- // character classes
- , ["[a-c]b*", ["abc", "abd", "abe", "bb", "cb"]]
- , ["[a-y]*[^c]", ["abd", "abe", "bb", "bcd",
- "bdir/", "ca", "cb", "dd", "de"]]
- , ["a*[^c]", ["abd", "abe"]]
- , function () { files.push("a-b", "aXb") }
- , ["a[X-]b", ["a-b", "aXb"]]
- , function () { files.push(".x", ".y") }
- , ["[^a-c]*", ["d", "dd", "de"]]
- , function () { files.push("a*b/", "a*b/ooo") }
- , ["a\\*b/*", ["a*b/ooo"]]
- , ["a\\*?/*", ["a*b/ooo"]]
- , ["*\\\\!*", [], {null: true}, ["echo !7"]]
- , ["*\\!*", ["echo !7"], null, ["echo !7"]]
- , ["*.\\*", ["r.*"], null, ["r.*"]]
- , ["a[b]c", ["abc"]]
- , ["a[\\b]c", ["abc"]]
- , ["a?c", ["abc"]]
- , ["a\\*c", [], {null: true}, ["abc"]]
- , ["", [""], { null: true }, [""]]
-
- , "http://www.opensource.apple.com/source/bash/bash-23/" +
- "bash/tests/glob-test"
- , function () { files.push("man/", "man/man1/", "man/man1/bash.1") }
- , ["*/man*/bash.*", ["man/man1/bash.1"]]
- , ["man/man1/bash.1", ["man/man1/bash.1"]]
- , ["a***c", ["abc"], null, ["abc"]]
- , ["a*****?c", ["abc"], null, ["abc"]]
- , ["?*****??", ["abc"], null, ["abc"]]
- , ["*****??", ["abc"], null, ["abc"]]
- , ["?*****?c", ["abc"], null, ["abc"]]
- , ["?***?****c", ["abc"], null, ["abc"]]
- , ["?***?****?", ["abc"], null, ["abc"]]
- , ["?***?****", ["abc"], null, ["abc"]]
- , ["*******c", ["abc"], null, ["abc"]]
- , ["*******?", ["abc"], null, ["abc"]]
- , ["a*cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
- , ["a**?**cd**?**??k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
- , ["a**?**cd**?**??k***", ["abcdecdhjk"], null, ["abcdecdhjk"]]
- , ["a**?**cd**?**??***k", ["abcdecdhjk"], null, ["abcdecdhjk"]]
- , ["a**?**cd**?**??***k**", ["abcdecdhjk"], null, ["abcdecdhjk"]]
- , ["a****c**?**??*****", ["abcdecdhjk"], null, ["abcdecdhjk"]]
- , ["[-abc]", ["-"], null, ["-"]]
- , ["[abc-]", ["-"], null, ["-"]]
- , ["\\", ["\\"], null, ["\\"]]
- , ["[\\\\]", ["\\"], null, ["\\"]]
- , ["[[]", ["["], null, ["["]]
- , ["[", ["["], null, ["["]]
- , ["[*", ["[abc"], null, ["[abc"]]
- , "a right bracket shall lose its special meaning and " +
- "represent itself in a bracket expression if it occurs " +
- "first in the list. -- POSIX.2 2.8.3.2"
- , ["[]]", ["]"], null, ["]"]]
- , ["[]-]", ["]"], null, ["]"]]
- , ["[a-\z]", ["p"], null, ["p"]]
- , ["[/\\\\]*", ["/tmp"], null, ["/tmp"]]
- , ["??**********?****?", [], { null: true }, ["abc"]]
- , ["??**********?****c", [], { null: true }, ["abc"]]
- , ["?************c****?****", [], { null: true }, ["abc"]]
- , ["*c*?**", [], { null: true }, ["abc"]]
- , ["a*****c*?**", [], { null: true }, ["abc"]]
- , ["a********???*******", [], { null: true }, ["abc"]]
- , ["[]", [], { null: true }, ["a"]]
- , ["[abc", [], { null: true }, ["["]]
-
- , "nocase tests"
- , ["XYZ", ["xYz"], { nocase: true, null: true }
- , ["xYz", "ABC", "IjK"]]
- , ["ab*", ["ABC"], { nocase: true, null: true }
- , ["xYz", "ABC", "IjK"]]
- , ["[ia]?[ck]", ["ABC", "IjK"], { nocase: true, null: true }
- , ["xYz", "ABC", "IjK"]]
-
- ].forEach(function (c) {
- if (typeof c === "function") return c()
- if (typeof c === "string") return t.comment(c)
-
- var pattern = c[0]
- , expect = c[1].sort(alpha)
- , options = c[2] || {}
- , f = c[3] || files
- , tapOpts = c[4] || {}
-
- // options.debug = true
- var r = mm.makeRe(pattern, options)
- tapOpts.re = String(r) || JSON.stringify(r)
- tapOpts.files = JSON.stringify(f)
- tapOpts.pattern = pattern
-
- var actual = mm.match(f, pattern, options)
-
- t.equivalent( actual, expect
- , JSON.stringify(pattern) + " " + JSON.stringify(expect)
- , c[4] )
- })
- t.end()
-})
-
-function alpha (a, b) {
- return a > b ? 1 : -1
-}
View
6 deps/npm/node_modules/mkdirp/examples/pow.js
@@ -1,6 +0,0 @@
-var mkdirp = require('mkdirp');
-
-mkdirp('/tmp/foo/bar/baz', 0755, function (err) {
- if (err) console.error(err)
- else console.log('pow!')
-});
View
39 deps/npm/node_modules/mkdirp/test/chmod.js
@@ -1,39 +0,0 @@
-var mkdirp = require('../').mkdirp;
-var path = require('path');
-var fs = require('fs');
-var test = require('tap').test;
-
-var ps = [ '', 'tmp' ];
-
-for (var i = 0; i < 25; i++) {
- var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
- ps.push(dir);
-}
-
-var file = ps.join('/');
-
-test('chmod-pre', function (t) {
- var mode = 0744
- mkdirp(file, mode, function (er) {
- t.ifError(er, 'should not error');
- fs.stat(file, function (er, stat) {
- t.ifError(er, 'should exist');
- t.ok(stat && stat.isDirectory(), 'should be directory');
- t.equal(stat && stat.mode & 0777, mode, 'should be 0744');
- t.end();
- });
- });
-});
-
-test('chmod', function (t) {
- var mode = 0755
- mkdirp(file, mode, function (er) {
- t.ifError(er, 'should not error');
- fs.stat(file, function (er, stat) {
- t.ifError(er, 'should exist');
- t.ok(stat && stat.isDirectory(), 'should be directory');
- t.equal(stat && stat.mode & 0777, mode, 'should be 0755');
- t.end();
- });
- });
-});
View
37 deps/npm/node_modules/mkdirp/test/clobber.js
@@ -1,37 +0,0 @@
-var mkdirp = require('../').mkdirp;
-var path = require('path');
-var fs = require('fs');
-var test = require('tap').test;
-
-var ps = [ '', 'tmp' ];
-
-for (var i = 0; i < 25; i++) {
- var dir = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
- ps.push(dir);
-}
-
-var file = ps.join('/');
-
-// a file in the way
-var itw = ps.slice(0, 3).join('/');
-
-
-test('clobber-pre', function (t) {
- console.error("about to write to "+itw)
- fs.writeFileSync(itw, 'I AM IN THE WAY, THE TRUTH, AND THE LIGHT.');
-
- fs.stat(itw, function (er, stat) {
- t.ifError(er)
- t.ok(stat && stat.isFile(), 'should be file')
- t.end()
- })
-})
-
-test('clobber', function (t) {
- t.plan(2);
- mkdirp(file, 0755, function (err) {
- t.ok(err);
- t.equal(err.code, 'ENOTDIR');
- t.end();
- });
-});