pleeease 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (615) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +22 -0
  3. data/Gemfile +4 -0
  4. data/LICENSE.txt +22 -0
  5. data/README.md +23 -0
  6. data/Rakefile +1 -0
  7. data/lib/pleeease.rb +9 -0
  8. data/lib/pleeease/processor.rb +13 -0
  9. data/lib/pleeease/railtie.rb +10 -0
  10. data/lib/pleeease/runner.rb +70 -0
  11. data/lib/pleeease/version.rb +3 -0
  12. data/node_modules/.bin/pleeease +13 -0
  13. data/node_modules/.bin/pleeease-compile +20 -0
  14. data/node_modules/.bin/pleeease-watch +20 -0
  15. data/node_modules/pleeease/.jshintignore +1 -0
  16. data/node_modules/pleeease/.jshintrc +28 -0
  17. data/node_modules/pleeease/.npmignore +2 -0
  18. data/node_modules/pleeease/README.md +288 -0
  19. data/node_modules/pleeease/app.min.css.map +1 -0
  20. data/node_modules/pleeease/bin/pleeease +13 -0
  21. data/node_modules/pleeease/bin/pleeease-compile +20 -0
  22. data/node_modules/pleeease/bin/pleeease-watch +20 -0
  23. data/node_modules/pleeease/jshint.sh +2 -0
  24. data/node_modules/pleeease/lib/cli.js +136 -0
  25. data/node_modules/pleeease/lib/index.js +97 -0
  26. data/node_modules/pleeease/lib/options.js +38 -0
  27. data/node_modules/pleeease/lib/processors/import.js +123 -0
  28. data/node_modules/pleeease/lib/processors/pseudoElements.js +24 -0
  29. data/node_modules/pleeease/node_modules/.bin/autoprefixer +13 -0
  30. data/node_modules/pleeease/node_modules/.bin/csswring +3 -0
  31. data/node_modules/pleeease/node_modules/.bin/mkdirp +33 -0
  32. data/node_modules/pleeease/node_modules/autoprefixer/ChangeLog.md +354 -0
  33. data/node_modules/pleeease/node_modules/autoprefixer/LICENSE +20 -0
  34. data/node_modules/pleeease/node_modules/autoprefixer/README.md +565 -0
  35. data/node_modules/pleeease/node_modules/autoprefixer/bin/autoprefixer +13 -0
  36. data/node_modules/pleeease/node_modules/autoprefixer/data/browsers.js +53 -0
  37. data/node_modules/pleeease/node_modules/autoprefixer/data/prefixes.js +323 -0
  38. data/node_modules/pleeease/node_modules/autoprefixer/lib/autoprefixer.js +109 -0
  39. data/node_modules/pleeease/node_modules/autoprefixer/lib/binary.js +344 -0
  40. data/node_modules/pleeease/node_modules/autoprefixer/lib/browsers.js +197 -0
  41. data/node_modules/pleeease/node_modules/autoprefixer/lib/declaration.js +152 -0
  42. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/align-content.js +57 -0
  43. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/align-items.js +57 -0
  44. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/align-self.js +55 -0
  45. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/border-image.js +28 -0
  46. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/border-radius.js +56 -0
  47. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/break-inside.js +54 -0
  48. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/display-flex.js +67 -0
  49. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/fill-available.js +41 -0
  50. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/filter.js +29 -0
  51. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/flex-basis.js +47 -0
  52. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/flex-direction.js +71 -0
  53. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/flex-flow.js +35 -0
  54. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/flex-grow.js +41 -0
  55. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/flex-shrink.js +47 -0
  56. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/flex-spec.js +11 -0
  57. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/flex-wrap.js +33 -0
  58. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/flex.js +56 -0
  59. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/fullscreen.js +33 -0
  60. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/gradient.js +217 -0
  61. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/justify-content.js +62 -0
  62. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/order.js +52 -0
  63. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/placeholder.js +39 -0
  64. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/transform-decl.js +59 -0
  65. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/transform-value.js +31 -0
  66. data/node_modules/pleeease/node_modules/autoprefixer/lib/hacks/transition.js +37 -0
  67. data/node_modules/pleeease/node_modules/autoprefixer/lib/info.js +114 -0
  68. data/node_modules/pleeease/node_modules/autoprefixer/lib/keyframes.js +40 -0
  69. data/node_modules/pleeease/node_modules/autoprefixer/lib/old-selector.js +68 -0
  70. data/node_modules/pleeease/node_modules/autoprefixer/lib/old-value.js +29 -0
  71. data/node_modules/pleeease/node_modules/autoprefixer/lib/prefixer.js +88 -0
  72. data/node_modules/pleeease/node_modules/autoprefixer/lib/prefixes.js +334 -0
  73. data/node_modules/pleeease/node_modules/autoprefixer/lib/processor.js +105 -0
  74. data/node_modules/pleeease/node_modules/autoprefixer/lib/selector.js +117 -0
  75. data/node_modules/pleeease/node_modules/autoprefixer/lib/updater.js +234 -0
  76. data/node_modules/pleeease/node_modules/autoprefixer/lib/utils.js +41 -0
  77. data/node_modules/pleeease/node_modules/autoprefixer/lib/value.js +99 -0
  78. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/.npmignore +2 -0
  79. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/CHANGELOG.md +126 -0
  80. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/LICENSE +15 -0
  81. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/README.md +371 -0
  82. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/lib/copy.js +79 -0
  83. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/lib/create.js +55 -0
  84. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/lib/ensure.js +4 -0
  85. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/lib/index.js +137 -0
  86. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/lib/json.js +30 -0
  87. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/lib/mkdir.js +8 -0
  88. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/lib/move.js +108 -0
  89. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/lib/output.js +37 -0
  90. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/lib/remove.js +19 -0
  91. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/.bin/mkdirp +33 -0
  92. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/.bin/ncp +48 -0
  93. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/.bin/rimraf +33 -0
  94. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/jsonfile/.npmignore +2 -0
  95. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/jsonfile/CHANGELOG.md +20 -0
  96. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/jsonfile/LICENSE +15 -0
  97. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/jsonfile/README.md +121 -0
  98. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/jsonfile/lib/jsonfile.js +47 -0
  99. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/jsonfile/package.json +44 -0
  100. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/.npmignore +2 -0
  101. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/.travis.yml +5 -0
  102. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/LICENSE +21 -0
  103. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/bin/cmd.js +33 -0
  104. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/bin/usage.txt +12 -0
  105. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/examples/pow.js +6 -0
  106. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/index.js +97 -0
  107. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/.travis.yml +4 -0
  108. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/LICENSE +18 -0
  109. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/example/parse.js +2 -0
  110. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/index.js +187 -0
  111. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/package.json +52 -0
  112. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/readme.markdown +73 -0
  113. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/test/dash.js +24 -0
  114. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/test/default_bool.js +20 -0
  115. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/test/dotted.js +16 -0
  116. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/test/long.js +31 -0
  117. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/test/parse.js +318 -0
  118. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +9 -0
  119. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/test/short.js +67 -0
  120. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/node_modules/minimist/test/whitespace.js +8 -0
  121. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/package.json +43 -0
  122. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/readme.markdown +100 -0
  123. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/chmod.js +38 -0
  124. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/clobber.js +37 -0
  125. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/mkdirp.js +26 -0
  126. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/opts_fs.js +27 -0
  127. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/opts_fs_sync.js +25 -0
  128. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/perm.js +30 -0
  129. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/perm_sync.js +34 -0
  130. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/race.js +40 -0
  131. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/rel.js +30 -0
  132. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/return.js +25 -0
  133. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/return_sync.js +24 -0
  134. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/root.js +18 -0
  135. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/sync.js +30 -0
  136. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/umask.js +26 -0
  137. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/mkdirp/test/umask_sync.js +30 -0
  138. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/.npmignore +4 -0
  139. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/.travis.yml +6 -0
  140. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/LICENSE.md +21 -0
  141. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/README.md +58 -0
  142. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/bin/ncp +48 -0
  143. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/lib/ncp.js +230 -0
  144. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/package.json +43 -0
  145. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/a +1 -0
  146. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/b +1 -0
  147. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/c +0 -0
  148. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/d +0 -0
  149. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/e +0 -0
  150. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/f +0 -0
  151. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/a +1 -0
  152. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/test/fixtures/src/sub/b +0 -0
  153. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/ncp/test/ncp.js +86 -0
  154. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/AUTHORS +6 -0
  155. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/LICENSE +23 -0
  156. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/README.md +30 -0
  157. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/bin.js +33 -0
  158. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/package.json +58 -0
  159. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/rimraf.js +248 -0
  160. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/test/run.sh +16 -0
  161. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/test/setup.sh +47 -0
  162. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/test/test-async.js +5 -0
  163. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/node_modules/rimraf/test/test-sync.js +3 -0
  164. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/fs-extra/package.json +68 -0
  165. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/ChangeLog.md +46 -0
  166. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/LICENSE +20 -0
  167. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/README.md +784 -0
  168. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/at-rule.js +94 -0
  169. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/comment.js +38 -0
  170. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/container.js +315 -0
  171. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/declaration.js +69 -0
  172. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/lazy.js +18 -0
  173. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/list.js +64 -0
  174. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/map-generator.js +242 -0
  175. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/node.js +189 -0
  176. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/parse.js +496 -0
  177. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/postcss.js +78 -0
  178. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/raw.js +32 -0
  179. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/result.js +26 -0
  180. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/root.js +57 -0
  181. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/rule.js +59 -0
  182. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/syntax-error.js +27 -0
  183. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/lib/vendor.js +27 -0
  184. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/base64-js/.travis.yml +5 -0
  185. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/base64-js/LICENSE.MIT +21 -0
  186. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/base64-js/README.md +31 -0
  187. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/base64-js/bench/bench.js +19 -0
  188. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/base64-js/lib/b64.js +120 -0
  189. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/base64-js/package.json +47 -0
  190. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/base64-js/test/convert.js +51 -0
  191. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/.npmignore +2 -0
  192. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/.tern-port +1 -0
  193. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/.travis.yml +4 -0
  194. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/CHANGELOG.md +137 -0
  195. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/LICENSE +28 -0
  196. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/Makefile.dryice.js +166 -0
  197. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/README.md +446 -0
  198. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/assert-shim.js +56 -0
  199. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/mini-require.js +152 -0
  200. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/prefix-source-map.jsm +20 -0
  201. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/prefix-utils.jsm +18 -0
  202. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/suffix-browser.js +8 -0
  203. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/suffix-source-map.jsm +6 -0
  204. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/suffix-utils.jsm +21 -0
  205. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/test-prefix.js +8 -0
  206. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/build/test-suffix.js +3 -0
  207. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/lib/source-map.js +8 -0
  208. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/lib/source-map/array-set.js +97 -0
  209. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
  210. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/lib/source-map/base64.js +42 -0
  211. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/lib/source-map/binary-search.js +81 -0
  212. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/lib/source-map/source-map-consumer.js +478 -0
  213. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/lib/source-map/source-map-generator.js +400 -0
  214. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/lib/source-map/source-node.js +400 -0
  215. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/lib/source-map/util.js +302 -0
  216. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  217. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/node_modules/amdefine/README.md +171 -0
  218. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
  219. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/node_modules/amdefine/intercept.js +36 -0
  220. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/node_modules/amdefine/package.json +39 -0
  221. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/package.json +132 -0
  222. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/run-tests.js +62 -0
  223. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-api.js +26 -0
  224. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-array-set.js +104 -0
  225. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
  226. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-base64.js +35 -0
  227. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
  228. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-dog-fooding.js +84 -0
  229. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-source-map-consumer.js +475 -0
  230. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-source-map-generator.js +549 -0
  231. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-source-node.js +487 -0
  232. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/test-util.js +127 -0
  233. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/node_modules/source-map/test/source-map/util.js +161 -0
  234. data/node_modules/pleeease/node_modules/autoprefixer/node_modules/postcss/package.json +46 -0
  235. data/node_modules/pleeease/node_modules/autoprefixer/package.json +49 -0
  236. data/node_modules/pleeease/node_modules/autoprefixer/updaters/browsers.js +65 -0
  237. data/node_modules/pleeease/node_modules/autoprefixer/updaters/prefixes.js +273 -0
  238. data/node_modules/pleeease/node_modules/chokidar/.npmignore +35 -0
  239. data/node_modules/pleeease/node_modules/chokidar/CHANGELOG.md +95 -0
  240. data/node_modules/pleeease/node_modules/chokidar/README.md +121 -0
  241. data/node_modules/pleeease/node_modules/chokidar/example.js +3 -0
  242. data/node_modules/pleeease/node_modules/chokidar/index.js +425 -0
  243. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/README.md +22 -0
  244. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/index.js +45 -0
  245. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/package.json +39 -0
  246. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/test/recursive-raddir-test.js +17 -0
  247. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/test/testdir/a/a +0 -0
  248. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/test/testdir/a/beans +0 -0
  249. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/test/testdir/b/123 +0 -0
  250. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/test/testdir/b/b/hurp-durp +0 -0
  251. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/test/testdir/c.txt +0 -0
  252. data/node_modules/pleeease/node_modules/chokidar/node_modules/recursive-readdir/test/testdir/d.txt +0 -0
  253. data/node_modules/pleeease/node_modules/chokidar/package.json +55 -0
  254. data/node_modules/pleeease/node_modules/chokidar/test.js +296 -0
  255. data/node_modules/pleeease/node_modules/colors/MIT-LICENSE.txt +22 -0
  256. data/node_modules/pleeease/node_modules/colors/ReadMe.md +77 -0
  257. data/node_modules/pleeease/node_modules/colors/colors.js +342 -0
  258. data/node_modules/pleeease/node_modules/colors/example.html +76 -0
  259. data/node_modules/pleeease/node_modules/colors/example.js +77 -0
  260. data/node_modules/pleeease/node_modules/colors/package.json +29 -0
  261. data/node_modules/pleeease/node_modules/colors/test.js +70 -0
  262. data/node_modules/pleeease/node_modules/colors/themes/winston-dark.js +12 -0
  263. data/node_modules/pleeease/node_modules/colors/themes/winston-light.js +12 -0
  264. data/node_modules/pleeease/node_modules/commander/Readme.md +208 -0
  265. data/node_modules/pleeease/node_modules/commander/index.js +852 -0
  266. data/node_modules/pleeease/node_modules/commander/package.json +43 -0
  267. data/node_modules/pleeease/node_modules/css-mqpacker/.npmignore +3 -0
  268. data/node_modules/pleeease/node_modules/css-mqpacker/.sass-cache/ca3e061f00144e273a11e95ed4eb3170f1f7a328/maps-input.scssc +0 -0
  269. data/node_modules/pleeease/node_modules/css-mqpacker/.sass-cache/ca3e061f00144e273a11e95ed4eb3170f1f7a328/sourcemap-expected.scssc +0 -0
  270. data/node_modules/pleeease/node_modules/css-mqpacker/README.md +141 -0
  271. data/node_modules/pleeease/node_modules/css-mqpacker/index.js +1 -0
  272. data/node_modules/pleeease/node_modules/css-mqpacker/lib/css-mqpacker.js +43 -0
  273. data/node_modules/pleeease/node_modules/css-mqpacker/package.json +43 -0
  274. data/node_modules/pleeease/node_modules/css-mqpacker/test/css-mqpacker_test.js +64 -0
  275. data/node_modules/pleeease/node_modules/css-mqpacker/test/expected/multi.css +31 -0
  276. data/node_modules/pleeease/node_modules/css-mqpacker/test/expected/query-order.css +17 -0
  277. data/node_modules/pleeease/node_modules/css-mqpacker/test/expected/simple.css +37 -0
  278. data/node_modules/pleeease/node_modules/css-mqpacker/test/fixtures/multi.css +37 -0
  279. data/node_modules/pleeease/node_modules/css-mqpacker/test/fixtures/query-order.css +19 -0
  280. data/node_modules/pleeease/node_modules/css-mqpacker/test/fixtures/simple.css +41 -0
  281. data/node_modules/pleeease/node_modules/csswring/.npmignore +3 -0
  282. data/node_modules/pleeease/node_modules/csswring/README.md +55 -0
  283. data/node_modules/pleeease/node_modules/csswring/bin/csswring +3 -0
  284. data/node_modules/pleeease/node_modules/csswring/index.js +1 -0
  285. data/node_modules/pleeease/node_modules/csswring/lib/cli.js +93 -0
  286. data/node_modules/pleeease/node_modules/csswring/lib/csswring.js +110 -0
  287. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/.travis.yml +4 -0
  288. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/LICENSE +18 -0
  289. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/example/parse.js +2 -0
  290. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/index.js +187 -0
  291. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/package.json +52 -0
  292. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/readme.markdown +73 -0
  293. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/test/dash.js +24 -0
  294. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/test/default_bool.js +20 -0
  295. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/test/dotted.js +16 -0
  296. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/test/long.js +31 -0
  297. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/test/parse.js +318 -0
  298. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/test/parse_modified.js +9 -0
  299. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/test/short.js +67 -0
  300. data/node_modules/pleeease/node_modules/csswring/node_modules/minimist/test/whitespace.js +8 -0
  301. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/.gitmodules +3 -0
  302. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/.npmignore +2 -0
  303. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/LICENSE +24 -0
  304. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/Makefile +45 -0
  305. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/README.md +313 -0
  306. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/bin/build.js +29 -0
  307. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/component.json +11 -0
  308. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/demo/demo.css +58 -0
  309. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/demo/demo.js +35 -0
  310. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/demo/index.html +54 -0
  311. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color-namedColors.js +150 -0
  312. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color.js +231 -0
  313. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/CMYK.js +31 -0
  314. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/HSL.js +30 -0
  315. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/HSV.js +94 -0
  316. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/LAB.js +33 -0
  317. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/XYZ.js +65 -0
  318. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/_all.js +25 -0
  319. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/_base.js +6 -0
  320. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/clearer.js +3 -0
  321. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/darken.js +5 -0
  322. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/desaturate.js +5 -0
  323. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/greyscale.js +9 -0
  324. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/lighten.js +5 -0
  325. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/mix.js +17 -0
  326. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/negate.js +4 -0
  327. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/opaquer.js +3 -0
  328. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/rotate.js +3 -0
  329. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/saturate.js +5 -0
  330. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/color/plugins/toAlpha.js +46 -0
  331. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/ender.js +5 -0
  332. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/lib/es5-shim.js +97 -0
  333. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/one-color-all-debug.js +754 -0
  334. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/one-color-all.js +1 -0
  335. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/one-color-debug.js +359 -0
  336. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/one-color-ieshim.js +1 -0
  337. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/one-color.js +1 -0
  338. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/package.json +66 -0
  339. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/README.markdown +5 -0
  340. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/boilerplate.html +55 -0
  341. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/classList.js +116 -0
  342. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/img/rainbow-wood.jpg +0 -0
  343. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/index.html +234 -0
  344. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/license.txt +21 -0
  345. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/logo.png +0 -0
  346. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/logo.svg +52 -0
  347. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/plugins/css-controls.js +40 -0
  348. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/plugins/css-edit.js +132 -0
  349. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/plugins/css-snippets.js +89 -0
  350. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/plugins/incrementable.js +94 -0
  351. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/slideshow.css +288 -0
  352. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/slideshow.js +471 -0
  353. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/talk.css +41 -0
  354. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/3rdparty/CSSS/theme.css +214 -0
  355. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/colorcat/css/colorcat.css +36 -0
  356. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/colorcat/css/demo.css +677 -0
  357. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/colorcat/images/transparent.gif +0 -0
  358. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/colorcat/js/colorcat.js +135 -0
  359. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/colorcat/js/one-color-debug.js +1137 -0
  360. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/1024px-HSV_color_solid_cylinder_alpha_lowgamma.png +0 -0
  361. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/ExtJS.png +0 -0
  362. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/HSL.png +0 -0
  363. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/HSV.png +0 -0
  364. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/Hsl-hsv_models_b.svg +450 -0
  365. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/Pixels.jpg +0 -0
  366. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/PullingHair.png +0 -0
  367. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/RGB.png +0 -0
  368. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/RGB_HSL_HSV_comparison.png +0 -0
  369. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/Space_Rainbow_desktop_background_pictures.jpg +0 -0
  370. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/blog.png +0 -0
  371. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/calendar.png +0 -0
  372. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/images/colorSpace.jpg +0 -0
  373. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/index.html +562 -0
  374. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/talk.css +137 -0
  375. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/slides/CPHJS-Oct2011/theme.css +247 -0
  376. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/test/color-test.js +178 -0
  377. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/test/conversion-test.js +46 -0
  378. data/node_modules/pleeease/node_modules/csswring/node_modules/onecolor/test/samples.js +147 -0
  379. data/node_modules/pleeease/node_modules/csswring/package.json +51 -0
  380. data/node_modules/pleeease/node_modules/csswring/test/csswring_test.js +67 -0
  381. data/node_modules/pleeease/node_modules/csswring/test/expected/empty-declarations.css +1 -0
  382. data/node_modules/pleeease/node_modules/csswring/test/expected/extra-semicolons.css +1 -0
  383. data/node_modules/pleeease/node_modules/csswring/test/expected/issue3.css +1 -0
  384. data/node_modules/pleeease/node_modules/csswring/test/expected/simple.css +3 -0
  385. data/node_modules/pleeease/node_modules/csswring/test/expected/single-charset.css +1 -0
  386. data/node_modules/pleeease/node_modules/csswring/test/expected/value.css +1 -0
  387. data/node_modules/pleeease/node_modules/csswring/test/fixtures/empty-declarations.css +12 -0
  388. data/node_modules/pleeease/node_modules/csswring/test/fixtures/extra-semicolons.css +4 -0
  389. data/node_modules/pleeease/node_modules/csswring/test/fixtures/issue3.css +3 -0
  390. data/node_modules/pleeease/node_modules/csswring/test/fixtures/simple.css +31 -0
  391. data/node_modules/pleeease/node_modules/csswring/test/fixtures/single-charset.css +13 -0
  392. data/node_modules/pleeease/node_modules/csswring/test/fixtures/value.css +14 -0
  393. data/node_modules/pleeease/node_modules/deep-extend/.npmignore +1 -0
  394. data/node_modules/pleeease/node_modules/deep-extend/LICENSE +20 -0
  395. data/node_modules/pleeease/node_modules/deep-extend/README.md +52 -0
  396. data/node_modules/pleeease/node_modules/deep-extend/index.js +87 -0
  397. data/node_modules/pleeease/node_modules/deep-extend/package.json +45 -0
  398. data/node_modules/pleeease/node_modules/deep-extend/test/index.spec.js +44 -0
  399. data/node_modules/pleeease/node_modules/deep-extend/test/mocha.opts +1 -0
  400. data/node_modules/pleeease/node_modules/mkdirp/.npmignore +2 -0
  401. data/node_modules/pleeease/node_modules/mkdirp/.travis.yml +5 -0
  402. data/node_modules/pleeease/node_modules/mkdirp/LICENSE +21 -0
  403. data/node_modules/pleeease/node_modules/mkdirp/bin/cmd.js +33 -0
  404. data/node_modules/pleeease/node_modules/mkdirp/bin/usage.txt +12 -0
  405. data/node_modules/pleeease/node_modules/mkdirp/examples/pow.js +6 -0
  406. data/node_modules/pleeease/node_modules/mkdirp/index.js +80 -0
  407. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/.travis.yml +4 -0
  408. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/LICENSE +18 -0
  409. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/example/parse.js +2 -0
  410. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/index.js +187 -0
  411. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/package.json +52 -0
  412. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/readme.markdown +73 -0
  413. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/test/dash.js +24 -0
  414. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/test/default_bool.js +20 -0
  415. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/test/dotted.js +16 -0
  416. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/test/long.js +31 -0
  417. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/test/parse.js +318 -0
  418. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/test/parse_modified.js +9 -0
  419. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/test/short.js +67 -0
  420. data/node_modules/pleeease/node_modules/mkdirp/node_modules/minimist/test/whitespace.js +8 -0
  421. data/node_modules/pleeease/node_modules/mkdirp/package.json +42 -0
  422. data/node_modules/pleeease/node_modules/mkdirp/readme.markdown +90 -0
  423. data/node_modules/pleeease/node_modules/mkdirp/test/chmod.js +38 -0
  424. data/node_modules/pleeease/node_modules/mkdirp/test/clobber.js +37 -0
  425. data/node_modules/pleeease/node_modules/mkdirp/test/mkdirp.js +28 -0
  426. data/node_modules/pleeease/node_modules/mkdirp/test/perm.js +32 -0
  427. data/node_modules/pleeease/node_modules/mkdirp/test/perm_sync.js +39 -0
  428. data/node_modules/pleeease/node_modules/mkdirp/test/race.js +41 -0
  429. data/node_modules/pleeease/node_modules/mkdirp/test/rel.js +32 -0
  430. data/node_modules/pleeease/node_modules/mkdirp/test/return.js +25 -0
  431. data/node_modules/pleeease/node_modules/mkdirp/test/return_sync.js +24 -0
  432. data/node_modules/pleeease/node_modules/mkdirp/test/root.js +18 -0
  433. data/node_modules/pleeease/node_modules/mkdirp/test/sync.js +32 -0
  434. data/node_modules/pleeease/node_modules/mkdirp/test/umask.js +28 -0
  435. data/node_modules/pleeease/node_modules/mkdirp/test/umask_sync.js +32 -0
  436. data/node_modules/pleeease/node_modules/multi-glob/.npmignore +2 -0
  437. data/node_modules/pleeease/node_modules/multi-glob/.travis.yml +3 -0
  438. data/node_modules/pleeease/node_modules/multi-glob/AUTHORS +2 -0
  439. data/node_modules/pleeease/node_modules/multi-glob/LICENSE +27 -0
  440. data/node_modules/pleeease/node_modules/multi-glob/Readme.rst +42 -0
  441. data/node_modules/pleeease/node_modules/multi-glob/autolint.js +20 -0
  442. data/node_modules/pleeease/node_modules/multi-glob/buster.js +6 -0
  443. data/node_modules/pleeease/node_modules/multi-glob/lib/multi-glob.js +39 -0
  444. data/node_modules/pleeease/node_modules/multi-glob/node_modules/async/.travis.yml +3 -0
  445. data/node_modules/pleeease/node_modules/multi-glob/node_modules/async/LICENSE +19 -0
  446. data/node_modules/pleeease/node_modules/multi-glob/node_modules/async/README.md +1646 -0
  447. data/node_modules/pleeease/node_modules/multi-glob/node_modules/async/component.json +11 -0
  448. data/node_modules/pleeease/node_modules/multi-glob/node_modules/async/lib/async.js +1123 -0
  449. data/node_modules/pleeease/node_modules/multi-glob/node_modules/async/package.json +45 -0
  450. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/.npmignore +2 -0
  451. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/.travis.yml +4 -0
  452. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/LICENSE +27 -0
  453. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/README.md +250 -0
  454. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/examples/g.js +9 -0
  455. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/examples/usr-local.js +9 -0
  456. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/glob.js +738 -0
  457. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/inherits/LICENSE +16 -0
  458. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/inherits/README.md +42 -0
  459. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/inherits/inherits.js +1 -0
  460. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/inherits/inherits_browser.js +23 -0
  461. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/inherits/package.json +33 -0
  462. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/inherits/test.js +25 -0
  463. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/.npmignore +1 -0
  464. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/LICENSE +23 -0
  465. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/README.md +218 -0
  466. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/minimatch.js +1061 -0
  467. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/.npmignore +1 -0
  468. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/CONTRIBUTORS +14 -0
  469. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/LICENSE +23 -0
  470. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/README.md +97 -0
  471. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/lib/lru-cache.js +252 -0
  472. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/package.json +33 -0
  473. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/basic.js +369 -0
  474. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/foreach.js +52 -0
  475. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/lru-cache/test/memory-leak.js +50 -0
  476. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/sigmund/LICENSE +27 -0
  477. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/sigmund/README.md +53 -0
  478. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/sigmund/bench.js +283 -0
  479. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/sigmund/package.json +42 -0
  480. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/sigmund/sigmund.js +39 -0
  481. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/node_modules/sigmund/test/basic.js +24 -0
  482. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/package.json +42 -0
  483. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/test/basic.js +399 -0
  484. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/test/brace-expand.js +33 -0
  485. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/test/caching.js +14 -0
  486. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/test/defaults.js +274 -0
  487. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/minimatch/test/extglob-ending-with-state-char.js +8 -0
  488. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/once/LICENSE +27 -0
  489. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/once/README.md +51 -0
  490. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/once/once.js +20 -0
  491. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/once/package.json +42 -0
  492. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/node_modules/once/test/once.js +20 -0
  493. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/package.json +43 -0
  494. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/00-setup.js +176 -0
  495. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/bash-comparison.js +63 -0
  496. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/bash-results.json +354 -0
  497. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/cwd-test.js +55 -0
  498. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/empty-set.js +20 -0
  499. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/error-callback.js +20 -0
  500. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/globstar-match.js +19 -0
  501. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/mark.js +118 -0
  502. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/new-glob-optional-options.js +10 -0
  503. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/nocase-nomagic.js +124 -0
  504. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/pause-resume.js +73 -0
  505. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/readme-issue.js +36 -0
  506. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/root-nomount.js +39 -0
  507. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/root.js +46 -0
  508. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/stat.js +32 -0
  509. data/node_modules/pleeease/node_modules/multi-glob/node_modules/glob/test/zz-cleanup.js +11 -0
  510. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/LICENSE.txt +22 -0
  511. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/README.md +163 -0
  512. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/dist/lodash.compat.js +7157 -0
  513. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/dist/lodash.compat.min.js +61 -0
  514. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/dist/lodash.js +6785 -0
  515. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/dist/lodash.min.js +56 -0
  516. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/dist/lodash.underscore.js +4979 -0
  517. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/dist/lodash.underscore.min.js +39 -0
  518. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/lodash.js +7179 -0
  519. data/node_modules/pleeease/node_modules/multi-glob/node_modules/lodash/package.json +102 -0
  520. data/node_modules/pleeease/node_modules/multi-glob/package.json +46 -0
  521. data/node_modules/pleeease/node_modules/multi-glob/test/multi-glob-test.js +113 -0
  522. data/node_modules/pleeease/node_modules/pixrem/.editorconfig +13 -0
  523. data/node_modules/pleeease/node_modules/pixrem/.gitattributes +1 -0
  524. data/node_modules/pleeease/node_modules/pixrem/.gitignore +2 -0
  525. data/node_modules/pleeease/node_modules/pixrem/.jshintrc +22 -0
  526. data/node_modules/pleeease/node_modules/pixrem/.travis.yml +4 -0
  527. data/node_modules/pleeease/node_modules/pixrem/LICENSE +22 -0
  528. data/node_modules/pleeease/node_modules/pixrem/README.md +108 -0
  529. data/node_modules/pleeease/node_modules/pixrem/lib/pixrem.js +73 -0
  530. data/node_modules/pleeease/node_modules/pixrem/package.json +50 -0
  531. data/node_modules/pleeease/node_modules/pixrem/spec/pixrem-spec.js +78 -0
  532. data/node_modules/pleeease/node_modules/postcss-vars/README.md +84 -0
  533. data/node_modules/pleeease/node_modules/postcss-vars/lib/index.js +91 -0
  534. data/node_modules/pleeease/node_modules/postcss-vars/package.json +18 -0
  535. data/node_modules/pleeease/node_modules/postcss/ChangeLog.md +42 -0
  536. data/node_modules/pleeease/node_modules/postcss/LICENSE +20 -0
  537. data/node_modules/pleeease/node_modules/postcss/README.md +732 -0
  538. data/node_modules/pleeease/node_modules/postcss/lib/at-rule.js +94 -0
  539. data/node_modules/pleeease/node_modules/postcss/lib/comment.js +38 -0
  540. data/node_modules/pleeease/node_modules/postcss/lib/container.js +315 -0
  541. data/node_modules/pleeease/node_modules/postcss/lib/declaration.js +69 -0
  542. data/node_modules/pleeease/node_modules/postcss/lib/lazy.js +18 -0
  543. data/node_modules/pleeease/node_modules/postcss/lib/list.js +64 -0
  544. data/node_modules/pleeease/node_modules/postcss/lib/map-generator.js +242 -0
  545. data/node_modules/pleeease/node_modules/postcss/lib/node.js +189 -0
  546. data/node_modules/pleeease/node_modules/postcss/lib/parse.js +496 -0
  547. data/node_modules/pleeease/node_modules/postcss/lib/postcss.js +76 -0
  548. data/node_modules/pleeease/node_modules/postcss/lib/raw.js +32 -0
  549. data/node_modules/pleeease/node_modules/postcss/lib/result.js +22 -0
  550. data/node_modules/pleeease/node_modules/postcss/lib/root.js +57 -0
  551. data/node_modules/pleeease/node_modules/postcss/lib/rule.js +59 -0
  552. data/node_modules/pleeease/node_modules/postcss/lib/syntax-error.js +27 -0
  553. data/node_modules/pleeease/node_modules/postcss/lib/vendor.js +27 -0
  554. data/node_modules/pleeease/node_modules/postcss/node_modules/base64-js/.travis.yml +5 -0
  555. data/node_modules/pleeease/node_modules/postcss/node_modules/base64-js/LICENSE.MIT +21 -0
  556. data/node_modules/pleeease/node_modules/postcss/node_modules/base64-js/README.md +31 -0
  557. data/node_modules/pleeease/node_modules/postcss/node_modules/base64-js/bench/bench.js +19 -0
  558. data/node_modules/pleeease/node_modules/postcss/node_modules/base64-js/lib/b64.js +120 -0
  559. data/node_modules/pleeease/node_modules/postcss/node_modules/base64-js/package.json +47 -0
  560. data/node_modules/pleeease/node_modules/postcss/node_modules/base64-js/test/convert.js +51 -0
  561. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/.npmignore +2 -0
  562. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/.tern-port +1 -0
  563. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/.travis.yml +4 -0
  564. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/CHANGELOG.md +137 -0
  565. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/LICENSE +28 -0
  566. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/Makefile.dryice.js +166 -0
  567. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/README.md +446 -0
  568. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/assert-shim.js +56 -0
  569. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/mini-require.js +152 -0
  570. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/prefix-source-map.jsm +20 -0
  571. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/prefix-utils.jsm +18 -0
  572. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/suffix-browser.js +8 -0
  573. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/suffix-source-map.jsm +6 -0
  574. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/suffix-utils.jsm +21 -0
  575. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/test-prefix.js +8 -0
  576. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/build/test-suffix.js +3 -0
  577. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/lib/source-map.js +8 -0
  578. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/lib/source-map/array-set.js +97 -0
  579. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/lib/source-map/base64-vlq.js +144 -0
  580. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/lib/source-map/base64.js +42 -0
  581. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/lib/source-map/binary-search.js +81 -0
  582. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/lib/source-map/source-map-consumer.js +478 -0
  583. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/lib/source-map/source-map-generator.js +400 -0
  584. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/lib/source-map/source-node.js +400 -0
  585. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/lib/source-map/util.js +302 -0
  586. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/node_modules/amdefine/LICENSE +58 -0
  587. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/node_modules/amdefine/README.md +171 -0
  588. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/node_modules/amdefine/amdefine.js +299 -0
  589. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/node_modules/amdefine/intercept.js +36 -0
  590. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/node_modules/amdefine/package.json +38 -0
  591. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/package.json +132 -0
  592. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/run-tests.js +62 -0
  593. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-api.js +26 -0
  594. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-array-set.js +104 -0
  595. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-base64-vlq.js +24 -0
  596. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-base64.js +35 -0
  597. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-binary-search.js +54 -0
  598. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-dog-fooding.js +84 -0
  599. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-source-map-consumer.js +475 -0
  600. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-source-map-generator.js +549 -0
  601. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-source-node.js +487 -0
  602. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/test-util.js +127 -0
  603. data/node_modules/pleeease/node_modules/postcss/node_modules/source-map/test/source-map/util.js +161 -0
  604. data/node_modules/pleeease/node_modules/postcss/package.json +46 -0
  605. data/node_modules/pleeease/package.json +40 -0
  606. data/node_modules/pleeease/spec/pleeease-spec.js +112 -0
  607. data/node_modules/pleeease/spec/prefixes.css +1 -0
  608. data/node_modules/pleeease/test/.pleeeaserc +7 -0
  609. data/node_modules/pleeease/test/app.min.css +42 -0
  610. data/node_modules/pleeease/test/bar.css +11 -0
  611. data/node_modules/pleeease/test/foo.css +25 -0
  612. data/node_modules/pleeease/test/import/imported.css +3 -0
  613. data/package.json +11 -0
  614. data/pleeease.gemspec +23 -0
  615. metadata +685 -0
