Permalink
Browse files

v0.2.0

  • Loading branch information...
1 parent a7b2ac8 commit b9faffb20159ab7f954d84e6bca1dafec8c1d874 Gabriel Llamas committed Dec 9, 2012
Showing with 41,759 additions and 568 deletions.
  1. +0 −2 .gitignore
  2. +51 −0 CHANGES
  3. +19 −42 README.md
  4. +161 −0 buffered-writer.js
  5. +0 −1 build/buffered-writer.js
  6. +0 −21 examples/touch.js
  7. +0 −25 examples/writeBytes.js
  8. +0 −31 examples/writeText.js
  9. 0 {build → }/node_modules/errno-codes/README.md
  10. 0 {build → }/node_modules/errno-codes/error.js
  11. +2 −1 {build → }/node_modules/errno-codes/package.json
  12. +25 −0 package.json
  13. +0 −162 src/buffered-writer.js
  14. +0 −1 test/playground.js
  15. +0 −101 test/tests/node_modules/buffered-reader/README.md
  16. +0 −1 test/tests/node_modules/buffered-reader/buffered-reader.js
  17. +0 −71 test/tests/node_modules/buffered-reader/node_modules/errno-codes/README.md
  18. +0 −1 test/tests/node_modules/buffered-reader/node_modules/errno-codes/error.js
  19. +0 −29 test/tests/node_modules/buffered-reader/node_modules/errno-codes/package.json
  20. +0 −39 test/tests/node_modules/buffered-reader/package.json
  21. +0 −36 test/tests/test1.js
  22. +0 −3 test/tests/utf8.js
  23. +365 −0 tests/buffered-writer.js
  24. +68 −0 tests/node_modules/mocha-runner/README.md
  25. +84 −0 tests/node_modules/mocha-runner/mocha-runner.js
  26. +15 −0 tests/node_modules/mocha-runner/node_modules/.bin/_mocha
  27. +6 −0 tests/node_modules/mocha-runner/node_modules/.bin/_mocha.cmd
  28. +15 −0 tests/node_modules/mocha-runner/node_modules/.bin/mocha
  29. +6 −0 tests/node_modules/mocha-runner/node_modules/.bin/mocha.cmd
  30. +9 −0 tests/node_modules/mocha-runner/node_modules/async/.gitmodules
  31. +4 −0 tests/node_modules/mocha-runner/node_modules/async/.npmignore
  32. +19 −0 tests/node_modules/mocha-runner/node_modules/async/LICENSE
  33. +25 −0 tests/node_modules/mocha-runner/node_modules/async/Makefile
  34. +1,021 −0 tests/node_modules/mocha-runner/node_modules/async/README.md
  35. +3 −0 tests/node_modules/mocha-runner/node_modules/async/index.js
  36. +692 −0 tests/node_modules/mocha-runner/node_modules/async/lib/async.js
  37. +31 −0 tests/node_modules/mocha-runner/node_modules/async/package.json
  38. +51 −0 tests/node_modules/mocha-runner/node_modules/file-utils/README.md
  39. +1 −0 tests/node_modules/mocha-runner/node_modules/file-utils/index.js
  40. +1 −0 tests/node_modules/mocha-runner/node_modules/file-utils/lib/file.js
  41. +1 −0 tests/node_modules/mocha-runner/node_modules/file-utils/lib/security-manager.js
  42. 0 {src → tests/node_modules/mocha-runner/node_modules/file-utils}/node_modules/errno-codes/README.md
  43. 0 {src → tests/node_modules/mocha-runner/node_modules/file-utils}/node_modules/errno-codes/error.js
  44. +2 −1 ... → tests/node_modules/mocha-runner/node_modules/file-utils}/node_modules/errno-codes/package.json
  45. +39 −0 tests/node_modules/mocha-runner/node_modules/file-utils/package.json
  46. +6 −0 tests/node_modules/mocha-runner/node_modules/mocha/.npmignore
  47. +5 −0 tests/node_modules/mocha-runner/node_modules/mocha/.travis.yml
  48. +483 −0 tests/node_modules/mocha-runner/node_modules/mocha/History.md
  49. +22 −0 tests/node_modules/mocha-runner/node_modules/mocha/LICENSE
  50. +126 −0 tests/node_modules/mocha-runner/node_modules/mocha/Makefile
  51. +36 −0 tests/node_modules/mocha-runner/node_modules/mocha/Readme.md
  52. +4,883 −0 tests/node_modules/mocha-runner/node_modules/mocha/_mocha.js
  53. +422 −0 tests/node_modules/mocha-runner/node_modules/mocha/bin/_mocha
  54. +47 −0 tests/node_modules/mocha-runner/node_modules/mocha/bin/mocha
  55. BIN tests/node_modules/mocha-runner/node_modules/mocha/images/error.png
  56. BIN tests/node_modules/mocha-runner/node_modules/mocha/images/ok.png
  57. +4 −0 tests/node_modules/mocha-runner/node_modules/mocha/index.js
  58. +6 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/browser/debug.js
  59. 0 tests/node_modules/mocha-runner/node_modules/mocha/lib/browser/diff.js
  60. +178 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/browser/events.js
  61. 0 tests/node_modules/mocha-runner/node_modules/mocha/lib/browser/fs.js
  62. 0 tests/node_modules/mocha-runner/node_modules/mocha/lib/browser/path.js
  63. +125 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/browser/progress.js
  64. +8 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/browser/tty.js
  65. +69 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/context.js
  66. +50 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/hook.js
  67. +133 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/interfaces/bdd.js
  68. +60 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/interfaces/exports.js
  69. +5 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/interfaces/index.js
  70. +91 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/interfaces/qunit.js
  71. +123 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/interfaces/tdd.js
  72. +301 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/mocha.js
  73. +81 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/ms.js
  74. +381 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/base.js
  75. +56 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/doc.js
  76. +62 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/dot.js
  77. +51 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/html-cov.js
  78. +255 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/html.js
  79. +19 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/index.js
  80. +153 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/json-cov.js
  81. +61 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/json-stream.js
  82. +70 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/json.js
  83. +97 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/landing.js
  84. +64 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/list.js
  85. +92 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/markdown.js
  86. +38 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/min.js
  87. +259 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/nyan.js
  88. +86 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/progress.js
  89. +87 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/spec.js
  90. +63 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/tap.js
  91. +65 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/teamcity.js
  92. +50 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/templates/coverage.jade
  93. +13 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/templates/menu.jade
  94. +34 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/templates/script.html
  95. +307 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/templates/style.html
  96. +115 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/reporters/xunit.js
  97. +219 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/runnable.js
  98. +529 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/runner.js
  99. +296 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/suite.js
  100. +17 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/template.html
  101. +32 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/test.js
  102. +282 −0 tests/node_modules/mocha-runner/node_modules/mocha/lib/utils.js
  103. +227 −0 tests/node_modules/mocha-runner/node_modules/mocha/mocha.css
  104. +4,999 −0 tests/node_modules/mocha-runner/node_modules/mocha/mocha.js
  105. +15 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/.bin/jade
  106. +6 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/.bin/jade.cmd
  107. +4 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/commander/.npmignore
  108. +4 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/commander/.travis.yml
  109. +107 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/commander/History.md
  110. +7 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/commander/Makefile
  111. +262 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/commander/Readme.md
  112. +2 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/commander/index.js
  113. +1,026 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/commander/lib/commander.js
  114. +35 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/commander/package.json
  115. +4 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/.npmignore
  116. +47 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/History.md
  117. +4 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/Makefile
  118. +130 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/Readme.md
  119. +120 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/debug.component.js
  120. +116 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/debug.js
  121. +19 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/example/app.js
  122. +24 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/example/browser.html
  123. +10 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/example/wildcards.js
  124. +22 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/example/worker.js
  125. +1 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/head.js
  126. +2 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/index.js
  127. +135 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/lib/debug.js
  128. +32 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/package.json
  129. +4 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/debug/tail.js
  130. +31 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/diff/LICENSE
  131. +94 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/diff/README.md
  132. +287 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/diff/diff.js
  133. +89 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/diff/index.html
  134. +43 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/diff/package.json
  135. +81 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/diff/style.css
  136. +616 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/diff/test/diffTest.js
  137. +58 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/growl/History.md
  138. +99 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/growl/Readme.md
  139. +232 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/growl/lib/growl.js
  140. +14 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/growl/package.json
  141. +20 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/growl/test.js
  142. +15 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/.npmignore
  143. +22 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/LICENSE
  144. +147 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/bin/jade
  145. +4 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/index.js
  146. +3,586 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/jade.js
  147. +510 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/jade.md
  148. +2 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/jade.min.js
  149. +642 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/compiler.js
  150. +18 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/doctypes.js
  151. +97 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/filters.js
  152. +28 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/inline-tags.js
  153. +237 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/jade.js
  154. +771 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/lexer.js
  155. +77 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/attrs.js
  156. +33 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/block-comment.js
  157. +121 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/block.js
  158. +43 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/case.js
  159. +35 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/code.js
  160. +32 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/comment.js
  161. +29 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/doctype.js
  162. +35 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/each.js
  163. +35 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/filter.js
  164. +20 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/index.js
  165. +32 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/literal.js
  166. +36 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/mixin.js
  167. +25 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/node.js
  168. +95 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/tag.js
  169. +36 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/nodes/text.js
  170. +710 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/parser.js
  171. +174 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/runtime.js
  172. +19 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/self-closing.js
  173. +49 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/lib/utils.js
  174. +2 −0 ...ode_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.orig
  175. +5 −0 ...node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.gitignore.rej
  176. +2 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/.npmignore
  177. +21 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/LICENSE
  178. +54 −0 ...ode_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/README.markdown
  179. +6 −0 ...ode_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js
  180. +6 −0 ...odules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.orig
  181. +19 −0 ...modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/examples/pow.js.rej
  182. +79 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/index.js
  183. +33 −0 ...s/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/package.json
  184. +38 −0 .../node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/chmod.js
  185. +37 −0 ...ode_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/clobber.js
  186. +28 −0 ...node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/mkdirp.js
  187. +32 −0 ...s/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm.js
  188. +39 −0 ...e_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/perm_sync.js
  189. +41 −0 ...s/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/race.js
  190. +32 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/rel.js
  191. +27 −0 ...s/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/sync.js
  192. +28 −0 .../node_modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask.js
  193. +27 −0 ..._modules/mocha-runner/node_modules/mocha/node_modules/jade/node_modules/mkdirp/test/umask_sync.js
  194. +44 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/package.json
  195. +179 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/runtime.js
  196. +1 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/runtime.min.js
  197. +7 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/test.jade
  198. +5 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/testing/head.jade
  199. +22 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/testing/index.jade
  200. +11 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/testing/index.js
  201. +6 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/testing/layout.jade
  202. +7 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/testing/user.jade
  203. +27 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/jade/testing/user.js
  204. +2 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/.gitignore.orig
  205. +5 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/.gitignore.rej
  206. +2 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/.npmignore
  207. +4 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/.travis.yml
  208. +21 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/LICENSE
  209. +61 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/README.markdown
  210. +6 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/examples/pow.js
  211. +6 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/examples/pow.js.orig
  212. +19 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/examples/pow.js.rej
  213. +94 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/index.js
  214. +33 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/package.json
  215. +38 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/chmod.js
  216. +37 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/clobber.js
  217. +28 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/mkdirp.js
  218. +32 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/perm.js
  219. +39 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/perm_sync.js
  220. +41 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/race.js
  221. +32 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/rel.js
  222. +25 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/return.js
  223. +24 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/return_sync.js
  224. +18 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/root.js
  225. +32 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/sync.js
  226. +28 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/umask.js
  227. +32 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/mkdirp/test/umask_sync.js
  228. +1 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/.npmignore
  229. +21 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/History.md
  230. +8 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/Makefile
  231. +24 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/README.md
  232. +7 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/component.json
  233. +81 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/ms.js
  234. +15 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/package.json
  235. +19 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/test/index.html
  236. +9,266 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/test/support/jquery.js
  237. +85 −0 tests/node_modules/mocha-runner/node_modules/mocha/node_modules/ms/test/test.js
  238. +47 −0 tests/node_modules/mocha-runner/node_modules/mocha/package.json
  239. +38 −0 tests/node_modules/mocha-runner/node_modules/mocha/test.js
  240. +38 −0 tests/node_modules/mocha-runner/package.json
  241. +9 −0 tests/run.js
