webpack_rails 0.3.0 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (353) hide show
  1. checksums.yaml +4 -4
  2. data/lib/webpack_rails/ErrorMessagePlugin.js +37 -0
  3. data/lib/webpack_rails/engine.rb +6 -5
  4. data/lib/webpack_rails/node_modules/cors/CONTRIBUTING.md +35 -0
  5. data/lib/webpack_rails/node_modules/cors/LICENSE +9 -0
  6. data/lib/webpack_rails/node_modules/cors/README.md +192 -0
  7. data/lib/webpack_rails/node_modules/cors/lib/index.js +242 -0
  8. data/lib/webpack_rails/node_modules/cors/node_modules/vary/HISTORY.md +29 -0
  9. data/lib/webpack_rails/node_modules/cors/node_modules/vary/LICENSE +22 -0
  10. data/lib/webpack_rails/node_modules/cors/node_modules/vary/README.md +91 -0
  11. data/lib/webpack_rails/node_modules/cors/node_modules/vary/index.js +124 -0
  12. data/lib/webpack_rails/node_modules/cors/node_modules/vary/package.json +72 -0
  13. data/lib/webpack_rails/node_modules/cors/package.json +79 -0
  14. data/lib/webpack_rails/node_modules/cors/test/basic-auth.js +40 -0
  15. data/lib/webpack_rails/node_modules/cors/test/body-events.js +81 -0
  16. data/lib/webpack_rails/node_modules/cors/test/cors.js +652 -0
  17. data/lib/webpack_rails/node_modules/cors/test/error-response.js +77 -0
  18. data/lib/webpack_rails/node_modules/cors/test/example-app.js +98 -0
  19. data/lib/webpack_rails/node_modules/cors/test/issue-2.js +56 -0
  20. data/lib/webpack_rails/node_modules/cors/test/issue-31.js +58 -0
  21. data/lib/webpack_rails/node_modules/cors/test/mocha.opts +3 -0
  22. data/lib/webpack_rails/node_modules/express/History.md +3025 -0
  23. data/lib/webpack_rails/node_modules/express/LICENSE +24 -0
  24. data/lib/webpack_rails/node_modules/express/Readme.md +138 -0
  25. data/lib/webpack_rails/node_modules/express/index.js +11 -0
  26. data/lib/webpack_rails/node_modules/express/lib/application.js +643 -0
  27. data/lib/webpack_rails/node_modules/express/lib/express.js +103 -0
  28. data/lib/webpack_rails/node_modules/express/lib/middleware/init.js +36 -0
  29. data/lib/webpack_rails/node_modules/express/lib/middleware/query.js +51 -0
  30. data/lib/webpack_rails/node_modules/express/lib/request.js +489 -0
  31. data/lib/webpack_rails/node_modules/express/lib/response.js +1053 -0
  32. data/lib/webpack_rails/node_modules/express/lib/router/index.js +645 -0
  33. data/lib/webpack_rails/node_modules/express/lib/router/layer.js +176 -0
  34. data/lib/webpack_rails/node_modules/express/lib/router/route.js +210 -0
  35. data/lib/webpack_rails/node_modules/express/lib/utils.js +300 -0
  36. data/lib/webpack_rails/node_modules/express/lib/view.js +173 -0
  37. data/lib/webpack_rails/node_modules/express/node_modules/accepts/HISTORY.md +170 -0
  38. data/lib/webpack_rails/node_modules/express/node_modules/accepts/LICENSE +23 -0
  39. data/lib/webpack_rails/node_modules/express/node_modules/accepts/README.md +135 -0
  40. data/lib/webpack_rails/node_modules/express/node_modules/accepts/index.js +231 -0
  41. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/HISTORY.md +171 -0
  42. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/LICENSE +23 -0
  43. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/README.md +103 -0
  44. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/index.js +188 -0
  45. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/HISTORY.md +274 -0
  46. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/LICENSE +22 -0
  47. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/README.md +82 -0
  48. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/db.json +6474 -0
  49. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/index.js +11 -0
  50. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/node_modules/mime-db/package.json +94 -0
  51. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/mime-types/package.json +84 -0
  52. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/HISTORY.md +76 -0
  53. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/LICENSE +24 -0
  54. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/README.md +203 -0
  55. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/index.js +62 -0
  56. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/charset.js +102 -0
  57. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/encoding.js +118 -0
  58. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/language.js +112 -0
  59. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/lib/mediaType.js +179 -0
  60. data/lib/webpack_rails/node_modules/express/node_modules/accepts/node_modules/negotiator/package.json +86 -0
  61. data/lib/webpack_rails/node_modules/express/node_modules/accepts/package.json +98 -0
  62. data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/LICENSE +21 -0
  63. data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/README.md +43 -0
  64. data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/array-flatten.js +64 -0
  65. data/lib/webpack_rails/node_modules/express/node_modules/array-flatten/package.json +62 -0
  66. data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/HISTORY.md +40 -0
  67. data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/LICENSE +22 -0
  68. data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/README.md +141 -0
  69. data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/index.js +443 -0
  70. data/lib/webpack_rails/node_modules/express/node_modules/content-disposition/package.json +66 -0
  71. data/lib/webpack_rails/node_modules/express/node_modules/content-type/HISTORY.md +9 -0
  72. data/lib/webpack_rails/node_modules/express/node_modules/content-type/LICENSE +22 -0
  73. data/lib/webpack_rails/node_modules/express/node_modules/content-type/README.md +92 -0
  74. data/lib/webpack_rails/node_modules/express/node_modules/content-type/index.js +214 -0
  75. data/lib/webpack_rails/node_modules/express/node_modules/content-type/package.json +65 -0
  76. data/lib/webpack_rails/node_modules/express/node_modules/cookie/LICENSE +23 -0
  77. data/lib/webpack_rails/node_modules/express/node_modules/cookie/README.md +64 -0
  78. data/lib/webpack_rails/node_modules/express/node_modules/cookie/index.js +116 -0
  79. data/lib/webpack_rails/node_modules/express/node_modules/cookie/package.json +68 -0
  80. data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/History.md +38 -0
  81. data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/Readme.md +42 -0
  82. data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/index.js +51 -0
  83. data/lib/webpack_rails/node_modules/express/node_modules/cookie-signature/package.json +59 -0
  84. data/lib/webpack_rails/node_modules/express/node_modules/debug/History.md +195 -0
  85. data/lib/webpack_rails/node_modules/express/node_modules/debug/Makefile +36 -0
  86. data/lib/webpack_rails/node_modules/express/node_modules/debug/Readme.md +188 -0
  87. data/lib/webpack_rails/node_modules/express/node_modules/debug/bower.json +28 -0
  88. data/lib/webpack_rails/node_modules/express/node_modules/debug/browser.js +168 -0
  89. data/lib/webpack_rails/node_modules/express/node_modules/debug/component.json +19 -0
  90. data/lib/webpack_rails/node_modules/express/node_modules/debug/debug.js +197 -0
  91. data/lib/webpack_rails/node_modules/express/node_modules/debug/node.js +209 -0
  92. data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/History.md +66 -0
  93. data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/LICENSE +20 -0
  94. data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/README.md +35 -0
  95. data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/index.js +125 -0
  96. data/lib/webpack_rails/node_modules/express/node_modules/debug/node_modules/ms/package.json +47 -0
  97. data/lib/webpack_rails/node_modules/express/node_modules/debug/package.json +73 -0
  98. data/lib/webpack_rails/node_modules/express/node_modules/depd/History.md +75 -0
  99. data/lib/webpack_rails/node_modules/express/node_modules/depd/LICENSE +22 -0
  100. data/lib/webpack_rails/node_modules/express/node_modules/depd/Readme.md +274 -0
  101. data/lib/webpack_rails/node_modules/express/node_modules/depd/index.js +529 -0
  102. data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/buffer-concat.js +33 -0
  103. data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/callsite-tostring.js +101 -0
  104. data/lib/webpack_rails/node_modules/express/node_modules/depd/lib/compat/index.js +69 -0
  105. data/lib/webpack_rails/node_modules/express/node_modules/depd/package.json +66 -0
  106. data/lib/webpack_rails/node_modules/express/node_modules/escape-html/LICENSE +22 -0
  107. data/lib/webpack_rails/node_modules/express/node_modules/escape-html/Readme.md +15 -0
  108. data/lib/webpack_rails/node_modules/express/node_modules/escape-html/index.js +29 -0
  109. data/lib/webpack_rails/node_modules/express/node_modules/escape-html/package.json +51 -0
  110. data/lib/webpack_rails/node_modules/express/node_modules/etag/HISTORY.md +71 -0
  111. data/lib/webpack_rails/node_modules/express/node_modules/etag/LICENSE +22 -0
  112. data/lib/webpack_rails/node_modules/express/node_modules/etag/README.md +165 -0
  113. data/lib/webpack_rails/node_modules/express/node_modules/etag/index.js +132 -0
  114. data/lib/webpack_rails/node_modules/express/node_modules/etag/package.json +73 -0
  115. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/HISTORY.md +90 -0
  116. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/LICENSE +22 -0
  117. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/README.md +133 -0
  118. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/index.js +151 -0
  119. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/HISTORY.md +4 -0
  120. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/LICENSE +22 -0
  121. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/README.md +43 -0
  122. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/index.js +69 -0
  123. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/node_modules/unpipe/package.json +59 -0
  124. data/lib/webpack_rails/node_modules/express/node_modules/finalhandler/package.json +81 -0
  125. data/lib/webpack_rails/node_modules/express/node_modules/fresh/HISTORY.md +38 -0
  126. data/lib/webpack_rails/node_modules/express/node_modules/fresh/LICENSE +22 -0
  127. data/lib/webpack_rails/node_modules/express/node_modules/fresh/README.md +58 -0
  128. data/lib/webpack_rails/node_modules/express/node_modules/fresh/index.js +57 -0
  129. data/lib/webpack_rails/node_modules/express/node_modules/fresh/package.json +87 -0
  130. data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/LICENSE +22 -0
  131. data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/README.md +34 -0
  132. data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/index.js +57 -0
  133. data/lib/webpack_rails/node_modules/express/node_modules/merge-descriptors/package.json +125 -0
  134. data/lib/webpack_rails/node_modules/express/node_modules/methods/HISTORY.md +24 -0
  135. data/lib/webpack_rails/node_modules/express/node_modules/methods/LICENSE +23 -0
  136. data/lib/webpack_rails/node_modules/express/node_modules/methods/README.md +41 -0
  137. data/lib/webpack_rails/node_modules/express/node_modules/methods/index.js +42 -0
  138. data/lib/webpack_rails/node_modules/express/node_modules/methods/package.json +88 -0
  139. data/lib/webpack_rails/node_modules/express/node_modules/on-finished/HISTORY.md +88 -0
  140. data/lib/webpack_rails/node_modules/express/node_modules/on-finished/LICENSE +23 -0
  141. data/lib/webpack_rails/node_modules/express/node_modules/on-finished/README.md +154 -0
  142. data/lib/webpack_rails/node_modules/express/node_modules/on-finished/index.js +196 -0
  143. data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/LICENSE +22 -0
  144. data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/README.md +80 -0
  145. data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/index.js +95 -0
  146. data/lib/webpack_rails/node_modules/express/node_modules/on-finished/node_modules/ee-first/package.json +64 -0
  147. data/lib/webpack_rails/node_modules/express/node_modules/on-finished/package.json +71 -0
  148. data/lib/webpack_rails/node_modules/express/node_modules/parseurl/HISTORY.md +42 -0
  149. data/lib/webpack_rails/node_modules/express/node_modules/parseurl/LICENSE +24 -0
  150. data/lib/webpack_rails/node_modules/express/node_modules/parseurl/README.md +107 -0
  151. data/lib/webpack_rails/node_modules/express/node_modules/parseurl/index.js +136 -0
  152. data/lib/webpack_rails/node_modules/express/node_modules/parseurl/package.json +80 -0
  153. data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/History.md +36 -0
  154. data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/LICENSE +21 -0
  155. data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/Readme.md +35 -0
  156. data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/index.js +129 -0
  157. data/lib/webpack_rails/node_modules/express/node_modules/path-to-regexp/package.json +184 -0
  158. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/HISTORY.md +66 -0
  159. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/LICENSE +22 -0
  160. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/README.md +137 -0
  161. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/index.js +345 -0
  162. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/HISTORY.md +4 -0
  163. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/LICENSE +22 -0
  164. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/README.md +53 -0
  165. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/index.js +35 -0
  166. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/forwarded/package.json +65 -0
  167. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/Cakefile +18 -0
  168. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/LICENSE +19 -0
  169. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/README.md +161 -0
  170. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/ipaddr.min.js +1 -0
  171. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/lib/ipaddr.js +439 -0
  172. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/package.json +60 -0
  173. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/src/ipaddr.coffee +374 -0
  174. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/node_modules/ipaddr.js/test/ipaddr.test.coffee +262 -0
  175. data/lib/webpack_rails/node_modules/express/node_modules/proxy-addr/package.json +90 -0
  176. data/lib/webpack_rails/node_modules/express/node_modules/qs/CHANGELOG.md +88 -0
  177. data/lib/webpack_rails/node_modules/express/node_modules/qs/CONTRIBUTING.md +1 -0
  178. data/lib/webpack_rails/node_modules/express/node_modules/qs/LICENSE +28 -0
  179. data/lib/webpack_rails/node_modules/express/node_modules/qs/README.md +317 -0
  180. data/lib/webpack_rails/node_modules/express/node_modules/qs/bower.json +22 -0
  181. data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/index.js +15 -0
  182. data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/parse.js +186 -0
  183. data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/stringify.js +121 -0
  184. data/lib/webpack_rails/node_modules/express/node_modules/qs/lib/utils.js +190 -0
  185. data/lib/webpack_rails/node_modules/express/node_modules/qs/package.json +56 -0
  186. data/lib/webpack_rails/node_modules/express/node_modules/qs/test/parse.js +478 -0
  187. data/lib/webpack_rails/node_modules/express/node_modules/qs/test/stringify.js +259 -0
  188. data/lib/webpack_rails/node_modules/express/node_modules/qs/test/utils.js +28 -0
  189. data/lib/webpack_rails/node_modules/express/node_modules/range-parser/HISTORY.md +35 -0
  190. data/lib/webpack_rails/node_modules/express/node_modules/range-parser/LICENSE +22 -0
  191. data/lib/webpack_rails/node_modules/express/node_modules/range-parser/README.md +48 -0
  192. data/lib/webpack_rails/node_modules/express/node_modules/range-parser/index.js +49 -0
  193. data/lib/webpack_rails/node_modules/express/node_modules/range-parser/package.json +76 -0
  194. data/lib/webpack_rails/node_modules/express/node_modules/send/HISTORY.md +295 -0
  195. data/lib/webpack_rails/node_modules/express/node_modules/send/LICENSE +23 -0
  196. data/lib/webpack_rails/node_modules/express/node_modules/send/README.md +195 -0
  197. data/lib/webpack_rails/node_modules/express/node_modules/send/index.js +820 -0
  198. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/README.md +38 -0
  199. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/index.js +36 -0
  200. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/destroy/package.json +67 -0
  201. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/HISTORY.md +76 -0
  202. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/LICENSE +22 -0
  203. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/README.md +63 -0
  204. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/index.js +120 -0
  205. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/LICENSE +16 -0
  206. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/README.md +42 -0
  207. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits.js +1 -0
  208. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/inherits_browser.js +23 -0
  209. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/package.json +50 -0
  210. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/node_modules/inherits/test.js +25 -0
  211. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/http-errors/package.json +85 -0
  212. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/LICENSE +19 -0
  213. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/README.md +90 -0
  214. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/build/build.js +11 -0
  215. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/build/test.js +57 -0
  216. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/cli.js +8 -0
  217. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/mime.js +108 -0
  218. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/package.json +73 -0
  219. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/mime/types.json +1 -0
  220. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/History.md +66 -0
  221. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/LICENSE +20 -0
  222. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/README.md +35 -0
  223. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/index.js +125 -0
  224. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/ms/package.json +47 -0
  225. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/LICENSE +22 -0
  226. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/README.md +114 -0
  227. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/codes.json +64 -0
  228. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/index.js +60 -0
  229. data/lib/webpack_rails/node_modules/express/node_modules/send/node_modules/statuses/package.json +84 -0
  230. data/lib/webpack_rails/node_modules/express/node_modules/send/package.json +89 -0
  231. data/lib/webpack_rails/node_modules/express/node_modules/serve-static/HISTORY.md +284 -0
  232. data/lib/webpack_rails/node_modules/express/node_modules/serve-static/LICENSE +25 -0
  233. data/lib/webpack_rails/node_modules/express/node_modules/serve-static/README.md +235 -0
  234. data/lib/webpack_rails/node_modules/express/node_modules/serve-static/index.js +187 -0
  235. data/lib/webpack_rails/node_modules/express/node_modules/serve-static/package.json +83 -0
  236. data/lib/webpack_rails/node_modules/express/node_modules/type-is/HISTORY.md +180 -0
  237. data/lib/webpack_rails/node_modules/express/node_modules/type-is/LICENSE +23 -0
  238. data/lib/webpack_rails/node_modules/express/node_modules/type-is/README.md +132 -0
  239. data/lib/webpack_rails/node_modules/express/node_modules/type-is/index.js +262 -0
  240. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/HISTORY.md +22 -0
  241. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/LICENSE +22 -0
  242. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/README.md +81 -0
  243. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/index.js +270 -0
  244. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/media-typer/package.json +58 -0
  245. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/HISTORY.md +171 -0
  246. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/LICENSE +23 -0
  247. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/README.md +103 -0
  248. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/index.js +188 -0
  249. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/HISTORY.md +274 -0
  250. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/LICENSE +22 -0
  251. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/README.md +82 -0
  252. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/db.json +6474 -0
  253. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/index.js +11 -0
  254. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/node_modules/mime-db/package.json +94 -0
  255. data/lib/webpack_rails/node_modules/express/node_modules/type-is/node_modules/mime-types/package.json +84 -0
  256. data/lib/webpack_rails/node_modules/express/node_modules/type-is/package.json +93 -0
  257. data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/LICENSE +20 -0
  258. data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/README.md +34 -0
  259. data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/index.js +23 -0
  260. data/lib/webpack_rails/node_modules/express/node_modules/utils-merge/package.json +58 -0
  261. data/lib/webpack_rails/node_modules/express/node_modules/vary/HISTORY.md +23 -0
  262. data/lib/webpack_rails/node_modules/express/node_modules/vary/LICENSE +22 -0
  263. data/lib/webpack_rails/node_modules/express/node_modules/vary/README.md +91 -0
  264. data/lib/webpack_rails/node_modules/express/node_modules/vary/index.js +117 -0
  265. data/lib/webpack_rails/node_modules/express/node_modules/vary/package.json +72 -0
  266. data/lib/webpack_rails/node_modules/express/package.json +167 -0
  267. data/lib/webpack_rails/node_modules/is-array/History.md +11 -0
  268. data/lib/webpack_rails/node_modules/is-array/Makefile +11 -0
  269. data/lib/webpack_rails/node_modules/is-array/Readme.md +27 -0
  270. data/lib/webpack_rails/node_modules/is-array/component.json +13 -0
  271. data/lib/webpack_rails/node_modules/is-array/index.js +33 -0
  272. data/lib/webpack_rails/node_modules/is-array/package.json +41 -0
  273. data/lib/webpack_rails/node_modules/is-array/test/test.html +46 -0
  274. data/lib/webpack_rails/node_modules/is-object/LICENSE +19 -0
  275. data/lib/webpack_rails/node_modules/is-object/README.md +55 -0
  276. data/lib/webpack_rails/node_modules/is-object/index.js +5 -0
  277. data/lib/webpack_rails/node_modules/is-object/package.json +91 -0
  278. data/lib/webpack_rails/node_modules/is-object/test/index.js +23 -0
  279. data/lib/webpack_rails/node_modules/is-string/CHANGELOG.md +19 -0
  280. data/lib/webpack_rails/node_modules/is-string/LICENSE +22 -0
  281. data/lib/webpack_rails/node_modules/is-string/Makefile +61 -0
  282. data/lib/webpack_rails/node_modules/is-string/README.md +57 -0
  283. data/lib/webpack_rails/node_modules/is-string/index.js +20 -0
  284. data/lib/webpack_rails/node_modules/is-string/package.json +93 -0
  285. data/lib/webpack_rails/node_modules/is-string/test.js +36 -0
  286. data/lib/webpack_rails/node_modules/js-string-escape/CHANGELOG.md +9 -0
  287. data/lib/webpack_rails/node_modules/js-string-escape/LICENSE +21 -0
  288. data/lib/webpack_rails/node_modules/js-string-escape/README.md +44 -0
  289. data/lib/webpack_rails/node_modules/js-string-escape/index.js +22 -0
  290. data/lib/webpack_rails/node_modules/js-string-escape/package.json +63 -0
  291. data/lib/webpack_rails/node_modules/js-string-escape/test/test.js +43 -0
  292. data/lib/webpack_rails/node_modules/strip-ansi/index.js +6 -0
  293. data/lib/webpack_rails/node_modules/strip-ansi/license +21 -0
  294. data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/index.js +4 -0
  295. data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/license +21 -0
  296. data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/package.json +86 -0
  297. data/lib/webpack_rails/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +31 -0
  298. data/lib/webpack_rails/node_modules/strip-ansi/package.json +85 -0
  299. data/lib/webpack_rails/node_modules/strip-ansi/readme.md +33 -0
  300. data/lib/webpack_rails/node_modules/webpack-hot-middleware/README.md +109 -0
  301. data/lib/webpack_rails/node_modules/webpack-hot-middleware/client-overlay.js +35 -0
  302. data/lib/webpack_rails/node_modules/webpack-hot-middleware/client.js +131 -0
  303. data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/README.md +15 -0
  304. data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/client.js +30 -0
  305. data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/index.html +18 -0
  306. data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/package.json +14 -0
  307. data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/server.js +41 -0
  308. data/lib/webpack_rails/node_modules/webpack-hot-middleware/example/webpack.config.js +22 -0
  309. data/lib/webpack_rails/node_modules/webpack-hot-middleware/helpers.js +8 -0
  310. data/lib/webpack_rails/node_modules/webpack-hot-middleware/middleware.js +83 -0
  311. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/History.md +20 -0
  312. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/License.md +19 -0
  313. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/Readme.md +15 -0
  314. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/decode.js +80 -0
  315. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/encode.js +64 -0
  316. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/index.js +4 -0
  317. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/package.json +96 -0
  318. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/common-index.js +3 -0
  319. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/index.js +210 -0
  320. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/querystring/test/tap-index.js +3 -0
  321. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/cli.js +47 -0
  322. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/index.js +6 -0
  323. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/index.js +4 -0
  324. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/license +21 -0
  325. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/package.json +86 -0
  326. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/node_modules/ansi-regex/readme.md +33 -0
  327. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/package.json +89 -0
  328. data/lib/webpack_rails/node_modules/webpack-hot-middleware/node_modules/strip-ansi/readme.md +43 -0
  329. data/lib/webpack_rails/node_modules/webpack-hot-middleware/package.json +58 -0
  330. data/lib/webpack_rails/node_modules/webpack-hot-middleware/process-update.js +105 -0
  331. data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/client-test.js +81 -0
  332. data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/helpers-test.js +22 -0
  333. data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/middleware-test.js +188 -0
  334. data/lib/webpack_rails/node_modules/webpack-hot-middleware/test/mocha.opts +1 -0
  335. data/lib/webpack_rails/node_modules/xtend/LICENCE +19 -0
  336. data/lib/webpack_rails/node_modules/xtend/Makefile +4 -0
  337. data/lib/webpack_rails/node_modules/xtend/README.md +32 -0
  338. data/lib/webpack_rails/node_modules/xtend/immutable.js +17 -0
  339. data/lib/webpack_rails/node_modules/xtend/mutable.js +15 -0
  340. data/lib/webpack_rails/node_modules/xtend/package.json +88 -0
  341. data/lib/webpack_rails/node_modules/xtend/test.js +63 -0
  342. data/lib/webpack_rails/package.json +22 -0
  343. data/lib/webpack_rails/processor.rb +28 -9
  344. data/lib/webpack_rails/require_directive_processor.rb +51 -0
  345. data/lib/webpack_rails/sprockets_environment.rb +45 -0
  346. data/lib/webpack_rails/task.rb +51 -22
  347. data/lib/webpack_rails/webpack-task-dev-server.js +122 -0
  348. data/lib/webpack_rails/{webpack-task.js → webpack-task-watch.js} +0 -0
  349. data/lib/webpack_rails/webpack.rake +5 -5
  350. data/lib/webpack_rails.rb +1 -3
  351. metadata +346 -5
  352. data/lib/webpack_rails/sprockets_base_webpack.rb +0 -14
  353. data/lib/webpack_rails/sprockets_index_webpack.rb +0 -15