@@ -0,0 +1,25 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('return value', function (t) {
7
+ t.plan(4);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ // should return the first dir created.
15
+ // By this point, it would be profoundly surprising if /tmp didn't
16
+ // already exist, since every other test makes things in there.
17
+ mkdirp(file, function (err, made) {
18
+ t.ifError(err);
19
+ t.equal(made, '/tmp/' + x);
20
+ mkdirp(file, function (err, made) {
21
+ t.ifError(err);
22
+ t.equal(made, null);
23
+ });
24
+ });
25
+ });
@@ -0,0 +1,24 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('return value', function (t) {
7
+ t.plan(2);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ // should return the first dir created.
15
+ // By this point, it would be profoundly surprising if /tmp didn't
16
+ // already exist, since every other test makes things in there.
17
+ // Note that this will throw on failure, which will fail the test.
18
+ var made = mkdirp.sync(file);
19
+ t.equal(made, '/tmp/' + x);
20
+
21
+ // making the same file again should have no effect.
22
+ made = mkdirp.sync(file);
23
+ t.equal(made, null);
24
+ });
@@ -0,0 +1,18 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('root', function (t) {
7
+ // '/' on unix, 'c:/' on windows.
8
+ var file = path.resolve('/');
9
+
10
+ mkdirp(file, 0755, function (err) {
11
+ if (err) throw err
12
+ fs.stat(file, function (er, stat) {
13
+ if (er) throw er
14
+ t.ok(stat.isDirectory(), 'target is a directory');
15
+ t.end();
16
+ })
17
+ });
18
+ });
@@ -0,0 +1,32 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('sync', function (t) {
7
+ t.plan(2);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ try {
15
+ mkdirp.sync(file, 0755);
16
+ } catch (err) {
17
+ t.fail(err);
18
+ return t.end();
19
+ }
20
+
21
+ path.exists(file, function (ex) {
22
+ if (!ex) t.fail('file not created')
23
+ else fs.stat(file, function (err, stat) {
24
+ if (err) t.fail(err)
25
+ else {
26
+ t.equal(stat.mode & 0777, 0755);
27
+ t.ok(stat.isDirectory(), 'target not a directory');
28
+ t.end();
29
+ }
30
+ });
31
+ });
32
+ });
@@ -0,0 +1,28 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('implicit mode from umask', function (t) {
7
+ t.plan(2);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ mkdirp(file, function (err) {
15
+ if (err) t.fail(err);
16
+ else path.exists(file, function (ex) {
17
+ if (!ex) t.fail('file not created')
18
+ else fs.stat(file, function (err, stat) {
19
+ if (err) t.fail(err)
20
+ else {
21
+ t.equal(stat.mode & 0777, 0777 & (~process.umask()));
22
+ t.ok(stat.isDirectory(), 'target not a directory');
23
+ t.end();
24
+ }
25
+ })
26
+ })
27
+ });
28
+ });
@@ -0,0 +1,32 @@
1
+ var mkdirp = require('../');
2
+ var path = require('path');
3
+ var fs = require('fs');
4
+ var test = require('tap').test;
5
+
6
+ test('umask sync modes', function (t) {
7
+ t.plan(2);
8
+ var x = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
9
+ var y = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
10
+ var z = Math.floor(Math.random() * Math.pow(16,4)).toString(16);
11
+
12
+ var file = '/tmp/' + [x,y,z].join('/');
13
+
14
+ try {
15
+ mkdirp.sync(file);
16
+ } catch (err) {
17
+ t.fail(err);
18
+ return t.end();
19
+ }
20
+
21
+ path.exists(file, function (ex) {
22
+ if (!ex) t.fail('file not created')
23
+ else fs.stat(file, function (err, stat) {
24
+ if (err) t.fail(err)
25
+ else {
26
+ t.equal(stat.mode & 0777, (0777 & (~process.umask())));
27
+ t.ok(stat.isDirectory(), 'target not a directory');
28
+ t.end();
29
+ }
30
+ });
31
+ });
32
+ });
@@ -0,0 +1,2 @@
1
+ *.log
2
+ node_modules
@@ -0,0 +1,3 @@
1
+ language: node_js
2
+ node_js:
3
+ - 0.6
@@ -0,0 +1,2 @@
1
+ Christian Johansen (christian@cjohansen.no)
2
+ Stein Magnus Jodal stein.magnus@jodal.no
@@ -0,0 +1,27 @@
1
+ (The BSD License)
2
+
3
+ Copyright (c) 2011-2012, Christian Johansen, christian@cjohansen.no.
4
+ All rights reserved.
5
+
6
+ Redistribution and use in source and binary forms, with or without modification,
7
+ are permitted provided that the following conditions are met:
8
+
9
+ * Redistributions of source code must retain the above copyright notice,
10
+ this list of conditions and the following disclaimer.
11
+ * Redistributions in binary form must reproduce the above copyright notice,
12
+ this list of conditions and the following disclaimer in the documentation
13
+ and/or other materials provided with the distribution.
14
+ * Neither the name of Christian Johansen nor the names of his contributors
15
+ may be used to endorse or promote products derived from this software
16
+ without specific prior written permission.
17
+
18
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
19
+ ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
20
+ WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
+ DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
22
+ FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23
+ DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
24
+ SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
25
+ CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
26
+ OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
27
+ THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
@@ -0,0 +1,42 @@
1
+ .. default-domain:: js
2
+ .. highlight:: javascript
3
+
4
+ ==========
5
+ multi-glob
6
+ ==========
7
+
8
+ Glob all the patterns!
9
+
10
+ .. raw:: html
11
+
12
+ <a href="http://travis-ci.org/busterjs/multi-glob" class="travis">
13
+ <img src="https://secure.travis-ci.org/busterjs/multi-glob.png">
14
+ </a>
15
+
16
+ ``multi-glob`` is a small wrapper around `node-glob
17
+ <https://github.com/isaacs/node-glob>`_ that allows you to glob multiple
18
+ patterns in one go, and optionally treat it as a failure if any one pattern
19
+ matches no files.
20
+
21
+ If you just need to glob multiple patterns in one go, you can simply do:
22
+
23
+ ::
24
+
25
+ var glob = require("glob");
26
+ glob("{all,the,patterns}", cb);
27
+
28
+ However, with ``multi-glob``, you can do a "strict" glob, which will cause an
29
+ error if e.g. the pattern ``"the"`` in the previous example matched no files.
30
+
31
+ API
32
+ ===
33
+
34
+ ``multiGlob.glob(patterns[, options], callback);``
35
+ --------------------------------------------------
36
+
37
+ Works like `node-glob's glob <https://github.com/isaacs/node-glob>`_, with the
38
+ following two exceptions:
39
+
40
+ * ``patterns`` may be either a string pattern or an array of string patterns
41
+ * ``options`` may include ``strict``. When set to ``true``, ``glob`` will yield
42
+ an error if either one of ``patterns`` matches no files.
@@ -0,0 +1,20 @@
1
+ module.exports = {
2
+ paths: [
3
+ "lib/*.js",
4
+ "test/*.js"
5
+ ],
6
+ linterOptions: {
7
+ node: true,
8
+ browser: true,
9
+ plusplus: true,
10
+ sloppy: true,
11
+ vars: true,
12
+ nomen: true,
13
+ predef: [
14
+ "define",
15
+ "assert",
16
+ "refute",
17
+ "buster"
18
+ ]
19
+ }
20
+ };
@@ -0,0 +1,6 @@
1
+ var config = module.exports;
2
+
3
+ config["Glob tests"] = {
4
+ environment: "node",
5
+ tests: ["test/**/*.js"]
6
+ };
@@ -0,0 +1,39 @@
1
+ var glob = require("glob");
2
+ var async = require("async");
3
+ var _ = require("lodash");
4
+
5
+ function array(arr) {
6
+ return Array.isArray(arr) ? arr : [arr];
7
+ }
8
+
9
+ function resolveGlobs(patterns, options) {
10
+ options = options || {};
11
+ return array(patterns).reduce(function (fns, pattern) {
12
+ fns.push(function (done) {
13
+ glob(pattern, options, function (err, matches) {
14
+ if (!err && options.strict && matches.length === 0) {
15
+ done(new Error("'" + pattern + "' matched no files"));
16
+ } else {
17
+ done(err, matches);
18
+ }
19
+ });
20
+ });
21
+ return fns;
22
+ }, []);
23
+ }
24
+
25
+ function processSingle(callback) {
26
+ return function (err, matches) {
27
+ callback(err, _.uniq(_.flatten(_.toArray(matches))));
28
+ };
29
+ }
30
+
31
+ module.exports = {
32
+ glob: function (patterns, options, cb) {
33
+ if (typeof options === "function") {
34
+ cb = options;
35
+ options = null;
36
+ }
37
+ async.parallel(resolveGlobs(patterns, options), processSingle(cb));
38
+ }
39
+ };
@@ -0,0 +1,3 @@
1
+ language: node_js
2
+ node_js:
3
+ - "0.10"
@@ -0,0 +1,19 @@
1
+ Copyright (c) 2010-2014 Caolan McMahon
2
+
3
+ Permission is hereby granted, free of charge, to any person obtaining a copy
4
+ of this software and associated documentation files (the "Software"), to deal
5
+ in the Software without restriction, including without limitation the rights
6
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
+ copies of the Software, and to permit persons to whom the Software is
8
+ furnished to do so, subject to the following conditions:
9
+
10
+ The above copyright notice and this permission notice shall be included in
11
+ all copies or substantial portions of the Software.
12
+
13
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
+ THE SOFTWARE.
@@ -0,0 +1,1646 @@
1
+ # Async.js
2
+
3
+ [![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)
4
+
5
+
6
+ Async is a utility module which provides straight-forward, powerful functions
7
+ for working with asynchronous JavaScript. Although originally designed for
8
+ use with [Node.js](http://nodejs.org), it can also be used directly in the
9
+ browser. Also supports [component](https://github.com/component/component).
10
+
11
+ Async provides around 20 functions that include the usual 'functional'
12
+ suspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns
13
+ for asynchronous control flow (`parallel`, `series`, `waterfall`…). All these
14
+ functions assume you follow the Node.js convention of providing a single
15
+ callback as the last argument of your `async` function.
16
+
17
+
18
+ ## Quick Examples
19
+
20
+ ```javascript
21
+ async.map(['file1','file2','file3'], fs.stat, function(err, results){
22
+ // results is now an array of stats for each file
23
+ });
24
+
25
+ async.filter(['file1','file2','file3'], fs.exists, function(results){
26
+ // results now equals an array of the existing files
27
+ });
28
+
29
+ async.parallel([
30
+ function(){ ... },
31
+ function(){ ... }
32
+ ], callback);
33
+
34
+ async.series([
35
+ function(){ ... },
36
+ function(){ ... }
37
+ ]);
38
+ ```
39
+
40
+ There are many more functions available so take a look at the docs below for a
41
+ full list. This module aims to be comprehensive, so if you feel anything is
42
+ missing please create a GitHub issue for it.
43
+
44
+ ## Common Pitfalls
45
+
46
+ ### Binding a context to an iterator
47
+
48
+ This section is really about `bind`, not about `async`. If you are wondering how to
49
+ make `async` execute your iterators in a given context, or are confused as to why
50
+ a method of another library isn't working as an iterator, study this example:
51
+
52
+ ```js
53
+ // Here is a simple object with an (unnecessarily roundabout) squaring method
54
+ var AsyncSquaringLibrary = {
55
+ squareExponent: 2,
56
+ square: function(number, callback){
57
+ var result = Math.pow(number, this.squareExponent);
58
+ setTimeout(function(){
59
+ callback(null, result);
60
+ }, 200);
61
+ }
62
+ };
63
+
64
+ async.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){
65
+ // result is [NaN, NaN, NaN]
66
+ // This fails because the `this.squareExponent` expression in the square
67
+ // function is not evaluated in the context of AsyncSquaringLibrary, and is
68
+ // therefore undefined.
69
+ });
70
+
71
+ async.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){
72
+ // result is [1, 4, 9]
73
+ // With the help of bind we can attach a context to the iterator before
74
+ // passing it to async. Now the square function will be executed in its
75
+ // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`
76
+ // will be as expected.
77
+ });
78
+ ```
79
+
80
+ ## Download
81
+
82
+ The source is available for download from
83
+ [GitHub](http://github.com/caolan/async).
84
+ Alternatively, you can install using Node Package Manager (`npm`):
85
+
86
+ npm install async
87
+
88
+ __Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed
89
+
90
+ ## In the Browser
91
+
92
+ So far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.
93
+
94
+ Usage:
95
+
96
+ ```html
97
+ <script type="text/javascript" src="async.js"></script>
98
+ <script type="text/javascript">
99
+
100
+ async.map(data, asyncProcess, function(err, results){
101
+ alert(results);
102
+ });
103
+
104
+ </script>
105
+ ```
106
+
107
+ ## Documentation
108
+
109
+ ### Collections
110
+
111
+ * [`each`](#each)
112
+ * [`eachSeries`](#eachSeries)
113
+ * [`eachLimit`](#eachLimit)
114
+ * [`map`](#map)
115
+ * [`mapSeries`](#mapSeries)
116
+ * [`mapLimit`](#mapLimit)
117
+ * [`filter`](#filter)
118
+ * [`filterSeries`](#filterSeries)
119
+ * [`reject`](#reject)
120
+ * [`rejectSeries`](#rejectSeries)
121
+ * [`reduce`](#reduce)
122
+ * [`reduceRight`](#reduceRight)
123
+ * [`detect`](#detect)
124
+ * [`detectSeries`](#detectSeries)
125
+ * [`sortBy`](#sortBy)
126
+ * [`some`](#some)
127
+ * [`every`](#every)
128
+ * [`concat`](#concat)
129
+ * [`concatSeries`](#concatSeries)
130
+
131
+ ### Control Flow
132
+
133
+ * [`series`](#seriestasks-callback)
134
+ * [`parallel`](#parallel)
135
+ * [`parallelLimit`](#parallellimittasks-limit-callback)
136
+ * [`whilst`](#whilst)
137
+ * [`doWhilst`](#doWhilst)
138
+ * [`until`](#until)
139
+ * [`doUntil`](#doUntil)
140
+ * [`forever`](#forever)
141
+ * [`waterfall`](#waterfall)
142
+ * [`compose`](#compose)
143
+ * [`seq`](#seq)
144
+ * [`applyEach`](#applyEach)
145
+ * [`applyEachSeries`](#applyEachSeries)
146
+ * [`queue`](#queue)
147
+ * [`priorityQueue`](#priorityQueue)
148
+ * [`cargo`](#cargo)
149
+ * [`auto`](#auto)
150
+ * [`retry`](#retry)
151
+ * [`iterator`](#iterator)
152
+ * [`apply`](#apply)
153
+ * [`nextTick`](#nextTick)
154
+ * [`times`](#times)
155
+ * [`timesSeries`](#timesSeries)
156
+
157
+ ### Utils
158
+
159
+ * [`memoize`](#memoize)
160
+ * [`unmemoize`](#unmemoize)
161
+ * [`log`](#log)
162
+ * [`dir`](#dir)
163
+ * [`noConflict`](#noConflict)
164
+
165
+
166
+ ## Collections
167
+
168
+ <a name="forEach" />
169
+ <a name="each" />
170
+ ### each(arr, iterator, callback)
171
+
172
+ Applies the function `iterator` to each item in `arr`, in parallel.
173
+ The `iterator` is called with an item from the list, and a callback for when it
174
+ has finished. If the `iterator` passes an error to its `callback`, the main
175
+ `callback` (for the `each` function) is immediately called with the error.
176
+
177
+ Note, that since this function applies `iterator` to each item in parallel,
178
+ there is no guarantee that the iterator functions will complete in order.
179
+
180
+ __Arguments__
181
+
182
+ * `arr` - An array to iterate over.
183
+ * `iterator(item, callback)` - A function to apply to each item in `arr`.
184
+ The iterator is passed a `callback(err)` which must be called once it has
185
+ completed. If no error has occured, the `callback` should be run without
186
+ arguments or with an explicit `null` argument.
187
+ * `callback(err)` - A callback which is called when all `iterator` functions
188
+ have finished, or an error occurs.
189
+
190
+ __Examples__
191
+
192
+
193
+ ```js
194
+ // assuming openFiles is an array of file names and saveFile is a function
195
+ // to save the modified contents of that file:
196
+
197
+ async.each(openFiles, saveFile, function(err){
198
+ // if any of the saves produced an error, err would equal that error
199
+ });
200
+ ```
201
+
202
+ ```js
203
+ // assuming openFiles is an array of file names
204
+
205
+ async.each(openFiles, function( file, callback) {
206
+
207
+ // Perform operation on file here.
208
+ console.log('Processing file ' + file);
209
+
210
+ if( file.length > 32 ) {
211
+ console.log('This file name is too long');
212
+ callback('File name too long');
213
+ } else {
214
+ // Do work to process file here
215
+ console.log('File processed');
216
+ callback();
217
+ }
218
+ }, function(err){
219
+ // if any of the file processing produced an error, err would equal that error
220
+ if( err ) {
221
+ // One of the iterations produced an error.
222
+ // All processing will now stop.
223
+ console.log('A file failed to process');
224
+ } else {
225
+ console.log('All files have been processed successfully');
226
+ }
227
+ });
228
+ ```
229
+
230
+ ---------------------------------------
231
+
232
+ <a name="forEachSeries" />
233
+ <a name="eachSeries" />
234
+ ### eachSeries(arr, iterator, callback)
235
+
236
+ The same as [`each`](#each), only `iterator` is applied to each item in `arr` in
237
+ series. The next `iterator` is only called once the current one has completed.
238
+ This means the `iterator` functions will complete in order.
239
+
240
+
241
+ ---------------------------------------
242
+
243
+ <a name="forEachLimit" />
244
+ <a name="eachLimit" />
245
+ ### eachLimit(arr, limit, iterator, callback)
246
+
247
+ The same as [`each`](#each), only no more than `limit` `iterator`s will be simultaneously
248
+ running at any time.
249
+
250
+ Note that the items in `arr` are not processed in batches, so there is no guarantee that
251
+ the first `limit` `iterator` functions will complete before any others are started.
252
+
253
+ __Arguments__
254
+
255
+ * `arr` - An array to iterate over.
256
+ * `limit` - The maximum number of `iterator`s to run at any time.
257
+ * `iterator(item, callback)` - A function to apply to each item in `arr`.
258
+ The iterator is passed a `callback(err)` which must be called once it has
259
+ completed. If no error has occured, the callback should be run without
260
+ arguments or with an explicit `null` argument.
261
+ * `callback(err)` - A callback which is called when all `iterator` functions
262
+ have finished, or an error occurs.
263
+
264
+ __Example__
265
+
266
+ ```js
267
+ // Assume documents is an array of JSON objects and requestApi is a
268
+ // function that interacts with a rate-limited REST api.
269
+
270
+ async.eachLimit(documents, 20, requestApi, function(err){
271
+ // if any of the saves produced an error, err would equal that error
272
+ });
273
+ ```
274
+
275
+ ---------------------------------------
276
+
277
+ <a name="map" />
278
+ ### map(arr, iterator, callback)
279
+
280
+ Produces a new array of values by mapping each value in `arr` through
281
+ the `iterator` function. The `iterator` is called with an item from `arr` and a
282
+ callback for when it has finished processing. Each of these callback takes 2 arguments:
283
+ an `error`, and the transformed item from `arr`. If `iterator` passes an error to this
284
+ callback, the main `callback` (for the `map` function) is immediately called with the error.
285
+
286
+ Note, that since this function applies the `iterator` to each item in parallel,
287
+ there is no guarantee that the `iterator` functions will complete in order.
288
+ However, the results array will be in the same order as the original `arr`.
289
+
290
+ __Arguments__
291
+
292
+ * `arr` - An array to iterate over.
293
+ * `iterator(item, callback)` - A function to apply to each item in `arr`.
294
+ The iterator is passed a `callback(err, transformed)` which must be called once
295
+ it has completed with an error (which can be `null`) and a transformed item.
296
+ * `callback(err, results)` - A callback which is called when all `iterator`
297
+ functions have finished, or an error occurs. Results is an array of the
298
+ transformed items from the `arr`.
299
+
300
+ __Example__
301
+
302
+ ```js
303
+ async.map(['file1','file2','file3'], fs.stat, function(err, results){
304
+ // results is now an array of stats for each file
305
+ });
306
+ ```
307
+
308
+ ---------------------------------------
309
+
310
+ <a name="mapSeries" />
311
+ ### mapSeries(arr, iterator, callback)
312
+
313
+ The same as [`map`](#map), only the `iterator` is applied to each item in `arr` in
314
+ series. The next `iterator` is only called once the current one has completed.
315
+ The results array will be in the same order as the original.
316
+
317
+
318
+ ---------------------------------------
319
+
320
+ <a name="mapLimit" />
321
+ ### mapLimit(arr, limit, iterator, callback)
322
+
323
+ The same as [`map`](#map), only no more than `limit` `iterator`s will be simultaneously
324
+ running at any time.
325
+
326
+ Note that the items are not processed in batches, so there is no guarantee that
327
+ the first `limit` `iterator` functions will complete before any others are started.
328
+
329
+ __Arguments__
330
+
331
+ * `arr` - An array to iterate over.
332
+ * `limit` - The maximum number of `iterator`s to run at any time.
333
+ * `iterator(item, callback)` - A function to apply to each item in `arr`.
334
+ The iterator is passed a `callback(err, transformed)` which must be called once
335
+ it has completed with an error (which can be `null`) and a transformed item.
336
+ * `callback(err, results)` - A callback which is called when all `iterator`
337
+ calls have finished, or an error occurs. The result is an array of the
338
+ transformed items from the original `arr`.
339
+
340
+ __Example__
341
+
342
+ ```js
343
+ async.mapLimit(['file1','file2','file3'], 1, fs.stat, function(err, results){
344
+ // results is now an array of stats for each file
345
+ });
346
+ ```
347
+
348
+ ---------------------------------------
349
+
350
+ <a name="select" />
351
+ <a name="filter" />
352
+ ### filter(arr, iterator, callback)
353
+
354
+ __Alias:__ `select`
355
+
356
+ Returns a new array of all the values in `arr` which pass an async truth test.
357
+ _The callback for each `iterator` call only accepts a single argument of `true` or
358
+ `false`; it does not accept an error argument first!_ This is in-line with the
359
+ way node libraries work with truth tests like `fs.exists`. This operation is
360
+ performed in parallel, but the results array will be in the same order as the
361
+ original.
362
+
363
+ __Arguments__
364
+
365
+ * `arr` - An array to iterate over.
366
+ * `iterator(item, callback)` - A truth test to apply to each item in `arr`.
367
+ The `iterator` is passed a `callback(truthValue)`, which must be called with a
368
+ boolean argument once it has completed.
369
+ * `callback(results)` - A callback which is called after all the `iterator`
370
+ functions have finished.
371
+
372
+ __Example__
373
+
374
+ ```js
375
+ async.filter(['file1','file2','file3'], fs.exists, function(results){
376
+ // results now equals an array of the existing files
377
+ });
378
+ ```
379
+
380
+ ---------------------------------------
381
+
382
+ <a name="selectSeries" />
383
+ <a name="filterSeries" />
384
+ ### filterSeries(arr, iterator, callback)
385
+
386
+ __Alias:__ `selectSeries`
387
+
388
+ The same as [`filter`](#filter) only the `iterator` is applied to each item in `arr` in
389
+ series. The next `iterator` is only called once the current one has completed.
390
+ The results array will be in the same order as the original.
391
+
392
+ ---------------------------------------
393
+
394
+ <a name="reject" />
395
+ ### reject(arr, iterator, callback)
396
+
397
+ The opposite of [`filter`](#filter). Removes values that pass an `async` truth test.
398
+
399
+ ---------------------------------------
400
+
401
+ <a name="rejectSeries" />
402
+ ### rejectSeries(arr, iterator, callback)
403
+
404
+ The same as [`reject`](#reject), only the `iterator` is applied to each item in `arr`
405
+ in series.
406
+
407
+
408
+ ---------------------------------------
409
+
410
+ <a name="reduce" />
411
+ ### reduce(arr, memo, iterator, callback)
412
+
413
+ __Aliases:__ `inject`, `foldl`
414
+
415
+ Reduces `arr` into a single value using an async `iterator` to return
416
+ each successive step. `memo` is the initial state of the reduction.
417
+ This function only operates in series.
418
+
419
+ For performance reasons, it may make sense to split a call to this function into
420
+ a parallel map, and then use the normal `Array.prototype.reduce` on the results.
421
+ This function is for situations where each step in the reduction needs to be async;
422
+ if you can get the data before reducing it, then it's probably a good idea to do so.
423
+
424
+ __Arguments__
425
+
426
+ * `arr` - An array to iterate over.
427
+ * `memo` - The initial state of the reduction.
428
+ * `iterator(memo, item, callback)` - A function applied to each item in the
429
+ array to produce the next step in the reduction. The `iterator` is passed a
430
+ `callback(err, reduction)` which accepts an optional error as its first
431
+ argument, and the state of the reduction as the second. If an error is
432
+ passed to the callback, the reduction is stopped and the main `callback` is
433
+ immediately called with the error.
434
+ * `callback(err, result)` - A callback which is called after all the `iterator`
435
+ functions have finished. Result is the reduced value.
436
+
437
+ __Example__
438
+
439
+ ```js
440
+ async.reduce([1,2,3], 0, function(memo, item, callback){
441
+ // pointless async:
442
+ process.nextTick(function(){
443
+ callback(null, memo + item)
444
+ });
445
+ }, function(err, result){
446
+ // result is now equal to the last value of memo, which is 6
447
+ });
448
+ ```
449
+
450
+ ---------------------------------------
451
+
452
+ <a name="reduceRight" />
453
+ ### reduceRight(arr, memo, iterator, callback)
454
+
455
+ __Alias:__ `foldr`
456
+
457
+ Same as [`reduce`](#reduce), only operates on `arr` in reverse order.
458
+
459
+
460
+ ---------------------------------------
461
+
462
+ <a name="detect" />
463
+ ### detect(arr, iterator, callback)
464
+
465
+ Returns the first value in `arr` that passes an async truth test. The
466
+ `iterator` is applied in parallel, meaning the first iterator to return `true` will
467
+ fire the detect `callback` with that result. That means the result might not be
468
+ the first item in the original `arr` (in terms of order) that passes the test.
469
+
470
+ If order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).
471
+
472
+ __Arguments__
473
+
474
+ * `arr` - An array to iterate over.
475
+ * `iterator(item, callback)` - A truth test to apply to each item in `arr`.
476
+ The iterator is passed a `callback(truthValue)` which must be called with a
477
+ boolean argument once it has completed.
478
+ * `callback(result)` - A callback which is called as soon as any iterator returns
479
+ `true`, or after all the `iterator` functions have finished. Result will be
480
+ the first item in the array that passes the truth test (iterator) or the
481
+ value `undefined` if none passed.
482
+
483
+ __Example__
484
+
485
+ ```js
486
+ async.detect(['file1','file2','file3'], fs.exists, function(result){
487
+ // result now equals the first file in the list that exists
488
+ });
489
+ ```
490
+
491
+ ---------------------------------------
492
+
493
+ <a name="detectSeries" />
494
+ ### detectSeries(arr, iterator, callback)
495
+
496
+ The same as [`detect`](#detect), only the `iterator` is applied to each item in `arr`
497
+ in series. This means the result is always the first in the original `arr` (in
498
+ terms of array order) that passes the truth test.
499
+
500
+
501
+ ---------------------------------------
502
+
503
+ <a name="sortBy" />
504
+ ### sortBy(arr, iterator, callback)
505
+
506
+ Sorts a list by the results of running each `arr` value through an async `iterator`.
507
+
508
+ __Arguments__
509
+
510
+ * `arr` - An array to iterate over.
511
+ * `iterator(item, callback)` - A function to apply to each item in `arr`.
512
+ The iterator is passed a `callback(err, sortValue)` which must be called once it
513
+ has completed with an error (which can be `null`) and a value to use as the sort
514
+ criteria.
515
+ * `callback(err, results)` - A callback which is called after all the `iterator`
516
+ functions have finished, or an error occurs. Results is the items from
517
+ the original `arr` sorted by the values returned by the `iterator` calls.
518
+
519
+ __Example__
520
+
521
+ ```js
522
+ async.sortBy(['file1','file2','file3'], function(file, callback){
523
+ fs.stat(file, function(err, stats){
524
+ callback(err, stats.mtime);
525
+ });
526
+ }, function(err, results){
527
+ // results is now the original array of files sorted by
528
+ // modified date
529
+ });
530
+ ```
531
+
532
+ __Sort Order__
533
+
534
+ By modifying the callback parameter the sorting order can be influenced:
535
+
536
+ ```js
537
+ //ascending order
538
+ async.sortBy([1,9,3,5], function(x, callback){
539
+ callback(err, x);
540
+ }, function(err,result){
541
+ //result callback
542
+ } );
543
+
544
+ //descending order
545
+ async.sortBy([1,9,3,5], function(x, callback){
546
+ callback(err, x*-1); //<- x*-1 instead of x, turns the order around
547
+ }, function(err,result){
548
+ //result callback
549
+ } );
550
+ ```
551
+
552
+ ---------------------------------------
553
+
554
+ <a name="some" />
555
+ ### some(arr, iterator, callback)
556
+
557
+ __Alias:__ `any`
558
+
559
+ Returns `true` if at least one element in the `arr` satisfies an async test.
560
+ _The callback for each iterator call only accepts a single argument of `true` or
561
+ `false`; it does not accept an error argument first!_ This is in-line with the
562
+ way node libraries work with truth tests like `fs.exists`. Once any iterator
563
+ call returns `true`, the main `callback` is immediately called.
564
+
565
+ __Arguments__
566
+
567
+ * `arr` - An array to iterate over.
568
+ * `iterator(item, callback)` - A truth test to apply to each item in the array
569
+ in parallel. The iterator is passed a callback(truthValue) which must be
570
+ called with a boolean argument once it has completed.
571
+ * `callback(result)` - A callback which is called as soon as any iterator returns
572
+ `true`, or after all the iterator functions have finished. Result will be
573
+ either `true` or `false` depending on the values of the async tests.
574
+
575
+ __Example__
576
+
577
+ ```js
578
+ async.some(['file1','file2','file3'], fs.exists, function(result){
579
+ // if result is true then at least one of the files exists
580
+ });
581
+ ```
582
+
583
+ ---------------------------------------
584
+
585
+ <a name="every" />
586
+ ### every(arr, iterator, callback)
587
+
588
+ __Alias:__ `all`
589
+
590
+ Returns `true` if every element in `arr` satisfies an async test.
591
+ _The callback for each `iterator` call only accepts a single argument of `true` or
592
+ `false`; it does not accept an error argument first!_ This is in-line with the
593
+ way node libraries work with truth tests like `fs.exists`.
594
+
595
+ __Arguments__
596
+
597
+ * `arr` - An array to iterate over.
598
+ * `iterator(item, callback)` - A truth test to apply to each item in the array
599
+ in parallel. The iterator is passed a callback(truthValue) which must be
600
+ called with a boolean argument once it has completed.
601
+ * `callback(result)` - A callback which is called after all the `iterator`
602
+ functions have finished. Result will be either `true` or `false` depending on
603
+ the values of the async tests.
604
+
605
+ __Example__
606
+
607
+ ```js
608
+ async.every(['file1','file2','file3'], fs.exists, function(result){
609
+ // if result is true then every file exists
610
+ });
611
+ ```
612
+
613
+ ---------------------------------------
614
+
615
+ <a name="concat" />
616
+ ### concat(arr, iterator, callback)
617
+
618
+ Applies `iterator` to each item in `arr`, concatenating the results. Returns the
619
+ concatenated list. The `iterator`s are called in parallel, and the results are
620
+ concatenated as they return. There is no guarantee that the results array will
621
+ be returned in the original order of `arr` passed to the `iterator` function.
622
+
623
+ __Arguments__
624
+
625
+ * `arr` - An array to iterate over.
626
+ * `iterator(item, callback)` - A function to apply to each item in `arr`.
627
+ The iterator is passed a `callback(err, results)` which must be called once it
628
+ has completed with an error (which can be `null`) and an array of results.
629
+ * `callback(err, results)` - A callback which is called after all the `iterator`
630
+ functions have finished, or an error occurs. Results is an array containing
631
+ the concatenated results of the `iterator` function.
632
+
633
+ __Example__
634
+
635
+ ```js
636
+ async.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){
637
+ // files is now a list of filenames that exist in the 3 directories
638
+ });
639
+ ```
640
+
641
+ ---------------------------------------
642
+
643
+ <a name="concatSeries" />
644
+ ### concatSeries(arr, iterator, callback)
645
+
646
+ Same as [`concat`](#concat), but executes in series instead of parallel.
647
+
648
+
649
+ ## Control Flow
650
+
651
+ <a name="series" />
652
+ ### series(tasks, [callback])
653
+
654
+ Run the functions in the `tasks` array in series, each one running once the previous
655
+ function has completed. If any functions in the series pass an error to its
656
+ callback, no more functions are run, and `callback` is immediately called with the value of the error.
657
+ Otherwise, `callback` receives an array of results when `tasks` have completed.
658
+
659
+ It is also possible to use an object instead of an array. Each property will be
660
+ run as a function, and the results will be passed to the final `callback` as an object
661
+ instead of an array. This can be a more readable way of handling results from
662
+ [`series`](#series).
663
+
664
+ **Note** that while many implementations preserve the order of object properties, the
665
+ [ECMAScript Language Specifcation](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)
666
+ explicitly states that
667
+
668
+ > The mechanics and order of enumerating the properties is not specified.
669
+
670
+ So if you rely on the order in which your series of functions are executed, and want
671
+ this to work on all platforms, consider using an array.
672
+
673
+ __Arguments__
674
+
675
+ * `tasks` - An array or object containing functions to run, each function is passed
676
+ a `callback(err, result)` it must call on completion with an error `err` (which can
677
+ be `null`) and an optional `result` value.
678
+ * `callback(err, results)` - An optional callback to run once all the functions
679
+ have completed. This function gets a results array (or object) containing all
680
+ the result arguments passed to the `task` callbacks.
681
+
682
+ __Example__
683
+
684
+ ```js
685
+ async.series([
686
+ function(callback){
687
+ // do some stuff ...
688
+ callback(null, 'one');
689
+ },
690
+ function(callback){
691
+ // do some more stuff ...
692
+ callback(null, 'two');
693
+ }
694
+ ],
695
+ // optional callback
696
+ function(err, results){
697
+ // results is now equal to ['one', 'two']
698
+ });
699
+
700
+
701
+ // an example using an object instead of an array
702
+ async.series({
703
+ one: function(callback){
704
+ setTimeout(function(){
705
+ callback(null, 1);
706
+ }, 200);
707
+ },
708
+ two: function(callback){
709
+ setTimeout(function(){
710
+ callback(null, 2);
711
+ }, 100);
712
+ }
713
+ },
714
+ function(err, results) {
715
+ // results is now equal to: {one: 1, two: 2}
716
+ });
717
+ ```
718
+
719
+ ---------------------------------------
720
+
721
+ <a name="parallel" />
722
+ ### parallel(tasks, [callback])
723
+
724
+ Run the `tasks` array of functions in parallel, without waiting until the previous
725
+ function has completed. If any of the functions pass an error to its
726
+ callback, the main `callback` is immediately called with the value of the error.
727
+ Once the `tasks` have completed, the results are passed to the final `callback` as an
728
+ array.
729
+
730
+ It is also possible to use an object instead of an array. Each property will be
731
+ run as a function and the results will be passed to the final `callback` as an object
732
+ instead of an array. This can be a more readable way of handling results from
733
+ [`parallel`](#parallel).
734
+
735
+
736
+ __Arguments__
737
+
738
+ * `tasks` - An array or object containing functions to run. Each function is passed
739
+ a `callback(err, result)` which it must call on completion with an error `err`
740
+ (which can be `null`) and an optional `result` value.
741
+ * `callback(err, results)` - An optional callback to run once all the functions
742
+ have completed. This function gets a results array (or object) containing all
743
+ the result arguments passed to the task callbacks.
744
+
745
+ __Example__
746
+
747
+ ```js
748
+ async.parallel([
749
+ function(callback){
750
+ setTimeout(function(){
751
+ callback(null, 'one');
752
+ }, 200);
753
+ },
754
+ function(callback){
755
+ setTimeout(function(){
756
+ callback(null, 'two');
757
+ }, 100);
758
+ }
759
+ ],
760
+ // optional callback
761
+ function(err, results){
762
+ // the results array will equal ['one','two'] even though
763
+ // the second function had a shorter timeout.
764
+ });
765
+
766
+
767
+ // an example using an object instead of an array
768
+ async.parallel({
769
+ one: function(callback){
770
+ setTimeout(function(){
771
+ callback(null, 1);
772
+ }, 200);
773
+ },
774
+ two: function(callback){
775
+ setTimeout(function(){
776
+ callback(null, 2);
777
+ }, 100);
778
+ }
779
+ },
780
+ function(err, results) {
781
+ // results is now equals to: {one: 1, two: 2}
782
+ });
783
+ ```
784
+
785
+ ---------------------------------------
786
+
787
+ <a name="parallelLimit" />
788
+ ### parallelLimit(tasks, limit, [callback])
789
+
790
+ The same as [`parallel`](#parallel), only `tasks` are executed in parallel
791
+ with a maximum of `limit` tasks executing at any time.
792
+
793
+ Note that the `tasks` are not executed in batches, so there is no guarantee that
794
+ the first `limit` tasks will complete before any others are started.
795
+
796
+ __Arguments__
797
+
798
+ * `tasks` - An array or object containing functions to run, each function is passed
799
+ a `callback(err, result)` it must call on completion with an error `err` (which can
800
+ be `null`) and an optional `result` value.
801
+ * `limit` - The maximum number of `tasks` to run at any time.
802
+ * `callback(err, results)` - An optional callback to run once all the functions
803
+ have completed. This function gets a results array (or object) containing all
804
+ the result arguments passed to the `task` callbacks.
805
+
806
+ ---------------------------------------
807
+
808
+ <a name="whilst" />
809
+ ### whilst(test, fn, callback)
810
+
811
+ Repeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,
812
+ or an error occurs.
813
+
814
+ __Arguments__
815
+
816
+ * `test()` - synchronous truth test to perform before each execution of `fn`.
817
+ * `fn(callback)` - A function which is called each time `test` passes. The function is
818
+ passed a `callback(err)`, which must be called once it has completed with an
819
+ optional `err` argument.
820
+ * `callback(err)` - A callback which is called after the test fails and repeated
821
+ execution of `fn` has stopped.
822
+
823
+ __Example__
824
+
825
+ ```js
826
+ var count = 0;
827
+
828
+ async.whilst(
829
+ function () { return count < 5; },
830
+ function (callback) {
831
+ count++;
832
+ setTimeout(callback, 1000);
833
+ },
834
+ function (err) {
835
+ // 5 seconds have passed
836
+ }
837
+ );
838
+ ```
839
+
840
+ ---------------------------------------
841
+
842
+ <a name="doWhilst" />
843
+ ### doWhilst(fn, test, callback)
844
+
845
+ The post-check version of [`whilst`](#whilst). To reflect the difference in
846
+ the order of operations, the arguments `test` and `fn` are switched.
847
+
848
+ `doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.
849
+
850
+ ---------------------------------------
851
+
852
+ <a name="until" />
853
+ ### until(test, fn, callback)
854
+
855
+ Repeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,
856
+ or an error occurs.
857
+
858
+ The inverse of [`whilst`](#whilst).
859
+
860
+ ---------------------------------------
861
+
862
+ <a name="doUntil" />
863
+ ### doUntil(fn, test, callback)
864
+
865
+ Like [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.
866
+
867
+ ---------------------------------------
868
+
869
+ <a name="forever" />
870
+ ### forever(fn, errback)
871
+
872
+ Calls the asynchronous function `fn` with a callback parameter that allows it to
873
+ call itself again, in series, indefinitely.
874
+
875
+ If an error is passed to the callback then `errback` is called with the
876
+ error, and execution stops, otherwise it will never be called.
877
+
878
+ ```js
879
+ async.forever(
880
+ function(next) {
881
+ // next is suitable for passing to things that need a callback(err [, whatever]);
882
+ // it will result in this function being called again.
883
+ },
884
+ function(err) {
885
+ // if next is called with a value in its first parameter, it will appear
886
+ // in here as 'err', and execution will stop.
887
+ }
888
+ );
889
+ ```
890
+
891
+ ---------------------------------------
892
+
893
+ <a name="waterfall" />
894
+ ### waterfall(tasks, [callback])
895
+
896
+ Runs the `tasks` array of functions in series, each passing their results to the next in
897
+ the array. However, if any of the `tasks` pass an error to their own callback, the
898
+ next function is not executed, and the main `callback` is immediately called with
899
+ the error.
900
+
901
+ __Arguments__
902
+
903
+ * `tasks` - An array of functions to run, each function is passed a
904
+ `callback(err, result1, result2, ...)` it must call on completion. The first
905
+ argument is an error (which can be `null`) and any further arguments will be
906
+ passed as arguments in order to the next task.
907
+ * `callback(err, [results])` - An optional callback to run once all the functions
908
+ have completed. This will be passed the results of the last task's callback.
909
+
910
+
911
+
912
+ __Example__
913
+
914
+ ```js
915
+ async.waterfall([
916
+ function(callback){
917
+ callback(null, 'one', 'two');
918
+ },
919
+ function(arg1, arg2, callback){
920
+ // arg1 now equals 'one' and arg2 now equals 'two'
921
+ callback(null, 'three');
922
+ },
923
+ function(arg1, callback){
924
+ // arg1 now equals 'three'
925
+ callback(null, 'done');
926
+ }
927
+ ], function (err, result) {
928
+ // result now equals 'done'
929
+ });
930
+ ```
931
+
932
+ ---------------------------------------
933
+ <a name="compose" />
934
+ ### compose(fn1, fn2...)
935
+
936
+ Creates a function which is a composition of the passed asynchronous
937
+ functions. Each function consumes the return value of the function that
938
+ follows. Composing functions `f()`, `g()`, and `h()` would produce the result of
939
+ `f(g(h()))`, only this version uses callbacks to obtain the return values.
940
+
941
+ Each function is executed with the `this` binding of the composed function.
942
+
943
+ __Arguments__
944
+
945
+ * `functions...` - the asynchronous functions to compose
946
+
947
+
948
+ __Example__
949
+
950
+ ```js
951
+ function add1(n, callback) {
952
+ setTimeout(function () {
953
+ callback(null, n + 1);
954
+ }, 10);
955
+ }
956
+
957
+ function mul3(n, callback) {
958
+ setTimeout(function () {
959
+ callback(null, n * 3);
960
+ }, 10);
961
+ }
962
+
963
+ var add1mul3 = async.compose(mul3, add1);
964
+
965
+ add1mul3(4, function (err, result) {
966
+ // result now equals 15
967
+ });
968
+ ```
969
+
970
+ ---------------------------------------
971
+ <a name="seq" />
972
+ ### seq(fn1, fn2...)
973
+
974
+ Version of the compose function that is more natural to read.
975
+ Each following function consumes the return value of the latter function.
976
+
977
+ Each function is executed with the `this` binding of the composed function.
978
+
979
+ __Arguments__
980
+
981
+ * functions... - the asynchronous functions to compose
982
+
983
+
984
+ __Example__
985
+
986
+ ```js
987
+ // Requires lodash (or underscore), express3 and dresende's orm2.
988
+ // Part of an app, that fetches cats of the logged user.
989
+ // This example uses `seq` function to avoid overnesting and error
990
+ // handling clutter.
991
+ app.get('/cats', function(request, response) {
992
+ function handleError(err, data, callback) {
993
+ if (err) {
994
+ console.error(err);
995
+ response.json({ status: 'error', message: err.message });
996
+ }
997
+ else {
998
+ callback(data);
999
+ }
1000
+ }
1001
+ var User = request.models.User;
1002
+ async.seq(
1003
+ _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))
1004
+ handleError,
1005
+ function(user, fn) {
1006
+ user.getCats(fn); // 'getCats' has signature (callback(err, data))
1007
+ },
1008
+ handleError,
1009
+ function(cats) {
1010
+ response.json({ status: 'ok', message: 'Cats found', data: cats });
1011
+ }
1012
+ )(req.session.user_id);
1013
+ }
1014
+ });
1015
+ ```
1016
+
1017
+ ---------------------------------------
1018
+ <a name="applyEach" />
1019
+ ### applyEach(fns, args..., callback)
1020
+
1021
+ Applies the provided arguments to each function in the array, calling
1022
+ `callback` after all functions have completed. If you only provide the first
1023
+ argument, then it will return a function which lets you pass in the
1024
+ arguments as if it were a single function call.
1025
+
1026
+ __Arguments__
1027
+
1028
+ * `fns` - the asynchronous functions to all call with the same arguments
1029
+ * `args...` - any number of separate arguments to pass to the function
1030
+ * `callback` - the final argument should be the callback, called when all
1031
+ functions have completed processing
1032
+
1033
+
1034
+ __Example__
1035
+
1036
+ ```js
1037
+ async.applyEach([enableSearch, updateSchema], 'bucket', callback);
1038
+
1039
+ // partial application example:
1040
+ async.each(
1041
+ buckets,
1042
+ async.applyEach([enableSearch, updateSchema]),
1043
+ callback
1044
+ );
1045
+ ```
1046
+
1047
+ ---------------------------------------
1048
+
1049
+ <a name="applyEachSeries" />
1050
+ ### applyEachSeries(arr, iterator, callback)
1051
+
1052
+ The same as [`applyEach`](#applyEach) only the functions are applied in series.
1053
+
1054
+ ---------------------------------------
1055
+
1056
+ <a name="queue" />
1057
+ ### queue(worker, concurrency)
1058
+
1059
+ Creates a `queue` object with the specified `concurrency`. Tasks added to the
1060
+ `queue` are processed in parallel (up to the `concurrency` limit). If all
1061
+ `worker`s are in progress, the task is queued until one becomes available.
1062
+ Once a `worker` completes a `task`, that `task`'s callback is called.
1063
+
1064
+ __Arguments__
1065
+
1066
+ * `worker(task, callback)` - An asynchronous function for processing a queued
1067
+ task, which must call its `callback(err)` argument when finished, with an
1068
+ optional `error` as an argument.
1069
+ * `concurrency` - An `integer` for determining how many `worker` functions should be
1070
+ run in parallel.
1071
+
1072
+ __Queue objects__
1073
+
1074
+ The `queue` object returned by this function has the following properties and
1075
+ methods:
1076
+
1077
+ * `length()` - a function returning the number of items waiting to be processed.
1078
+ * `started` - a function returning whether or not any items have been pushed and processed by the queue
1079
+ * `running()` - a function returning the number of items currently being processed.
1080
+ * `idle()` - a function returning false if there are items waiting or being processed, or true if not.
1081
+ * `concurrency` - an integer for determining how many `worker` functions should be
1082
+ run in parallel. This property can be changed after a `queue` is created to
1083
+ alter the concurrency on-the-fly.
1084
+ * `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once
1085
+ the `worker` has finished processing the task. Instead of a single task, a `tasks` array
1086
+ can be submitted. The respective callback is used for every task in the list.
1087
+ * `unshift(task, [callback])` - add a new task to the front of the `queue`.
1088
+ * `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,
1089
+ and further tasks will be queued.
1090
+ * `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.
1091
+ * `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.
1092
+ * `paused` - a boolean for determining whether the queue is in a paused state
1093
+ * `pause()` - a function that pauses the processing of tasks until `resume()` is called.
1094
+ * `resume()` - a function that resumes the processing of queued tasks when the queue is paused.
1095
+ * `kill()` - a function that empties remaining tasks from the queue forcing it to go idle.
1096
+
1097
+ __Example__
1098
+
1099
+ ```js
1100
+ // create a queue object with concurrency 2
1101
+
1102
+ var q = async.queue(function (task, callback) {
1103
+ console.log('hello ' + task.name);
1104
+ callback();
1105
+ }, 2);
1106
+
1107
+
1108
+ // assign a callback
1109
+ q.drain = function() {
1110
+ console.log('all items have been processed');
1111
+ }
1112
+
1113
+ // add some items to the queue
1114
+
1115
+ q.push({name: 'foo'}, function (err) {
1116
+ console.log('finished processing foo');
1117
+ });
1118
+ q.push({name: 'bar'}, function (err) {
1119
+ console.log('finished processing bar');
1120
+ });
1121
+
1122
+ // add some items to the queue (batch-wise)
1123
+
1124
+ q.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {
1125
+ console.log('finished processing bar');
1126
+ });
1127
+
1128
+ // add some items to the front of the queue
1129
+
1130
+ q.unshift({name: 'bar'}, function (err) {
1131
+ console.log('finished processing bar');
1132
+ });
1133
+ ```
1134
+
1135
+
1136
+ ---------------------------------------
1137
+
1138
+ <a name="priorityQueue" />
1139
+ ### priorityQueue(worker, concurrency)
1140
+
1141
+ The same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:
1142
+
1143
+ * `push(task, priority, [callback])` - `priority` should be a number. If an array of
1144
+ `tasks` is given, all tasks will be assigned the same priority.
1145
+ * The `unshift` method was removed.
1146
+
1147
+ ---------------------------------------
1148
+
1149
+ <a name="cargo" />
1150
+ ### cargo(worker, [payload])
1151
+
1152
+ Creates a `cargo` object with the specified payload. Tasks added to the
1153
+ cargo will be processed altogether (up to the `payload` limit). If the
1154
+ `worker` is in progress, the task is queued until it becomes available. Once
1155
+ the `worker` has completed some tasks, each callback of those tasks is called.
1156
+ Check out [this animation](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) for how `cargo` and `queue` work.
1157
+
1158
+ While [queue](#queue) passes only one task to one of a group of workers
1159
+ at a time, cargo passes an array of tasks to a single worker, repeating
1160
+ when the worker is finished.
1161
+
1162
+ __Arguments__
1163
+
1164
+ * `worker(tasks, callback)` - An asynchronous function for processing an array of
1165
+ queued tasks, which must call its `callback(err)` argument when finished, with
1166
+ an optional `err` argument.
1167
+ * `payload` - An optional `integer` for determining how many tasks should be
1168
+ processed per round; if omitted, the default is unlimited.
1169
+
1170
+ __Cargo objects__
1171
+
1172
+ The `cargo` object returned by this function has the following properties and
1173
+ methods:
1174
+
1175
+ * `length()` - A function returning the number of items waiting to be processed.
1176
+ * `payload` - An `integer` for determining how many tasks should be
1177
+ process per round. This property can be changed after a `cargo` is created to
1178
+ alter the payload on-the-fly.
1179
+ * `push(task, [callback])` - Adds `task` to the `queue`. The callback is called
1180
+ once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`
1181
+ can be submitted. The respective callback is used for every task in the list.
1182
+ * `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.
1183
+ * `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.
1184
+ * `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.
1185
+
1186
+ __Example__
1187
+
1188
+ ```js
1189
+ // create a cargo object with payload 2
1190
+
1191
+ var cargo = async.cargo(function (tasks, callback) {
1192
+ for(var i=0; i<tasks.length; i++){
1193
+ console.log('hello ' + tasks[i].name);
1194
+ }
1195
+ callback();
1196
+ }, 2);
1197
+
1198
+
1199
+ // add some items
1200
+
1201
+ cargo.push({name: 'foo'}, function (err) {
1202
+ console.log('finished processing foo');
1203
+ });
1204
+ cargo.push({name: 'bar'}, function (err) {
1205
+ console.log('finished processing bar');
1206
+ });
1207
+ cargo.push({name: 'baz'}, function (err) {
1208
+ console.log('finished processing baz');
1209
+ });
1210
+ ```
1211
+
1212
+ ---------------------------------------
1213
+
1214
+ <a name="auto" />
1215
+ ### auto(tasks, [callback])
1216
+
1217
+ Determines the best order for running the functions in `tasks`, based on their
1218
+ requirements. Each function can optionally depend on other functions being completed
1219
+ first, and each function is run as soon as its requirements are satisfied.
1220
+
1221
+ If any of the functions pass an error to their callback, it will not
1222
+ complete (so any other functions depending on it will not run), and the main
1223
+ `callback` is immediately called with the error. Functions also receive an
1224
+ object containing the results of functions which have completed so far.
1225
+
1226
+ Note, all functions are called with a `results` object as a second argument,
1227
+ so it is unsafe to pass functions in the `tasks` object which cannot handle the
1228
+ extra argument.
1229
+
1230
+ For example, this snippet of code:
1231
+
1232
+ ```js
1233
+ async.auto({
1234
+ readData: async.apply(fs.readFile, 'data.txt', 'utf-8')
1235
+ }, callback);
1236
+ ```
1237
+
1238
+ will have the effect of calling `readFile` with the results object as the last
1239
+ argument, which will fail:
1240
+
1241
+ ```js
1242
+ fs.readFile('data.txt', 'utf-8', cb, {});
1243
+ ```
1244
+
1245
+ Instead, wrap the call to `readFile` in a function which does not forward the
1246
+ `results` object:
1247
+
1248
+ ```js
1249
+ async.auto({
1250
+ readData: function(cb, results){
1251
+ fs.readFile('data.txt', 'utf-8', cb);
1252
+ }
1253
+ }, callback);
1254
+ ```
1255
+
1256
+ __Arguments__
1257
+
1258
+ * `tasks` - An object. Each of its properties is either a function or an array of
1259
+ requirements, with the function itself the last item in the array. The object's key
1260
+ of a property serves as the name of the task defined by that property,
1261
+ i.e. can be used when specifying requirements for other tasks.
1262
+ The function receives two arguments: (1) a `callback(err, result)` which must be
1263
+ called when finished, passing an `error` (which can be `null`) and the result of
1264
+ the function's execution, and (2) a `results` object, containing the results of
1265
+ the previously executed functions.
1266
+ * `callback(err, results)` - An optional callback which is called when all the
1267
+ tasks have been completed. It receives the `err` argument if any `tasks`
1268
+ pass an error to their callback. Results are always returned; however, if
1269
+ an error occurs, no further `tasks` will be performed, and the results
1270
+ object will only contain partial results.
1271
+
1272
+
1273
+ __Example__
1274
+
1275
+ ```js
1276
+ async.auto({
1277
+ get_data: function(callback){
1278
+ console.log('in get_data');
1279
+ // async code to get some data
1280
+ callback(null, 'data', 'converted to array');
1281
+ },
1282
+ make_folder: function(callback){
1283
+ console.log('in make_folder');
1284
+ // async code to create a directory to store a file in
1285
+ // this is run at the same time as getting the data
1286
+ callback(null, 'folder');
1287
+ },
1288
+ write_file: ['get_data', 'make_folder', function(callback, results){
1289
+ console.log('in write_file', JSON.stringify(results));
1290
+ // once there is some data and the directory exists,
1291
+ // write the data to a file in the directory
1292
+ callback(null, 'filename');
1293
+ }],
1294
+ email_link: ['write_file', function(callback, results){
1295
+ console.log('in email_link', JSON.stringify(results));
1296
+ // once the file is written let's email a link to it...
1297
+ // results.write_file contains the filename returned by write_file.
1298
+ callback(null, {'file':results.write_file, 'email':'user@example.com'});
1299
+ }]
1300
+ }, function(err, results) {
1301
+ console.log('err = ', err);
1302
+ console.log('results = ', results);
1303
+ });
1304
+ ```
1305
+
1306
+ This is a fairly trivial example, but to do this using the basic parallel and
1307
+ series functions would look like this:
1308
+
1309
+ ```js
1310
+ async.parallel([
1311
+ function(callback){
1312
+ console.log('in get_data');
1313
+ // async code to get some data
1314
+ callback(null, 'data', 'converted to array');
1315
+ },
1316
+ function(callback){
1317
+ console.log('in make_folder');
1318
+ // async code to create a directory to store a file in
1319
+ // this is run at the same time as getting the data
1320
+ callback(null, 'folder');
1321
+ }
1322
+ ],
1323
+ function(err, results){
1324
+ async.series([
1325
+ function(callback){
1326
+ console.log('in write_file', JSON.stringify(results));
1327
+ // once there is some data and the directory exists,
1328
+ // write the data to a file in the directory
1329
+ results.push('filename');
1330
+ callback(null);
1331
+ },
1332
+ function(callback){
1333
+ console.log('in email_link', JSON.stringify(results));
1334
+ // once the file is written let's email a link to it...
1335
+ callback(null, {'file':results.pop(), 'email':'user@example.com'});
1336
+ }
1337
+ ]);
1338
+ });
1339
+ ```
1340
+
1341
+ For a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding
1342
+ new tasks much easier (and the code more readable).
1343
+
1344
+
1345
+ ---------------------------------------
1346
+
1347
+ <a name="retry" />
1348
+ ### retry([times = 5], task, [callback])
1349
+
1350
+ Attempts to get a successful response from `task` no more than `times` times before
1351
+ returning an error. If the task is successful, the `callback` will be passed the result
1352
+ of the successfull task. If all attemps fail, the callback will be passed the error and
1353
+ result (if any) of the final attempt.
1354
+
1355
+ __Arguments__
1356
+
1357
+ * `times` - An integer indicating how many times to attempt the `task` before giving up. Defaults to 5.
1358
+ * `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`
1359
+ which must be called when finished, passing `err` (which can be `null`) and the `result` of
1360
+ the function's execution, and (2) a `results` object, containing the results of
1361
+ the previously executed functions (if nested inside another control flow).
1362
+ * `callback(err, results)` - An optional callback which is called when the
1363
+ task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.
1364
+
1365
+ The [`retry`](#retry) function can be used as a stand-alone control flow by passing a
1366
+ callback, as shown below:
1367
+
1368
+ ```js
1369
+ async.retry(3, apiMethod, function(err, result) {
1370
+ // do something with the result
1371
+ });
1372
+ ```
1373
+
1374
+ It can also be embeded within other control flow functions to retry individual methods
1375
+ that are not as reliable, like this:
1376
+
1377
+ ```js
1378
+ async.auto({
1379
+ users: api.getUsers.bind(api),
1380
+ payments: async.retry(3, api.getPayments.bind(api))
1381
+ }, function(err, results) {
1382
+ // do something with the results
1383
+ });
1384
+ ```
1385
+
1386
+
1387
+ ---------------------------------------
1388
+
1389
+ <a name="iterator" />
1390
+ ### iterator(tasks)
1391
+
1392
+ Creates an iterator function which calls the next function in the `tasks` array,
1393
+ returning a continuation to call the next one after that. It's also possible to
1394
+ “peek” at the next iterator with `iterator.next()`.
1395
+
1396
+ This function is used internally by the `async` module, but can be useful when
1397
+ you want to manually control the flow of functions in series.
1398
+
1399
+ __Arguments__
1400
+
1401
+ * `tasks` - An array of functions to run.
1402
+
1403
+ __Example__
1404
+
1405
+ ```js
1406
+ var iterator = async.iterator([
1407
+ function(){ sys.p('one'); },
1408
+ function(){ sys.p('two'); },
1409
+ function(){ sys.p('three'); }
1410
+ ]);
1411
+
1412
+ node> var iterator2 = iterator();
1413
+ 'one'
1414
+ node> var iterator3 = iterator2();
1415
+ 'two'
1416
+ node> iterator3();
1417
+ 'three'
1418
+ node> var nextfn = iterator2.next();
1419
+ node> nextfn();
1420
+ 'three'
1421
+ ```
1422
+
1423
+ ---------------------------------------
1424
+
1425
+ <a name="apply" />
1426
+ ### apply(function, arguments..)
1427
+
1428
+ Creates a continuation function with some arguments already applied.
1429
+
1430
+ Useful as a shorthand when combined with other control flow functions. Any arguments
1431
+ passed to the returned function are added to the arguments originally passed
1432
+ to apply.
1433
+
1434
+ __Arguments__
1435
+
1436
+ * `function` - The function you want to eventually apply all arguments to.
1437
+ * `arguments...` - Any number of arguments to automatically apply when the
1438
+ continuation is called.
1439
+
1440
+ __Example__
1441
+
1442
+ ```js
1443
+ // using apply
1444
+
1445
+ async.parallel([
1446
+ async.apply(fs.writeFile, 'testfile1', 'test1'),
1447
+ async.apply(fs.writeFile, 'testfile2', 'test2'),
1448
+ ]);
1449
+
1450
+
1451
+ // the same process without using apply
1452
+
1453
+ async.parallel([
1454
+ function(callback){
1455
+ fs.writeFile('testfile1', 'test1', callback);
1456
+ },
1457
+ function(callback){
1458
+ fs.writeFile('testfile2', 'test2', callback);
1459
+ }
1460
+ ]);
1461
+ ```
1462
+
1463
+ It's possible to pass any number of additional arguments when calling the
1464
+ continuation:
1465
+
1466
+ ```js
1467
+ node> var fn = async.apply(sys.puts, 'one');
1468
+ node> fn('two', 'three');
1469
+ one
1470
+ two
1471
+ three
1472
+ ```
1473
+
1474
+ ---------------------------------------
1475
+
1476
+ <a name="nextTick" />
1477
+ ### nextTick(callback)
1478
+
1479
+ Calls `callback` on a later loop around the event loop. In Node.js this just
1480
+ calls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`
1481
+ if available, otherwise `setTimeout(callback, 0)`, which means other higher priority
1482
+ events may precede the execution of `callback`.
1483
+
1484
+ This is used internally for browser-compatibility purposes.
1485
+
1486
+ __Arguments__
1487
+
1488
+ * `callback` - The function to call on a later loop around the event loop.
1489
+
1490
+ __Example__
1491
+
1492
+ ```js
1493
+ var call_order = [];
1494
+ async.nextTick(function(){
1495
+ call_order.push('two');
1496
+ // call_order now equals ['one','two']
1497
+ });
1498
+ call_order.push('one')
1499
+ ```
1500
+
1501
+ <a name="times" />
1502
+ ### times(n, callback)
1503
+
1504
+ Calls the `callback` function `n` times, and accumulates results in the same manner
1505
+ you would use with [`map`](#map).
1506
+
1507
+ __Arguments__
1508
+
1509
+ * `n` - The number of times to run the function.
1510
+ * `callback` - The function to call `n` times.
1511
+
1512
+ __Example__
1513
+
1514
+ ```js
1515
+ // Pretend this is some complicated async factory
1516
+ var createUser = function(id, callback) {
1517
+ callback(null, {
1518
+ id: 'user' + id
1519
+ })
1520
+ }
1521
+ // generate 5 users
1522
+ async.times(5, function(n, next){
1523
+ createUser(n, function(err, user) {
1524
+ next(err, user)
1525
+ })
1526
+ }, function(err, users) {
1527
+ // we should now have 5 users
1528
+ });
1529
+ ```
1530
+
1531
+ <a name="timesSeries" />
1532
+ ### timesSeries(n, callback)
1533
+
1534
+ The same as [`times`](#times), only the iterator is applied to each item in `arr` in
1535
+ series. The next `iterator` is only called once the current one has completed.
1536
+ The results array will be in the same order as the original.
1537
+
1538
+
1539
+ ## Utils
1540
+
1541
+ <a name="memoize" />
1542
+ ### memoize(fn, [hasher])
1543
+
1544
+ Caches the results of an `async` function. When creating a hash to store function
1545
+ results against, the callback is omitted from the hash and an optional hash
1546
+ function can be used.
1547
+
1548
+ The cache of results is exposed as the `memo` property of the function returned
1549
+ by `memoize`.
1550
+
1551
+ __Arguments__
1552
+
1553
+ * `fn` - The function to proxy and cache results from.
1554
+ * `hasher` - Tn optional function for generating a custom hash for storing
1555
+ results. It has all the arguments applied to it apart from the callback, and
1556
+ must be synchronous.
1557
+
1558
+ __Example__
1559
+
1560
+ ```js
1561
+ var slow_fn = function (name, callback) {
1562
+ // do something
1563
+ callback(null, result);
1564
+ };
1565
+ var fn = async.memoize(slow_fn);
1566
+
1567
+ // fn can now be used as if it were slow_fn
1568
+ fn('some name', function () {
1569
+ // callback
1570
+ });
1571
+ ```
1572
+
1573
+ <a name="unmemoize" />
1574
+ ### unmemoize(fn)
1575
+
1576
+ Undoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized
1577
+ form. Handy for testing.
1578
+
1579
+ __Arguments__
1580
+
1581
+ * `fn` - the memoized function
1582
+
1583
+ <a name="log" />
1584
+ ### log(function, arguments)
1585
+
1586
+ Logs the result of an `async` function to the `console`. Only works in Node.js or
1587
+ in browsers that support `console.log` and `console.error` (such as FF and Chrome).
1588
+ If multiple arguments are returned from the async function, `console.log` is
1589
+ called on each argument in order.
1590
+
1591
+ __Arguments__
1592
+
1593
+ * `function` - The function you want to eventually apply all arguments to.
1594
+ * `arguments...` - Any number of arguments to apply to the function.
1595
+
1596
+ __Example__
1597
+
1598
+ ```js
1599
+ var hello = function(name, callback){
1600
+ setTimeout(function(){
1601
+ callback(null, 'hello ' + name);
1602
+ }, 1000);
1603
+ };
1604
+ ```
1605
+ ```js
1606
+ node> async.log(hello, 'world');
1607
+ 'hello world'
1608
+ ```
1609
+
1610
+ ---------------------------------------
1611
+
1612
+ <a name="dir" />
1613
+ ### dir(function, arguments)
1614
+
1615
+ Logs the result of an `async` function to the `console` using `console.dir` to
1616
+ display the properties of the resulting object. Only works in Node.js or
1617
+ in browsers that support `console.dir` and `console.error` (such as FF and Chrome).
1618
+ If multiple arguments are returned from the async function, `console.dir` is
1619
+ called on each argument in order.
1620
+
1621
+ __Arguments__
1622
+
1623
+ * `function` - The function you want to eventually apply all arguments to.
1624
+ * `arguments...` - Any number of arguments to apply to the function.
1625
+
1626
+ __Example__
1627
+
1628
+ ```js
1629
+ var hello = function(name, callback){
1630
+ setTimeout(function(){
1631
+ callback(null, {hello: name});
1632
+ }, 1000);
1633
+ };
1634
+ ```
1635
+ ```js
1636
+ node> async.dir(hello, 'world');
1637
+ {hello: 'world'}
1638
+ ```
1639
+
1640
+ ---------------------------------------
1641
+
1642
+ <a name="noConflict" />
1643
+ ### noConflict()
1644
+
1645
+ Changes the value of `async` back to its original value, returning a reference to the
1646
+ `async` object.