View
@@ -1,2 +0,0 @@
-doc
-manage
View
51 CHANGES
@@ -0,0 +1,51 @@
+v0.2.0 (xx Dec 2012)
+ Complete code revision and refactor.
+ Removed "touch()".
+ Added "open()".
+ Minor improvements.
+
+v0.1.12 (09 Oct 2012)
+ Minor bugfixes.
+
+v0.1.11 (17 Aug 2012)
+ Updated errno-codes module.
+
+v0.1.10 (05 Aug 2012)
+ Better error management.
+
+v0.1.9 (24 Jul 2012)
+ Added touch() function.
+
+v0.1.8 (22 Jul 2012)
+ Improved code when the data to write had a length of 0.
+
+v0.1.7 (24 May 2012)
+ Fixed "error" event. Now is correctly emitted.
+
+v0.1.6 (04 May 2012)
+ Wow... Fixed noob error.
+
+v0.1.5 (04 May 2012)
+ Fixed bug when the data length exceeds the buffer size.
+ Fixed bug with utf8 encoding.
+
+v0.1.4 (02 May 2012)
+ Now the constructor receives an object in literal notation for the settings.
+ The "close()" function now receives a callback for being notified when the
+ data has been flushed to the kernel and it's safe to read it back.
+
+v0.1.3 (30 Apr 2012)
+ Improved number to hex array function.
+
+v0.1.2 (29 Apr 2012)
+ Now it's possible to write more than one byte passing a number, eg.:
+ "write(0x1234)" will write 0x12, 0x34.
+
+v0.1.1 (28 Apr 2012)
+ Fixed parameters in "write()" function.
+
+v0.1.0 (28 Apr 2012)
+ No more callbacks. The buffer is flushed using a WriteStream.
+
+v0.0.1 (28 Apr 2012)
+ First commit.
View
@@ -1,61 +1,38 @@
-<a name="start"></a>
-
-Node BufferedWriter
-===================
+buffered-writer
+===============
_Node.js project_
-#### Fully configurable buffered writer ####
-
-[Show me!](#showme) | [Availability](#availability) | [Compatibility](#compatibility) | [Documentation](#documentation)
+#### Writes buffered data ####
-Version: 0.1.12
+Version: 0.2.0
When you need to write a file you typically write the content in little chunks at a time. To avoid multiple calls to the underlying I/O layer you need to use a piece of memory called "buffer", so instead of writting directly to the disk, you write to the buffer and when it is filled the content is written to disk. Doing this you win performance.
This library allows you to write files using internal buffers, so you don't have to worry about them.
-<a name="showme"></a>
-#### Show me! [](#start) ####
+#### Installation ####
+
+```
+npm install buffered-writer
+```
+
+#### Example ####
```javascript
-var BufferedWriter = require ("buffered-writer");
+var bw = require ("buffered-writer");
-new BufferedWriter ("file")
+bw.open ("file")
.on ("error", function (error){
console.log (error);
})
-
- .write ([0x00, 0x01, 0x02], 0, 3) //Writes 0x00, 0x01, 0x02
- .write (new Buffer ([0x03, 0x04]), 1, 1) //Writes 0x04
- .write (0x0506) //Writes 0x05, 0x06
+ .write ([0x00, 0x01, 0x02]) //Writes: 0x00, 0x01, 0x02
+ .write (new Buffer ([0x03, 0x04]), 1, 1) //Writes: 0x04
+ .write (0x0506) //Writes: 0x05, 0x06
+ .write ("a↑b", 1) //Writes: ↑ (0xe2, 0x86, 0x91)
.close ();
```
-***
-
-<a name="availability"></a>
-#### Availability [](#start) ####
-
-Via npm:
-
-```
-npm install buffered-writer
-```
-
-***
-
-<a name="compatibility"></a>
-#### Compatibility [](#start) ####
-
-✔ Node 0.4.10+
-
-***
+#### Methods ####
-<a name="documentation"></a>
-#### Documentation [](#start) ####
-
-[Reference](https://github.com/Gagle/Node-BufferedWriter/wiki/Reference)
-[Examples](https://github.com/Gagle/Node-BufferedWriter/tree/master/examples)
-[Change Log](https://github.com/Gagle/Node-BufferedWriter/wiki/Change-Log)
-[MIT License](https://github.com/Gagle/Node-BufferedWriter/blob/master/LICENSE)
+todo
View
@@ -0,0 +1,161 @@
+"use strict";
+
+var EVENTS = require ("events");
+var FS = require ("fs");
+var errno = require ("errno-codes");
+
+errno.create (errno.getNextAvailableErrno (), "INVALID_BUFFER_SIZE",
+ "The buffer size must be greater than 0.");
+errno.create (errno.getNextAvailableErrno (), "STREAM_CLOSED",
+ "The stream is already closed, cannot write nor close it again.");
+errno.create (errno.getNextAvailableErrno (), "INVALID_OFFSET_LENGTH",
+ "The offset or length parameters are not valid (offset={offset}, " +
+ "length={length}, length-offset<0).");
+
+var BUFFER_SIZE = 16384;
+var EOL = process.platform === "win32"
+ ? new Buffer ([0x0d, 0x0a])
+ : new Buffer ([0x0a]);
+
+var bw = module.exports = {};
+
+bw.open = function (file, args){
+ args = args || {};
+
+ if (args.bufferSize === 0) args.bufferSize = -1;
+ args.bufferSize = args.bufferSize || BUFFER_SIZE;
+ if (args.bufferSize < 1) throw errno.get ("INVALID_BUFFER_SIZE");
+
+ return new Writer (file, args);
+};
+
+var Writer = function (file, args){
+ EVENTS.EventEmitter.call (this);
+
+ this._bufferSize = args.bufferSize;
+ this._encoding = args.encoding;
+ this._buffer = null;
+ this._offset = 0;
+ this._closed = false;
+
+ var me = this;
+ this._stream = FS.createWriteStream (file, {
+ flags: args.append ? "a" : "w",
+ encoding: args.encoding
+ }).on ("error", function (error){
+ me.emit ("error", error);
+ });
+};
+
+Writer.prototype = Object.create (EVENTS.EventEmitter.prototype);
+Writer.prototype.constructor = Writer;
+
+Writer.prototype._error = function (error){
+ if (this.listeners ("error").length !== 0){
+ this.emit ("error", error);
+ }else{
+ throw error;
+ }
+};
+
+Writer.prototype._flush = function (){
+ this._stream.write (new Buffer (this._offset !== this._bufferSize ?
+ this._buffer.slice (0, this._offset) : this._buffer));
+ this._offset = 0;
+};
+
+Writer.prototype._write = function (data, offset, length){
+ var me = this;
+
+ if (!this._buffer){
+ this._buffer = new Buffer (this._bufferSize);
+ }
+
+ var bytes = length + this._offset > this._bufferSize ?
+ this._bufferSize - this._offset :
+ length;
+
+ data.copy (this._buffer, this._offset, offset, offset + bytes);
+ this._offset += bytes;
+ offset += bytes;
+ length -= bytes;
+ if (this._offset === this._bufferSize){
+ this._flush ();
+ if (length !== 0){
+ this._write (data, offset, length);
+ }
+ }
+};
+
+Writer.prototype.close = function (cb){
+ if (this._closed){
+ return this._error (errno.get ("STREAM_CLOSED"));
+ }
+
+ if (this._offset){
+ this._flush ();
+ }
+
+ var me = this;
+ this._stream.on ("close", function (){
+ if (cb) cb ();
+ });
+ this._stream.destroySoon ();
+ this._closed = true;
+};
+
+Writer.prototype.line = function (){
+ if (this._closed){
+ return this._error (errno.get ("STREAM_CLOSED"));
+ }
+ this._write (EOL, 0, EOL.length);
+ return this;
+};
+
+var toHexArray = function (n){
+ var array = [];
+ do{
+ array.unshift (n & 0xff);
+ n = n >>> 8;
+ }while (n);
+ return array;
+};
+
+Writer.prototype.write = function (buffer, offset, length){
+ if (this._closed){
+ return this._error (errno.get ("STREAM_CLOSED"));
+ }
+
+ offset = offset || 0;
+ var type = typeof buffer;
+ if (type === "number"){
+ buffer = toHexArray (buffer);
+ length = length || buffer.length - offset;
+ buffer = new Buffer (buffer);
+ }else if (type === "string"){
+ length = length || Buffer.byteLength (buffer, this._encoding) - offset;
+ buffer = new Buffer (buffer, this._encoding);
+ }else if (Array.isArray (buffer)){
+ buffer = new Buffer (buffer);
+ length = length || buffer.length - offset;
+ }else{
+ //Buffer
+ length = length || buffer.length - offset;
+ }
+
+ if (length < 0){
+ var me = this;
+ this.close (function (){
+ me._error (errno.get ("INVALID_OFFSET_LENGTH", {
+ offset: offset,
+ length: length
+ }));
+ });
+ return;
+ }
+
+ if (length !== 0){
+ this._write (buffer, offset, length);
+ }
+ return this;
+};
View

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
View
@@ -1,21 +0,0 @@
-var BufferedWriter = require ("../build/buffered-writer");
-
-new BufferedWriter ("file")
- .on ("error", function (error){
- console.log (error);
- })
-
- .write ("some data")
- .close (function (){
- //The file contains: "some data"
-
- new BufferedWriter ("file", { append: true })
- .on ("error", function (error){
- console.log (error);
- })
-
- .touch () //Truncates the file to zero length, no matter if the settings are configured to append
- .write ("test")
- .touch ().touch () //No operation because the file is already opened
- .close (); //The file contains: "test"
- });
View
@@ -1,25 +0,0 @@
-var BufferedWriter = require ("../build/buffered-writer");
-
-//The BufferedWriter truncates the file because append == false
-new BufferedWriter ("file")
- .on ("error", function (error){
- console.log (error);
- })
-
- //From the beginning of the file:
- .write ([0x00, 0x01, 0x02], 0, 3) //Writes 0x00, 0x01, 0x02
- .write (new Buffer ([0x03, 0x04]), 1, 1) //Writes 0x04
- .write (0x0506) //Writes 0x05, 0x06
- .close (); //Closes the writer. A flush is implicitly done.
-
-//The BufferedWriter appends content to the end of the file because append == true
-new BufferedWriter ("file", { append: true })
- .on ("error", function (error){
- console.log (error);
- })
-
- //From the end of the file:
- .write (0xFF) //Writes 0xFF
- .close (); //Closes the writer. A flush is implicitly done.
-
-//The file contains: 0x00, 0x01, 0x02, 0x04, 0x05, 0x06, 0xFF
View
@@ -1,31 +0,0 @@
-var BufferedWriter = require ("../build/buffered-writer");
-
-//The BufferedWriter truncates the file because append == false
-new BufferedWriter ("file", { encoding: "utf8" })
- .on ("error", function (error){
- console.log (error);
- })
-
- //From the beginning of the file:
- .write ("First line") //Writes "First line"
- .newLine () //Writes EOL (OS dependent; \r\n on Windows, otherwise \n)
- .write ("Second line") //Writes "Second line"
- .close (); //Closes the writer. A flush is implicitly done.
-
-//The BufferedWriter appends content to the end of the file because append == true
-new BufferedWriter ("file", { encoding: "utf8", append: true })
- .on ("error", function (error){
- console.log (error);
- })
-
- //From the end of the file:
- .newLine () //Writes EOL (OS dependent; \r\n on Windows, otherwise \n)
- .write ("Third line") //Writes "Third line"
- .close (); //Closes the writer. A flush is implicitly done.
-
-//The file contains:
-/*
- First line
- Second line
- Third line
-*/

Some generated files are not rendered by default. Learn more.

Oops, something went wrong.
Oops, something went wrong.

0 comments on commit b9faffb

Please sign in to comment.