@@ -0,0 +1,88 @@
1
+ {
2
+ "name": "methods",
3
+ "description": "HTTP methods that node supports",
4
+ "version": "1.1.1",
5
+ "contributors": [
6
+ {
7
+ "name": "Douglas Christopher Wilson",
8
+ "email": "doug@somethingdoug.com"
9
+ },
10
+ {
11
+ "name": "Jonathan Ong",
12
+ "email": "me@jongleberry.com",
13
+ "url": "http://jongleberry.com"
14
+ },
15
+ {
16
+ "name": "TJ Holowaychuk",
17
+ "email": "tj@vision-media.ca",
18
+ "url": "http://tjholowaychuk.com"
19
+ }
20
+ ],
21
+ "license": "MIT",
22
+ "repository": {
23
+ "type": "git",
24
+ "url": "git+https://github.com/jshttp/methods.git"
25
+ },
26
+ "devDependencies": {
27
+ "istanbul": "0.3",
28
+ "mocha": "1"
29
+ },
30
+ "files": [
31
+ "index.js",
32
+ "HISTORY.md",
33
+ "LICENSE"
34
+ ],
35
+ "engines": {
36
+ "node": ">= 0.6"
37
+ },
38
+ "scripts": {
39
+ "test": "mocha --reporter spec",
40
+ "test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --reporter dot",
41
+ "test-travis": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --reporter dot"
42
+ },
43
+ "browser": {
44
+ "http": false
45
+ },
46
+ "keywords": [
47
+ "http",
48
+ "methods"
49
+ ],
50
+ "gitHead": "6293c6b27c5fb963acf67a347af80ad2ebd7247f",
51
+ "bugs": {
52
+ "url": "https://github.com/jshttp/methods/issues"
53
+ },
54
+ "homepage": "https://github.com/jshttp/methods",
55
+ "_id": "methods@1.1.1",
56
+ "_shasum": "17ea6366066d00c58e375b8ec7dfd0453c89822a",
57
+ "_from": "methods@>=1.1.1 <1.2.0",
58
+ "_npmVersion": "1.4.28",
59
+ "_npmUser": {
60
+ "name": "dougwilson",
61
+ "email": "doug@somethingdoug.com"
62
+ },
63
+ "maintainers": [
64
+ {
65
+ "name": "tjholowaychuk",
66
+ "email": "tj@vision-media.ca"
67
+ },
68
+ {
69
+ "name": "jonathanong",
70
+ "email": "jonathanrichardong@gmail.com"
71
+ },
72
+ {
73
+ "name": "jongleberry",
74
+ "email": "jonathanrichardong@gmail.com"
75
+ },
76
+ {
77
+ "name": "dougwilson",
78
+ "email": "doug@somethingdoug.com"
79
+ }
80
+ ],
81
+ "dist": {
82
+ "shasum": "17ea6366066d00c58e375b8ec7dfd0453c89822a",
83
+ "tarball": "http://registry.npmjs.org/methods/-/methods-1.1.1.tgz"
84
+ },
85
+ "directories": {},
86
+ "_resolved": "http://registry.npmjs.org/methods/-/methods-1.1.1.tgz",
87
+ "readme": "ERROR: No README data found!"
88
+ }
@@ -0,0 +1,88 @@
1
+ 2.3.0 / 2015-05-26
2
+ ==================
3
+
4
+ * Add defined behavior for HTTP `CONNECT` requests
5
+ * Add defined behavior for HTTP `Upgrade` requests
6
+ * deps: ee-first@1.1.1
7
+
8
+ 2.2.1 / 2015-04-22
9
+ ==================
10
+
11
+ * Fix `isFinished(req)` when data buffered
12
+
13
+ 2.2.0 / 2014-12-22
14
+ ==================
15
+
16
+ * Add message object to callback arguments
17
+
18
+ 2.1.1 / 2014-10-22
19
+ ==================
20
+
21
+ * Fix handling of pipelined requests
22
+
23
+ 2.1.0 / 2014-08-16
24
+ ==================
25
+
26
+ * Check if `socket` is detached
27
+ * Return `undefined` for `isFinished` if state unknown
28
+
29
+ 2.0.0 / 2014-08-16
30
+ ==================
31
+
32
+ * Add `isFinished` function
33
+ * Move to `jshttp` organization
34
+ * Remove support for plain socket argument
35
+ * Rename to `on-finished`
36
+ * Support both `req` and `res` as arguments
37
+ * deps: ee-first@1.0.5
38
+
39
+ 1.2.2 / 2014-06-10
40
+ ==================
41
+
42
+ * Reduce listeners added to emitters
43
+ - avoids "event emitter leak" warnings when used multiple times on same request
44
+
45
+ 1.2.1 / 2014-06-08
46
+ ==================
47
+
48
+ * Fix returned value when already finished
49
+
50
+ 1.2.0 / 2014-06-05
51
+ ==================
52
+
53
+ * Call callback when called on already-finished socket
54
+
55
+ 1.1.4 / 2014-05-27
56
+ ==================
57
+
58
+ * Support node.js 0.8
59
+
60
+ 1.1.3 / 2014-04-30
61
+ ==================
62
+
63
+ * Make sure errors passed as instanceof `Error`
64
+
65
+ 1.1.2 / 2014-04-18
66
+ ==================
67
+
68
+ * Default the `socket` to passed-in object
69
+
70
+ 1.1.1 / 2014-01-16
71
+ ==================
72
+
73
+ * Rename module to `finished`
74
+
75
+ 1.1.0 / 2013-12-25
76
+ ==================
77
+
78
+ * Call callback when called on already-errored socket
79
+
80
+ 1.0.1 / 2013-12-20
81
+ ==================
82
+
83
+ * Actually pass the error to the callback
84
+
85
+ 1.0.0 / 2013-12-20
86
+ ==================
87
+
88
+ * Initial release
@@ -0,0 +1,23 @@
1
+ (The MIT License)
2
+
3
+ Copyright (c) 2013 Jonathan Ong <me@jongleberry.com>
4
+ Copyright (c) 2014 Douglas Christopher Wilson <doug@somethingdoug.com>
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining
7
+ a copy of this software and associated documentation files (the
8
+ 'Software'), to deal in the Software without restriction, including
9
+ without limitation the rights to use, copy, modify, merge, publish,
10
+ distribute, sublicense, and/or sell copies of the Software, and to
11
+ permit persons to whom the Software is furnished to do so, subject to
12
+ the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be
15
+ included in all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20
+ IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21
+ CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22
+ TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23
+ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,154 @@
1
+ # on-finished
2
+
3
+ [![NPM Version][npm-image]][npm-url]
4
+ [![NPM Downloads][downloads-image]][downloads-url]
5
+ [![Node.js Version][node-version-image]][node-version-url]
6
+ [![Build Status][travis-image]][travis-url]
7
+ [![Test Coverage][coveralls-image]][coveralls-url]
8
+
9
+ Execute a callback when a HTTP request closes, finishes, or errors.
10
+
11
+ ## Install
12
+
13
+ ```sh
14
+ $ npm install on-finished
15
+ ```
16
+
17
+ ## API
18
+
19
+ ```js
20
+ var onFinished = require('on-finished')
21
+ ```
22
+
23
+ ### onFinished(res, listener)
24
+
25
+ Attach a listener to listen for the response to finish. The listener will
26
+ be invoked only once when the response finished. If the response finished
27
+ to an error, the first argument will contain the error. If the response
28
+ has already finished, the listener will be invoked.
29
+
30
+ Listening to the end of a response would be used to close things associated
31
+ with the response, like open files.
32
+
33
+ Listener is invoked as `listener(err, res)`.
34
+
35
+ ```js
36
+ onFinished(res, function (err, res) {
37
+ // clean up open fds, etc.
38
+ // err contains the error is request error'd
39
+ })
40
+ ```
41
+
42
+ ### onFinished(req, listener)
43
+
44
+ Attach a listener to listen for the request to finish. The listener will
45
+ be invoked only once when the request finished. If the request finished
46
+ to an error, the first argument will contain the error. If the request
47
+ has already finished, the listener will be invoked.
48
+
49
+ Listening to the end of a request would be used to know when to continue
50
+ after reading the data.
51
+
52
+ Listener is invoked as `listener(err, req)`.
53
+
54
+ ```js
55
+ var data = ''
56
+
57
+ req.setEncoding('utf8')
58
+ res.on('data', function (str) {
59
+ data += str
60
+ })
61
+
62
+ onFinished(req, function (err, req) {
63
+ // data is read unless there is err
64
+ })
65
+ ```
66
+
67
+ ### onFinished.isFinished(res)
68
+
69
+ Determine if `res` is already finished. This would be useful to check and
70
+ not even start certain operations if the response has already finished.
71
+
72
+ ### onFinished.isFinished(req)
73
+
74
+ Determine if `req` is already finished. This would be useful to check and
75
+ not even start certain operations if the request has already finished.
76
+
77
+ ## Special Node.js requests
78
+
79
+ ### HTTP CONNECT method
80
+
81
+ The meaning of the `CONNECT` method from RFC 7231, section 4.3.6:
82
+
83
+ > The CONNECT method requests that the recipient establish a tunnel to
84
+ > the destination origin server identified by the request-target and,
85
+ > if successful, thereafter restrict its behavior to blind forwarding
86
+ > of packets, in both directions, until the tunnel is closed. Tunnels
87
+ > are commonly used to create an end-to-end virtual connection, through
88
+ > one or more proxies, which can then be secured using TLS (Transport
89
+ > Layer Security, [RFC5246]).
90
+
91
+ In Node.js, these request objects come from the `'connect'` event on
92
+ the HTTP server.
93
+
94
+ When this module is used on a HTTP `CONNECT` request, the request is
95
+ considered "finished" immediately, **due to limitations in the Node.js
96
+ interface**. This means if the `CONNECT` request contains a request entity,
97
+ the request will be considered "finished" even before it has been read.
98
+
99
+ There is no such thing as a response object to a `CONNECT` request in
100
+ Node.js, so there is no support for for one.
101
+
102
+ ### HTTP Upgrade request
103
+
104
+ The meaning of the `Upgrade` header from RFC 7230, section 6.1:
105
+
106
+ > The "Upgrade" header field is intended to provide a simple mechanism
107
+ > for transitioning from HTTP/1.1 to some other protocol on the same
108
+ > connection.
109
+
110
+ In Node.js, these request objects come from the `'upgrade'` event on
111
+ the HTTP server.
112
+
113
+ When this module is used on a HTTP request with an `Upgrade` header, the
114
+ request is considered "finished" immediately, **due to limitations in the
115
+ Node.js interface**. This means if the `Upgrade` request contains a request
116
+ entity, the request will be considered "finished" even before it has been
117
+ read.
118
+
119
+ There is no such thing as a response object to a `Upgrade` request in
120
+ Node.js, so there is no support for for one.
121
+
122
+ ## Example
123
+
124
+ The following code ensures that file descriptors are always closed
125
+ once the response finishes.
126
+
127
+ ```js
128
+ var destroy = require('destroy')
129
+ var http = require('http')
130
+ var onFinished = require('on-finished')
131
+
132
+ http.createServer(function onRequest(req, res) {
133
+ var stream = fs.createReadStream('package.json')
134
+ stream.pipe(res)
135
+ onFinished(res, function (err) {
136
+ destroy(stream)
137
+ })
138
+ })
139
+ ```
140
+
141
+ ## License
142
+
143
+ [MIT](LICENSE)
144
+
145
+ [npm-image]: https://img.shields.io/npm/v/on-finished.svg
146
+ [npm-url]: https://npmjs.org/package/on-finished
147
+ [node-version-image]: https://img.shields.io/node/v/on-finished.svg
148
+ [node-version-url]: http://nodejs.org/download/
149
+ [travis-image]: https://img.shields.io/travis/jshttp/on-finished/master.svg
150
+ [travis-url]: https://travis-ci.org/jshttp/on-finished
151
+ [coveralls-image]: https://img.shields.io/coveralls/jshttp/on-finished/master.svg
152
+ [coveralls-url]: https://coveralls.io/r/jshttp/on-finished?branch=master
153
+ [downloads-image]: https://img.shields.io/npm/dm/on-finished.svg
154
+ [downloads-url]: https://npmjs.org/package/on-finished
@@ -0,0 +1,196 @@
1
+ /*!
2
+ * on-finished
3
+ * Copyright(c) 2013 Jonathan Ong
4
+ * Copyright(c) 2014 Douglas Christopher Wilson
5
+ * MIT Licensed
6
+ */
7
+
8
+ 'use strict'
9
+
10
+ /**
11
+ * Module exports.
12
+ * @public
13
+ */
14
+
15
+ module.exports = onFinished
16
+ module.exports.isFinished = isFinished
17
+
18
+ /**
19
+ * Module dependencies.
20
+ * @private
21
+ */
22
+
23
+ var first = require('ee-first')
24
+
25
+ /**
26
+ * Variables.
27
+ * @private
28
+ */
29
+
30
+ /* istanbul ignore next */
31
+ var defer = typeof setImmediate === 'function'
32
+ ? setImmediate
33
+ : function(fn){ process.nextTick(fn.bind.apply(fn, arguments)) }
34
+
35
+ /**
36
+ * Invoke callback when the response has finished, useful for
37
+ * cleaning up resources afterwards.
38
+ *
39
+ * @param {object} msg
40
+ * @param {function} listener
41
+ * @return {object}
42
+ * @public
43
+ */
44
+
45
+ function onFinished(msg, listener) {
46
+ if (isFinished(msg) !== false) {
47
+ defer(listener, null, msg)
48
+ return msg
49
+ }
50
+
51
+ // attach the listener to the message
52
+ attachListener(msg, listener)
53
+
54
+ return msg
55
+ }
56
+
57
+ /**
58
+ * Determine if message is already finished.
59
+ *
60
+ * @param {object} msg
61
+ * @return {boolean}
62
+ * @public
63
+ */
64
+
65
+ function isFinished(msg) {
66
+ var socket = msg.socket
67
+
68
+ if (typeof msg.finished === 'boolean') {
69
+ // OutgoingMessage
70
+ return Boolean(msg.finished || (socket && !socket.writable))
71
+ }
72
+
73
+ if (typeof msg.complete === 'boolean') {
74
+ // IncomingMessage
75
+ return Boolean(msg.upgrade || !socket || !socket.readable || (msg.complete && !msg.readable))
76
+ }
77
+
78
+ // don't know
79
+ return undefined
80
+ }
81
+
82
+ /**
83
+ * Attach a finished listener to the message.
84
+ *
85
+ * @param {object} msg
86
+ * @param {function} callback
87
+ * @private
88
+ */
89
+
90
+ function attachFinishedListener(msg, callback) {
91
+ var eeMsg
92
+ var eeSocket
93
+ var finished = false
94
+
95
+ function onFinish(error) {
96
+ eeMsg.cancel()
97
+ eeSocket.cancel()
98
+
99
+ finished = true
100
+ callback(error)
101
+ }
102
+
103
+ // finished on first message event
104
+ eeMsg = eeSocket = first([[msg, 'end', 'finish']], onFinish)
105
+
106
+ function onSocket(socket) {
107
+ // remove listener
108
+ msg.removeListener('socket', onSocket)
109
+
110
+ if (finished) return
111
+ if (eeMsg !== eeSocket) return
112
+
113
+ // finished on first socket event
114
+ eeSocket = first([[socket, 'error', 'close']], onFinish)
115
+ }
116
+
117
+ if (msg.socket) {
118
+ // socket already assigned
119
+ onSocket(msg.socket)
120
+ return
121
+ }
122
+
123
+ // wait for socket to be assigned
124
+ msg.on('socket', onSocket)
125
+
126
+ if (msg.socket === undefined) {
127
+ // node.js 0.8 patch
128
+ patchAssignSocket(msg, onSocket)
129
+ }
130
+ }
131
+
132
+ /**
133
+ * Attach the listener to the message.
134
+ *
135
+ * @param {object} msg
136
+ * @return {function}
137
+ * @private
138
+ */
139
+
140
+ function attachListener(msg, listener) {
141
+ var attached = msg.__onFinished
142
+
143
+ // create a private single listener with queue
144
+ if (!attached || !attached.queue) {
145
+ attached = msg.__onFinished = createListener(msg)
146
+ attachFinishedListener(msg, attached)
147
+ }
148
+
149
+ attached.queue.push(listener)
150
+ }
151
+
152
+ /**
153
+ * Create listener on message.
154
+ *
155
+ * @param {object} msg
156
+ * @return {function}
157
+ * @private
158
+ */
159
+
160
+ function createListener(msg) {
161
+ function listener(err) {
162
+ if (msg.__onFinished === listener) msg.__onFinished = null
163
+ if (!listener.queue) return
164
+
165
+ var queue = listener.queue
166
+ listener.queue = null
167
+
168
+ for (var i = 0; i < queue.length; i++) {
169
+ queue[i](err, msg)
170
+ }
171
+ }
172
+
173
+ listener.queue = []
174
+
175
+ return listener
176
+ }
177
+
178
+ /**
179
+ * Patch ServerResponse.prototype.assignSocket for node.js 0.8.
180
+ *
181
+ * @param {ServerResponse} res
182
+ * @param {function} callback
183
+ * @private
184
+ */
185
+
186
+ function patchAssignSocket(res, callback) {
187
+ var assignSocket = res.assignSocket
188
+
189
+ if (typeof assignSocket !== 'function') return
190
+
191
+ // res.on('socket', callback) is broken in 0.8
192
+ res.assignSocket = function _assignSocket(socket) {
193
+ assignSocket.call(this, socket)
194
+ callback(socket)
195
+ }
196
+ }
@@ -0,0 +1,22 @@
1
+
2
+ The MIT License (MIT)
3
+
4
+ Copyright (c) 2014 Jonathan Ong me@jongleberry.com
5
+
6
+ Permission is hereby granted, free of charge, to any person obtaining a copy
7
+ of this software and associated documentation files (the "Software"), to deal
8
+ in the Software without restriction, including without limitation the rights
9
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10
+ copies of the Software, and to permit persons to whom the Software is
11
+ furnished to do so, subject to the following conditions:
12
+
13
+ The above copyright notice and this permission notice shall be included in
14
+ all copies or substantial portions of the Software.
15
+
16
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
+ THE SOFTWARE.
@@ -0,0 +1,80 @@
1
+ # EE First
2
+
3
+ [![NPM version][npm-image]][npm-url]
4
+ [![Build status][travis-image]][travis-url]
5
+ [![Test coverage][coveralls-image]][coveralls-url]
6
+ [![License][license-image]][license-url]
7
+ [![Downloads][downloads-image]][downloads-url]
8
+ [![Gittip][gittip-image]][gittip-url]
9
+
10
+ Get the first event in a set of event emitters and event pairs,
11
+ then clean up after itself.
12
+
13
+ ## Install
14
+
15
+ ```sh
16
+ $ npm install ee-first
17
+ ```
18
+
19
+ ## API
20
+
21
+ ```js
22
+ var first = require('ee-first')
23
+ ```
24
+
25
+ ### first(arr, listener)
26
+
27
+ Invoke `listener` on the first event from the list specified in `arr`. `arr` is
28
+ an array of arrays, with each array in the format `[ee, ...event]`. `listener`
29
+ will be called only once, the first time any of the given events are emitted. If
30
+ `error` is one of the listened events, then if that fires first, the `listener`
31
+ will be given the `err` argument.
32
+
33
+ The `listener` is invoked as `listener(err, ee, event, args)`, where `err` is the
34
+ first argument emitted from an `error` event, if applicable; `ee` is the event
35
+ emitter that fired; `event` is the string event name that fired; and `args` is an
36
+ array of the arguments that were emitted on the event.
37
+
38
+ ```js
39
+ var ee1 = new EventEmitter()
40
+ var ee2 = new EventEmitter()
41
+
42
+ first([
43
+ [ee1, 'close', 'end', 'error'],
44
+ [ee2, 'error']
45
+ ], function (err, ee, event, args) {
46
+ // listener invoked
47
+ })
48
+ ```
49
+
50
+ #### .cancel()
51
+
52
+ The group of listeners can be cancelled before being invoked and have all the event
53
+ listeners removed from the underlying event emitters.
54
+
55
+ ```js
56
+ var thunk = first([
57
+ [ee1, 'close', 'end', 'error'],
58
+ [ee2, 'error']
59
+ ], function (err, ee, event, args) {
60
+ // listener invoked
61
+ })
62
+
63
+ // cancel and clean up
64
+ thunk.cancel()
65
+ ```
66
+
67
+ [npm-image]: https://img.shields.io/npm/v/ee-first.svg?style=flat-square
68
+ [npm-url]: https://npmjs.org/package/ee-first
69
+ [github-tag]: http://img.shields.io/github/tag/jonathanong/ee-first.svg?style=flat-square
70
+ [github-url]: https://github.com/jonathanong/ee-first/tags
71
+ [travis-image]: https://img.shields.io/travis/jonathanong/ee-first.svg?style=flat-square
72
+ [travis-url]: https://travis-ci.org/jonathanong/ee-first
73
+ [coveralls-image]: https://img.shields.io/coveralls/jonathanong/ee-first.svg?style=flat-square
74
+ [coveralls-url]: https://coveralls.io/r/jonathanong/ee-first?branch=master
75
+ [license-image]: http://img.shields.io/npm/l/ee-first.svg?style=flat-square
76
+ [license-url]: LICENSE.md
77
+ [downloads-image]: http://img.shields.io/npm/dm/ee-first.svg?style=flat-square
78
+ [downloads-url]: https://npmjs.org/package/ee-first
79
+ [gittip-image]: https://img.shields.io/gittip/jonathanong.svg?style=flat-square
80
+ [gittip-url]: https://www.gittip.com/jonathanong/