jimmy 7 years ago
commit
8522805c98
100 changed files with 7984 additions and 0 deletions
  1. BIN
      log/all.log
  2. 32 0
      log/mqtt_puablish.log
  3. BIN
      log/mqtt_rece.log
  4. 9 0
      log/wss_conn.log
  5. 32 0
      log/wss_recemsg.log
  6. 302 0
      log/wss_tomobile.log
  7. 28 0
      node_modules/.bin/leven
  8. 41 0
      node_modules/.bin/mqtt
  9. 146 0
      node_modules/.bin/mqtt_pub
  10. 123 0
      node_modules/.bin/mqtt_sub
  11. 7 0
      node_modules/async-limiter/.travis.yml
  12. 8 0
      node_modules/async-limiter/LICENSE
  13. 1 0
      node_modules/async-limiter/coverage/coverage.json
  14. 73 0
      node_modules/async-limiter/coverage/lcov-report/async-throttle/index.html
  15. 246 0
      node_modules/async-limiter/coverage/lcov-report/async-throttle/index.js.html
  16. 182 0
      node_modules/async-limiter/coverage/lcov-report/base.css
  17. 73 0
      node_modules/async-limiter/coverage/lcov-report/index.html
  18. 1 0
      node_modules/async-limiter/coverage/lcov-report/prettify.css
  19. 1 0
      node_modules/async-limiter/coverage/lcov-report/prettify.js
  20. BIN
      node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png
  21. 156 0
      node_modules/async-limiter/coverage/lcov-report/sorter.js
  22. 74 0
      node_modules/async-limiter/coverage/lcov.info
  23. 67 0
      node_modules/async-limiter/index.js
  24. 69 0
      node_modules/async-limiter/package.json
  25. 132 0
      node_modules/async-limiter/readme.md
  26. 5 0
      node_modules/balanced-match/.npmignore
  27. 21 0
      node_modules/balanced-match/LICENSE.md
  28. 91 0
      node_modules/balanced-match/README.md
  29. 59 0
      node_modules/balanced-match/index.js
  30. 77 0
      node_modules/balanced-match/package.json
  31. 59 0
      node_modules/bl/.jshintrc
  32. 16 0
      node_modules/bl/.travis.yml
  33. 13 0
      node_modules/bl/LICENSE.md
  34. 208 0
      node_modules/bl/README.md
  35. 281 0
      node_modules/bl/bl.js
  36. 63 0
      node_modules/bl/package.json
  37. 702 0
      node_modules/bl/test/test.js
  38. 21 0
      node_modules/brace-expansion/LICENSE
  39. 129 0
      node_modules/brace-expansion/README.md
  40. 201 0
      node_modules/brace-expansion/index.js
  41. 75 0
      node_modules/brace-expansion/package.json
  42. 69 0
      node_modules/buffer-from/index.js
  43. 49 0
      node_modules/buffer-from/package.json
  44. 69 0
      node_modules/buffer-from/readme.md
  45. 12 0
      node_modules/buffer-from/test.js
  46. 60 0
      node_modules/callback-stream/.jshintrc
  47. 7 0
      node_modules/callback-stream/.npmignore
  48. 4 0
      node_modules/callback-stream/.travis.yml
  49. 86 0
      node_modules/callback-stream/README.md
  50. 51 0
      node_modules/callback-stream/index.js
  51. 67 0
      node_modules/callback-stream/package.json
  52. 57 0
      node_modules/callback-stream/test.js
  53. 25 0
      node_modules/commist/.npmignore
  54. 21 0
      node_modules/commist/LICENSE
  55. 56 0
      node_modules/commist/README.md
  56. 24 0
      node_modules/commist/example.js
  57. 123 0
      node_modules/commist/index.js
  58. 57 0
      node_modules/commist/package.json
  59. 191 0
      node_modules/commist/test.js
  60. 4 0
      node_modules/concat-map/.travis.yml
  61. 18 0
      node_modules/concat-map/LICENSE
  62. 62 0
      node_modules/concat-map/README.markdown
  63. 6 0
      node_modules/concat-map/example/map.js
  64. 13 0
      node_modules/concat-map/index.js
  65. 88 0
      node_modules/concat-map/package.json
  66. 39 0
      node_modules/concat-map/test/map.js
  67. 24 0
      node_modules/concat-stream/LICENSE
  68. 144 0
      node_modules/concat-stream/index.js
  69. 84 0
      node_modules/concat-stream/package.json
  70. 102 0
      node_modules/concat-stream/readme.md
  71. 19 0
      node_modules/core-util-is/LICENSE
  72. 3 0
      node_modules/core-util-is/README.md
  73. 604 0
      node_modules/core-util-is/float.patch
  74. 107 0
      node_modules/core-util-is/lib/util.js
  75. 62 0
      node_modules/core-util-is/package.json
  76. 68 0
      node_modules/core-util-is/test.js
  77. 6 0
      node_modules/duplexify/.travis.yml
  78. 21 0
      node_modules/duplexify/LICENSE
  79. 97 0
      node_modules/duplexify/README.md
  80. 21 0
      node_modules/duplexify/example.js
  81. 235 0
      node_modules/duplexify/index.js
  82. 67 0
      node_modules/duplexify/package.json
  83. 291 0
      node_modules/duplexify/test.js
  84. 1 0
      node_modules/encoding/.npmignore
  85. 25 0
      node_modules/encoding/.travis.yml
  86. 16 0
      node_modules/encoding/LICENSE
  87. 52 0
      node_modules/encoding/README.md
  88. 113 0
      node_modules/encoding/lib/encoding.js
  89. 14 0
      node_modules/encoding/lib/iconv-loader.js
  90. 54 0
      node_modules/encoding/package.json
  91. 75 0
      node_modules/encoding/test/test.js
  92. 21 0
      node_modules/end-of-stream/LICENSE
  93. 52 0
      node_modules/end-of-stream/README.md
  94. 87 0
      node_modules/end-of-stream/index.js
  95. 65 0
      node_modules/end-of-stream/package.json
  96. 17 0
      node_modules/extend/.eslintrc
  97. 175 0
      node_modules/extend/.jscs.json
  98. 1 0
      node_modules/extend/.npmignore
  99. 179 0
      node_modules/extend/.travis.yml
  100. 0 0
      node_modules/extend/CHANGELOG.md

BIN
log/all.log View File


+ 32 - 0
log/mqtt_puablish.log View File

@@ -0,0 +1,32 @@
1
+2018:05:30:11:15:18 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,132,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,51,56,57,53,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,206,102
2
+2018:05:30:11:21:11 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,132,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,51,56,57,54,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,223,85
3
+2018:05:30:11:22:31 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,131,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,57,54,51,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,237,222
4
+2018:05:30:11:22:45 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,148,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,88,154,25,3,185,185,169,64,166,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,224,170,10,202,129,76,3,32,0,178,83,18,75,18,149,172,170,149,210,50,115,82,139,149,172,162,33,44,37,43,5,37,35,51,160,116,90,10,72,178,32,177,8,172,40,63,31,168,17,232,128,218,218,218,216,218,90,0,71,155,40,179,185,87
5
+2018:05:30:11:23:05 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,149,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,61,139,63,11,194,64,12,197,191,138,188,217,33,181,88,240,54,71,87,23,7,145,35,216,11,28,84,115,94,15,28,74,190,187,169,130,143,12,191,188,63,11,248,222,178,62,17,112,126,157,180,93,176,197,156,106,230,201,157,195,208,251,251,72,142,61,81,236,226,177,35,90,47,238,221,47,85,165,253,91,229,237,72,46,231,145,27,35,44,144,60,165,25,225,250,35,132,13,118,131,199,50,174,97,225,250,45,169,250,80,69,96,102,55,179,15,112,70,41,17,56,91
6
+2018:05:30:11:23:09 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,148,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,88,154,25,3,185,185,169,64,166,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,224,170,10,202,129,76,3,32,0,178,83,18,75,18,149,172,170,149,210,50,115,82,139,149,172,162,33,44,37,43,5,37,35,51,160,116,90,10,72,178,32,177,8,172,40,63,31,168,17,232,128,218,218,218,216,218,90,0,71,155,40,179,185,87
7
+2018:05:30:11:23:14 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,149,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,61,139,63,11,194,64,12,197,191,138,188,217,33,181,88,240,54,71,87,23,7,145,35,216,11,28,84,115,94,15,28,74,190,187,169,130,143,12,191,188,63,11,248,222,178,62,17,112,126,157,180,93,176,197,156,106,230,201,157,195,208,251,251,72,142,61,81,236,226,177,35,90,47,238,221,47,85,165,253,91,229,237,72,46,231,145,27,35,44,144,60,165,25,225,250,35,132,13,118,131,199,50,174,97,225,250,45,169,250,80,69,96,102,55,179,15,112,70,41,17,56,91
8
+2018:05:30:11:24:38 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,148,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,88,154,25,3,185,185,169,64,166,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,224,170,10,202,129,76,3,32,0,178,83,18,75,18,149,172,170,149,210,50,115,82,139,149,172,162,33,44,37,43,5,37,35,51,160,116,90,10,72,178,32,177,8,172,40,63,31,168,17,232,128,218,218,218,216,218,90,0,71,155,40,179,185,87
9
+2018:05:30:11:25:04 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,132,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,54,54,52,56,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,108,255
10
+2018:05:30:11:25:16 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,151,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,152,153,153,88,0,249,185,169,64,182,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,16,202,10,202,129,108,3,32,0,178,83,18,75,18,149,172,170,149,210,50,115,82,139,149,172,162,33,44,37,43,5,37,35,51,160,116,90,10,72,178,32,177,8,172,40,63,31,168,49,63,45,77,169,182,182,54,182,182,22,0,181,133,41,125,201,148
11
+2018:05:30:11:25:18 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,149,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,152,153,153,88,0,249,185,169,64,182,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,16,202,10,202,129,108,3,32,0,178,83,18,75,18,149,172,170,149,210,50,115,82,139,149,172,162,33,44,37,43,5,37,35,51,160,116,90,10,72,178,32,177,8,172,40,63,31,168,17,232,132,218,218,218,216,218,90,0,140,110,41,31,121,186
12
+2018:05:30:11:25:33 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,152,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,37,139,177,14,194,48,12,68,127,5,221,204,144,82,136,32,27,35,43,11,3,66,145,69,99,41,82,193,109,26,137,161,242,191,227,128,229,225,221,61,123,5,61,107,150,55,2,174,243,69,234,13,91,44,169,100,26,173,57,249,222,226,43,25,246,206,197,46,158,59,231,218,198,131,245,83,17,174,166,188,223,31,91,252,24,59,27,227,129,42,33,172,224,60,166,5,225,254,39,132,13,118,222,52,15,77,78,84,126,71,34,246,40,204,80,213,135,234,23,147,91,41,71,34,239
13
+2018:05:30:11:25:35 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,153,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,88,154,25,3,185,185,169,64,166,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,128,82,102,102,38,22,32,110,57,144,109,0,4,64,118,74,98,73,162,146,85,181,82,90,102,78,106,177,146,85,52,132,165,100,165,160,100,100,6,148,78,75,1,73,22,36,22,129,21,229,231,3,53,2,93,80,91,91,27,91,91,11,0,106,122,40,233,39,139
14
+2018:05:30:11:25:37 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,152,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,37,139,177,14,194,48,12,68,127,5,221,204,144,82,136,32,27,35,43,11,3,66,145,69,99,41,82,193,109,26,137,161,242,191,227,128,229,225,221,61,123,5,61,107,150,55,2,174,243,69,234,13,91,44,169,100,26,173,57,249,222,226,43,25,246,206,197,46,158,59,231,218,198,131,245,83,17,174,166,188,223,31,91,252,24,59,27,227,129,42,33,172,224,60,166,5,225,254,39,132,13,118,222,52,15,77,78,84,126,71,34,246,40,204,80,213,135,234,23,147,91,41,71,34,239
15
+2018:05:30:11:25:44 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,153,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,88,154,25,3,185,185,169,64,166,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,128,82,102,102,38,22,32,110,57,144,109,0,4,64,118,74,98,73,162,146,85,181,82,90,102,78,106,177,146,85,52,132,165,100,165,160,100,100,6,148,78,75,1,73,22,36,22,129,21,229,231,3,53,2,93,80,91,91,27,91,91,11,0,106,122,40,233,39,139
16
+2018:05:30:11:25:47 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,152,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,37,139,177,14,194,48,12,68,127,5,221,204,144,82,136,32,27,35,43,11,3,66,145,69,99,41,82,193,109,26,137,161,242,191,227,128,229,225,221,61,123,5,61,107,150,55,2,174,243,69,234,13,91,44,169,100,26,173,57,249,222,226,43,25,246,206,197,46,158,59,231,218,198,131,245,83,17,174,166,188,223,31,91,252,24,59,27,227,129,42,33,172,224,60,166,5,225,254,39,132,13,118,222,52,15,77,78,84,126,71,34,246,40,204,80,213,135,234,23,147,91,41,71,34,239
17
+2018:05:30:11:25:51 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,153,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,88,154,25,3,185,185,169,64,166,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,128,82,102,102,38,22,32,110,57,144,109,0,4,64,118,74,98,73,162,146,85,181,82,90,102,78,106,177,146,85,52,132,165,100,165,160,100,100,6,148,78,75,1,73,22,36,22,129,21,229,231,3,53,2,93,80,91,91,27,91,91,11,0,106,122,40,233,39,139
18
+2018:05:30:11:25:55 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,152,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,37,139,177,14,194,48,12,68,127,5,221,204,144,82,136,32,27,35,43,11,3,66,145,69,99,41,82,193,109,26,137,161,242,191,227,128,229,225,221,61,123,5,61,107,150,55,2,174,243,69,234,13,91,44,169,100,26,173,57,249,222,226,43,25,246,206,197,46,158,59,231,218,198,131,245,83,17,174,166,188,223,31,91,252,24,59,27,227,129,42,33,172,224,60,166,5,225,254,39,132,13,118,222,52,15,77,78,84,126,71,34,246,40,204,80,213,135,234,23,147,91,41,71,34,239
19
+2018:05:30:11:27:31 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,152,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,88,154,25,3,185,185,169,64,166,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,64,170,76,13,44,64,220,114,32,219,0,8,128,236,148,196,146,68,37,171,106,165,180,204,156,212,98,37,171,104,8,75,201,74,65,201,200,12,40,157,150,2,146,44,72,44,2,43,202,207,7,106,4,186,160,182,182,54,182,182,22,0,105,231,40,231,141,77
20
+2018:05:30:11:29:19 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,151,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,37,139,61,11,194,48,16,134,255,138,188,179,195,213,210,162,217,28,93,93,58,72,9,135,205,65,160,122,53,13,56,148,252,247,94,244,184,225,121,191,54,240,51,71,125,195,225,254,185,105,30,112,196,26,82,228,217,156,75,223,154,124,5,195,150,200,55,254,218,16,213,247,157,249,75,82,201,181,213,209,185,202,175,49,217,25,79,156,25,110,131,196,57,172,112,143,63,193,29,112,234,45,150,169,134,11,167,95,73,213,134,42,130,82,202,88,202,14,146,198,41,69,159,8
21
+2018:05:30:11:29:21 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,152,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,88,154,25,3,185,185,169,64,166,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,64,170,76,13,44,64,220,114,32,219,0,8,128,236,148,196,146,68,37,171,106,165,180,204,156,212,98,37,171,104,8,75,201,74,65,201,200,12,40,157,150,2,146,44,72,44,2,43,202,207,7,106,4,186,160,182,182,54,182,182,22,0,105,231,40,231,141,77
22
+2018:05:30:11:31:39 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,132,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,54,54,52,57,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,98,46
23
+2018:05:30:11:32:09 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,132,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,52,51,50,49,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,80,214
24
+2018:05:30:11:32:25 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,149,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,152,24,27,25,2,249,185,169,64,182,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,16,202,10,202,129,108,3,32,0,178,83,18,75,18,149,172,170,149,210,50,115,82,139,149,172,162,33,44,37,43,5,37,35,115,160,116,90,10,72,178,32,177,8,172,40,63,31,168,17,232,132,218,218,218,216,218,90,0,130,28,41,4,219,100
25
+2018:05:30:11:32:29 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,150,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,69,139,63,11,194,48,16,197,191,138,188,217,225,210,42,66,54,71,87,23,7,145,16,218,28,4,170,23,211,128,67,185,239,238,213,14,62,110,248,221,251,179,32,14,45,203,11,30,215,247,69,218,13,123,204,169,230,56,153,115,232,59,103,255,51,25,247,68,193,133,179,35,90,47,28,205,47,85,184,253,107,229,99,76,38,227,49,182,8,191,128,243,148,102,248,251,70,240,59,116,39,139,121,92,195,18,235,175,36,98,67,97,134,170,62,84,191,171,24,41,98,192,241
26
+2018:05:30:11:32:39 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,150,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,69,139,189,14,194,48,12,132,95,5,221,204,224,180,192,144,141,145,149,133,1,161,40,106,99,41,82,193,33,141,196,80,249,221,113,233,192,201,195,231,251,89,16,135,150,229,5,143,235,251,34,237,134,61,230,84,115,156,204,57,244,157,179,255,153,140,123,162,224,194,217,17,173,23,142,230,151,42,220,254,181,242,49,38,147,241,24,91,132,95,192,121,74,51,252,125,35,248,29,186,147,197,60,174,97,137,245,87,18,177,161,48,67,85,31,170,95,170,247,41,97,87,54
27
+2018:05:30:11:32:44 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,149,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,171,86,74,76,46,201,204,207,83,178,82,10,42,244,204,47,9,87,210,81,42,78,45,202,76,204,1,138,152,24,27,25,2,249,185,169,64,182,177,129,65,188,97,188,163,161,129,1,8,197,155,2,197,11,138,242,211,74,16,202,10,202,129,108,3,32,0,178,83,18,75,18,149,172,170,149,210,50,115,82,139,149,172,162,33,44,37,43,5,37,35,51,160,116,90,10,72,178,32,177,8,172,40,63,31,168,17,232,132,218,218,218,216,218,90,0,129,252,41,3,155,100
28
+2018:05:30:11:32:48 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,150,0,0,1,1,1,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,120,156,69,139,189,14,194,48,12,132,95,5,221,204,224,180,192,144,141,145,149,133,1,161,40,106,99,41,82,193,33,141,196,80,249,221,113,233,192,201,195,231,251,89,16,135,150,229,5,143,235,251,34,237,134,61,230,84,115,156,204,57,244,157,179,255,153,140,123,162,224,194,217,17,173,23,142,230,151,42,220,254,181,242,49,38,147,241,24,91,132,95,192,121,74,51,252,125,35,248,29,186,147,197,60,174,97,137,245,87,18,177,161,48,67,85,31,170,95,170,247,41,97,87,54
29
+2018:05:30:11:33:18 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,132,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,54,54,53,48,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,69,115
30
+2018:05:30:11:36:44 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,130,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,50,48,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,62,24
31
+2018:05:30:11:36:50 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,130,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,50,49,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,48,201
32
+2018:05:30:11:37:06 mqtt publish: 71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,0,0,0,132,0,0,1,1,0,71,65,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,0,0,0,0,0,0,123,32,34,97,99,116,105,111,110,34,58,32,34,82,113,73,111,116,82,34,44,32,34,115,101,114,105,97,108,34,58,32,34,54,54,53,49,34,44,32,34,109,101,34,58,32,34,51,48,48,95,49,95,65,49,48,48,49,48,48,49,95,53,34,44,32,34,112,119,34,58,32,34,48,48,48,48,34,44,32,34,100,97,116,97,34,58,32,123,32,34,102,105,108,101,34,58,32,34,48,34,32,125,32,125,75,162

BIN
log/mqtt_rece.log View File


+ 9 - 0
log/wss_conn.log View File

@@ -0,0 +1,9 @@
1
+2018:05:30:11:15:18 wss connect in
2
+2018:05:30:11:21:11 wss connect in
3
+2018:05:30:11:22:31 wss connect in
4
+2018:05:30:11:25:04 wss connect in
5
+2018:05:30:11:31:39 wss connect in
6
+2018:05:30:11:32:09 wss connect in
7
+2018:05:30:11:33:18 wss connect in
8
+2018:05:30:11:36:43 wss connect in
9
+2018:05:30:11:37:06 wss connect in

+ 32 - 0
log/wss_recemsg.log View File

@@ -0,0 +1,32 @@
1
+2018:05:30:11:15:18 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"3895\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}
2
+2018:05:30:11:21:11 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"3896\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}
3
+2018:05:30:11:22:31 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"963\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}
4
+2018:05:30:11:22:45 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"963\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
5
+2018:05:30:11:23:05 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"963\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
6
+2018:05:30:11:23:09 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"963\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
7
+2018:05:30:11:23:14 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"963\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
8
+2018:05:30:11:24:38 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"963\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
9
+2018:05:30:11:25:04 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"6648\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}
10
+2018:05:30:11:25:16 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"6648\",\"me\":\"300_1_A1001001_5\",\"proft\":\"6648\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
11
+2018:05:30:11:25:18 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"6648\",\"me\":\"300_1_A1001001_5\",\"proft\":\"6648\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
12
+2018:05:30:11:25:33 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"6648\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
13
+2018:05:30:11:25:35 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"6648\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
14
+2018:05:30:11:25:37 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"6648\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
15
+2018:05:30:11:25:44 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"6648\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
16
+2018:05:30:11:25:47 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"6648\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
17
+2018:05:30:11:25:51 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"6648\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
18
+2018:05:30:11:25:55 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"6648\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
19
+2018:05:30:11:27:31 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"9508\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
20
+2018:05:30:11:29:19 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"9508\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
21
+2018:05:30:11:29:21 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"963\",\"me\":\"300_1_A1001001_5\",\"proft\":\"9508\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
22
+2018:05:30:11:31:39 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"6649\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}
23
+2018:05:30:11:32:09 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"4321\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}
24
+2018:05:30:11:32:25 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"4321\",\"me\":\"300_1_A1001001_5\",\"proft\":\"4321\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"27\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
25
+2018:05:30:11:32:29 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"4321\",\"me\":\"300_1_A1001001_5\",\"proft\":\"4321\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"27\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
26
+2018:05:30:11:32:39 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"4321\",\"me\":\"300_1_A1001001_5\",\"proft\":\"4321\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
27
+2018:05:30:11:32:44 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"4321\",\"me\":\"300_1_A1001001_5\",\"proft\":\"4321\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"on\"}}}]}}"}
28
+2018:05:30:11:32:48 wss rece: {"cmd":"wxxIotM","data":"{\"action\":\"RqIotW\",\"serial\":\"4321\",\"me\":\"300_1_A1001001_5\",\"proft\":\"4321\",\"pw\":\"0000\",\"data\":{\"files\":[{\"file\": \"26\",\"fd\":{\"para\":{\"oo\":\"off\"}}}]}}"}
29
+2018:05:30:11:33:18 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"6650\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}
30
+2018:05:30:11:36:44 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"20\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}
31
+2018:05:30:11:36:50 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"21\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}
32
+2018:05:30:11:37:06 wss rece: {"cmd":"wxxIotM","data":"{ \"action\": \"RqIotR\", \"serial\": \"6651\", \"me\": \"300_1_A1001001_5\", \"pw\": \"0000\", \"data\": { \"file\": \"0\" } }"}

File diff suppressed because it is too large
+ 302 - 0
log/wss_tomobile.log


+ 28 - 0
node_modules/.bin/leven View File

@@ -0,0 +1,28 @@
1
+#!/usr/bin/env node
2
+'use strict';
3
+var pkg = require('./package.json');
4
+var leven = require('./');
5
+var argv = process.argv.slice(2);
6
+
7
+function help() {
8
+	console.log([
9
+		'',
10
+		'  ' + pkg.description,
11
+		'',
12
+		'  Example',
13
+		'    $ leven cat cow',
14
+		'    2'
15
+	].join('\n'));
16
+}
17
+
18
+if (argv.length !== 2 || argv.indexOf('--help') !== -1) {
19
+	help();
20
+	return;
21
+}
22
+
23
+if (argv.indexOf('--version') !== -1) {
24
+	console.log(pkg.version);
25
+	return;
26
+}
27
+
28
+console.log(leven(argv[0], argv[1]));

+ 41 - 0
node_modules/.bin/mqtt View File

@@ -0,0 +1,41 @@
1
+#!/usr/bin/env node
2
+'use strict'
3
+
4
+/*
5
+ * Copyright (c) 2015-2015 MQTT.js contributors.
6
+ * Copyright (c) 2011-2014 Adam Rudd.
7
+ *
8
+ * See LICENSE for more information
9
+ */
10
+
11
+var MqttClient = require('./lib/client')
12
+var connect = require('./lib/connect')
13
+var Store = require('./lib/store')
14
+
15
+module.exports.connect = connect
16
+
17
+// Expose MqttClient
18
+module.exports.MqttClient = MqttClient
19
+module.exports.Client = MqttClient
20
+module.exports.Store = Store
21
+
22
+function cli () {
23
+  var commist = require('commist')()
24
+  var helpMe = require('help-me')()
25
+
26
+  commist.register('publish', require('./bin/pub'))
27
+  commist.register('subscribe', require('./bin/sub'))
28
+  commist.register('version', function () {
29
+    console.log('MQTT.js version:', require('./package.json').version)
30
+  })
31
+  commist.register('help', helpMe.toStdout)
32
+
33
+  if (commist.parse(process.argv.slice(2)) !== null) {
34
+    console.log('No such command:', process.argv[2], '\n')
35
+    helpMe.toStdout()
36
+  }
37
+}
38
+
39
+if (require.main === module) {
40
+  cli()
41
+}

+ 146 - 0
node_modules/.bin/mqtt_pub View File

@@ -0,0 +1,146 @@
1
+#!/usr/bin/env node
2
+
3
+'use strict'
4
+
5
+var mqtt = require('../')
6
+var pump = require('pump')
7
+var path = require('path')
8
+var fs = require('fs')
9
+var concat = require('concat-stream')
10
+var Writable = require('readable-stream').Writable
11
+var helpMe = require('help-me')({
12
+  dir: path.join(__dirname, '..', 'doc')
13
+})
14
+var minimist = require('minimist')
15
+var split2 = require('split2')
16
+
17
+function send (args) {
18
+  var client = mqtt.connect(args)
19
+  client.on('connect', function () {
20
+    client.publish(args.topic, args.message, args, function (err) {
21
+      if (err) {
22
+        console.warn(err)
23
+      }
24
+      client.end()
25
+    })
26
+  })
27
+  client.on('error', function (err) {
28
+    console.warn(err)
29
+    client.end()
30
+  })
31
+}
32
+
33
+function multisend (args) {
34
+  var client = mqtt.connect(args)
35
+  var sender = new Writable({
36
+    objectMode: true
37
+  })
38
+  sender._write = function (line, enc, cb) {
39
+    client.publish(args.topic, line.trim(), args, cb)
40
+  }
41
+
42
+  client.on('connect', function () {
43
+    pump(process.stdin, split2(), sender, function (err) {
44
+      client.end()
45
+      if (err) {
46
+        throw err
47
+      }
48
+    })
49
+  })
50
+}
51
+
52
+function start (args) {
53
+  args = minimist(args, {
54
+    string: ['hostname', 'username', 'password', 'key', 'cert', 'ca', 'message', 'clientId', 'i', 'id'],
55
+    boolean: ['stdin', 'retain', 'help', 'insecure', 'multiline'],
56
+    alias: {
57
+      port: 'p',
58
+      hostname: ['h', 'host'],
59
+      topic: 't',
60
+      message: 'm',
61
+      qos: 'q',
62
+      clientId: ['i', 'id'],
63
+      retain: 'r',
64
+      username: 'u',
65
+      password: 'P',
66
+      stdin: 's',
67
+      multiline: 'M',
68
+      protocol: ['C', 'l'],
69
+      help: 'H',
70
+      ca: 'cafile'
71
+    },
72
+    default: {
73
+      host: 'localhost',
74
+      qos: 0,
75
+      retain: false,
76
+      topic: '',
77
+      message: ''
78
+    }
79
+  })
80
+
81
+  if (args.help) {
82
+    return helpMe.toStdout('publish')
83
+  }
84
+
85
+  if (args.key) {
86
+    args.key = fs.readFileSync(args.key)
87
+  }
88
+
89
+  if (args.cert) {
90
+    args.cert = fs.readFileSync(args.cert)
91
+  }
92
+
93
+  if (args.ca) {
94
+    args.ca = fs.readFileSync(args.ca)
95
+  }
96
+
97
+  if (args.key && args.cert && !args.protocol) {
98
+    args.protocol = 'mqtts'
99
+  }
100
+
101
+  if (args.port) {
102
+    if (typeof args.port !== 'number') {
103
+      console.warn('# Port: number expected, \'%s\' was given.', typeof args.port)
104
+      return
105
+    }
106
+  }
107
+
108
+  if (args['will-topic']) {
109
+    args.will = {}
110
+    args.will.topic = args['will-topic']
111
+    args.will.payload = args['will-message']
112
+    args.will.qos = args['will-qos']
113
+    args.will.retain = args['will-retain']
114
+  }
115
+
116
+  if (args.insecure) {
117
+    args.rejectUnauthorized = false
118
+  }
119
+
120
+  args.topic = (args.topic || args._.shift()).toString()
121
+  args.message = (args.message || args._.shift()).toString()
122
+
123
+  if (!args.topic) {
124
+    console.error('missing topic\n')
125
+    return helpMe.toStdout('publish')
126
+  }
127
+
128
+  if (args.stdin) {
129
+    if (args.multiline) {
130
+      multisend(args)
131
+    } else {
132
+      process.stdin.pipe(concat(function (data) {
133
+        args.message = data
134
+        send(args)
135
+      }))
136
+    }
137
+  } else {
138
+    send(args)
139
+  }
140
+}
141
+
142
+module.exports = start
143
+
144
+if (require.main === module) {
145
+  start(process.argv.slice(2))
146
+}

+ 123 - 0
node_modules/.bin/mqtt_sub View File

@@ -0,0 +1,123 @@
1
+#!/usr/bin/env node
2
+
3
+var mqtt = require('../')
4
+var path = require('path')
5
+var fs = require('fs')
6
+var helpMe = require('help-me')({
7
+  dir: path.join(__dirname, '..', 'doc')
8
+})
9
+var minimist = require('minimist')
10
+
11
+function start (args) {
12
+  args = minimist(args, {
13
+    string: ['hostname', 'username', 'password', 'key', 'cert', 'ca', 'clientId', 'i', 'id'],
14
+    boolean: ['stdin', 'help', 'clean', 'insecure'],
15
+    alias: {
16
+      port: 'p',
17
+      hostname: ['h', 'host'],
18
+      topic: 't',
19
+      qos: 'q',
20
+      clean: 'c',
21
+      keepalive: 'k',
22
+      clientId: ['i', 'id'],
23
+      username: 'u',
24
+      password: 'P',
25
+      protocol: ['C', 'l'],
26
+      verbose: 'v',
27
+      help: '-H',
28
+      ca: 'cafile'
29
+    },
30
+    default: {
31
+      host: 'localhost',
32
+      qos: 0,
33
+      retain: false,
34
+      clean: true,
35
+      keepAlive: 30 // 30 sec
36
+    }
37
+  })
38
+
39
+  if (args.help) {
40
+    return helpMe.toStdout('subscribe')
41
+  }
42
+
43
+  args.topic = args.topic || args._.shift()
44
+
45
+  if (!args.topic) {
46
+    console.error('missing topic\n')
47
+    return helpMe.toStdout('subscribe')
48
+  }
49
+
50
+  if (args.key) {
51
+    args.key = fs.readFileSync(args.key)
52
+  }
53
+
54
+  if (args.cert) {
55
+    args.cert = fs.readFileSync(args.cert)
56
+  }
57
+
58
+  if (args.ca) {
59
+    args.ca = fs.readFileSync(args.ca)
60
+  }
61
+
62
+  if (args.key && args.cert && !args.protocol) {
63
+    args.protocol = 'mqtts'
64
+  }
65
+
66
+  if (args.insecure) {
67
+    args.rejectUnauthorized = false
68
+  }
69
+
70
+  if (args.port) {
71
+    if (typeof args.port !== 'number') {
72
+      console.warn('# Port: number expected, \'%s\' was given.', typeof args.port)
73
+      return
74
+    }
75
+  }
76
+
77
+  if (args['will-topic']) {
78
+    args.will = {}
79
+    args.will.topic = args['will-topic']
80
+    args.will.payload = args['will-message']
81
+    args.will.qos = args['will-qos']
82
+    args.will.retain = args['will-retain']
83
+  }
84
+
85
+  args.keepAlive = args['keep-alive']
86
+
87
+  var client = mqtt.connect(args)
88
+
89
+  client.on('connect', function () {
90
+    client.subscribe(args.topic, { qos: args.qos }, function (err, result) {
91
+      if (err) {
92
+        console.error(err)
93
+        process.exit(1)
94
+      }
95
+
96
+      result.forEach(function (sub) {
97
+        if (sub.qos > 2) {
98
+          console.error('subscription negated to', sub.topic, 'with code', sub.qos)
99
+          process.exit(1)
100
+        }
101
+      })
102
+    })
103
+  })
104
+
105
+  client.on('message', function (topic, payload) {
106
+    if (args.verbose) {
107
+      console.log(topic, payload.toString())
108
+    } else {
109
+      console.log(payload.toString())
110
+    }
111
+  })
112
+
113
+  client.on('error', function (err) {
114
+    console.warn(err)
115
+    client.end()
116
+  })
117
+}
118
+
119
+module.exports = start
120
+
121
+if (require.main === module) {
122
+  start(process.argv.slice(2))
123
+}

+ 7 - 0
node_modules/async-limiter/.travis.yml View File

@@ -0,0 +1,7 @@
1
+language: node_js
2
+node_js:
3
+  - "6"
4
+  - "node"
5
+script: npm run travis
6
+cache:
7
+  yarn: true

+ 8 - 0
node_modules/async-limiter/LICENSE View File

@@ -0,0 +1,8 @@
1
+The MIT License (MIT)
2
+Copyright (c) 2017 Samuel Reed <samuel.trace.reed@gmail.com>
3
+
4
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
5
+
6
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
7
+
8
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 1 - 0
node_modules/async-limiter/coverage/coverage.json View File

@@ -0,0 +1 @@
1
+{"/Users/samuelreed/git/forks/async-throttle/index.js":{"path":"/Users/samuelreed/git/forks/async-throttle/index.js","s":{"1":1,"2":7,"3":1,"4":6,"5":6,"6":6,"7":6,"8":6,"9":6,"10":1,"11":1,"12":3,"13":13,"14":13,"15":13,"16":1,"17":19,"18":1,"19":45,"20":6,"21":39,"22":13,"23":13,"24":13,"25":13,"26":39,"27":18,"28":6,"29":6,"30":1,"31":6,"32":6,"33":6,"34":1,"35":13,"36":13,"37":1},"b":{"1":[1,6],"2":[6,5],"3":[6,5],"4":[6,39],"5":[13,26],"6":[18,21],"7":[6,0]},"f":{"1":7,"2":3,"3":13,"4":19,"5":45,"6":6,"7":13},"fnMap":{"1":{"name":"Queue","line":3,"loc":{"start":{"line":3,"column":0},"end":{"line":3,"column":24}}},"2":{"name":"(anonymous_2)","line":22,"loc":{"start":{"line":22,"column":24},"end":{"line":22,"column":41}}},"3":{"name":"(anonymous_3)","line":23,"loc":{"start":{"line":23,"column":28},"end":{"line":23,"column":39}}},"4":{"name":"(anonymous_4)","line":31,"loc":{"start":{"line":31,"column":7},"end":{"line":31,"column":18}}},"5":{"name":"(anonymous_5)","line":36,"loc":{"start":{"line":36,"column":23},"end":{"line":36,"column":34}}},"6":{"name":"(anonymous_6)","line":55,"loc":{"start":{"line":55,"column":25},"end":{"line":55,"column":38}}},"7":{"name":"done","line":62,"loc":{"start":{"line":62,"column":0},"end":{"line":62,"column":16}}}},"statementMap":{"1":{"start":{"line":3,"column":0},"end":{"line":14,"column":1}},"2":{"start":{"line":4,"column":2},"end":{"line":6,"column":3}},"3":{"start":{"line":5,"column":4},"end":{"line":5,"column":30}},"4":{"start":{"line":8,"column":2},"end":{"line":8,"column":26}},"5":{"start":{"line":9,"column":2},"end":{"line":9,"column":53}},"6":{"start":{"line":10,"column":2},"end":{"line":10,"column":19}},"7":{"start":{"line":11,"column":2},"end":{"line":11,"column":17}},"8":{"start":{"line":12,"column":2},"end":{"line":12,"column":16}},"9":{"start":{"line":13,"column":2},"end":{"line":13,"column":31}},"10":{"start":{"line":16,"column":0},"end":{"line":20,"column":2}},"11":{"start":{"line":22,"column":0},"end":{"line":28,"column":3}},"12":{"start":{"line":23,"column":2},"end":{"line":27,"column":4}},"13":{"start":{"line":24,"column":4},"end":{"line":24,"column":75}},"14":{"start":{"line":25,"column":4},"end":{"line":25,"column":16}},"15":{"start":{"line":26,"column":4},"end":{"line":26,"column":24}},"16":{"start":{"line":30,"column":0},"end":{"line":34,"column":3}},"17":{"start":{"line":32,"column":4},"end":{"line":32,"column":43}},"18":{"start":{"line":36,"column":0},"end":{"line":53,"column":2}},"19":{"start":{"line":37,"column":2},"end":{"line":39,"column":3}},"20":{"start":{"line":38,"column":4},"end":{"line":38,"column":11}},"21":{"start":{"line":40,"column":2},"end":{"line":45,"column":3}},"22":{"start":{"line":41,"column":4},"end":{"line":41,"column":32}},"23":{"start":{"line":42,"column":4},"end":{"line":42,"column":19}},"24":{"start":{"line":43,"column":4},"end":{"line":43,"column":20}},"25":{"start":{"line":44,"column":4},"end":{"line":44,"column":16}},"26":{"start":{"line":47,"column":2},"end":{"line":52,"column":3}},"27":{"start":{"line":48,"column":4},"end":{"line":51,"column":5}},"28":{"start":{"line":49,"column":6},"end":{"line":49,"column":30}},"29":{"start":{"line":50,"column":6},"end":{"line":50,"column":27}},"30":{"start":{"line":55,"column":0},"end":{"line":60,"column":2}},"31":{"start":{"line":56,"column":2},"end":{"line":59,"column":3}},"32":{"start":{"line":57,"column":4},"end":{"line":57,"column":22}},"33":{"start":{"line":58,"column":4},"end":{"line":58,"column":16}},"34":{"start":{"line":62,"column":0},"end":{"line":65,"column":1}},"35":{"start":{"line":63,"column":2},"end":{"line":63,"column":17}},"36":{"start":{"line":64,"column":2},"end":{"line":64,"column":14}},"37":{"start":{"line":67,"column":0},"end":{"line":67,"column":23}}},"branchMap":{"1":{"line":4,"type":"if","locations":[{"start":{"line":4,"column":2},"end":{"line":4,"column":2}},{"start":{"line":4,"column":2},"end":{"line":4,"column":2}}]},"2":{"line":8,"type":"binary-expr","locations":[{"start":{"line":8,"column":12},"end":{"line":8,"column":19}},{"start":{"line":8,"column":23},"end":{"line":8,"column":25}}]},"3":{"line":9,"type":"binary-expr","locations":[{"start":{"line":9,"column":21},"end":{"line":9,"column":40}},{"start":{"line":9,"column":44},"end":{"line":9,"column":52}}]},"4":{"line":37,"type":"if","locations":[{"start":{"line":37,"column":2},"end":{"line":37,"column":2}},{"start":{"line":37,"column":2},"end":{"line":37,"column":2}}]},"5":{"line":40,"type":"if","locations":[{"start":{"line":40,"column":2},"end":{"line":40,"column":2}},{"start":{"line":40,"column":2},"end":{"line":40,"column":2}}]},"6":{"line":47,"type":"if","locations":[{"start":{"line":47,"column":2},"end":{"line":47,"column":2}},{"start":{"line":47,"column":2},"end":{"line":47,"column":2}}]},"7":{"line":56,"type":"if","locations":[{"start":{"line":56,"column":2},"end":{"line":56,"column":2}},{"start":{"line":56,"column":2},"end":{"line":56,"column":2}}]}}}}

+ 73 - 0
node_modules/async-limiter/coverage/lcov-report/async-throttle/index.html View File

@@ -0,0 +1,73 @@
1
+<!doctype html>
2
+<html lang="en">
3
+<head>
4
+    <title>Code coverage report for async-throttle/</title>
5
+    <meta charset="utf-8">
6
+    <link rel="stylesheet" href="../prettify.css">
7
+    <link rel="stylesheet" href="../base.css">
8
+    <style type='text/css'>
9
+        div.coverage-summary .sorter {
10
+            background-image: url(../sort-arrow-sprite.png);
11
+        }
12
+    </style>
13
+</head>
14
+<body>
15
+<div class="header high">
16
+    <h1>Code coverage report for <span class="entity">async-throttle/</span></h1>
17
+    <h2>
18
+        Statements: <span class="metric">100% <small>(37 / 37)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
19
+        Branches: <span class="metric">92.86% <small>(13 / 14)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
20
+        Functions: <span class="metric">100% <small>(7 / 7)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
21
+        Lines: <span class="metric">100% <small>(37 / 37)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
22
+        Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
23
+    </h2>
24
+    <div class="path"><a href="../index.html">All files</a> &#187; async-throttle/</div>
25
+</div>
26
+<div class="body">
27
+<div class="coverage-summary">
28
+<table>
29
+<thead>
30
+<tr>
31
+   <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
32
+   <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
33
+   <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
34
+   <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
35
+   <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
36
+   <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
37
+   <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
38
+   <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
39
+   <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
40
+   <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
41
+</tr>
42
+</thead>
43
+<tbody><tr>
44
+	<td class="file high" data-value="index.js"><a href="index.js.html">index.js</a></td>
45
+	<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
46
+	<td data-value="100" class="pct high">100%</td>
47
+	<td data-value="37" class="abs high">(37&nbsp;/&nbsp;37)</td>
48
+	<td data-value="92.86" class="pct high">92.86%</td>
49
+	<td data-value="14" class="abs high">(13&nbsp;/&nbsp;14)</td>
50
+	<td data-value="100" class="pct high">100%</td>
51
+	<td data-value="7" class="abs high">(7&nbsp;/&nbsp;7)</td>
52
+	<td data-value="100" class="pct high">100%</td>
53
+	<td data-value="37" class="abs high">(37&nbsp;/&nbsp;37)</td>
54
+	</tr>
55
+
56
+</tbody>
57
+</table>
58
+</div>
59
+</div>
60
+<div class="footer">
61
+    <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Sep 11 2017 11:14:14 GMT-0500 (CDT)</div>
62
+</div>
63
+<script src="../prettify.js"></script>
64
+<script>
65
+window.onload = function () {
66
+        if (typeof prettyPrint === 'function') {
67
+            prettyPrint();
68
+        }
69
+};
70
+</script>
71
+<script src="../sorter.js"></script>
72
+</body>
73
+</html>

+ 246 - 0
node_modules/async-limiter/coverage/lcov-report/async-throttle/index.js.html View File

@@ -0,0 +1,246 @@
1
+<!doctype html>
2
+<html lang="en">
3
+<head>
4
+    <title>Code coverage report for async-throttle/index.js</title>
5
+    <meta charset="utf-8">
6
+    <link rel="stylesheet" href="../prettify.css">
7
+    <link rel="stylesheet" href="../base.css">
8
+    <style type='text/css'>
9
+        div.coverage-summary .sorter {
10
+            background-image: url(../sort-arrow-sprite.png);
11
+        }
12
+    </style>
13
+</head>
14
+<body>
15
+<div class="header high">
16
+    <h1>Code coverage report for <span class="entity">async-throttle/index.js</span></h1>
17
+    <h2>
18
+        Statements: <span class="metric">100% <small>(37 / 37)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
19
+        Branches: <span class="metric">92.86% <small>(13 / 14)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
20
+        Functions: <span class="metric">100% <small>(7 / 7)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
21
+        Lines: <span class="metric">100% <small>(37 / 37)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
22
+        Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
23
+    </h2>
24
+    <div class="path"><a href="../index.html">All files</a> &#187; <a href="index.html">async-throttle/</a> &#187; index.js</div>
25
+</div>
26
+<div class="body">
27
+<pre><table class="coverage">
28
+<tr><td class="line-count">1
29
+2
30
+3
31
+4
32
+5
33
+6
34
+7
35
+8
36
+9
37
+10
38
+11
39
+12
40
+13
41
+14
42
+15
43
+16
44
+17
45
+18
46
+19
47
+20
48
+21
49
+22
50
+23
51
+24
52
+25
53
+26
54
+27
55
+28
56
+29
57
+30
58
+31
59
+32
60
+33
61
+34
62
+35
63
+36
64
+37
65
+38
66
+39
67
+40
68
+41
69
+42
70
+43
71
+44
72
+45
73
+46
74
+47
75
+48
76
+49
77
+50
78
+51
79
+52
80
+53
81
+54
82
+55
83
+56
84
+57
85
+58
86
+59
87
+60
88
+61
89
+62
90
+63
91
+64
92
+65
93
+66
94
+67
95
+68</td><td class="line-coverage"><span class="cline-any cline-neutral">&nbsp;</span>
96
+<span class="cline-any cline-neutral">&nbsp;</span>
97
+<span class="cline-any cline-yes">1</span>
98
+<span class="cline-any cline-yes">7</span>
99
+<span class="cline-any cline-yes">1</span>
100
+<span class="cline-any cline-neutral">&nbsp;</span>
101
+<span class="cline-any cline-neutral">&nbsp;</span>
102
+<span class="cline-any cline-yes">6</span>
103
+<span class="cline-any cline-yes">6</span>
104
+<span class="cline-any cline-yes">6</span>
105
+<span class="cline-any cline-yes">6</span>
106
+<span class="cline-any cline-yes">6</span>
107
+<span class="cline-any cline-yes">6</span>
108
+<span class="cline-any cline-neutral">&nbsp;</span>
109
+<span class="cline-any cline-neutral">&nbsp;</span>
110
+<span class="cline-any cline-yes">1</span>
111
+<span class="cline-any cline-neutral">&nbsp;</span>
112
+<span class="cline-any cline-neutral">&nbsp;</span>
113
+<span class="cline-any cline-neutral">&nbsp;</span>
114
+<span class="cline-any cline-neutral">&nbsp;</span>
115
+<span class="cline-any cline-neutral">&nbsp;</span>
116
+<span class="cline-any cline-yes">1</span>
117
+<span class="cline-any cline-yes">3</span>
118
+<span class="cline-any cline-yes">13</span>
119
+<span class="cline-any cline-yes">13</span>
120
+<span class="cline-any cline-yes">13</span>
121
+<span class="cline-any cline-neutral">&nbsp;</span>
122
+<span class="cline-any cline-neutral">&nbsp;</span>
123
+<span class="cline-any cline-neutral">&nbsp;</span>
124
+<span class="cline-any cline-yes">1</span>
125
+<span class="cline-any cline-neutral">&nbsp;</span>
126
+<span class="cline-any cline-yes">19</span>
127
+<span class="cline-any cline-neutral">&nbsp;</span>
128
+<span class="cline-any cline-neutral">&nbsp;</span>
129
+<span class="cline-any cline-neutral">&nbsp;</span>
130
+<span class="cline-any cline-yes">1</span>
131
+<span class="cline-any cline-yes">45</span>
132
+<span class="cline-any cline-yes">6</span>
133
+<span class="cline-any cline-neutral">&nbsp;</span>
134
+<span class="cline-any cline-yes">39</span>
135
+<span class="cline-any cline-yes">13</span>
136
+<span class="cline-any cline-yes">13</span>
137
+<span class="cline-any cline-yes">13</span>
138
+<span class="cline-any cline-yes">13</span>
139
+<span class="cline-any cline-neutral">&nbsp;</span>
140
+<span class="cline-any cline-neutral">&nbsp;</span>
141
+<span class="cline-any cline-yes">39</span>
142
+<span class="cline-any cline-yes">18</span>
143
+<span class="cline-any cline-yes">6</span>
144
+<span class="cline-any cline-yes">6</span>
145
+<span class="cline-any cline-neutral">&nbsp;</span>
146
+<span class="cline-any cline-neutral">&nbsp;</span>
147
+<span class="cline-any cline-neutral">&nbsp;</span>
148
+<span class="cline-any cline-neutral">&nbsp;</span>
149
+<span class="cline-any cline-yes">1</span>
150
+<span class="cline-any cline-yes">6</span>
151
+<span class="cline-any cline-yes">6</span>
152
+<span class="cline-any cline-yes">6</span>
153
+<span class="cline-any cline-neutral">&nbsp;</span>
154
+<span class="cline-any cline-neutral">&nbsp;</span>
155
+<span class="cline-any cline-neutral">&nbsp;</span>
156
+<span class="cline-any cline-yes">1</span>
157
+<span class="cline-any cline-yes">13</span>
158
+<span class="cline-any cline-yes">13</span>
159
+<span class="cline-any cline-neutral">&nbsp;</span>
160
+<span class="cline-any cline-neutral">&nbsp;</span>
161
+<span class="cline-any cline-yes">1</span>
162
+<span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">'use strict';
163
+&nbsp;
164
+function Queue(options) {
165
+  if (!(this instanceof Queue)) {
166
+    return new Queue(options);
167
+  }
168
+&nbsp;
169
+  options = options || {};
170
+  this.concurrency = options.concurrency || Infinity;
171
+  this.pending = 0;
172
+  this.jobs = [];
173
+  this.cbs = [];
174
+  this._done = done.bind(this);
175
+}
176
+&nbsp;
177
+var arrayAddMethods = [
178
+  'push',
179
+  'unshift',
180
+  'splice'
181
+];
182
+&nbsp;
183
+arrayAddMethods.forEach(function(method) {
184
+  Queue.prototype[method] = function() {
185
+    var methodResult = Array.prototype[method].apply(this.jobs, arguments);
186
+    this._run();
187
+    return methodResult;
188
+  };
189
+});
190
+&nbsp;
191
+Object.defineProperty(Queue.prototype, 'length', {
192
+  get: function() {
193
+    return this.pending + this.jobs.length;
194
+  }
195
+});
196
+&nbsp;
197
+Queue.prototype._run = function() {
198
+  if (this.pending === this.concurrency) {
199
+    return;
200
+  }
201
+  if (this.jobs.length) {
202
+    var job = this.jobs.shift();
203
+    this.pending++;
204
+    job(this._done);
205
+    this._run();
206
+  }
207
+&nbsp;
208
+  if (this.pending === 0) {
209
+    while (this.cbs.length !== 0) {
210
+      var cb = this.cbs.pop();
211
+      process.nextTick(cb);
212
+    }
213
+  }
214
+};
215
+&nbsp;
216
+Queue.prototype.onDone = function(cb) {
217
+  <span class="missing-if-branch" title="else path not taken" >E</span>if (typeof cb === 'function') {
218
+    this.cbs.push(cb);
219
+    this._run();
220
+  }
221
+};
222
+&nbsp;
223
+function done() {
224
+  this.pending--;
225
+  this._run();
226
+}
227
+&nbsp;
228
+module.exports = Queue;
229
+&nbsp;</pre></td></tr>
230
+</table></pre>
231
+
232
+</div>
233
+<div class="footer">
234
+    <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Sep 11 2017 11:14:14 GMT-0500 (CDT)</div>
235
+</div>
236
+<script src="../prettify.js"></script>
237
+<script>
238
+window.onload = function () {
239
+        if (typeof prettyPrint === 'function') {
240
+            prettyPrint();
241
+        }
242
+};
243
+</script>
244
+<script src="../sorter.js"></script>
245
+</body>
246
+</html>

+ 182 - 0
node_modules/async-limiter/coverage/lcov-report/base.css View File

@@ -0,0 +1,182 @@
1
+body, html {
2
+    margin:0; padding: 0;
3
+}
4
+body {
5
+    font-family: Helvetica Neue, Helvetica,Arial;
6
+    font-size: 10pt;
7
+}
8
+div.header, div.footer {
9
+    background: #eee;
10
+    padding: 1em;
11
+}
12
+div.header {
13
+    z-index: 100;
14
+    position: fixed;
15
+    top: 0;
16
+    border-bottom: 1px solid #666;
17
+    width: 100%;
18
+}
19
+div.footer {
20
+    border-top: 1px solid #666;
21
+}
22
+div.body {
23
+    margin-top: 10em;
24
+}
25
+div.meta {
26
+    font-size: 90%;
27
+    text-align: center;
28
+}
29
+h1, h2, h3 {
30
+    font-weight: normal;
31
+}
32
+h1 {
33
+    font-size: 12pt;
34
+}
35
+h2 {
36
+    font-size: 10pt;
37
+}
38
+pre {
39
+    font-family: Consolas, Menlo, Monaco, monospace;
40
+    margin: 0;
41
+    padding: 0;
42
+    line-height: 1.3;
43
+    font-size: 14px;
44
+    -moz-tab-size: 2;
45
+    -o-tab-size:  2;
46
+    tab-size: 2;
47
+}
48
+
49
+div.path { font-size: 110%; }
50
+div.path a:link, div.path a:visited { color: #000; }
51
+table.coverage { border-collapse: collapse; margin:0; padding: 0 }
52
+
53
+table.coverage td {
54
+    margin: 0;
55
+    padding: 0;
56
+    color: #111;
57
+    vertical-align: top;
58
+}
59
+table.coverage td.line-count {
60
+    width: 50px;
61
+    text-align: right;
62
+    padding-right: 5px;
63
+}
64
+table.coverage td.line-coverage {
65
+    color: #777 !important;
66
+    text-align: right;
67
+    border-left: 1px solid #666;
68
+    border-right: 1px solid #666;
69
+}
70
+
71
+table.coverage td.text {
72
+}
73
+
74
+table.coverage td span.cline-any {
75
+    display: inline-block;
76
+    padding: 0 5px;
77
+    width: 40px;
78
+}
79
+table.coverage td span.cline-neutral {
80
+    background: #eee;
81
+}
82
+table.coverage td span.cline-yes {
83
+    background: #b5d592;
84
+    color: #999;
85
+}
86
+table.coverage td span.cline-no {
87
+    background: #fc8c84;
88
+}
89
+
90
+.cstat-yes { color: #111; }
91
+.cstat-no { background: #fc8c84; color: #111; }
92
+.fstat-no { background: #ffc520; color: #111 !important; }
93
+.cbranch-no { background:  yellow !important; color: #111; }
94
+
95
+.cstat-skip { background: #ddd; color: #111; }
96
+.fstat-skip { background: #ddd; color: #111 !important; }
97
+.cbranch-skip { background: #ddd !important; color: #111; }
98
+
99
+.missing-if-branch {
100
+    display: inline-block;
101
+    margin-right: 10px;
102
+    position: relative;
103
+    padding: 0 4px;
104
+    background: black;
105
+    color: yellow;
106
+}
107
+
108
+.skip-if-branch {
109
+    display: none;
110
+    margin-right: 10px;
111
+    position: relative;
112
+    padding: 0 4px;
113
+    background: #ccc;
114
+    color: white;
115
+}
116
+
117
+.missing-if-branch .typ, .skip-if-branch .typ {
118
+    color: inherit !important;
119
+}
120
+
121
+.entity, .metric { font-weight: bold; }
122
+.metric { display: inline-block; border: 1px solid #333; padding: 0.3em; background: white; }
123
+.metric small { font-size: 80%; font-weight: normal; color: #666; }
124
+
125
+div.coverage-summary table { border-collapse: collapse; margin: 3em; font-size: 110%; }
126
+div.coverage-summary td, div.coverage-summary table  th { margin: 0; padding: 0.25em 1em; border-top: 1px solid #666; border-bottom: 1px solid #666; }
127
+div.coverage-summary th { text-align: left; border: 1px solid #666; background: #eee; font-weight: normal; }
128
+div.coverage-summary th.file { border-right: none !important; }
129
+div.coverage-summary th.pic { border-left: none !important; text-align: right; }
130
+div.coverage-summary th.pct { border-right: none !important; }
131
+div.coverage-summary th.abs { border-left: none !important; text-align: right; }
132
+div.coverage-summary td.pct { text-align: right; border-left: 1px solid #666; }
133
+div.coverage-summary td.abs { text-align: right; font-size: 90%; color: #444; border-right: 1px solid #666; }
134
+div.coverage-summary td.file { border-left: 1px solid #666; white-space: nowrap;  }
135
+div.coverage-summary td.pic { min-width: 120px !important;  }
136
+div.coverage-summary a:link { text-decoration: none; color: #000; }
137
+div.coverage-summary a:visited { text-decoration: none; color: #777; }
138
+div.coverage-summary a:hover { text-decoration: underline; }
139
+div.coverage-summary tfoot td { border-top: 1px solid #666; }
140
+
141
+div.coverage-summary .sorter {
142
+    height: 10px;
143
+    width: 7px;
144
+    display: inline-block;
145
+    margin-left: 0.5em;
146
+    background: url(sort-arrow-sprite.png) no-repeat scroll 0 0 transparent;
147
+}
148
+div.coverage-summary .sorted .sorter {
149
+    background-position: 0 -20px;
150
+}
151
+div.coverage-summary .sorted-desc .sorter {
152
+    background-position: 0 -10px;
153
+}
154
+
155
+.high { background: #b5d592 !important; }
156
+.medium { background: #ffe87c !important; }
157
+.low { background: #fc8c84 !important; }
158
+
159
+span.cover-fill, span.cover-empty {
160
+    display:inline-block;
161
+    border:1px solid #444;
162
+    background: white;
163
+    height: 12px;
164
+}
165
+span.cover-fill {
166
+    background: #ccc;
167
+    border-right: 1px solid #444;
168
+}
169
+span.cover-empty {
170
+    background: white;
171
+    border-left: none;
172
+}
173
+span.cover-full {
174
+    border-right: none !important;
175
+}
176
+pre.prettyprint {
177
+    border: none !important;
178
+    padding: 0 !important;
179
+    margin: 0 !important;
180
+}
181
+.com { color: #999 !important; }
182
+.ignore-none { color: #999; font-weight: normal; }

+ 73 - 0
node_modules/async-limiter/coverage/lcov-report/index.html View File

@@ -0,0 +1,73 @@
1
+<!doctype html>
2
+<html lang="en">
3
+<head>
4
+    <title>Code coverage report for All files</title>
5
+    <meta charset="utf-8">
6
+    <link rel="stylesheet" href="prettify.css">
7
+    <link rel="stylesheet" href="base.css">
8
+    <style type='text/css'>
9
+        div.coverage-summary .sorter {
10
+            background-image: url(sort-arrow-sprite.png);
11
+        }
12
+    </style>
13
+</head>
14
+<body>
15
+<div class="header high">
16
+    <h1>Code coverage report for <span class="entity">All files</span></h1>
17
+    <h2>
18
+        Statements: <span class="metric">100% <small>(37 / 37)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
19
+        Branches: <span class="metric">92.86% <small>(13 / 14)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
20
+        Functions: <span class="metric">100% <small>(7 / 7)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
21
+        Lines: <span class="metric">100% <small>(37 / 37)</small></span> &nbsp;&nbsp;&nbsp;&nbsp;
22
+        Ignored: <span class="metric"><span class="ignore-none">none</span></span> &nbsp;&nbsp;&nbsp;&nbsp;
23
+    </h2>
24
+    <div class="path"></div>
25
+</div>
26
+<div class="body">
27
+<div class="coverage-summary">
28
+<table>
29
+<thead>
30
+<tr>
31
+   <th data-col="file" data-fmt="html" data-html="true" class="file">File</th>
32
+   <th data-col="pic" data-type="number" data-fmt="html" data-html="true" class="pic"></th>
33
+   <th data-col="statements" data-type="number" data-fmt="pct" class="pct">Statements</th>
34
+   <th data-col="statements_raw" data-type="number" data-fmt="html" class="abs"></th>
35
+   <th data-col="branches" data-type="number" data-fmt="pct" class="pct">Branches</th>
36
+   <th data-col="branches_raw" data-type="number" data-fmt="html" class="abs"></th>
37
+   <th data-col="functions" data-type="number" data-fmt="pct" class="pct">Functions</th>
38
+   <th data-col="functions_raw" data-type="number" data-fmt="html" class="abs"></th>
39
+   <th data-col="lines" data-type="number" data-fmt="pct" class="pct">Lines</th>
40
+   <th data-col="lines_raw" data-type="number" data-fmt="html" class="abs"></th>
41
+</tr>
42
+</thead>
43
+<tbody><tr>
44
+	<td class="file high" data-value="async-throttle/"><a href="async-throttle/index.html">async-throttle/</a></td>
45
+	<td data-value="100" class="pic high"><span class="cover-fill cover-full" style="width: 100px;"></span><span class="cover-empty" style="width:0px;"></span></td>
46
+	<td data-value="100" class="pct high">100%</td>
47
+	<td data-value="37" class="abs high">(37&nbsp;/&nbsp;37)</td>
48
+	<td data-value="92.86" class="pct high">92.86%</td>
49
+	<td data-value="14" class="abs high">(13&nbsp;/&nbsp;14)</td>
50
+	<td data-value="100" class="pct high">100%</td>
51
+	<td data-value="7" class="abs high">(7&nbsp;/&nbsp;7)</td>
52
+	<td data-value="100" class="pct high">100%</td>
53
+	<td data-value="37" class="abs high">(37&nbsp;/&nbsp;37)</td>
54
+	</tr>
55
+
56
+</tbody>
57
+</table>
58
+</div>
59
+</div>
60
+<div class="footer">
61
+    <div class="meta">Generated by <a href="http://istanbul-js.org/" target="_blank">istanbul</a> at Mon Sep 11 2017 11:14:14 GMT-0500 (CDT)</div>
62
+</div>
63
+<script src="prettify.js"></script>
64
+<script>
65
+window.onload = function () {
66
+        if (typeof prettyPrint === 'function') {
67
+            prettyPrint();
68
+        }
69
+};
70
+</script>
71
+<script src="sorter.js"></script>
72
+</body>
73
+</html>

+ 1 - 0
node_modules/async-limiter/coverage/lcov-report/prettify.css View File

@@ -0,0 +1 @@
1
+.pln{color:#000}@media screen{.str{color:#080}.kwd{color:#008}.com{color:#800}.typ{color:#606}.lit{color:#066}.pun,.opn,.clo{color:#660}.tag{color:#008}.atn{color:#606}.atv{color:#080}.dec,.var{color:#606}.fun{color:red}}@media print,projection{.str{color:#060}.kwd{color:#006;font-weight:bold}.com{color:#600;font-style:italic}.typ{color:#404;font-weight:bold}.lit{color:#044}.pun,.opn,.clo{color:#440}.tag{color:#006;font-weight:bold}.atn{color:#404}.atv{color:#060}}pre.prettyprint{padding:2px;border:1px solid #888}ol.linenums{margin-top:0;margin-bottom:0}li.L0,li.L1,li.L2,li.L3,li.L5,li.L6,li.L7,li.L8{list-style-type:none}li.L1,li.L3,li.L5,li.L7,li.L9{background:#eee}

File diff suppressed because it is too large
+ 1 - 0
node_modules/async-limiter/coverage/lcov-report/prettify.js


BIN
node_modules/async-limiter/coverage/lcov-report/sort-arrow-sprite.png View File


+ 156 - 0
node_modules/async-limiter/coverage/lcov-report/sorter.js View File

@@ -0,0 +1,156 @@
1
+var addSorting = (function () {
2
+    "use strict";
3
+    var cols,
4
+        currentSort = {
5
+            index: 0,
6
+            desc: false
7
+        };
8
+
9
+    // returns the summary table element
10
+    function getTable() { return document.querySelector('.coverage-summary table'); }
11
+    // returns the thead element of the summary table
12
+    function getTableHeader() { return getTable().querySelector('thead tr'); }
13
+    // returns the tbody element of the summary table
14
+    function getTableBody() { return getTable().querySelector('tbody'); }
15
+    // returns the th element for nth column
16
+    function getNthColumn(n) { return getTableHeader().querySelectorAll('th')[n]; }
17
+
18
+    // loads all columns
19
+    function loadColumns() {
20
+        var colNodes = getTableHeader().querySelectorAll('th'),
21
+            colNode,
22
+            cols = [],
23
+            col,
24
+            i;
25
+
26
+        for (i = 0; i < colNodes.length; i += 1) {
27
+            colNode = colNodes[i];
28
+            col = {
29
+                key: colNode.getAttribute('data-col'),
30
+                sortable: !colNode.getAttribute('data-nosort'),
31
+                type: colNode.getAttribute('data-type') || 'string'
32
+            };
33
+            cols.push(col);
34
+            if (col.sortable) {
35
+                col.defaultDescSort = col.type === 'number';
36
+                colNode.innerHTML = colNode.innerHTML + '<span class="sorter"></span>';
37
+            }
38
+        }
39
+        return cols;
40
+    }
41
+    // attaches a data attribute to every tr element with an object
42
+    // of data values keyed by column name
43
+    function loadRowData(tableRow) {
44
+        var tableCols = tableRow.querySelectorAll('td'),
45
+            colNode,
46
+            col,
47
+            data = {},
48
+            i,
49
+            val;
50
+        for (i = 0; i < tableCols.length; i += 1) {
51
+            colNode = tableCols[i];
52
+            col = cols[i];
53
+            val = colNode.getAttribute('data-value');
54
+            if (col.type === 'number') {
55
+                val = Number(val);
56
+            }
57
+            data[col.key] = val;
58
+        }
59
+        return data;
60
+    }
61
+    // loads all row data
62
+    function loadData() {
63
+        var rows = getTableBody().querySelectorAll('tr'),
64
+            i;
65
+
66
+        for (i = 0; i < rows.length; i += 1) {
67
+            rows[i].data = loadRowData(rows[i]);
68
+        }
69
+    }
70
+    // sorts the table using the data for the ith column
71
+    function sortByIndex(index, desc) {
72
+        var key = cols[index].key,
73
+            sorter = function (a, b) {
74
+                a = a.data[key];
75
+                b = b.data[key];
76
+                return a < b ? -1 : a > b ? 1 : 0;
77
+            },
78
+            finalSorter = sorter,
79
+            tableBody = document.querySelector('.coverage-summary tbody'),
80
+            rowNodes = tableBody.querySelectorAll('tr'),
81
+            rows = [],
82
+            i;
83
+
84
+        if (desc) {
85
+            finalSorter = function (a, b) {
86
+                return -1 * sorter(a, b);
87
+            };
88
+        }
89
+
90
+        for (i = 0; i < rowNodes.length; i += 1) {
91
+            rows.push(rowNodes[i]);
92
+            tableBody.removeChild(rowNodes[i]);
93
+        }
94
+
95
+        rows.sort(finalSorter);
96
+
97
+        for (i = 0; i < rows.length; i += 1) {
98
+            tableBody.appendChild(rows[i]);
99
+        }
100
+    }
101
+    // removes sort indicators for current column being sorted
102
+    function removeSortIndicators() {
103
+        var col = getNthColumn(currentSort.index),
104
+            cls = col.className;
105
+
106
+        cls = cls.replace(/ sorted$/, '').replace(/ sorted-desc$/, '');
107
+        col.className = cls;
108
+    }
109
+    // adds sort indicators for current column being sorted
110
+    function addSortIndicators() {
111
+        getNthColumn(currentSort.index).className += currentSort.desc ? ' sorted-desc' : ' sorted';
112
+    }
113
+    // adds event listeners for all sorter widgets
114
+    function enableUI() {
115
+        var i,
116
+            el,
117
+            ithSorter = function ithSorter(i) {
118
+                var col = cols[i];
119
+
120
+                return function () {
121
+                    var desc = col.defaultDescSort;
122
+
123
+                    if (currentSort.index === i) {
124
+                        desc = !currentSort.desc;
125
+                    }
126
+                    sortByIndex(i, desc);
127
+                    removeSortIndicators();
128
+                    currentSort.index = i;
129
+                    currentSort.desc = desc;
130
+                    addSortIndicators();
131
+                };
132
+            };
133
+        for (i =0 ; i < cols.length; i += 1) {
134
+            if (cols[i].sortable) {
135
+                el = getNthColumn(i).querySelector('.sorter');
136
+                if (el.addEventListener) {
137
+                    el.addEventListener('click', ithSorter(i));
138
+                } else {
139
+                    el.attachEvent('onclick', ithSorter(i));
140
+                }
141
+            }
142
+        }
143
+    }
144
+    // adds sorting functionality to the UI
145
+    return function () {
146
+        if (!getTable()) {
147
+            return;
148
+        }
149
+        cols = loadColumns();
150
+        loadData(cols);
151
+        addSortIndicators();
152
+        enableUI();
153
+    };
154
+})();
155
+
156
+window.addEventListener('load', addSorting);

+ 74 - 0
node_modules/async-limiter/coverage/lcov.info View File

@@ -0,0 +1,74 @@
1
+TN:
2
+SF:/Users/samuelreed/git/forks/async-throttle/index.js
3
+FN:3,Queue
4
+FN:22,(anonymous_2)
5
+FN:23,(anonymous_3)
6
+FN:31,(anonymous_4)
7
+FN:36,(anonymous_5)
8
+FN:55,(anonymous_6)
9
+FN:62,done
10
+FNF:7
11
+FNH:7
12
+FNDA:7,Queue
13
+FNDA:3,(anonymous_2)
14
+FNDA:13,(anonymous_3)
15
+FNDA:19,(anonymous_4)
16
+FNDA:45,(anonymous_5)
17
+FNDA:6,(anonymous_6)
18
+FNDA:13,done
19
+DA:3,1
20
+DA:4,7
21
+DA:5,1
22
+DA:8,6
23
+DA:9,6
24
+DA:10,6
25
+DA:11,6
26
+DA:12,6
27
+DA:13,6
28
+DA:16,1
29
+DA:22,1
30
+DA:23,3
31
+DA:24,13
32
+DA:25,13
33
+DA:26,13
34
+DA:30,1
35
+DA:32,19
36
+DA:36,1
37
+DA:37,45
38
+DA:38,6
39
+DA:40,39
40
+DA:41,13
41
+DA:42,13
42
+DA:43,13
43
+DA:44,13
44
+DA:47,39
45
+DA:48,18
46
+DA:49,6
47
+DA:50,6
48
+DA:55,1
49
+DA:56,6
50
+DA:57,6
51
+DA:58,6
52
+DA:62,1
53
+DA:63,13
54
+DA:64,13
55
+DA:67,1
56
+LF:37
57
+LH:37
58
+BRDA:4,1,0,1
59
+BRDA:4,1,1,6
60
+BRDA:8,2,0,6
61
+BRDA:8,2,1,5
62
+BRDA:9,3,0,6
63
+BRDA:9,3,1,5
64
+BRDA:37,4,0,6
65
+BRDA:37,4,1,39
66
+BRDA:40,5,0,13
67
+BRDA:40,5,1,26
68
+BRDA:47,6,0,18
69
+BRDA:47,6,1,21
70
+BRDA:56,7,0,6
71
+BRDA:56,7,1,0
72
+BRF:14
73
+BRH:13
74
+end_of_record

+ 67 - 0
node_modules/async-limiter/index.js View File

@@ -0,0 +1,67 @@
1
+'use strict';
2
+
3
+function Queue(options) {
4
+  if (!(this instanceof Queue)) {
5
+    return new Queue(options);
6
+  }
7
+
8
+  options = options || {};
9
+  this.concurrency = options.concurrency || Infinity;
10
+  this.pending = 0;
11
+  this.jobs = [];
12
+  this.cbs = [];
13
+  this._done = done.bind(this);
14
+}
15
+
16
+var arrayAddMethods = [
17
+  'push',
18
+  'unshift',
19
+  'splice'
20
+];
21
+
22
+arrayAddMethods.forEach(function(method) {
23
+  Queue.prototype[method] = function() {
24
+    var methodResult = Array.prototype[method].apply(this.jobs, arguments);
25
+    this._run();
26
+    return methodResult;
27
+  };
28
+});
29
+
30
+Object.defineProperty(Queue.prototype, 'length', {
31
+  get: function() {
32
+    return this.pending + this.jobs.length;
33
+  }
34
+});
35
+
36
+Queue.prototype._run = function() {
37
+  if (this.pending === this.concurrency) {
38
+    return;
39
+  }
40
+  if (this.jobs.length) {
41
+    var job = this.jobs.shift();
42
+    this.pending++;
43
+    job(this._done);
44
+    this._run();
45
+  }
46
+
47
+  if (this.pending === 0) {
48
+    while (this.cbs.length !== 0) {
49
+      var cb = this.cbs.pop();
50
+      process.nextTick(cb);
51
+    }
52
+  }
53
+};
54
+
55
+Queue.prototype.onDone = function(cb) {
56
+  if (typeof cb === 'function') {
57
+    this.cbs.push(cb);
58
+    this._run();
59
+  }
60
+};
61
+
62
+function done() {
63
+  this.pending--;
64
+  this._run();
65
+}
66
+
67
+module.exports = Queue;

+ 69 - 0
node_modules/async-limiter/package.json View File

@@ -0,0 +1,69 @@
1
+{
2
+  "_from": "async-limiter@~1.0.0",
3
+  "_id": "async-limiter@1.0.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-jp/uFnooOiO+L211eZOoSyzpOITMXx1rBITauYykG3BRYPu8h0UcxsPNB04RR5vo4Tyz3+ay17tR6JVf9qzYWg==",
6
+  "_location": "/async-limiter",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "async-limiter@~1.0.0",
12
+    "name": "async-limiter",
13
+    "escapedName": "async-limiter",
14
+    "rawSpec": "~1.0.0",
15
+    "saveSpec": null,
16
+    "fetchSpec": "~1.0.0"
17
+  },
18
+  "_requiredBy": [
19
+    "/websocket-stream/ws"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz",
22
+  "_shasum": "78faed8c3d074ab81f22b4e985d79e8738f720f8",
23
+  "_spec": "async-limiter@~1.0.0",
24
+  "_where": "/var/wss/node_modules/websocket-stream/node_modules/ws",
25
+  "author": {
26
+    "name": "Samuel Reed"
27
+  },
28
+  "bugs": {
29
+    "url": "https://github.com/strml/async-limiter/issues"
30
+  },
31
+  "bundleDependencies": false,
32
+  "dependencies": {},
33
+  "deprecated": false,
34
+  "description": "asynchronous function queue with adjustable concurrency",
35
+  "devDependencies": {
36
+    "coveralls": "^2.11.2",
37
+    "eslint": "^4.6.1",
38
+    "eslint-plugin-mocha": "^4.11.0",
39
+    "intelli-espower-loader": "^1.0.1",
40
+    "istanbul": "^0.3.2",
41
+    "mocha": "^3.5.2",
42
+    "power-assert": "^1.4.4"
43
+  },
44
+  "homepage": "https://github.com/strml/async-limiter#readme",
45
+  "keywords": [
46
+    "throttle",
47
+    "async",
48
+    "limiter",
49
+    "asynchronous",
50
+    "job",
51
+    "task",
52
+    "concurrency",
53
+    "concurrent"
54
+  ],
55
+  "license": "MIT",
56
+  "name": "async-limiter",
57
+  "repository": {
58
+    "type": "git",
59
+    "url": "git+https://github.com/strml/async-limiter.git"
60
+  },
61
+  "scripts": {
62
+    "coverage": "istanbul cover ./node_modules/mocha/bin/_mocha --report lcovonly -- -R spec && cat ./coverage/lcov.info | coveralls",
63
+    "example": "node example",
64
+    "lint": "eslint .",
65
+    "test": "mocha --R intelli-espower-loader test/",
66
+    "travis": "npm run lint && npm run coverage"
67
+  },
68
+  "version": "1.0.0"
69
+}

+ 132 - 0
node_modules/async-limiter/readme.md View File

@@ -0,0 +1,132 @@
1
+# Async-Limiter
2
+
3
+A module for limiting concurrent asynchronous actions in flight. Forked from [queue](https://github.com/jessetane/queue).
4
+
5
+[![npm](http://img.shields.io/npm/v/async-limiter.svg?style=flat-square)](http://www.npmjs.org/async-limiter)
6
+[![tests](https://img.shields.io/travis/STRML/async-limiter.svg?style=flat-square&branch=master)](https://travis-ci.org/STRML/async-limiter)
7
+[![coverage](https://img.shields.io/coveralls/STRML/async-limiter.svg?style=flat-square&branch=master)](https://coveralls.io/r/STRML/async-limiter)
8
+
9
+This module exports a class `Limiter` that implements some of the `Array` API.
10
+Pass async functions (ones that accept a callback or return a promise) to an instance's additive array methods.
11
+
12
+## Motivation
13
+
14
+Certain functions, like `zlib`, have [undesirable behavior](https://github.com/nodejs/node/issues/8871#issuecomment-250915913) when
15
+run at infinite concurrency.
16
+
17
+In this case, it is actually faster, and takes far less memory, to limit concurrency.
18
+
19
+This module should do the absolute minimum work necessary to queue up functions. PRs are welcome that would
20
+make this module faster or lighter, but new functionality is not desired.
21
+
22
+Style should confirm to nodejs/node style.
23
+
24
+## Example
25
+
26
+``` javascript
27
+var Limiter = require('async-limiter')
28
+
29
+var t = new Limiter({concurrency: 2});
30
+var results = []
31
+
32
+// add jobs using the familiar Array API
33
+t.push(function (cb) {
34
+  results.push('two')
35
+  cb()
36
+})
37
+
38
+t.push(
39
+  function (cb) {
40
+    results.push('four')
41
+    cb()
42
+  },
43
+  function (cb) {
44
+    results.push('five')
45
+    cb()
46
+  }
47
+)
48
+
49
+t.unshift(function (cb) {
50
+  results.push('one')
51
+  cb()
52
+})
53
+
54
+t.splice(2, 0, function (cb) {
55
+  results.push('three')
56
+  cb()
57
+})
58
+
59
+// Jobs run automatically. If you want a callback when all are done,
60
+// call 'onDone()'.
61
+t.onDone(function () {
62
+  console.log('all done:', results)
63
+})
64
+```
65
+
66
+## Zlib Example
67
+
68
+```js
69
+const zlib = require('zlib');
70
+const Limiter = require('async-limiter');
71
+
72
+const message = {some: "data"};
73
+const payload = new Buffer(JSON.stringify(message));
74
+
75
+// Try with different concurrency values to see how this actually
76
+// slows significantly with higher concurrency!
77
+//
78
+// 5:        1398.607ms
79
+// 10:       1375.668ms
80
+// Infinity: 4423.300ms
81
+//
82
+const t = new Limiter({concurrency: 5});
83
+function deflate(payload, cb) {
84
+  t.push(function(done) {
85
+    zlib.deflate(payload, function(err, buffer) {
86
+      done();
87
+      cb(err, buffer);
88
+    });
89
+  });
90
+}
91
+
92
+console.time('deflate');
93
+for(let i = 0; i < 30000; ++i) {
94
+  deflate(payload, function (err, buffer) {});
95
+}
96
+q.onDone(function() {
97
+  console.timeEnd('deflate');
98
+});
99
+```
100
+
101
+## Install
102
+
103
+`npm install async-limiter`
104
+
105
+## Test
106
+
107
+`npm test`
108
+
109
+## API
110
+
111
+### `var t = new Limiter([opts])`
112
+Constructor. `opts` may contain inital values for:
113
+* `q.concurrency`
114
+
115
+## Instance methods
116
+
117
+### `q.onDone(fn)`
118
+`fn` will be called once and only once, when the queue is empty.
119
+
120
+## Instance methods mixed in from `Array`
121
+Mozilla has docs on how these methods work [here](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array).
122
+### `q.push(element1, ..., elementN)`
123
+### `q.unshift(element1, ..., elementN)`
124
+### `q.splice(index , howMany[, element1[, ...[, elementN]]])`
125
+
126
+## Properties
127
+### `q.concurrency`
128
+Max number of jobs the queue should process concurrently, defaults to `Infinity`.
129
+
130
+### `q.length`
131
+Jobs pending + jobs to process (readonly).
132
+

+ 5 - 0
node_modules/balanced-match/.npmignore View File

@@ -0,0 +1,5 @@
1
+test
2
+.gitignore
3
+.travis.yml
4
+Makefile
5
+example.js

+ 21 - 0
node_modules/balanced-match/LICENSE.md View File

@@ -0,0 +1,21 @@
1
+(MIT)
2
+
3
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy of
6
+this software and associated documentation files (the "Software"), to deal in
7
+the Software without restriction, including without limitation the rights to
8
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
9
+of the Software, and to permit persons to whom the Software is furnished to do
10
+so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.

+ 91 - 0
node_modules/balanced-match/README.md View File

@@ -0,0 +1,91 @@
1
+# balanced-match
2
+
3
+Match balanced string pairs, like `{` and `}` or `<b>` and `</b>`. Supports regular expressions as well!
4
+
5
+[![build status](https://secure.travis-ci.org/juliangruber/balanced-match.svg)](http://travis-ci.org/juliangruber/balanced-match)
6
+[![downloads](https://img.shields.io/npm/dm/balanced-match.svg)](https://www.npmjs.org/package/balanced-match)
7
+
8
+[![testling badge](https://ci.testling.com/juliangruber/balanced-match.png)](https://ci.testling.com/juliangruber/balanced-match)
9
+
10
+## Example
11
+
12
+Get the first matching pair of braces:
13
+
14
+```js
15
+var balanced = require('balanced-match');
16
+
17
+console.log(balanced('{', '}', 'pre{in{nested}}post'));
18
+console.log(balanced('{', '}', 'pre{first}between{second}post'));
19
+console.log(balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre  {   in{nest}   }  post'));
20
+```
21
+
22
+The matches are:
23
+
24
+```bash
25
+$ node example.js
26
+{ start: 3, end: 14, pre: 'pre', body: 'in{nested}', post: 'post' }
27
+{ start: 3,
28
+  end: 9,
29
+  pre: 'pre',
30
+  body: 'first',
31
+  post: 'between{second}post' }
32
+{ start: 3, end: 17, pre: 'pre', body: 'in{nest}', post: 'post' }
33
+```
34
+
35
+## API
36
+
37
+### var m = balanced(a, b, str)
38
+
39
+For the first non-nested matching pair of `a` and `b` in `str`, return an
40
+object with those keys:
41
+
42
+* **start** the index of the first match of `a`
43
+* **end** the index of the matching `b`
44
+* **pre** the preamble, `a` and `b` not included
45
+* **body** the match, `a` and `b` not included
46
+* **post** the postscript, `a` and `b` not included
47
+
48
+If there's no match, `undefined` will be returned.
49
+
50
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `['{', 'a', '']` and `{a}}` will match `['', 'a', '}']`.
51
+
52
+### var r = balanced.range(a, b, str)
53
+
54
+For the first non-nested matching pair of `a` and `b` in `str`, return an
55
+array with indexes: `[ <a index>, <b index> ]`.
56
+
57
+If there's no match, `undefined` will be returned.
58
+
59
+If the `str` contains more `a` than `b` / there are unmatched pairs, the first match that was closed will be used. For example, `{{a}` will match `[ 1, 3 ]` and `{a}}` will match `[0, 2]`.
60
+
61
+## Installation
62
+
63
+With [npm](https://npmjs.org) do:
64
+
65
+```bash
66
+npm install balanced-match
67
+```
68
+
69
+## License
70
+
71
+(MIT)
72
+
73
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
74
+
75
+Permission is hereby granted, free of charge, to any person obtaining a copy of
76
+this software and associated documentation files (the "Software"), to deal in
77
+the Software without restriction, including without limitation the rights to
78
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
79
+of the Software, and to permit persons to whom the Software is furnished to do
80
+so, subject to the following conditions:
81
+
82
+The above copyright notice and this permission notice shall be included in all
83
+copies or substantial portions of the Software.
84
+
85
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
86
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
87
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
88
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
89
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
90
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
91
+SOFTWARE.

+ 59 - 0
node_modules/balanced-match/index.js View File

@@ -0,0 +1,59 @@
1
+'use strict';
2
+module.exports = balanced;
3
+function balanced(a, b, str) {
4
+  if (a instanceof RegExp) a = maybeMatch(a, str);
5
+  if (b instanceof RegExp) b = maybeMatch(b, str);
6
+
7
+  var r = range(a, b, str);
8
+
9
+  return r && {
10
+    start: r[0],
11
+    end: r[1],
12
+    pre: str.slice(0, r[0]),
13
+    body: str.slice(r[0] + a.length, r[1]),
14
+    post: str.slice(r[1] + b.length)
15
+  };
16
+}
17
+
18
+function maybeMatch(reg, str) {
19
+  var m = str.match(reg);
20
+  return m ? m[0] : null;
21
+}
22
+
23
+balanced.range = range;
24
+function range(a, b, str) {
25
+  var begs, beg, left, right, result;
26
+  var ai = str.indexOf(a);
27
+  var bi = str.indexOf(b, ai + 1);
28
+  var i = ai;
29
+
30
+  if (ai >= 0 && bi > 0) {
31
+    begs = [];
32
+    left = str.length;
33
+
34
+    while (i >= 0 && !result) {
35
+      if (i == ai) {
36
+        begs.push(i);
37
+        ai = str.indexOf(a, i + 1);
38
+      } else if (begs.length == 1) {
39
+        result = [ begs.pop(), bi ];
40
+      } else {
41
+        beg = begs.pop();
42
+        if (beg < left) {
43
+          left = beg;
44
+          right = bi;
45
+        }
46
+
47
+        bi = str.indexOf(b, i + 1);
48
+      }
49
+
50
+      i = ai < bi && ai >= 0 ? ai : bi;
51
+    }
52
+
53
+    if (begs.length) {
54
+      result = [ left, right ];
55
+    }
56
+  }
57
+
58
+  return result;
59
+}

+ 77 - 0
node_modules/balanced-match/package.json View File

@@ -0,0 +1,77 @@
1
+{
2
+  "_from": "balanced-match@^1.0.0",
3
+  "_id": "balanced-match@1.0.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=",
6
+  "_location": "/balanced-match",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "balanced-match@^1.0.0",
12
+    "name": "balanced-match",
13
+    "escapedName": "balanced-match",
14
+    "rawSpec": "^1.0.0",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.0.0"
17
+  },
18
+  "_requiredBy": [
19
+    "/brace-expansion"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz",
22
+  "_shasum": "89b4d199ab2bee49de164ea02b89ce462d71b767",
23
+  "_spec": "balanced-match@^1.0.0",
24
+  "_where": "/var/wss/node_modules/brace-expansion",
25
+  "author": {
26
+    "name": "Julian Gruber",
27
+    "email": "mail@juliangruber.com",
28
+    "url": "http://juliangruber.com"
29
+  },
30
+  "bugs": {
31
+    "url": "https://github.com/juliangruber/balanced-match/issues"
32
+  },
33
+  "bundleDependencies": false,
34
+  "dependencies": {},
35
+  "deprecated": false,
36
+  "description": "Match balanced character pairs, like \"{\" and \"}\"",
37
+  "devDependencies": {
38
+    "matcha": "^0.7.0",
39
+    "tape": "^4.6.0"
40
+  },
41
+  "homepage": "https://github.com/juliangruber/balanced-match",
42
+  "keywords": [
43
+    "match",
44
+    "regexp",
45
+    "test",
46
+    "balanced",
47
+    "parse"
48
+  ],
49
+  "license": "MIT",
50
+  "main": "index.js",
51
+  "name": "balanced-match",
52
+  "repository": {
53
+    "type": "git",
54
+    "url": "git://github.com/juliangruber/balanced-match.git"
55
+  },
56
+  "scripts": {
57
+    "bench": "make bench",
58
+    "test": "make test"
59
+  },
60
+  "testling": {
61
+    "files": "test/*.js",
62
+    "browsers": [
63
+      "ie/8..latest",
64
+      "firefox/20..latest",
65
+      "firefox/nightly",
66
+      "chrome/25..latest",
67
+      "chrome/canary",
68
+      "opera/12..latest",
69
+      "opera/next",
70
+      "safari/5.1..latest",
71
+      "ipad/6.0..latest",
72
+      "iphone/6.0..latest",
73
+      "android-browser/4.2..latest"
74
+    ]
75
+  },
76
+  "version": "1.0.0"
77
+}

+ 59 - 0
node_modules/bl/.jshintrc View File

@@ -0,0 +1,59 @@
1
+{
2
+    "predef": [ ]
3
+  , "bitwise": false
4
+  , "camelcase": false
5
+  , "curly": false
6
+  , "eqeqeq": false
7
+  , "forin": false
8
+  , "immed": false
9
+  , "latedef": false
10
+  , "noarg": true
11
+  , "noempty": true
12
+  , "nonew": true
13
+  , "plusplus": false
14
+  , "quotmark": true
15
+  , "regexp": false
16
+  , "undef": true
17
+  , "unused": true
18
+  , "strict": false
19
+  , "trailing": true
20
+  , "maxlen": 120
21
+  , "asi": true
22
+  , "boss": true
23
+  , "debug": true
24
+  , "eqnull": true
25
+  , "esnext": true
26
+  , "evil": true
27
+  , "expr": true
28
+  , "funcscope": false
29
+  , "globalstrict": false
30
+  , "iterator": false
31
+  , "lastsemic": true
32
+  , "laxbreak": true
33
+  , "laxcomma": true
34
+  , "loopfunc": true
35
+  , "multistr": false
36
+  , "onecase": false
37
+  , "proto": false
38
+  , "regexdash": false
39
+  , "scripturl": true
40
+  , "smarttabs": false
41
+  , "shadow": false
42
+  , "sub": true
43
+  , "supernew": false
44
+  , "validthis": true
45
+  , "browser": true
46
+  , "couch": false
47
+  , "devel": false
48
+  , "dojo": false
49
+  , "mootools": false
50
+  , "node": true
51
+  , "nonstandard": true
52
+  , "prototypejs": false
53
+  , "rhino": false
54
+  , "worker": true
55
+  , "wsh": false
56
+  , "nomen": false
57
+  , "onevar": false
58
+  , "passfail": false
59
+}

+ 16 - 0
node_modules/bl/.travis.yml View File

@@ -0,0 +1,16 @@
1
+sudo: false
2
+language: node_js
3
+node_js:
4
+  - '0.10'
5
+  - '0.12'
6
+  - '4'
7
+  - '6'
8
+  - '8'
9
+  - '9'
10
+branches:
11
+  only:
12
+    - master
13
+notifications:
14
+  email:
15
+    - rod@vagg.org
16
+    - matteo.collina@gmail.com

+ 13 - 0
node_modules/bl/LICENSE.md View File

@@ -0,0 +1,13 @@
1
+The MIT License (MIT)
2
+=====================
3
+
4
+Copyright (c) 2013-2016 bl contributors
5
+----------------------------------
6
+
7
+*bl contributors listed at <https://github.com/rvagg/bl#contributors>*
8
+
9
+Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
10
+
11
+The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
12
+
13
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 208 - 0
node_modules/bl/README.md View File

@@ -0,0 +1,208 @@
1
+# bl *(BufferList)*
2
+
3
+[![Build Status](https://travis-ci.org/rvagg/bl.svg?branch=master)](https://travis-ci.org/rvagg/bl)
4
+
5
+**A Node.js Buffer list collector, reader and streamer thingy.**
6
+
7
+[![NPM](https://nodei.co/npm/bl.png?downloads=true&downloadRank=true)](https://nodei.co/npm/bl/)
8
+[![NPM](https://nodei.co/npm-dl/bl.png?months=6&height=3)](https://nodei.co/npm/bl/)
9
+
10
+**bl** is a storage object for collections of Node Buffers, exposing them with the main Buffer readable API. Also works as a duplex stream so you can collect buffers from a stream that emits them and emit buffers to a stream that consumes them!
11
+
12
+The original buffers are kept intact and copies are only done as necessary. Any reads that require the use of a single original buffer will return a slice of that buffer only (which references the same memory as the original buffer). Reads that span buffers perform concatenation as required and return the results transparently.
13
+
14
+```js
15
+const BufferList = require('bl')
16
+
17
+var bl = new BufferList()
18
+bl.append(new Buffer('abcd'))
19
+bl.append(new Buffer('efg'))
20
+bl.append('hi')                     // bl will also accept & convert Strings
21
+bl.append(new Buffer('j'))
22
+bl.append(new Buffer([ 0x3, 0x4 ]))
23
+
24
+console.log(bl.length) // 12
25
+
26
+console.log(bl.slice(0, 10).toString('ascii')) // 'abcdefghij'
27
+console.log(bl.slice(3, 10).toString('ascii')) // 'defghij'
28
+console.log(bl.slice(3, 6).toString('ascii'))  // 'def'
29
+console.log(bl.slice(3, 8).toString('ascii'))  // 'defgh'
30
+console.log(bl.slice(5, 10).toString('ascii')) // 'fghij'
31
+
32
+// or just use toString!
33
+console.log(bl.toString())               // 'abcdefghij\u0003\u0004'
34
+console.log(bl.toString('ascii', 3, 8))  // 'defgh'
35
+console.log(bl.toString('ascii', 5, 10)) // 'fghij'
36
+
37
+// other standard Buffer readables
38
+console.log(bl.readUInt16BE(10)) // 0x0304
39
+console.log(bl.readUInt16LE(10)) // 0x0403
40
+```
41
+
42
+Give it a callback in the constructor and use it just like **[concat-stream](https://github.com/maxogden/node-concat-stream)**:
43
+
44
+```js
45
+const bl = require('bl')
46
+    , fs = require('fs')
47
+
48
+fs.createReadStream('README.md')
49
+  .pipe(bl(function (err, data) { // note 'new' isn't strictly required
50
+    // `data` is a complete Buffer object containing the full data
51
+    console.log(data.toString())
52
+  }))
53
+```
54
+
55
+Note that when you use the *callback* method like this, the resulting `data` parameter is a concatenation of all `Buffer` objects in the list. If you want to avoid the overhead of this concatenation (in cases of extreme performance consciousness), then avoid the *callback* method and just listen to `'end'` instead, like a standard Stream.
56
+
57
+Or to fetch a URL using [hyperquest](https://github.com/substack/hyperquest) (should work with [request](http://github.com/mikeal/request) and even plain Node http too!):
58
+```js
59
+const hyperquest = require('hyperquest')
60
+    , bl         = require('bl')
61
+    , url        = 'https://raw.github.com/rvagg/bl/master/README.md'
62
+
63
+hyperquest(url).pipe(bl(function (err, data) {
64
+  console.log(data.toString())
65
+}))
66
+```
67
+
68
+Or, use it as a readable stream to recompose a list of Buffers to an output source:
69
+
70
+```js
71
+const BufferList = require('bl')
72
+    , fs         = require('fs')
73
+
74
+var bl = new BufferList()
75
+bl.append(new Buffer('abcd'))
76
+bl.append(new Buffer('efg'))
77
+bl.append(new Buffer('hi'))
78
+bl.append(new Buffer('j'))
79
+
80
+bl.pipe(fs.createWriteStream('gibberish.txt'))
81
+```
82
+
83
+## API
84
+
85
+  * <a href="#ctor"><code><b>new BufferList([ callback ])</b></code></a>
86
+  * <a href="#length"><code>bl.<b>length</b></code></a>
87
+  * <a href="#append"><code>bl.<b>append(buffer)</b></code></a>
88
+  * <a href="#get"><code>bl.<b>get(index)</b></code></a>
89
+  * <a href="#slice"><code>bl.<b>slice([ start[, end ] ])</b></code></a>
90
+  * <a href="#shallowSlice"><code>bl.<b>shallowSlice([ start[, end ] ])</b></code></a>
91
+  * <a href="#copy"><code>bl.<b>copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])</b></code></a>
92
+  * <a href="#duplicate"><code>bl.<b>duplicate()</b></code></a>
93
+  * <a href="#consume"><code>bl.<b>consume(bytes)</b></code></a>
94
+  * <a href="#toString"><code>bl.<b>toString([encoding, [ start, [ end ]]])</b></code></a>
95
+  * <a href="#readXX"><code>bl.<b>readDoubleBE()</b></code>, <code>bl.<b>readDoubleLE()</b></code>, <code>bl.<b>readFloatBE()</b></code>, <code>bl.<b>readFloatLE()</b></code>, <code>bl.<b>readInt32BE()</b></code>, <code>bl.<b>readInt32LE()</b></code>, <code>bl.<b>readUInt32BE()</b></code>, <code>bl.<b>readUInt32LE()</b></code>, <code>bl.<b>readInt16BE()</b></code>, <code>bl.<b>readInt16LE()</b></code>, <code>bl.<b>readUInt16BE()</b></code>, <code>bl.<b>readUInt16LE()</b></code>, <code>bl.<b>readInt8()</b></code>, <code>bl.<b>readUInt8()</b></code></a>
96
+  * <a href="#streams">Streams</a>
97
+
98
+--------------------------------------------------------
99
+<a name="ctor"></a>
100
+### new BufferList([ callback | Buffer | Buffer array | BufferList | BufferList array | String ])
101
+The constructor takes an optional callback, if supplied, the callback will be called with an error argument followed by a reference to the **bl** instance, when `bl.end()` is called (i.e. from a piped stream). This is a convenient method of collecting the entire contents of a stream, particularly when the stream is *chunky*, such as a network stream.
102
+
103
+Normally, no arguments are required for the constructor, but you can initialise the list by passing in a single `Buffer` object or an array of `Buffer` object.
104
+
105
+`new` is not strictly required, if you don't instantiate a new object, it will be done automatically for you so you can create a new instance simply with:
106
+
107
+```js
108
+var bl = require('bl')
109
+var myinstance = bl()
110
+
111
+// equivalent to:
112
+
113
+var BufferList = require('bl')
114
+var myinstance = new BufferList()
115
+```
116
+
117
+--------------------------------------------------------
118
+<a name="length"></a>
119
+### bl.length
120
+Get the length of the list in bytes. This is the sum of the lengths of all of the buffers contained in the list, minus any initial offset for a semi-consumed buffer at the beginning. Should accurately represent the total number of bytes that can be read from the list.
121
+
122
+--------------------------------------------------------
123
+<a name="append"></a>
124
+### bl.append(Buffer | Buffer array | BufferList | BufferList array | String)
125
+`append(buffer)` adds an additional buffer or BufferList to the internal list. `this` is returned so it can be chained.
126
+
127
+--------------------------------------------------------
128
+<a name="get"></a>
129
+### bl.get(index)
130
+`get()` will return the byte at the specified index.
131
+
132
+--------------------------------------------------------
133
+<a name="slice"></a>
134
+### bl.slice([ start, [ end ] ])
135
+`slice()` returns a new `Buffer` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
136
+
137
+If the requested range spans a single internal buffer then a slice of that buffer will be returned which shares the original memory range of that Buffer. If the range spans multiple buffers then copy operations will likely occur to give you a uniform Buffer.
138
+
139
+--------------------------------------------------------
140
+<a name="shallowSlice"></a>
141
+### bl.shallowSlice([ start, [ end ] ])
142
+`shallowSlice()` returns a new `BufferList` object containing the bytes within the range specified. Both `start` and `end` are optional and will default to the beginning and end of the list respectively.
143
+
144
+No copies will be performed. All buffers in the result share memory with the original list.
145
+
146
+--------------------------------------------------------
147
+<a name="copy"></a>
148
+### bl.copy(dest, [ destStart, [ srcStart [, srcEnd ] ] ])
149
+`copy()` copies the content of the list in the `dest` buffer, starting from `destStart` and containing the bytes within the range specified with `srcStart` to `srcEnd`. `destStart`, `start` and `end` are optional and will default to the beginning of the `dest` buffer, and the beginning and end of the list respectively.
150
+
151
+--------------------------------------------------------
152
+<a name="duplicate"></a>
153
+### bl.duplicate()
154
+`duplicate()` performs a **shallow-copy** of the list. The internal Buffers remains the same, so if you change the underlying Buffers, the change will be reflected in both the original and the duplicate. This method is needed if you want to call `consume()` or `pipe()` and still keep the original list.Example:
155
+
156
+```js
157
+var bl = new BufferList()
158
+
159
+bl.append('hello')
160
+bl.append(' world')
161
+bl.append('\n')
162
+
163
+bl.duplicate().pipe(process.stdout, { end: false })
164
+
165
+console.log(bl.toString())
166
+```
167
+
168
+--------------------------------------------------------
169
+<a name="consume"></a>
170
+### bl.consume(bytes)
171
+`consume()` will shift bytes *off the start of the list*. The number of bytes consumed don't need to line up with the sizes of the internal Buffers&mdash;initial offsets will be calculated accordingly in order to give you a consistent view of the data.
172
+
173
+--------------------------------------------------------
174
+<a name="toString"></a>
175
+### bl.toString([encoding, [ start, [ end ]]])
176
+`toString()` will return a string representation of the buffer. The optional `start` and `end` arguments are passed on to `slice()`, while the `encoding` is passed on to `toString()` of the resulting Buffer. See the [Buffer#toString()](http://nodejs.org/docs/latest/api/buffer.html#buffer_buf_tostring_encoding_start_end) documentation for more information.
177
+
178
+--------------------------------------------------------
179
+<a name="readXX"></a>
180
+### bl.readDoubleBE(), bl.readDoubleLE(), bl.readFloatBE(), bl.readFloatLE(), bl.readInt32BE(), bl.readInt32LE(), bl.readUInt32BE(), bl.readUInt32LE(), bl.readInt16BE(), bl.readInt16LE(), bl.readUInt16BE(), bl.readUInt16LE(), bl.readInt8(), bl.readUInt8()
181
+
182
+All of the standard byte-reading methods of the `Buffer` interface are implemented and will operate across internal Buffer boundaries transparently.
183
+
184
+See the <b><code>[Buffer](http://nodejs.org/docs/latest/api/buffer.html)</code></b> documentation for how these work.
185
+
186
+--------------------------------------------------------
187
+<a name="streams"></a>
188
+### Streams
189
+**bl** is a Node **[Duplex Stream](http://nodejs.org/docs/latest/api/stream.html#stream_class_stream_duplex)**, so it can be read from and written to like a standard Node stream. You can also `pipe()` to and from a **bl** instance.
190
+
191
+--------------------------------------------------------
192
+
193
+## Contributors
194
+
195
+**bl** is brought to you by the following hackers:
196
+
197
+ * [Rod Vagg](https://github.com/rvagg)
198
+ * [Matteo Collina](https://github.com/mcollina)
199
+ * [Jarett Cruger](https://github.com/jcrugzz)
200
+
201
+=======
202
+
203
+<a name="license"></a>
204
+## License &amp; copyright
205
+
206
+Copyright (c) 2013-2016 bl contributors (listed above).
207
+
208
+bl is licensed under the MIT license. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE.md file for more details.

+ 281 - 0
node_modules/bl/bl.js View File

@@ -0,0 +1,281 @@
1
+var DuplexStream = require('readable-stream/duplex')
2
+  , util         = require('util')
3
+  , Buffer       = require('safe-buffer').Buffer
4
+
5
+
6
+function BufferList (callback) {
7
+  if (!(this instanceof BufferList))
8
+    return new BufferList(callback)
9
+
10
+  this._bufs  = []
11
+  this.length = 0
12
+
13
+  if (typeof callback == 'function') {
14
+    this._callback = callback
15
+
16
+    var piper = function piper (err) {
17
+      if (this._callback) {
18
+        this._callback(err)
19
+        this._callback = null
20
+      }
21
+    }.bind(this)
22
+
23
+    this.on('pipe', function onPipe (src) {
24
+      src.on('error', piper)
25
+    })
26
+    this.on('unpipe', function onUnpipe (src) {
27
+      src.removeListener('error', piper)
28
+    })
29
+  } else {
30
+    this.append(callback)
31
+  }
32
+
33
+  DuplexStream.call(this)
34
+}
35
+
36
+
37
+util.inherits(BufferList, DuplexStream)
38
+
39
+
40
+BufferList.prototype._offset = function _offset (offset) {
41
+  var tot = 0, i = 0, _t
42
+  if (offset === 0) return [ 0, 0 ]
43
+  for (; i < this._bufs.length; i++) {
44
+    _t = tot + this._bufs[i].length
45
+    if (offset < _t || i == this._bufs.length - 1)
46
+      return [ i, offset - tot ]
47
+    tot = _t
48
+  }
49
+}
50
+
51
+
52
+BufferList.prototype.append = function append (buf) {
53
+  var i = 0
54
+
55
+  if (Buffer.isBuffer(buf)) {
56
+    this._appendBuffer(buf);
57
+  } else if (Array.isArray(buf)) {
58
+    for (; i < buf.length; i++)
59
+      this.append(buf[i])
60
+  } else if (buf instanceof BufferList) {
61
+    // unwrap argument into individual BufferLists
62
+    for (; i < buf._bufs.length; i++)
63
+      this.append(buf._bufs[i])
64
+  } else if (buf != null) {
65
+    // coerce number arguments to strings, since Buffer(number) does
66
+    // uninitialized memory allocation
67
+    if (typeof buf == 'number')
68
+      buf = buf.toString()
69
+
70
+    this._appendBuffer(Buffer.from(buf));
71
+  }
72
+
73
+  return this
74
+}
75
+
76
+
77
+BufferList.prototype._appendBuffer = function appendBuffer (buf) {
78
+  this._bufs.push(buf)
79
+  this.length += buf.length
80
+}
81
+
82
+
83
+BufferList.prototype._write = function _write (buf, encoding, callback) {
84
+  this._appendBuffer(buf)
85
+
86
+  if (typeof callback == 'function')
87
+    callback()
88
+}
89
+
90
+
91
+BufferList.prototype._read = function _read (size) {
92
+  if (!this.length)
93
+    return this.push(null)
94
+
95
+  size = Math.min(size, this.length)
96
+  this.push(this.slice(0, size))
97
+  this.consume(size)
98
+}
99
+
100
+
101
+BufferList.prototype.end = function end (chunk) {
102
+  DuplexStream.prototype.end.call(this, chunk)
103
+
104
+  if (this._callback) {
105
+    this._callback(null, this.slice())
106
+    this._callback = null
107
+  }
108
+}
109
+
110
+
111
+BufferList.prototype.get = function get (index) {
112
+  return this.slice(index, index + 1)[0]
113
+}
114
+
115
+
116
+BufferList.prototype.slice = function slice (start, end) {
117
+  if (typeof start == 'number' && start < 0)
118
+    start += this.length
119
+  if (typeof end == 'number' && end < 0)
120
+    end += this.length
121
+  return this.copy(null, 0, start, end)
122
+}
123
+
124
+
125
+BufferList.prototype.copy = function copy (dst, dstStart, srcStart, srcEnd) {
126
+  if (typeof srcStart != 'number' || srcStart < 0)
127
+    srcStart = 0
128
+  if (typeof srcEnd != 'number' || srcEnd > this.length)
129
+    srcEnd = this.length
130
+  if (srcStart >= this.length)
131
+    return dst || Buffer.alloc(0)
132
+  if (srcEnd <= 0)
133
+    return dst || Buffer.alloc(0)
134
+
135
+  var copy   = !!dst
136
+    , off    = this._offset(srcStart)
137
+    , len    = srcEnd - srcStart
138
+    , bytes  = len
139
+    , bufoff = (copy && dstStart) || 0
140
+    , start  = off[1]
141
+    , l
142
+    , i
143
+
144
+  // copy/slice everything
145
+  if (srcStart === 0 && srcEnd == this.length) {
146
+    if (!copy) { // slice, but full concat if multiple buffers
147
+      return this._bufs.length === 1
148
+        ? this._bufs[0]
149
+        : Buffer.concat(this._bufs, this.length)
150
+    }
151
+
152
+    // copy, need to copy individual buffers
153
+    for (i = 0; i < this._bufs.length; i++) {
154
+      this._bufs[i].copy(dst, bufoff)
155
+      bufoff += this._bufs[i].length
156
+    }
157
+
158
+    return dst
159
+  }
160
+
161
+  // easy, cheap case where it's a subset of one of the buffers
162
+  if (bytes <= this._bufs[off[0]].length - start) {
163
+    return copy
164
+      ? this._bufs[off[0]].copy(dst, dstStart, start, start + bytes)
165
+      : this._bufs[off[0]].slice(start, start + bytes)
166
+  }
167
+
168
+  if (!copy) // a slice, we need something to copy in to
169
+    dst = Buffer.allocUnsafe(len)
170
+
171
+  for (i = off[0]; i < this._bufs.length; i++) {
172
+    l = this._bufs[i].length - start
173
+
174
+    if (bytes > l) {
175
+      this._bufs[i].copy(dst, bufoff, start)
176
+    } else {
177
+      this._bufs[i].copy(dst, bufoff, start, start + bytes)
178
+      break
179
+    }
180
+
181
+    bufoff += l
182
+    bytes -= l
183
+
184
+    if (start)
185
+      start = 0
186
+  }
187
+
188
+  return dst
189
+}
190
+
191
+BufferList.prototype.shallowSlice = function shallowSlice (start, end) {
192
+  start = start || 0
193
+  end = end || this.length
194
+
195
+  if (start < 0)
196
+    start += this.length
197
+  if (end < 0)
198
+    end += this.length
199
+
200
+  var startOffset = this._offset(start)
201
+    , endOffset = this._offset(end)
202
+    , buffers = this._bufs.slice(startOffset[0], endOffset[0] + 1)
203
+
204
+  if (endOffset[1] == 0)
205
+    buffers.pop()
206
+  else
207
+    buffers[buffers.length-1] = buffers[buffers.length-1].slice(0, endOffset[1])
208
+
209
+  if (startOffset[1] != 0)
210
+    buffers[0] = buffers[0].slice(startOffset[1])
211
+
212
+  return new BufferList(buffers)
213
+}
214
+
215
+BufferList.prototype.toString = function toString (encoding, start, end) {
216
+  return this.slice(start, end).toString(encoding)
217
+}
218
+
219
+BufferList.prototype.consume = function consume (bytes) {
220
+  while (this._bufs.length) {
221
+    if (bytes >= this._bufs[0].length) {
222
+      bytes -= this._bufs[0].length
223
+      this.length -= this._bufs[0].length
224
+      this._bufs.shift()
225
+    } else {
226
+      this._bufs[0] = this._bufs[0].slice(bytes)
227
+      this.length -= bytes
228
+      break
229
+    }
230
+  }
231
+  return this
232
+}
233
+
234
+
235
+BufferList.prototype.duplicate = function duplicate () {
236
+  var i = 0
237
+    , copy = new BufferList()
238
+
239
+  for (; i < this._bufs.length; i++)
240
+    copy.append(this._bufs[i])
241
+
242
+  return copy
243
+}
244
+
245
+
246
+BufferList.prototype.destroy = function destroy () {
247
+  this._bufs.length = 0
248
+  this.length = 0
249
+  this.push(null)
250
+}
251
+
252
+
253
+;(function () {
254
+  var methods = {
255
+      'readDoubleBE' : 8
256
+    , 'readDoubleLE' : 8
257
+    , 'readFloatBE'  : 4
258
+    , 'readFloatLE'  : 4
259
+    , 'readInt32BE'  : 4
260
+    , 'readInt32LE'  : 4
261
+    , 'readUInt32BE' : 4
262
+    , 'readUInt32LE' : 4
263
+    , 'readInt16BE'  : 2
264
+    , 'readInt16LE'  : 2
265
+    , 'readUInt16BE' : 2
266
+    , 'readUInt16LE' : 2
267
+    , 'readInt8'     : 1
268
+    , 'readUInt8'    : 1
269
+  }
270
+
271
+  for (var m in methods) {
272
+    (function (m) {
273
+      BufferList.prototype[m] = function (offset) {
274
+        return this.slice(offset, offset + methods[m])[m](0)
275
+      }
276
+    }(m))
277
+  }
278
+}())
279
+
280
+
281
+module.exports = BufferList

+ 63 - 0
node_modules/bl/package.json View File

@@ -0,0 +1,63 @@
1
+{
2
+  "_from": "bl@^1.2.1",
3
+  "_id": "bl@1.2.2",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-e8tQYnZodmebYDWGH7KMRvtzKXaJHx3BbilrgZCfvyLUYdKpK1t5PSPmpkny/SgiTSCnjfLW7v5rlONXVFkQEA==",
6
+  "_location": "/bl",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "bl@^1.2.1",
12
+    "name": "bl",
13
+    "escapedName": "bl",
14
+    "rawSpec": "^1.2.1",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.2.1"
17
+  },
18
+  "_requiredBy": [
19
+    "/mqtt-packet"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/bl/-/bl-1.2.2.tgz",
22
+  "_shasum": "a160911717103c07410cef63ef51b397c025af9c",
23
+  "_spec": "bl@^1.2.1",
24
+  "_where": "/var/wss/node_modules/mqtt-packet",
25
+  "authors": [
26
+    "Rod Vagg <rod@vagg.org> (https://github.com/rvagg)",
27
+    "Matteo Collina <matteo.collina@gmail.com> (https://github.com/mcollina)",
28
+    "Jarett Cruger <jcrugzz@gmail.com> (https://github.com/jcrugzz)"
29
+  ],
30
+  "bugs": {
31
+    "url": "https://github.com/rvagg/bl/issues"
32
+  },
33
+  "bundleDependencies": false,
34
+  "dependencies": {
35
+    "readable-stream": "^2.3.5",
36
+    "safe-buffer": "^5.1.1"
37
+  },
38
+  "deprecated": false,
39
+  "description": "Buffer List: collect buffers and access with a standard readable Buffer interface, streamable too!",
40
+  "devDependencies": {
41
+    "faucet": "0.0.1",
42
+    "hash_file": "~0.1.1",
43
+    "tape": "~4.9.0"
44
+  },
45
+  "homepage": "https://github.com/rvagg/bl",
46
+  "keywords": [
47
+    "buffer",
48
+    "buffers",
49
+    "stream",
50
+    "awesomesauce"
51
+  ],
52
+  "license": "MIT",
53
+  "main": "bl.js",
54
+  "name": "bl",
55
+  "repository": {
56
+    "type": "git",
57
+    "url": "git+https://github.com/rvagg/bl.git"
58
+  },
59
+  "scripts": {
60
+    "test": "node test/test.js | faucet"
61
+  },
62
+  "version": "1.2.2"
63
+}

+ 702 - 0
node_modules/bl/test/test.js View File

@@ -0,0 +1,702 @@
1
+var tape       = require('tape')
2
+  , crypto     = require('crypto')
3
+  , fs         = require('fs')
4
+  , hash       = require('hash_file')
5
+  , BufferList = require('../')
6
+  , Buffer     = require('safe-buffer').Buffer
7
+
8
+  , encodings  =
9
+      ('hex utf8 utf-8 ascii binary base64'
10
+          + (process.browser ? '' : ' ucs2 ucs-2 utf16le utf-16le')).split(' ')
11
+
12
+tape('single bytes from single buffer', function (t) {
13
+  var bl = new BufferList()
14
+  bl.append(Buffer.from('abcd'))
15
+
16
+  t.equal(bl.length, 4)
17
+
18
+  t.equal(bl.get(0), 97)
19
+  t.equal(bl.get(1), 98)
20
+  t.equal(bl.get(2), 99)
21
+  t.equal(bl.get(3), 100)
22
+
23
+  t.end()
24
+})
25
+
26
+tape('single bytes from multiple buffers', function (t) {
27
+  var bl = new BufferList()
28
+  bl.append(Buffer.from('abcd'))
29
+  bl.append(Buffer.from('efg'))
30
+  bl.append(Buffer.from('hi'))
31
+  bl.append(Buffer.from('j'))
32
+
33
+  t.equal(bl.length, 10)
34
+
35
+  t.equal(bl.get(0), 97)
36
+  t.equal(bl.get(1), 98)
37
+  t.equal(bl.get(2), 99)
38
+  t.equal(bl.get(3), 100)
39
+  t.equal(bl.get(4), 101)
40
+  t.equal(bl.get(5), 102)
41
+  t.equal(bl.get(6), 103)
42
+  t.equal(bl.get(7), 104)
43
+  t.equal(bl.get(8), 105)
44
+  t.equal(bl.get(9), 106)
45
+  t.end()
46
+})
47
+
48
+tape('multi bytes from single buffer', function (t) {
49
+  var bl = new BufferList()
50
+  bl.append(Buffer.from('abcd'))
51
+
52
+  t.equal(bl.length, 4)
53
+
54
+  t.equal(bl.slice(0, 4).toString('ascii'), 'abcd')
55
+  t.equal(bl.slice(0, 3).toString('ascii'), 'abc')
56
+  t.equal(bl.slice(1, 4).toString('ascii'), 'bcd')
57
+  t.equal(bl.slice(-4, -1).toString('ascii'), 'abc')
58
+
59
+  t.end()
60
+})
61
+
62
+tape('multi bytes from single buffer (negative indexes)', function (t) {
63
+  var bl = new BufferList()
64
+  bl.append(Buffer.from('buffer'))
65
+
66
+  t.equal(bl.length, 6)
67
+
68
+  t.equal(bl.slice(-6, -1).toString('ascii'), 'buffe')
69
+  t.equal(bl.slice(-6, -2).toString('ascii'), 'buff')
70
+  t.equal(bl.slice(-5, -2).toString('ascii'), 'uff')
71
+
72
+  t.end()
73
+})
74
+
75
+tape('multiple bytes from multiple buffers', function (t) {
76
+  var bl = new BufferList()
77
+
78
+  bl.append(Buffer.from('abcd'))
79
+  bl.append(Buffer.from('efg'))
80
+  bl.append(Buffer.from('hi'))
81
+  bl.append(Buffer.from('j'))
82
+
83
+  t.equal(bl.length, 10)
84
+
85
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
86
+  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
87
+  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
88
+  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
89
+  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
90
+  t.equal(bl.slice(-7, -4).toString('ascii'), 'def')
91
+
92
+  t.end()
93
+})
94
+
95
+tape('multiple bytes from multiple buffer lists', function (t) {
96
+  var bl = new BufferList()
97
+
98
+  bl.append(new BufferList([ Buffer.from('abcd'), Buffer.from('efg') ]))
99
+  bl.append(new BufferList([ Buffer.from('hi'), Buffer.from('j') ]))
100
+
101
+  t.equal(bl.length, 10)
102
+
103
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
104
+
105
+  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
106
+  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
107
+  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
108
+  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
109
+
110
+  t.end()
111
+})
112
+
113
+// same data as previous test, just using nested constructors
114
+tape('multiple bytes from crazy nested buffer lists', function (t) {
115
+  var bl = new BufferList()
116
+
117
+  bl.append(new BufferList([
118
+      new BufferList([
119
+          new BufferList(Buffer.from('abc'))
120
+        , Buffer.from('d')
121
+        , new BufferList(Buffer.from('efg'))
122
+      ])
123
+    , new BufferList([ Buffer.from('hi') ])
124
+    , new BufferList(Buffer.from('j'))
125
+  ]))
126
+
127
+  t.equal(bl.length, 10)
128
+
129
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
130
+
131
+  t.equal(bl.slice(3, 10).toString('ascii'), 'defghij')
132
+  t.equal(bl.slice(3, 6).toString('ascii'), 'def')
133
+  t.equal(bl.slice(3, 8).toString('ascii'), 'defgh')
134
+  t.equal(bl.slice(5, 10).toString('ascii'), 'fghij')
135
+
136
+  t.end()
137
+})
138
+
139
+tape('append accepts arrays of Buffers', function (t) {
140
+  var bl = new BufferList()
141
+  bl.append(Buffer.from('abc'))
142
+  bl.append([ Buffer.from('def') ])
143
+  bl.append([ Buffer.from('ghi'), Buffer.from('jkl') ])
144
+  bl.append([ Buffer.from('mnop'), Buffer.from('qrstu'), Buffer.from('vwxyz') ])
145
+  t.equal(bl.length, 26)
146
+  t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
147
+  t.end()
148
+})
149
+
150
+tape('append accepts arrays of BufferLists', function (t) {
151
+  var bl = new BufferList()
152
+  bl.append(Buffer.from('abc'))
153
+  bl.append([ new BufferList('def') ])
154
+  bl.append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ]))
155
+  bl.append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ])
156
+  t.equal(bl.length, 26)
157
+  t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
158
+  t.end()
159
+})
160
+
161
+tape('append chainable', function (t) {
162
+  var bl = new BufferList()
163
+  t.ok(bl.append(Buffer.from('abcd')) === bl)
164
+  t.ok(bl.append([ Buffer.from('abcd') ]) === bl)
165
+  t.ok(bl.append(new BufferList(Buffer.from('abcd'))) === bl)
166
+  t.ok(bl.append([ new BufferList(Buffer.from('abcd')) ]) === bl)
167
+  t.end()
168
+})
169
+
170
+tape('append chainable (test results)', function (t) {
171
+  var bl = new BufferList('abc')
172
+    .append([ new BufferList('def') ])
173
+    .append(new BufferList([ Buffer.from('ghi'), new BufferList('jkl') ]))
174
+    .append([ Buffer.from('mnop'), new BufferList([ Buffer.from('qrstu'), Buffer.from('vwxyz') ]) ])
175
+
176
+  t.equal(bl.length, 26)
177
+  t.equal(bl.slice().toString('ascii'), 'abcdefghijklmnopqrstuvwxyz')
178
+  t.end()
179
+})
180
+
181
+tape('consuming from multiple buffers', function (t) {
182
+  var bl = new BufferList()
183
+
184
+  bl.append(Buffer.from('abcd'))
185
+  bl.append(Buffer.from('efg'))
186
+  bl.append(Buffer.from('hi'))
187
+  bl.append(Buffer.from('j'))
188
+
189
+  t.equal(bl.length, 10)
190
+
191
+  t.equal(bl.slice(0, 10).toString('ascii'), 'abcdefghij')
192
+
193
+  bl.consume(3)
194
+  t.equal(bl.length, 7)
195
+  t.equal(bl.slice(0, 7).toString('ascii'), 'defghij')
196
+
197
+  bl.consume(2)
198
+  t.equal(bl.length, 5)
199
+  t.equal(bl.slice(0, 5).toString('ascii'), 'fghij')
200
+
201
+  bl.consume(1)
202
+  t.equal(bl.length, 4)
203
+  t.equal(bl.slice(0, 4).toString('ascii'), 'ghij')
204
+
205
+  bl.consume(1)
206
+  t.equal(bl.length, 3)
207
+  t.equal(bl.slice(0, 3).toString('ascii'), 'hij')
208
+
209
+  bl.consume(2)
210
+  t.equal(bl.length, 1)
211
+  t.equal(bl.slice(0, 1).toString('ascii'), 'j')
212
+
213
+  t.end()
214
+})
215
+
216
+tape('complete consumption', function (t) {
217
+  var bl = new BufferList()
218
+
219
+  bl.append(Buffer.from('a'))
220
+  bl.append(Buffer.from('b'))
221
+
222
+  bl.consume(2)
223
+
224
+  t.equal(bl.length, 0)
225
+  t.equal(bl._bufs.length, 0)
226
+
227
+  t.end()
228
+})
229
+
230
+tape('test readUInt8 / readInt8', function (t) {
231
+  var buf1 = Buffer.alloc(1)
232
+    , buf2 = Buffer.alloc(3)
233
+    , buf3 = Buffer.alloc(3)
234
+    , bl  = new BufferList()
235
+
236
+  buf2[1] = 0x3
237
+  buf2[2] = 0x4
238
+  buf3[0] = 0x23
239
+  buf3[1] = 0x42
240
+
241
+  bl.append(buf1)
242
+  bl.append(buf2)
243
+  bl.append(buf3)
244
+
245
+  t.equal(bl.readUInt8(2), 0x3)
246
+  t.equal(bl.readInt8(2), 0x3)
247
+  t.equal(bl.readUInt8(3), 0x4)
248
+  t.equal(bl.readInt8(3), 0x4)
249
+  t.equal(bl.readUInt8(4), 0x23)
250
+  t.equal(bl.readInt8(4), 0x23)
251
+  t.equal(bl.readUInt8(5), 0x42)
252
+  t.equal(bl.readInt8(5), 0x42)
253
+  t.end()
254
+})
255
+
256
+tape('test readUInt16LE / readUInt16BE / readInt16LE / readInt16BE', function (t) {
257
+  var buf1 = Buffer.alloc(1)
258
+    , buf2 = Buffer.alloc(3)
259
+    , buf3 = Buffer.alloc(3)
260
+    , bl   = new BufferList()
261
+
262
+  buf2[1] = 0x3
263
+  buf2[2] = 0x4
264
+  buf3[0] = 0x23
265
+  buf3[1] = 0x42
266
+
267
+  bl.append(buf1)
268
+  bl.append(buf2)
269
+  bl.append(buf3)
270
+
271
+  t.equal(bl.readUInt16BE(2), 0x0304)
272
+  t.equal(bl.readUInt16LE(2), 0x0403)
273
+  t.equal(bl.readInt16BE(2), 0x0304)
274
+  t.equal(bl.readInt16LE(2), 0x0403)
275
+  t.equal(bl.readUInt16BE(3), 0x0423)
276
+  t.equal(bl.readUInt16LE(3), 0x2304)
277
+  t.equal(bl.readInt16BE(3), 0x0423)
278
+  t.equal(bl.readInt16LE(3), 0x2304)
279
+  t.equal(bl.readUInt16BE(4), 0x2342)
280
+  t.equal(bl.readUInt16LE(4), 0x4223)
281
+  t.equal(bl.readInt16BE(4), 0x2342)
282
+  t.equal(bl.readInt16LE(4), 0x4223)
283
+  t.end()
284
+})
285
+
286
+tape('test readUInt32LE / readUInt32BE / readInt32LE / readInt32BE', function (t) {
287
+  var buf1 = Buffer.alloc(1)
288
+    , buf2 = Buffer.alloc(3)
289
+    , buf3 = Buffer.alloc(3)
290
+    , bl   = new BufferList()
291
+
292
+  buf2[1] = 0x3
293
+  buf2[2] = 0x4
294
+  buf3[0] = 0x23
295
+  buf3[1] = 0x42
296
+
297
+  bl.append(buf1)
298
+  bl.append(buf2)
299
+  bl.append(buf3)
300
+
301
+  t.equal(bl.readUInt32BE(2), 0x03042342)
302
+  t.equal(bl.readUInt32LE(2), 0x42230403)
303
+  t.equal(bl.readInt32BE(2), 0x03042342)
304
+  t.equal(bl.readInt32LE(2), 0x42230403)
305
+  t.end()
306
+})
307
+
308
+tape('test readFloatLE / readFloatBE', function (t) {
309
+  var buf1 = Buffer.alloc(1)
310
+    , buf2 = Buffer.alloc(3)
311
+    , buf3 = Buffer.alloc(3)
312
+    , bl   = new BufferList()
313
+
314
+  buf2[1] = 0x00
315
+  buf2[2] = 0x00
316
+  buf3[0] = 0x80
317
+  buf3[1] = 0x3f
318
+
319
+  bl.append(buf1)
320
+  bl.append(buf2)
321
+  bl.append(buf3)
322
+
323
+  t.equal(bl.readFloatLE(2), 0x01)
324
+  t.end()
325
+})
326
+
327
+tape('test readDoubleLE / readDoubleBE', function (t) {
328
+  var buf1 = Buffer.alloc(1)
329
+    , buf2 = Buffer.alloc(3)
330
+    , buf3 = Buffer.alloc(10)
331
+    , bl   = new BufferList()
332
+
333
+  buf2[1] = 0x55
334
+  buf2[2] = 0x55
335
+  buf3[0] = 0x55
336
+  buf3[1] = 0x55
337
+  buf3[2] = 0x55
338
+  buf3[3] = 0x55
339
+  buf3[4] = 0xd5
340
+  buf3[5] = 0x3f
341
+
342
+  bl.append(buf1)
343
+  bl.append(buf2)
344
+  bl.append(buf3)
345
+
346
+  t.equal(bl.readDoubleLE(2), 0.3333333333333333)
347
+  t.end()
348
+})
349
+
350
+tape('test toString', function (t) {
351
+  var bl = new BufferList()
352
+
353
+  bl.append(Buffer.from('abcd'))
354
+  bl.append(Buffer.from('efg'))
355
+  bl.append(Buffer.from('hi'))
356
+  bl.append(Buffer.from('j'))
357
+
358
+  t.equal(bl.toString('ascii', 0, 10), 'abcdefghij')
359
+  t.equal(bl.toString('ascii', 3, 10), 'defghij')
360
+  t.equal(bl.toString('ascii', 3, 6), 'def')
361
+  t.equal(bl.toString('ascii', 3, 8), 'defgh')
362
+  t.equal(bl.toString('ascii', 5, 10), 'fghij')
363
+
364
+  t.end()
365
+})
366
+
367
+tape('test toString encoding', function (t) {
368
+  var bl = new BufferList()
369
+    , b  = Buffer.from('abcdefghij\xff\x00')
370
+
371
+  bl.append(Buffer.from('abcd'))
372
+  bl.append(Buffer.from('efg'))
373
+  bl.append(Buffer.from('hi'))
374
+  bl.append(Buffer.from('j'))
375
+  bl.append(Buffer.from('\xff\x00'))
376
+
377
+  encodings.forEach(function (enc) {
378
+      t.equal(bl.toString(enc), b.toString(enc), enc)
379
+    })
380
+
381
+  t.end()
382
+})
383
+
384
+!process.browser && tape('test stream', function (t) {
385
+  var random = crypto.randomBytes(65534)
386
+    , rndhash = hash(random, 'md5')
387
+    , md5sum = crypto.createHash('md5')
388
+    , bl     = new BufferList(function (err, buf) {
389
+        t.ok(Buffer.isBuffer(buf))
390
+        t.ok(err === null)
391
+        t.equal(rndhash, hash(bl.slice(), 'md5'))
392
+        t.equal(rndhash, hash(buf, 'md5'))
393
+
394
+        bl.pipe(fs.createWriteStream('/tmp/bl_test_rnd_out.dat'))
395
+          .on('close', function () {
396
+            var s = fs.createReadStream('/tmp/bl_test_rnd_out.dat')
397
+            s.on('data', md5sum.update.bind(md5sum))
398
+            s.on('end', function() {
399
+              t.equal(rndhash, md5sum.digest('hex'), 'woohoo! correct hash!')
400
+              t.end()
401
+            })
402
+          })
403
+
404
+      })
405
+
406
+  fs.writeFileSync('/tmp/bl_test_rnd.dat', random)
407
+  fs.createReadStream('/tmp/bl_test_rnd.dat').pipe(bl)
408
+})
409
+
410
+tape('instantiation with Buffer', function (t) {
411
+  var buf  = crypto.randomBytes(1024)
412
+    , buf2 = crypto.randomBytes(1024)
413
+    , b    = BufferList(buf)
414
+
415
+  t.equal(buf.toString('hex'), b.slice().toString('hex'), 'same buffer')
416
+  b = BufferList([ buf, buf2 ])
417
+  t.equal(b.slice().toString('hex'), Buffer.concat([ buf, buf2 ]).toString('hex'), 'same buffer')
418
+  t.end()
419
+})
420
+
421
+tape('test String appendage', function (t) {
422
+  var bl = new BufferList()
423
+    , b  = Buffer.from('abcdefghij\xff\x00')
424
+
425
+  bl.append('abcd')
426
+  bl.append('efg')
427
+  bl.append('hi')
428
+  bl.append('j')
429
+  bl.append('\xff\x00')
430
+
431
+  encodings.forEach(function (enc) {
432
+      t.equal(bl.toString(enc), b.toString(enc))
433
+    })
434
+
435
+  t.end()
436
+})
437
+
438
+tape('test Number appendage', function (t) {
439
+  var bl = new BufferList()
440
+    , b  = Buffer.from('1234567890')
441
+
442
+  bl.append(1234)
443
+  bl.append(567)
444
+  bl.append(89)
445
+  bl.append(0)
446
+
447
+  encodings.forEach(function (enc) {
448
+      t.equal(bl.toString(enc), b.toString(enc))
449
+    })
450
+
451
+  t.end()
452
+})
453
+
454
+tape('write nothing, should get empty buffer', function (t) {
455
+  t.plan(3)
456
+  BufferList(function (err, data) {
457
+    t.notOk(err, 'no error')
458
+    t.ok(Buffer.isBuffer(data), 'got a buffer')
459
+    t.equal(0, data.length, 'got a zero-length buffer')
460
+    t.end()
461
+  }).end()
462
+})
463
+
464
+tape('unicode string', function (t) {
465
+  t.plan(2)
466
+  var inp1 = '\u2600'
467
+    , inp2 = '\u2603'
468
+    , exp = inp1 + ' and ' + inp2
469
+    , bl = BufferList()
470
+  bl.write(inp1)
471
+  bl.write(' and ')
472
+  bl.write(inp2)
473
+  t.equal(exp, bl.toString())
474
+  t.equal(Buffer.from(exp).toString('hex'), bl.toString('hex'))
475
+})
476
+
477
+tape('should emit finish', function (t) {
478
+  var source = BufferList()
479
+    , dest = BufferList()
480
+
481
+  source.write('hello')
482
+  source.pipe(dest)
483
+
484
+  dest.on('finish', function () {
485
+    t.equal(dest.toString('utf8'), 'hello')
486
+    t.end()
487
+  })
488
+})
489
+
490
+tape('basic copy', function (t) {
491
+  var buf  = crypto.randomBytes(1024)
492
+    , buf2 = Buffer.alloc(1024)
493
+    , b    = BufferList(buf)
494
+
495
+  b.copy(buf2)
496
+  t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
497
+  t.end()
498
+})
499
+
500
+tape('copy after many appends', function (t) {
501
+  var buf  = crypto.randomBytes(512)
502
+    , buf2 = Buffer.alloc(1024)
503
+    , b    = BufferList(buf)
504
+
505
+  b.append(buf)
506
+  b.copy(buf2)
507
+  t.equal(b.slice().toString('hex'), buf2.toString('hex'), 'same buffer')
508
+  t.end()
509
+})
510
+
511
+tape('copy at a precise position', function (t) {
512
+  var buf  = crypto.randomBytes(1004)
513
+    , buf2 = Buffer.alloc(1024)
514
+    , b    = BufferList(buf)
515
+
516
+  b.copy(buf2, 20)
517
+  t.equal(b.slice().toString('hex'), buf2.slice(20).toString('hex'), 'same buffer')
518
+  t.end()
519
+})
520
+
521
+tape('copy starting from a precise location', function (t) {
522
+  var buf  = crypto.randomBytes(10)
523
+    , buf2 = Buffer.alloc(5)
524
+    , b    = BufferList(buf)
525
+
526
+  b.copy(buf2, 0, 5)
527
+  t.equal(b.slice(5).toString('hex'), buf2.toString('hex'), 'same buffer')
528
+  t.end()
529
+})
530
+
531
+tape('copy in an interval', function (t) {
532
+  var rnd      = crypto.randomBytes(10)
533
+    , b        = BufferList(rnd) // put the random bytes there
534
+    , actual   = Buffer.alloc(3)
535
+    , expected = Buffer.alloc(3)
536
+
537
+  rnd.copy(expected, 0, 5, 8)
538
+  b.copy(actual, 0, 5, 8)
539
+
540
+  t.equal(actual.toString('hex'), expected.toString('hex'), 'same buffer')
541
+  t.end()
542
+})
543
+
544
+tape('copy an interval between two buffers', function (t) {
545
+  var buf      = crypto.randomBytes(10)
546
+    , buf2     = Buffer.alloc(10)
547
+    , b        = BufferList(buf)
548
+
549
+  b.append(buf)
550
+  b.copy(buf2, 0, 5, 15)
551
+
552
+  t.equal(b.slice(5, 15).toString('hex'), buf2.toString('hex'), 'same buffer')
553
+  t.end()
554
+})
555
+
556
+tape('shallow slice across buffer boundaries', function (t) {
557
+  var bl = new BufferList(['First', 'Second', 'Third'])
558
+
559
+  t.equal(bl.shallowSlice(3, 13).toString(), 'stSecondTh')
560
+  t.end()
561
+})
562
+
563
+tape('shallow slice within single buffer', function (t) {
564
+  t.plan(2)
565
+  var bl = new BufferList(['First', 'Second', 'Third'])
566
+
567
+  t.equal(bl.shallowSlice(5, 10).toString(), 'Secon')
568
+  t.equal(bl.shallowSlice(7, 10).toString(), 'con')
569
+  t.end()
570
+})
571
+
572
+tape('shallow slice single buffer', function (t) {
573
+  t.plan(3)
574
+  var bl = new BufferList(['First', 'Second', 'Third'])
575
+
576
+  t.equal(bl.shallowSlice(0, 5).toString(), 'First')
577
+  t.equal(bl.shallowSlice(5, 11).toString(), 'Second')
578
+  t.equal(bl.shallowSlice(11, 16).toString(), 'Third')
579
+})
580
+
581
+tape('shallow slice with negative or omitted indices', function (t) {
582
+  t.plan(4)
583
+  var bl = new BufferList(['First', 'Second', 'Third'])
584
+
585
+  t.equal(bl.shallowSlice().toString(), 'FirstSecondThird')
586
+  t.equal(bl.shallowSlice(5).toString(), 'SecondThird')
587
+  t.equal(bl.shallowSlice(5, -3).toString(), 'SecondTh')
588
+  t.equal(bl.shallowSlice(-8).toString(), 'ondThird')
589
+})
590
+
591
+tape('shallow slice does not make a copy', function (t) {
592
+  t.plan(1)
593
+  var buffers = [Buffer.from('First'), Buffer.from('Second'), Buffer.from('Third')]
594
+  var bl = (new BufferList(buffers)).shallowSlice(5, -3)
595
+
596
+  buffers[1].fill('h')
597
+  buffers[2].fill('h')
598
+
599
+  t.equal(bl.toString(), 'hhhhhhhh')
600
+})
601
+
602
+tape('duplicate', function (t) {
603
+  t.plan(2)
604
+
605
+  var bl = new BufferList('abcdefghij\xff\x00')
606
+    , dup = bl.duplicate()
607
+
608
+  t.equal(bl.prototype, dup.prototype)
609
+  t.equal(bl.toString('hex'), dup.toString('hex'))
610
+})
611
+
612
+tape('destroy no pipe', function (t) {
613
+  t.plan(2)
614
+
615
+  var bl = new BufferList('alsdkfja;lsdkfja;lsdk')
616
+  bl.destroy()
617
+
618
+  t.equal(bl._bufs.length, 0)
619
+  t.equal(bl.length, 0)
620
+})
621
+
622
+!process.browser && tape('destroy with pipe before read end', function (t) {
623
+  t.plan(2)
624
+
625
+  var bl = new BufferList()
626
+  fs.createReadStream(__dirname + '/test.js')
627
+    .pipe(bl)
628
+
629
+  bl.destroy()
630
+
631
+  t.equal(bl._bufs.length, 0)
632
+  t.equal(bl.length, 0)
633
+
634
+})
635
+
636
+!process.browser && tape('destroy with pipe before read end with race', function (t) {
637
+  t.plan(2)
638
+
639
+  var bl = new BufferList()
640
+  fs.createReadStream(__dirname + '/test.js')
641
+    .pipe(bl)
642
+
643
+  setTimeout(function () {
644
+    bl.destroy()
645
+    setTimeout(function () {
646
+      t.equal(bl._bufs.length, 0)
647
+      t.equal(bl.length, 0)
648
+    }, 500)
649
+  }, 500)
650
+})
651
+
652
+!process.browser && tape('destroy with pipe after read end', function (t) {
653
+  t.plan(2)
654
+
655
+  var bl = new BufferList()
656
+  fs.createReadStream(__dirname + '/test.js')
657
+    .on('end', onEnd)
658
+    .pipe(bl)
659
+
660
+  function onEnd () {
661
+    bl.destroy()
662
+
663
+    t.equal(bl._bufs.length, 0)
664
+    t.equal(bl.length, 0)
665
+  }
666
+})
667
+
668
+!process.browser && tape('destroy with pipe while writing to a destination', function (t) {
669
+  t.plan(4)
670
+
671
+  var bl = new BufferList()
672
+    , ds = new BufferList()
673
+
674
+  fs.createReadStream(__dirname + '/test.js')
675
+    .on('end', onEnd)
676
+    .pipe(bl)
677
+
678
+  function onEnd () {
679
+    bl.pipe(ds)
680
+
681
+    setTimeout(function () {
682
+      bl.destroy()
683
+
684
+      t.equals(bl._bufs.length, 0)
685
+      t.equals(bl.length, 0)
686
+
687
+      ds.destroy()
688
+
689
+      t.equals(bl._bufs.length, 0)
690
+      t.equals(bl.length, 0)
691
+
692
+    }, 100)
693
+  }
694
+})
695
+
696
+!process.browser && tape('handle error', function (t) {
697
+  t.plan(2)
698
+  fs.createReadStream('/does/not/exist').pipe(BufferList(function (err, data) {
699
+    t.ok(err instanceof Error, 'has error')
700
+    t.notOk(data, 'no data')
701
+  }))
702
+})

+ 21 - 0
node_modules/brace-expansion/LICENSE View File

@@ -0,0 +1,21 @@
1
+MIT License
2
+
3
+Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.

+ 129 - 0
node_modules/brace-expansion/README.md View File

@@ -0,0 +1,129 @@
1
+# brace-expansion
2
+
3
+[Brace expansion](https://www.gnu.org/software/bash/manual/html_node/Brace-Expansion.html), 
4
+as known from sh/bash, in JavaScript.
5
+
6
+[![build status](https://secure.travis-ci.org/juliangruber/brace-expansion.svg)](http://travis-ci.org/juliangruber/brace-expansion)
7
+[![downloads](https://img.shields.io/npm/dm/brace-expansion.svg)](https://www.npmjs.org/package/brace-expansion)
8
+[![Greenkeeper badge](https://badges.greenkeeper.io/juliangruber/brace-expansion.svg)](https://greenkeeper.io/)
9
+
10
+[![testling badge](https://ci.testling.com/juliangruber/brace-expansion.png)](https://ci.testling.com/juliangruber/brace-expansion)
11
+
12
+## Example
13
+
14
+```js
15
+var expand = require('brace-expansion');
16
+
17
+expand('file-{a,b,c}.jpg')
18
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
19
+
20
+expand('-v{,,}')
21
+// => ['-v', '-v', '-v']
22
+
23
+expand('file{0..2}.jpg')
24
+// => ['file0.jpg', 'file1.jpg', 'file2.jpg']
25
+
26
+expand('file-{a..c}.jpg')
27
+// => ['file-a.jpg', 'file-b.jpg', 'file-c.jpg']
28
+
29
+expand('file{2..0}.jpg')
30
+// => ['file2.jpg', 'file1.jpg', 'file0.jpg']
31
+
32
+expand('file{0..4..2}.jpg')
33
+// => ['file0.jpg', 'file2.jpg', 'file4.jpg']
34
+
35
+expand('file-{a..e..2}.jpg')
36
+// => ['file-a.jpg', 'file-c.jpg', 'file-e.jpg']
37
+
38
+expand('file{00..10..5}.jpg')
39
+// => ['file00.jpg', 'file05.jpg', 'file10.jpg']
40
+
41
+expand('{{A..C},{a..c}}')
42
+// => ['A', 'B', 'C', 'a', 'b', 'c']
43
+
44
+expand('ppp{,config,oe{,conf}}')
45
+// => ['ppp', 'pppconfig', 'pppoe', 'pppoeconf']
46
+```
47
+
48
+## API
49
+
50
+```js
51
+var expand = require('brace-expansion');
52
+```
53
+
54
+### var expanded = expand(str)
55
+
56
+Return an array of all possible and valid expansions of `str`. If none are
57
+found, `[str]` is returned.
58
+
59
+Valid expansions are:
60
+
61
+```js
62
+/^(.*,)+(.+)?$/
63
+// {a,b,...}
64
+```
65
+
66
+A comma separated list of options, like `{a,b}` or `{a,{b,c}}` or `{,a,}`.
67
+
68
+```js
69
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
70
+// {x..y[..incr]}
71
+```
72
+
73
+A numeric sequence from `x` to `y` inclusive, with optional increment.
74
+If `x` or `y` start with a leading `0`, all the numbers will be padded
75
+to have equal length. Negative numbers and backwards iteration work too.
76
+
77
+```js
78
+/^-?\d+\.\.-?\d+(\.\.-?\d+)?$/
79
+// {x..y[..incr]}
80
+```
81
+
82
+An alphabetic sequence from `x` to `y` inclusive, with optional increment.
83
+`x` and `y` must be exactly one character, and if given, `incr` must be a
84
+number.
85
+
86
+For compatibility reasons, the string `${` is not eligible for brace expansion.
87
+
88
+## Installation
89
+
90
+With [npm](https://npmjs.org) do:
91
+
92
+```bash
93
+npm install brace-expansion
94
+```
95
+
96
+## Contributors
97
+
98
+- [Julian Gruber](https://github.com/juliangruber)
99
+- [Isaac Z. Schlueter](https://github.com/isaacs)
100
+
101
+## Sponsors
102
+
103
+This module is proudly supported by my [Sponsors](https://github.com/juliangruber/sponsors)!
104
+
105
+Do you want to support modules like this to improve their quality, stability and weigh in on new features? Then please consider donating to my [Patreon](https://www.patreon.com/juliangruber). Not sure how much of my modules you're using? Try [feross/thanks](https://github.com/feross/thanks)!
106
+
107
+## License
108
+
109
+(MIT)
110
+
111
+Copyright (c) 2013 Julian Gruber &lt;julian@juliangruber.com&gt;
112
+
113
+Permission is hereby granted, free of charge, to any person obtaining a copy of
114
+this software and associated documentation files (the "Software"), to deal in
115
+the Software without restriction, including without limitation the rights to
116
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
117
+of the Software, and to permit persons to whom the Software is furnished to do
118
+so, subject to the following conditions:
119
+
120
+The above copyright notice and this permission notice shall be included in all
121
+copies or substantial portions of the Software.
122
+
123
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
124
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
125
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
126
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
127
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
128
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
129
+SOFTWARE.

+ 201 - 0
node_modules/brace-expansion/index.js View File

@@ -0,0 +1,201 @@
1
+var concatMap = require('concat-map');
2
+var balanced = require('balanced-match');
3
+
4
+module.exports = expandTop;
5
+
6
+var escSlash = '\0SLASH'+Math.random()+'\0';
7
+var escOpen = '\0OPEN'+Math.random()+'\0';
8
+var escClose = '\0CLOSE'+Math.random()+'\0';
9
+var escComma = '\0COMMA'+Math.random()+'\0';
10
+var escPeriod = '\0PERIOD'+Math.random()+'\0';
11
+
12
+function numeric(str) {
13
+  return parseInt(str, 10) == str
14
+    ? parseInt(str, 10)
15
+    : str.charCodeAt(0);
16
+}
17
+
18
+function escapeBraces(str) {
19
+  return str.split('\\\\').join(escSlash)
20
+            .split('\\{').join(escOpen)
21
+            .split('\\}').join(escClose)
22
+            .split('\\,').join(escComma)
23
+            .split('\\.').join(escPeriod);
24
+}
25
+
26
+function unescapeBraces(str) {
27
+  return str.split(escSlash).join('\\')
28
+            .split(escOpen).join('{')
29
+            .split(escClose).join('}')
30
+            .split(escComma).join(',')
31
+            .split(escPeriod).join('.');
32
+}
33
+
34
+
35
+// Basically just str.split(","), but handling cases
36
+// where we have nested braced sections, which should be
37
+// treated as individual members, like {a,{b,c},d}
38
+function parseCommaParts(str) {
39
+  if (!str)
40
+    return [''];
41
+
42
+  var parts = [];
43
+  var m = balanced('{', '}', str);
44
+
45
+  if (!m)
46
+    return str.split(',');
47
+
48
+  var pre = m.pre;
49
+  var body = m.body;
50
+  var post = m.post;
51
+  var p = pre.split(',');
52
+
53
+  p[p.length-1] += '{' + body + '}';
54
+  var postParts = parseCommaParts(post);
55
+  if (post.length) {
56
+    p[p.length-1] += postParts.shift();
57
+    p.push.apply(p, postParts);
58
+  }
59
+
60
+  parts.push.apply(parts, p);
61
+
62
+  return parts;
63
+}
64
+
65
+function expandTop(str) {
66
+  if (!str)
67
+    return [];
68
+
69
+  // I don't know why Bash 4.3 does this, but it does.
70
+  // Anything starting with {} will have the first two bytes preserved
71
+  // but *only* at the top level, so {},a}b will not expand to anything,
72
+  // but a{},b}c will be expanded to [a}c,abc].
73
+  // One could argue that this is a bug in Bash, but since the goal of
74
+  // this module is to match Bash's rules, we escape a leading {}
75
+  if (str.substr(0, 2) === '{}') {
76
+    str = '\\{\\}' + str.substr(2);
77
+  }
78
+
79
+  return expand(escapeBraces(str), true).map(unescapeBraces);
80
+}
81
+
82
+function identity(e) {
83
+  return e;
84
+}
85
+
86
+function embrace(str) {
87
+  return '{' + str + '}';
88
+}
89
+function isPadded(el) {
90
+  return /^-?0\d/.test(el);
91
+}
92
+
93
+function lte(i, y) {
94
+  return i <= y;
95
+}
96
+function gte(i, y) {
97
+  return i >= y;
98
+}
99
+
100
+function expand(str, isTop) {
101
+  var expansions = [];
102
+
103
+  var m = balanced('{', '}', str);
104
+  if (!m || /\$$/.test(m.pre)) return [str];
105
+
106
+  var isNumericSequence = /^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(m.body);
107
+  var isAlphaSequence = /^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(m.body);
108
+  var isSequence = isNumericSequence || isAlphaSequence;
109
+  var isOptions = m.body.indexOf(',') >= 0;
110
+  if (!isSequence && !isOptions) {
111
+    // {a},b}
112
+    if (m.post.match(/,.*\}/)) {
113
+      str = m.pre + '{' + m.body + escClose + m.post;
114
+      return expand(str);
115
+    }
116
+    return [str];
117
+  }
118
+
119
+  var n;
120
+  if (isSequence) {
121
+    n = m.body.split(/\.\./);
122
+  } else {
123
+    n = parseCommaParts(m.body);
124
+    if (n.length === 1) {
125
+      // x{{a,b}}y ==> x{a}y x{b}y
126
+      n = expand(n[0], false).map(embrace);
127
+      if (n.length === 1) {
128
+        var post = m.post.length
129
+          ? expand(m.post, false)
130
+          : [''];
131
+        return post.map(function(p) {
132
+          return m.pre + n[0] + p;
133
+        });
134
+      }
135
+    }
136
+  }
137
+
138
+  // at this point, n is the parts, and we know it's not a comma set
139
+  // with a single entry.
140
+
141
+  // no need to expand pre, since it is guaranteed to be free of brace-sets
142
+  var pre = m.pre;
143
+  var post = m.post.length
144
+    ? expand(m.post, false)
145
+    : [''];
146
+
147
+  var N;
148
+
149
+  if (isSequence) {
150
+    var x = numeric(n[0]);
151
+    var y = numeric(n[1]);
152
+    var width = Math.max(n[0].length, n[1].length)
153
+    var incr = n.length == 3
154
+      ? Math.abs(numeric(n[2]))
155
+      : 1;
156
+    var test = lte;
157
+    var reverse = y < x;
158
+    if (reverse) {
159
+      incr *= -1;
160
+      test = gte;
161
+    }
162
+    var pad = n.some(isPadded);
163
+
164
+    N = [];
165
+
166
+    for (var i = x; test(i, y); i += incr) {
167
+      var c;
168
+      if (isAlphaSequence) {
169
+        c = String.fromCharCode(i);
170
+        if (c === '\\')
171
+          c = '';
172
+      } else {
173
+        c = String(i);
174
+        if (pad) {
175
+          var need = width - c.length;
176
+          if (need > 0) {
177
+            var z = new Array(need + 1).join('0');
178
+            if (i < 0)
179
+              c = '-' + z + c.slice(1);
180
+            else
181
+              c = z + c;
182
+          }
183
+        }
184
+      }
185
+      N.push(c);
186
+    }
187
+  } else {
188
+    N = concatMap(n, function(el) { return expand(el, false) });
189
+  }
190
+
191
+  for (var j = 0; j < N.length; j++) {
192
+    for (var k = 0; k < post.length; k++) {
193
+      var expansion = pre + N[j] + post[k];
194
+      if (!isTop || isSequence || expansion)
195
+        expansions.push(expansion);
196
+    }
197
+  }
198
+
199
+  return expansions;
200
+}
201
+

+ 75 - 0
node_modules/brace-expansion/package.json View File

@@ -0,0 +1,75 @@
1
+{
2
+  "_from": "brace-expansion@^1.1.7",
3
+  "_id": "brace-expansion@1.1.11",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",
6
+  "_location": "/brace-expansion",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "brace-expansion@^1.1.7",
12
+    "name": "brace-expansion",
13
+    "escapedName": "brace-expansion",
14
+    "rawSpec": "^1.1.7",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.1.7"
17
+  },
18
+  "_requiredBy": [
19
+    "/minimatch"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",
22
+  "_shasum": "3c7fcbf529d87226f3d2f52b966ff5271eb441dd",
23
+  "_spec": "brace-expansion@^1.1.7",
24
+  "_where": "/var/wss/node_modules/minimatch",
25
+  "author": {
26
+    "name": "Julian Gruber",
27
+    "email": "mail@juliangruber.com",
28
+    "url": "http://juliangruber.com"
29
+  },
30
+  "bugs": {
31
+    "url": "https://github.com/juliangruber/brace-expansion/issues"
32
+  },
33
+  "bundleDependencies": false,
34
+  "dependencies": {
35
+    "balanced-match": "^1.0.0",
36
+    "concat-map": "0.0.1"
37
+  },
38
+  "deprecated": false,
39
+  "description": "Brace expansion as known from sh/bash",
40
+  "devDependencies": {
41
+    "matcha": "^0.7.0",
42
+    "tape": "^4.6.0"
43
+  },
44
+  "homepage": "https://github.com/juliangruber/brace-expansion",
45
+  "keywords": [],
46
+  "license": "MIT",
47
+  "main": "index.js",
48
+  "name": "brace-expansion",
49
+  "repository": {
50
+    "type": "git",
51
+    "url": "git://github.com/juliangruber/brace-expansion.git"
52
+  },
53
+  "scripts": {
54
+    "bench": "matcha test/perf/bench.js",
55
+    "gentest": "bash test/generate.sh",
56
+    "test": "tape test/*.js"
57
+  },
58
+  "testling": {
59
+    "files": "test/*.js",
60
+    "browsers": [
61
+      "ie/8..latest",
62
+      "firefox/20..latest",
63
+      "firefox/nightly",
64
+      "chrome/25..latest",
65
+      "chrome/canary",
66
+      "opera/12..latest",
67
+      "opera/next",
68
+      "safari/5.1..latest",
69
+      "ipad/6.0..latest",
70
+      "iphone/6.0..latest",
71
+      "android-browser/4.2..latest"
72
+    ]
73
+  },
74
+  "version": "1.1.11"
75
+}

+ 69 - 0
node_modules/buffer-from/index.js View File

@@ -0,0 +1,69 @@
1
+var toString = Object.prototype.toString
2
+
3
+var isModern = (
4
+  typeof Buffer.alloc === 'function' &&
5
+  typeof Buffer.allocUnsafe === 'function' &&
6
+  typeof Buffer.from === 'function'
7
+)
8
+
9
+function isArrayBuffer (input) {
10
+  return toString.call(input).slice(8, -1) === 'ArrayBuffer'
11
+}
12
+
13
+function fromArrayBuffer (obj, byteOffset, length) {
14
+  byteOffset >>>= 0
15
+
16
+  var maxLength = obj.byteLength - byteOffset
17
+
18
+  if (maxLength < 0) {
19
+    throw new RangeError("'offset' is out of bounds")
20
+  }
21
+
22
+  if (length === undefined) {
23
+    length = maxLength
24
+  } else {
25
+    length >>>= 0
26
+
27
+    if (length > maxLength) {
28
+      throw new RangeError("'length' is out of bounds")
29
+    }
30
+  }
31
+
32
+  return isModern
33
+    ? Buffer.from(obj.slice(byteOffset, byteOffset + length))
34
+    : new Buffer(new Uint8Array(obj.slice(byteOffset, byteOffset + length)))
35
+}
36
+
37
+function fromString (string, encoding) {
38
+  if (typeof encoding !== 'string' || encoding === '') {
39
+    encoding = 'utf8'
40
+  }
41
+
42
+  if (!Buffer.isEncoding(encoding)) {
43
+    throw new TypeError('"encoding" must be a valid string encoding')
44
+  }
45
+
46
+  return isModern
47
+    ? Buffer.from(string, encoding)
48
+    : new Buffer(string, encoding)
49
+}
50
+
51
+function bufferFrom (value, encodingOrOffset, length) {
52
+  if (typeof value === 'number') {
53
+    throw new TypeError('"value" argument must not be a number')
54
+  }
55
+
56
+  if (isArrayBuffer(value)) {
57
+    return fromArrayBuffer(value, encodingOrOffset, length)
58
+  }
59
+
60
+  if (typeof value === 'string') {
61
+    return fromString(value, encodingOrOffset)
62
+  }
63
+
64
+  return isModern
65
+    ? Buffer.from(value)
66
+    : new Buffer(value)
67
+}
68
+
69
+module.exports = bufferFrom

+ 49 - 0
node_modules/buffer-from/package.json View File

@@ -0,0 +1,49 @@
1
+{
2
+  "_from": "buffer-from@^1.0.0",
3
+  "_id": "buffer-from@1.0.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-83apNb8KK0Se60UE1+4Ukbe3HbfELJ6UlI4ldtOGs7So4KD26orJM8hIY9lxdzP+UpItH1Yh/Y8GUvNFWFFRxA==",
6
+  "_location": "/buffer-from",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "buffer-from@^1.0.0",
12
+    "name": "buffer-from",
13
+    "escapedName": "buffer-from",
14
+    "rawSpec": "^1.0.0",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.0.0"
17
+  },
18
+  "_requiredBy": [
19
+    "/concat-stream"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.0.0.tgz",
22
+  "_shasum": "4cb8832d23612589b0406e9e2956c17f06fdf531",
23
+  "_spec": "buffer-from@^1.0.0",
24
+  "_where": "/var/wss/node_modules/concat-stream",
25
+  "bugs": {
26
+    "url": "https://github.com/LinusU/buffer-from/issues"
27
+  },
28
+  "bundleDependencies": false,
29
+  "deprecated": false,
30
+  "description": "A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.",
31
+  "devDependencies": {
32
+    "standard": "^7.1.2"
33
+  },
34
+  "homepage": "https://github.com/LinusU/buffer-from#readme",
35
+  "keywords": [
36
+    "buffer",
37
+    "buffer from"
38
+  ],
39
+  "license": "MIT",
40
+  "name": "buffer-from",
41
+  "repository": {
42
+    "type": "git",
43
+    "url": "git+https://github.com/LinusU/buffer-from.git"
44
+  },
45
+  "scripts": {
46
+    "test": "standard && node test"
47
+  },
48
+  "version": "1.0.0"
49
+}

+ 69 - 0
node_modules/buffer-from/readme.md View File

@@ -0,0 +1,69 @@
1
+# Buffer From
2
+
3
+A [ponyfill](https://ponyfill.com) for `Buffer.from`, uses native implementation if available.
4
+
5
+## Installation
6
+
7
+```sh
8
+npm install --save buffer-from
9
+```
10
+
11
+## Usage
12
+
13
+```js
14
+const bufferFrom = require('buffer-from')
15
+
16
+console.log(bufferFrom([1, 2, 3, 4]))
17
+//=> <Buffer 01 02 03 04>
18
+
19
+const arr = new Uint8Array([1, 2, 3, 4])
20
+console.log(bufferFrom(arr.buffer, 1, 2))
21
+//=> <Buffer 02 03>
22
+
23
+console.log(bufferFrom('test', 'utf8'))
24
+//=> <Buffer 74 65 73 74>
25
+
26
+const buf = bufferFrom('test')
27
+console.log(bufferFrom(buf))
28
+//=> <Buffer 74 65 73 74>
29
+```
30
+
31
+## API
32
+
33
+### bufferFrom(array)
34
+
35
+- `array` &lt;Array&gt;
36
+
37
+Allocates a new `Buffer` using an `array` of octets.
38
+
39
+### bufferFrom(arrayBuffer[, byteOffset[, length]])
40
+
41
+- `arrayBuffer` &lt;ArrayBuffer&gt; The `.buffer` property of a TypedArray or ArrayBuffer
42
+- `byteOffset` &lt;Integer&gt; Where to start copying from `arrayBuffer`. **Default:** `0`
43
+- `length` &lt;Integer&gt; How many bytes to copy from `arrayBuffer`. **Default:** `arrayBuffer.length - byteOffset`
44
+
45
+When passed a reference to the `.buffer` property of a TypedArray instance, the
46
+newly created `Buffer` will share the same allocated memory as the TypedArray.
47
+
48
+The optional `byteOffset` and `length` arguments specify a memory range within
49
+the `arrayBuffer` that will be shared by the `Buffer`.
50
+
51
+### bufferFrom(buffer)
52
+
53
+- `buffer` &lt;Buffer&gt; An existing `Buffer` to copy data from
54
+
55
+Copies the passed `buffer` data onto a new `Buffer` instance.
56
+
57
+### bufferFrom(string[, encoding])
58
+
59
+- `string` &lt;String&gt; A string to encode.
60
+- `encoding` &lt;String&gt; The encoding of `string`. **Default:** `'utf8'`
61
+
62
+Creates a new `Buffer` containing the given JavaScript string `string`. If
63
+provided, the `encoding` parameter identifies the character encoding of
64
+`string`.
65
+
66
+## See also
67
+
68
+- [buffer-alloc](https://github.com/LinusU/buffer-alloc) A ponyfill for `Buffer.alloc`
69
+- [buffer-alloc-unsafe](https://github.com/LinusU/buffer-alloc-unsafe) A ponyfill for `Buffer.allocUnsafe`

+ 12 - 0
node_modules/buffer-from/test.js View File

@@ -0,0 +1,12 @@
1
+var bufferFrom = require('./')
2
+var assert = require('assert')
3
+
4
+assert.equal(bufferFrom([1, 2, 3, 4]).toString('hex'), '01020304')
5
+
6
+var arr = new Uint8Array([1, 2, 3, 4])
7
+assert.equal(bufferFrom(arr.buffer, 1, 2).toString('hex'), '0203')
8
+
9
+assert.equal(bufferFrom('test', 'utf8').toString('hex'), '74657374')
10
+
11
+var buf = bufferFrom('test')
12
+assert.equal(bufferFrom(buf).toString('hex'), '74657374')

+ 60 - 0
node_modules/callback-stream/.jshintrc View File

@@ -0,0 +1,60 @@
1
+{
2
+    "predef": [ ]
3
+  , "bitwise": false
4
+  , "camelcase": false
5
+  , "curly": false
6
+  , "eqeqeq": false
7
+  , "forin": false
8
+  , "immed": false
9
+  , "latedef": false
10
+  , "noarg": true
11
+  , "noempty": true
12
+  , "nonew": true
13
+  , "plusplus": false
14
+  , "quotmark": true
15
+  , "regexp": false
16
+  , "undef": true
17
+  , "unused": true
18
+  , "strict": false
19
+  , "trailing": true
20
+  , "maxlen": 120
21
+  , "asi": true
22
+  , "boss": true
23
+  , "debug": true
24
+  , "eqnull": true
25
+  , "es5": true
26
+  , "esnext": true
27
+  , "evil": true
28
+  , "expr": true
29
+  , "funcscope": false
30
+  , "globalstrict": false
31
+  , "iterator": false
32
+  , "lastsemic": true
33
+  , "laxbreak": true
34
+  , "laxcomma": true
35
+  , "loopfunc": true
36
+  , "multistr": false
37
+  , "onecase": false
38
+  , "proto": false
39
+  , "regexdash": false
40
+  , "scripturl": true
41
+  , "smarttabs": false
42
+  , "shadow": false
43
+  , "sub": true
44
+  , "supernew": false
45
+  , "validthis": true
46
+  , "browser": true
47
+  , "couch": false
48
+  , "devel": false
49
+  , "dojo": false
50
+  , "mootools": false
51
+  , "node": true
52
+  , "nonstandard": true
53
+  , "prototypejs": false
54
+  , "rhino": false
55
+  , "worker": true
56
+  , "wsh": false
57
+  , "nomen": false
58
+  , "onevar": true
59
+  , "passfail": false
60
+}

+ 7 - 0
node_modules/callback-stream/.npmignore View File

@@ -0,0 +1,7 @@
1
+node_modules/
2
+build/
3
+libleveldb.so
4
+libleveldb.a
5
+test-data/
6
+_benchdb_*
7
+*.sw*

+ 4 - 0
node_modules/callback-stream/.travis.yml View File

@@ -0,0 +1,4 @@
1
+language: node_js
2
+node_js:
3
+  - 0.8
4
+  - "0.10"

+ 86 - 0
node_modules/callback-stream/README.md View File

@@ -0,0 +1,86 @@
1
+CallbackStream
2
+=====
3
+
4
+[![Build
5
+Status](https://travis-ci.org/mcollina/callback-stream.png)](https://travis-ci.org/mcollina/callback-stream)
6
+
7
+It is a safe variant of the
8
+[concat-stream](https://github.com/maxogden/node-concat-stream)
9
+package that _will always return an array_.
10
+
11
+It does everything callback-stream does, minus the concatenation.
12
+In fact, it just callbacks you with an array containing your
13
+good stuff.
14
+
15
+It is based on the Stream 2 API, but it also works on node v0.8.
16
+It also support Stream 3, which is bundled with node v0.12 and iojs.
17
+
18
+## Installation
19
+
20
+```
21
+npm install callback-stream --save
22
+```
23
+
24
+## Pipe usage
25
+
26
+```js
27
+var callback = require('callback-stream')
28
+var fs = require('fs')
29
+var read = fs.createReadStream('readme.md')
30
+var write = callback(function (err, data) {
31
+  console.log(err, data)
32
+})
33
+
34
+read.pipe(write)
35
+```
36
+
37
+## Object mode usage
38
+
39
+```
40
+var callback = require('callback-stream')
41
+var write = callback.obj(function (err, data) {
42
+  // this will print ['hello', 'world']
43
+  console.log(data)
44
+})
45
+
46
+write.write('hello')
47
+write.write('world')
48
+write.end()
49
+```
50
+
51
+## Contributing to CallbackStream
52
+
53
+* Check out the latest master to make sure the feature hasn't been
54
+  implemented or the bug hasn't been fixed yet
55
+* Check out the issue tracker to make sure someone already hasn't
56
+  requested it and/or contributed it
57
+* Fork the project
58
+* Start a feature/bugfix branch
59
+* Commit and push until you are happy with your contribution
60
+* Make sure to add tests for it. This is important so I don't break it
61
+  in a future version unintentionally.
62
+
63
+## LICENSE - "MIT License"
64
+
65
+Copyright (c) 2013-2015 Matteo Collina, http://matteocollina.com
66
+
67
+Permission is hereby granted, free of charge, to any person
68
+obtaining a copy of this software and associated documentation
69
+files (the "Software"), to deal in the Software without
70
+restriction, including without limitation the rights to use,
71
+copy, modify, merge, publish, distribute, sublicense, and/or sell
72
+copies of the Software, and to permit persons to whom the
73
+Software is furnished to do so, subject to the following
74
+conditions:
75
+
76
+The above copyright notice and this permission notice shall be
77
+included in all copies or substantial portions of the Software.
78
+
79
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
80
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
81
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
82
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
83
+HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
84
+WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
85
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
86
+OTHER DEALINGS IN THE SOFTWARE.

+ 51 - 0
node_modules/callback-stream/index.js View File

@@ -0,0 +1,51 @@
1
+'use strict'
2
+
3
+var Writable = require('readable-stream').Writable
4
+var inherits = require('inherits')
5
+
6
+function CallbackStream (options, callback) {
7
+  if (!(this instanceof CallbackStream)) {
8
+    return new CallbackStream(options, callback)
9
+  }
10
+
11
+  if (typeof options === 'function') {
12
+    callback = options
13
+    options = {}
14
+  }
15
+
16
+  Writable.call(this, options)
17
+
18
+  this.results = []
19
+  this.callback = callback
20
+
21
+  this.on('finish', deliversCallback)
22
+  this.once('pipe', handlePipe)
23
+}
24
+
25
+function deliversCallback () {
26
+  this.callback(null, this.results)
27
+}
28
+
29
+function handlePipe (source) {
30
+  source.on('error', this.callback)
31
+}
32
+
33
+inherits(CallbackStream, Writable)
34
+
35
+CallbackStream.prototype._write = function (data, encoding, done) {
36
+  this.results.push(data)
37
+  done()
38
+}
39
+
40
+CallbackStream.obj = function (options, callback) {
41
+  if (typeof options === 'function') {
42
+    callback = options
43
+    options = {}
44
+  }
45
+
46
+  options.objectMode = true
47
+
48
+  return new CallbackStream(options, callback)
49
+}
50
+
51
+module.exports = CallbackStream

+ 67 - 0
node_modules/callback-stream/package.json View File

@@ -0,0 +1,67 @@
1
+{
2
+  "_from": "callback-stream@^1.0.2",
3
+  "_id": "callback-stream@1.1.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-RwGlEmbwbgbqpx/BcjOCLYdfSQg=",
6
+  "_location": "/callback-stream",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "callback-stream@^1.0.2",
12
+    "name": "callback-stream",
13
+    "escapedName": "callback-stream",
14
+    "rawSpec": "^1.0.2",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.0.2"
17
+  },
18
+  "_requiredBy": [
19
+    "/help-me"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/callback-stream/-/callback-stream-1.1.0.tgz",
22
+  "_shasum": "4701a51266f06e06eaa71fc17233822d875f4908",
23
+  "_spec": "callback-stream@^1.0.2",
24
+  "_where": "/var/wss/node_modules/help-me",
25
+  "author": {
26
+    "name": "Matteo Collina",
27
+    "email": "hello@matteocollina.com"
28
+  },
29
+  "bugs": {
30
+    "url": "http://github.com/mcollina/callback-stream/issues"
31
+  },
32
+  "bundleDependencies": false,
33
+  "dependencies": {
34
+    "inherits": "^2.0.1",
35
+    "readable-stream": "> 1.0.0 < 3.0.0"
36
+  },
37
+  "deprecated": false,
38
+  "description": "A pipeable stream that calls your callback",
39
+  "devDependencies": {
40
+    "pre-commit": "^1.1.1",
41
+    "standard": "^5.0.0",
42
+    "tap": "~0.4.2",
43
+    "tape": "^4.0.2"
44
+  },
45
+  "homepage": "https://github.com/mcollina/callback-stream#readme",
46
+  "keywords": [
47
+    "callback",
48
+    "stream"
49
+  ],
50
+  "license": "MIT",
51
+  "main": "index.js",
52
+  "name": "callback-stream",
53
+  "precommit": [
54
+    "lint",
55
+    "test"
56
+  ],
57
+  "repository": {
58
+    "type": "git",
59
+    "url": "git+https://github.com/mcollina/callback-stream.git"
60
+  },
61
+  "scripts": {
62
+    "lint": "standard",
63
+    "test": "tap test.js"
64
+  },
65
+  "version": "1.1.0",
66
+  "website": "https://github.com/mcollina/callback-stream"
67
+}

+ 57 - 0
node_modules/callback-stream/test.js View File

@@ -0,0 +1,57 @@
1
+'use strict'
2
+
3
+var test = require('tap').test
4
+var callback = require('./')
5
+var fs = require('fs')
6
+
7
+test('call the callback after end with object mode', function (t) {
8
+  var opts = { objectMode: true }
9
+  var stream = callback(opts, function (err, results) {
10
+    t.deepEqual(results, ['hello'], 'should return the ending value')
11
+    t.end()
12
+  })
13
+
14
+  stream.end('hello')
15
+})
16
+
17
+test('support multiple writes with object mode', function (t) {
18
+  var opts = { objectMode: true }
19
+  var stream = callback(opts, function (err, results) {
20
+    t.deepEqual(results, ['hello', 'world'], 'should return the ending value')
21
+    t.end()
22
+  })
23
+
24
+  stream.write('hello')
25
+  stream.end('world')
26
+})
27
+
28
+test('works without object mode', function (t) {
29
+  var stream = callback(function (err, results) {
30
+    t.equal(results.length, 1, 'should contain only one value')
31
+    t.deepEqual(results[0].toString(), 'world', 'should return the ending value')
32
+    t.end()
33
+  })
34
+
35
+  stream.end('world')
36
+})
37
+
38
+test('is pipeable', function (t) {
39
+  var write = callback(function (err, results) {
40
+    var actual = Buffer.concat(results).toString()
41
+    var expected = fs.readFileSync('README.md').toString()
42
+    t.equal(actual, expected, 'should have the same content of the file')
43
+    t.end()
44
+  })
45
+  var read = fs.createReadStream('README.md')
46
+
47
+  read.pipe(write)
48
+})
49
+
50
+test('callback.obj shortcut for objectMode', function (t) {
51
+  var stream = callback.obj(function (err, results) {
52
+    t.deepEqual(results, ['hello'], 'should return the ending value')
53
+    t.end()
54
+  })
55
+
56
+  stream.end('hello')
57
+})

+ 25 - 0
node_modules/commist/.npmignore View File

@@ -0,0 +1,25 @@
1
+# Logs
2
+logs
3
+*.log
4
+
5
+# Runtime data
6
+pids
7
+*.pid
8
+*.seed
9
+
10
+# Directory for instrumented libs generated by jscoverage/JSCover
11
+lib-cov
12
+
13
+# Coverage directory used by tools like istanbul
14
+coverage
15
+
16
+# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
17
+.grunt
18
+
19
+# Compiled binary addons (http://nodejs.org/api/addons.html)
20
+build/Release
21
+
22
+# Dependency directory
23
+# Deployed apps should consider commenting this line out:
24
+# see https://npmjs.org/doc/faq.html#Should-I-check-my-node_modules-folder-into-git
25
+node_modules

+ 21 - 0
node_modules/commist/LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2014 Matteo Collina
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in all
13
+copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+SOFTWARE.

+ 56 - 0
node_modules/commist/README.md View File

@@ -0,0 +1,56 @@
1
+commist
2
+=======
3
+
4
+Build command line application with multiple commands the easy way.
5
+To be used with [minimist](http://npm.im/minimist).
6
+
7
+```js
8
+var program = require('commist')()
9
+  , minimist = require('minimist')
10
+  , result
11
+
12
+result = program
13
+  .register('abcd', function(args) {
14
+    console.log('just do', args)
15
+  })
16
+  .register('args', function(args) {
17
+    args = minimist(args)
18
+    console.log('just do', args)
19
+  })
20
+  .register('abcde code', function(args) {
21
+    console.log('doing something', args)
22
+  })
23
+  .register('another command', function(args) {
24
+    console.log('anothering', args)
25
+  })
26
+  .parse(process.argv.splice(2))
27
+
28
+if (result) {
29
+  console.log('no command called, args', result)
30
+}
31
+```
32
+
33
+When calling _commist_ programs, you can abbreviate down to three char
34
+words. In the above example, these are valid commands:
35
+
36
+```
37
+node example.js abc
38
+node example.js abc cod
39
+node example.js anot comm
40
+```
41
+
42
+Moreover, little spelling mistakes are corrected too:
43
+
44
+```
45
+node example.js abcs cod
46
+```
47
+
48
+Acknowledgements
49
+----------------
50
+
51
+This project was kindly sponsored by [nearForm](http://nearform.com).
52
+
53
+License
54
+-------
55
+
56
+MIT

+ 24 - 0
node_modules/commist/example.js View File

@@ -0,0 +1,24 @@
1
+
2
+var program = require('./')()
3
+  , minimist = require('minimist')
4
+  , result
5
+
6
+result = program
7
+  .register('abcd', function(args) {
8
+    console.log('just do', args)
9
+  })
10
+  .register('args', function(args) {
11
+    args = minimist(args)
12
+    console.log('just do', args)
13
+  })
14
+  .register('abcde code', function(args) {
15
+    console.log('doing something', args)
16
+  })
17
+  .register('another command', function(args) {
18
+    console.log('anothering', args)
19
+  })
20
+  .parse(process.argv.splice(2))
21
+
22
+if (result) {
23
+  console.log('no command called, args', result)
24
+}

+ 123 - 0
node_modules/commist/index.js View File

@@ -0,0 +1,123 @@
1
+/*
2
+The MIT License (MIT)
3
+
4
+Copyright (c) 2014 Matteo Collina
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 all
14
+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 THE
22
+SOFTWARE.
23
+*/
24
+
25
+'use strict';
26
+
27
+var leven = require('leven')
28
+
29
+function commist() {
30
+
31
+  var commands = []
32
+
33
+  function lookup(array) {
34
+    if (typeof array === 'string')
35
+      array = array.split(' ')
36
+
37
+    return commands.map(function(cmd) {
38
+      return cmd.match(array)
39
+    }).filter(function(match) {
40
+      return match.partsNotMatched === 0
41
+    }).sort(function(a, b) {
42
+      if (a.inputNotMatched > b.inputNotMatched)
43
+        return 1
44
+
45
+      if (a.inputNotMatched === b.inputNotMatched && a.totalDistance > b.totalDistance)
46
+        return 1
47
+
48
+      return -1
49
+    }).map(function(match) {
50
+      return match.cmd
51
+    })
52
+  }
53
+
54
+  function parse(args) {
55
+    var matching = lookup(args)
56
+
57
+    if (matching.length > 0) {
58
+      matching[0].call(args)
59
+
60
+      // return null if there is nothing left to do
61
+      return null
62
+    }
63
+
64
+    return args
65
+  }
66
+
67
+  function register(command, func) {
68
+    var matching  = lookup(command)
69
+
70
+    matching.forEach(function(match) {
71
+      if (match.string === command)
72
+        throw new Error('command already registered: ' + command)
73
+    })
74
+
75
+    commands.push(new Command(command, func))
76
+
77
+    return this
78
+  }
79
+
80
+  return {
81
+      register: register
82
+    , parse: parse
83
+    , lookup: lookup
84
+  }
85
+}
86
+
87
+function Command(string, func) {
88
+  this.string   = string
89
+  this.parts    = string.split(' ')
90
+  this.length   = this.parts.length
91
+  this.func     = func
92
+
93
+  this.parts.forEach(function(part) {
94
+    if (part.length < 3)
95
+      throw new Error('command words must be at least 3 chars: ' + command)
96
+  })
97
+}
98
+
99
+Command.prototype.call = function call(argv) {
100
+  this.func(argv.slice(this.length))
101
+}
102
+
103
+Command.prototype.match = function match(string) {
104
+  return new CommandMatch(this, string)
105
+}
106
+
107
+function CommandMatch(cmd, array) {
108
+  this.cmd = cmd
109
+  this.distances = cmd.parts.map(function(elem, i) {
110
+    if (array[i] !== undefined)
111
+      return leven(elem, array[i])
112
+    else
113
+      return undefined
114
+  }).filter(function(distance, i) {
115
+    return distance !== undefined && distance < cmd.parts[i].length - 2
116
+  })
117
+
118
+  this.partsNotMatched = cmd.length - this.distances.length
119
+  this.inputNotMatched = array.length - this.distances.length
120
+  this.totalDistance = this.distances.reduce(function(acc, i) { return acc + i }, 0)
121
+}
122
+
123
+module.exports = commist

+ 57 - 0
node_modules/commist/package.json View File

@@ -0,0 +1,57 @@
1
+{
2
+  "_from": "commist@^1.0.0",
3
+  "_id": "commist@1.0.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-wMNSUBz29S6RJOPvicmAbiAi6+8=",
6
+  "_location": "/commist",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "commist@^1.0.0",
12
+    "name": "commist",
13
+    "escapedName": "commist",
14
+    "rawSpec": "^1.0.0",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.0.0"
17
+  },
18
+  "_requiredBy": [
19
+    "/mqtt"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/commist/-/commist-1.0.0.tgz",
22
+  "_shasum": "c0c352501cf6f52e9124e3ef89c9806e2022ebef",
23
+  "_spec": "commist@^1.0.0",
24
+  "_where": "/var/wss/node_modules/mqtt",
25
+  "author": {
26
+    "name": "Matteo Collina",
27
+    "email": "hello@matteocollina.com"
28
+  },
29
+  "bugs": {
30
+    "url": "https://github.com/mcollina/commist/issues"
31
+  },
32
+  "bundleDependencies": false,
33
+  "dependencies": {
34
+    "leven": "^1.0.0",
35
+    "minimist": "^1.1.0"
36
+  },
37
+  "deprecated": false,
38
+  "description": "Build your commands on minimist!",
39
+  "devDependencies": {
40
+    "minimist": "^1.1.0",
41
+    "pre-commit": "0.0.9",
42
+    "tape": "^3.0.3"
43
+  },
44
+  "homepage": "https://github.com/mcollina/commist",
45
+  "license": "MIT",
46
+  "main": "index.js",
47
+  "name": "commist",
48
+  "pre-commit": "test",
49
+  "repository": {
50
+    "type": "git",
51
+    "url": "git+https://github.com/mcollina/commist.git"
52
+  },
53
+  "scripts": {
54
+    "test": "tap test.js"
55
+  },
56
+  "version": "1.0.0"
57
+}

+ 191 - 0
node_modules/commist/test.js View File

@@ -0,0 +1,191 @@
1
+
2
+var test      = require('tape').test
3
+  , commist   = require('./')
4
+  , minimist  = require('minimist')
5
+
6
+test('registering a command', function(t) {
7
+  t.plan(2)
8
+
9
+  var program = commist()
10
+    , result
11
+
12
+  program.register('hello', function(args) {
13
+    t.deepEqual(args, ['a', '-x', '23'])
14
+  })
15
+
16
+  result = program.parse(['hello', 'a', '-x', '23'])
17
+
18
+  t.notOk(result, 'must return null, the command have been handled')
19
+})
20
+
21
+test('registering two commands', function(t) {
22
+  t.plan(1)
23
+
24
+  var program = commist()
25
+    , result
26
+
27
+  program.register('hello', function(args) {
28
+    t.ok(false, 'must pick the right command')
29
+  })
30
+
31
+  program.register('world', function(args) {
32
+    t.deepEqual(args, ['a', '-x', '23'])
33
+  })
34
+
35
+  program.parse(['world', 'a', '-x', '23'])
36
+})
37
+
38
+test('registering two commands (bis)', function(t) {
39
+  t.plan(1)
40
+
41
+  var program = commist()
42
+    , result
43
+
44
+  program.register('hello', function(args) {
45
+    t.deepEqual(args, ['a', '-x', '23'])
46
+  })
47
+
48
+  program.register('world', function(args) {
49
+    t.ok(false, 'must pick the right command')
50
+  })
51
+
52
+  program.parse(['hello', 'a', '-x', '23'])
53
+})
54
+
55
+test('registering two words commands', function(t) {
56
+  t.plan(1)
57
+
58
+  var program = commist()
59
+    , result
60
+
61
+  program.register('hello', function(args) {
62
+    t.ok(false, 'must pick the right command')
63
+  })
64
+
65
+  program.register('hello world', function(args) {
66
+    t.deepEqual(args, ['a', '-x', '23'])
67
+  })
68
+
69
+  program.parse(['hello', 'world', 'a', '-x', '23'])
70
+})
71
+
72
+test('registering two words commands (bis)', function(t) {
73
+  t.plan(1)
74
+
75
+  var program = commist()
76
+    , result
77
+
78
+  program.register('hello', function(args) {
79
+    t.deepEqual(args, ['a', '-x', '23'])
80
+  })
81
+
82
+  program.register('hello world', function(args) {
83
+    t.ok(false, 'must pick the right command')
84
+  })
85
+
86
+  program.parse(['hello', 'a', '-x', '23'])
87
+})
88
+
89
+test('registering ambiguous commands throws exception', function(t) {
90
+  var program = commist()
91
+    , result
92
+
93
+  function noop() {}
94
+
95
+  program.register('hello', noop)
96
+  program.register('hello world', noop)
97
+  program.register('hello world matteo', noop)
98
+
99
+  try {
100
+    program.register('hello world', noop)
101
+    t.ok(false, 'must throw if double-registering the same command')
102
+  } catch(err) {
103
+  }
104
+
105
+  t.end()
106
+})
107
+
108
+test('looking up commands', function(t) {
109
+  var program = commist()
110
+    , result
111
+
112
+  function noop1() {}
113
+  function noop2() {}
114
+  function noop3() {}
115
+
116
+  program.register('hello', noop1)
117
+  program.register('hello world matteo', noop3)
118
+  program.register('hello world', noop2)
119
+
120
+  t.equal(program.lookup('hello')[0].func, noop1)
121
+  t.equal(program.lookup('hello world matteo')[0].func, noop3)
122
+  t.equal(program.lookup('hello world')[0].func, noop2)
123
+
124
+  t.end()
125
+})
126
+
127
+test('looking up commands with abbreviations', function(t) {
128
+  var program = commist()
129
+    , result
130
+
131
+  function noop1() {}
132
+  function noop2() {}
133
+  function noop3() {}
134
+
135
+  program.register('hello', noop1)
136
+  program.register('hello world matteo', noop3)
137
+  program.register('hello world', noop2)
138
+
139
+  t.equal(program.lookup('hel')[0].func, noop1)
140
+  t.equal(program.lookup('hel wor mat')[0].func, noop3)
141
+  t.equal(program.lookup('hel wor')[0].func, noop2)
142
+
143
+  t.end()
144
+})
145
+
146
+test('executing commands from abbreviations', function(t) {
147
+  t.plan(1)
148
+
149
+  var program = commist()
150
+    , result
151
+
152
+  program.register('hello', function(args) {
153
+    t.deepEqual(args, ['a', '-x', '23'])
154
+  })
155
+
156
+  program.register('hello world', function(args) {
157
+    t.ok(false, 'must pick the right command')
158
+  })
159
+
160
+  program.parse(['hel', 'a', '-x', '23'])
161
+})
162
+
163
+test('a command must be at least 3 chars', function(t) {
164
+  var program = commist()
165
+    , result
166
+
167
+  function noop1() {}
168
+
169
+  try {
170
+    program.register('h', noop1)
171
+    t.ok(false, 'not thrown')
172
+  } catch(err) {
173
+  }
174
+
175
+  t.end()
176
+})
177
+
178
+test('a command part must be at least 3 chars', function(t) {
179
+  var program = commist()
180
+    , result
181
+
182
+  function noop1() {}
183
+
184
+  try {
185
+    program.register('h b', noop1)
186
+    t.ok(false, 'not thrown')
187
+  } catch(err) {
188
+  }
189
+
190
+  t.end()
191
+})

+ 4 - 0
node_modules/concat-map/.travis.yml View File

@@ -0,0 +1,4 @@
1
+language: node_js
2
+node_js:
3
+  - 0.4
4
+  - 0.6

+ 18 - 0
node_modules/concat-map/LICENSE View File

@@ -0,0 +1,18 @@
1
+This software is released under the MIT license:
2
+
3
+Permission is hereby granted, free of charge, to any person obtaining a copy of
4
+this software and associated documentation files (the "Software"), to deal in
5
+the Software without restriction, including without limitation the rights to
6
+use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
7
+the Software, and to permit persons to whom the Software is furnished to do so,
8
+subject to the following conditions:
9
+
10
+The above copyright notice and this permission notice shall be included in all
11
+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, FITNESS
15
+FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
16
+COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
17
+IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
18
+CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 62 - 0
node_modules/concat-map/README.markdown View File

@@ -0,0 +1,62 @@
1
+concat-map
2
+==========
3
+
4
+Concatenative mapdashery.
5
+
6
+[![browser support](http://ci.testling.com/substack/node-concat-map.png)](http://ci.testling.com/substack/node-concat-map)
7
+
8
+[![build status](https://secure.travis-ci.org/substack/node-concat-map.png)](http://travis-ci.org/substack/node-concat-map)
9
+
10
+example
11
+=======
12
+
13
+``` js
14
+var concatMap = require('concat-map');
15
+var xs = [ 1, 2, 3, 4, 5, 6 ];
16
+var ys = concatMap(xs, function (x) {
17
+    return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
18
+});
19
+console.dir(ys);
20
+```
21
+
22
+***
23
+
24
+```
25
+[ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]
26
+```
27
+
28
+methods
29
+=======
30
+
31
+``` js
32
+var concatMap = require('concat-map')
33
+```
34
+
35
+concatMap(xs, fn)
36
+-----------------
37
+
38
+Return an array of concatenated elements by calling `fn(x, i)` for each element
39
+`x` and each index `i` in the array `xs`.
40
+
41
+When `fn(x, i)` returns an array, its result will be concatenated with the
42
+result array. If `fn(x, i)` returns anything else, that value will be pushed
43
+onto the end of the result array.
44
+
45
+install
46
+=======
47
+
48
+With [npm](http://npmjs.org) do:
49
+
50
+```
51
+npm install concat-map
52
+```
53
+
54
+license
55
+=======
56
+
57
+MIT
58
+
59
+notes
60
+=====
61
+
62
+This module was written while sitting high above the ground in a tree.

+ 6 - 0
node_modules/concat-map/example/map.js View File

@@ -0,0 +1,6 @@
1
+var concatMap = require('../');
2
+var xs = [ 1, 2, 3, 4, 5, 6 ];
3
+var ys = concatMap(xs, function (x) {
4
+    return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
5
+});
6
+console.dir(ys);

+ 13 - 0
node_modules/concat-map/index.js View File

@@ -0,0 +1,13 @@
1
+module.exports = function (xs, fn) {
2
+    var res = [];
3
+    for (var i = 0; i < xs.length; i++) {
4
+        var x = fn(xs[i], i);
5
+        if (isArray(x)) res.push.apply(res, x);
6
+        else res.push(x);
7
+    }
8
+    return res;
9
+};
10
+
11
+var isArray = Array.isArray || function (xs) {
12
+    return Object.prototype.toString.call(xs) === '[object Array]';
13
+};

+ 88 - 0
node_modules/concat-map/package.json View File

@@ -0,0 +1,88 @@
1
+{
2
+  "_from": "concat-map@0.0.1",
3
+  "_id": "concat-map@0.0.1",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=",
6
+  "_location": "/concat-map",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "version",
10
+    "registry": true,
11
+    "raw": "concat-map@0.0.1",
12
+    "name": "concat-map",
13
+    "escapedName": "concat-map",
14
+    "rawSpec": "0.0.1",
15
+    "saveSpec": null,
16
+    "fetchSpec": "0.0.1"
17
+  },
18
+  "_requiredBy": [
19
+    "/brace-expansion"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz",
22
+  "_shasum": "d8a96bd77fd68df7793a73036a3ba0d5405d477b",
23
+  "_spec": "concat-map@0.0.1",
24
+  "_where": "/var/wss/node_modules/brace-expansion",
25
+  "author": {
26
+    "name": "James Halliday",
27
+    "email": "mail@substack.net",
28
+    "url": "http://substack.net"
29
+  },
30
+  "bugs": {
31
+    "url": "https://github.com/substack/node-concat-map/issues"
32
+  },
33
+  "bundleDependencies": false,
34
+  "deprecated": false,
35
+  "description": "concatenative mapdashery",
36
+  "devDependencies": {
37
+    "tape": "~2.4.0"
38
+  },
39
+  "directories": {
40
+    "example": "example",
41
+    "test": "test"
42
+  },
43
+  "homepage": "https://github.com/substack/node-concat-map#readme",
44
+  "keywords": [
45
+    "concat",
46
+    "concatMap",
47
+    "map",
48
+    "functional",
49
+    "higher-order"
50
+  ],
51
+  "license": "MIT",
52
+  "main": "index.js",
53
+  "name": "concat-map",
54
+  "repository": {
55
+    "type": "git",
56
+    "url": "git://github.com/substack/node-concat-map.git"
57
+  },
58
+  "scripts": {
59
+    "test": "tape test/*.js"
60
+  },
61
+  "testling": {
62
+    "files": "test/*.js",
63
+    "browsers": {
64
+      "ie": [
65
+        6,
66
+        7,
67
+        8,
68
+        9
69
+      ],
70
+      "ff": [
71
+        3.5,
72
+        10,
73
+        15
74
+      ],
75
+      "chrome": [
76
+        10,
77
+        22
78
+      ],
79
+      "safari": [
80
+        5.1
81
+      ],
82
+      "opera": [
83
+        12
84
+      ]
85
+    }
86
+  },
87
+  "version": "0.0.1"
88
+}

+ 39 - 0
node_modules/concat-map/test/map.js View File

@@ -0,0 +1,39 @@
1
+var concatMap = require('../');
2
+var test = require('tape');
3
+
4
+test('empty or not', function (t) {
5
+    var xs = [ 1, 2, 3, 4, 5, 6 ];
6
+    var ixes = [];
7
+    var ys = concatMap(xs, function (x, ix) {
8
+        ixes.push(ix);
9
+        return x % 2 ? [ x - 0.1, x, x + 0.1 ] : [];
10
+    });
11
+    t.same(ys, [ 0.9, 1, 1.1, 2.9, 3, 3.1, 4.9, 5, 5.1 ]);
12
+    t.same(ixes, [ 0, 1, 2, 3, 4, 5 ]);
13
+    t.end();
14
+});
15
+
16
+test('always something', function (t) {
17
+    var xs = [ 'a', 'b', 'c', 'd' ];
18
+    var ys = concatMap(xs, function (x) {
19
+        return x === 'b' ? [ 'B', 'B', 'B' ] : [ x ];
20
+    });
21
+    t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
22
+    t.end();
23
+});
24
+
25
+test('scalars', function (t) {
26
+    var xs = [ 'a', 'b', 'c', 'd' ];
27
+    var ys = concatMap(xs, function (x) {
28
+        return x === 'b' ? [ 'B', 'B', 'B' ] : x;
29
+    });
30
+    t.same(ys, [ 'a', 'B', 'B', 'B', 'c', 'd' ]);
31
+    t.end();
32
+});
33
+
34
+test('undefs', function (t) {
35
+    var xs = [ 'a', 'b', 'c', 'd' ];
36
+    var ys = concatMap(xs, function () {});
37
+    t.same(ys, [ undefined, undefined, undefined, undefined ]);
38
+    t.end();
39
+});

+ 24 - 0
node_modules/concat-stream/LICENSE View File

@@ -0,0 +1,24 @@
1
+The MIT License
2
+
3
+Copyright (c) 2013 Max Ogden
4
+
5
+Permission is hereby granted, free of charge, 
6
+to any person obtaining a copy of this software and 
7
+associated documentation files (the "Software"), to 
8
+deal in the Software without restriction, including 
9
+without limitation the rights to use, copy, modify, 
10
+merge, publish, distribute, sublicense, and/or sell 
11
+copies of the Software, and to permit persons to whom 
12
+the Software is furnished to do so, 
13
+subject to the following conditions:
14
+
15
+The above copyright notice and this permission notice 
16
+shall be included in all copies or substantial portions of the Software.
17
+
18
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 
19
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES 
20
+OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 
21
+IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR 
22
+ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, 
23
+TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE 
24
+SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 144 - 0
node_modules/concat-stream/index.js View File

@@ -0,0 +1,144 @@
1
+var Writable = require('readable-stream').Writable
2
+var inherits = require('inherits')
3
+var bufferFrom = require('buffer-from')
4
+
5
+if (typeof Uint8Array === 'undefined') {
6
+  var U8 = require('typedarray').Uint8Array
7
+} else {
8
+  var U8 = Uint8Array
9
+}
10
+
11
+function ConcatStream(opts, cb) {
12
+  if (!(this instanceof ConcatStream)) return new ConcatStream(opts, cb)
13
+
14
+  if (typeof opts === 'function') {
15
+    cb = opts
16
+    opts = {}
17
+  }
18
+  if (!opts) opts = {}
19
+
20
+  var encoding = opts.encoding
21
+  var shouldInferEncoding = false
22
+
23
+  if (!encoding) {
24
+    shouldInferEncoding = true
25
+  } else {
26
+    encoding =  String(encoding).toLowerCase()
27
+    if (encoding === 'u8' || encoding === 'uint8') {
28
+      encoding = 'uint8array'
29
+    }
30
+  }
31
+
32
+  Writable.call(this, { objectMode: true })
33
+
34
+  this.encoding = encoding
35
+  this.shouldInferEncoding = shouldInferEncoding
36
+
37
+  if (cb) this.on('finish', function () { cb(this.getBody()) })
38
+  this.body = []
39
+}
40
+
41
+module.exports = ConcatStream
42
+inherits(ConcatStream, Writable)
43
+
44
+ConcatStream.prototype._write = function(chunk, enc, next) {
45
+  this.body.push(chunk)
46
+  next()
47
+}
48
+
49
+ConcatStream.prototype.inferEncoding = function (buff) {
50
+  var firstBuffer = buff === undefined ? this.body[0] : buff;
51
+  if (Buffer.isBuffer(firstBuffer)) return 'buffer'
52
+  if (typeof Uint8Array !== 'undefined' && firstBuffer instanceof Uint8Array) return 'uint8array'
53
+  if (Array.isArray(firstBuffer)) return 'array'
54
+  if (typeof firstBuffer === 'string') return 'string'
55
+  if (Object.prototype.toString.call(firstBuffer) === "[object Object]") return 'object'
56
+  return 'buffer'
57
+}
58
+
59
+ConcatStream.prototype.getBody = function () {
60
+  if (!this.encoding && this.body.length === 0) return []
61
+  if (this.shouldInferEncoding) this.encoding = this.inferEncoding()
62
+  if (this.encoding === 'array') return arrayConcat(this.body)
63
+  if (this.encoding === 'string') return stringConcat(this.body)
64
+  if (this.encoding === 'buffer') return bufferConcat(this.body)
65
+  if (this.encoding === 'uint8array') return u8Concat(this.body)
66
+  return this.body
67
+}
68
+
69
+var isArray = Array.isArray || function (arr) {
70
+  return Object.prototype.toString.call(arr) == '[object Array]'
71
+}
72
+
73
+function isArrayish (arr) {
74
+  return /Array\]$/.test(Object.prototype.toString.call(arr))
75
+}
76
+
77
+function isBufferish (p) {
78
+  return typeof p === 'string' || isArrayish(p) || (p && typeof p.subarray === 'function')
79
+}
80
+
81
+function stringConcat (parts) {
82
+  var strings = []
83
+  var needsToString = false
84
+  for (var i = 0; i < parts.length; i++) {
85
+    var p = parts[i]
86
+    if (typeof p === 'string') {
87
+      strings.push(p)
88
+    } else if (Buffer.isBuffer(p)) {
89
+      strings.push(p)
90
+    } else if (isBufferish(p)) {
91
+      strings.push(bufferFrom(p))
92
+    } else {
93
+      strings.push(bufferFrom(String(p)))
94
+    }
95
+  }
96
+  if (Buffer.isBuffer(parts[0])) {
97
+    strings = Buffer.concat(strings)
98
+    strings = strings.toString('utf8')
99
+  } else {
100
+    strings = strings.join('')
101
+  }
102
+  return strings
103
+}
104
+
105
+function bufferConcat (parts) {
106
+  var bufs = []
107
+  for (var i = 0; i < parts.length; i++) {
108
+    var p = parts[i]
109
+    if (Buffer.isBuffer(p)) {
110
+      bufs.push(p)
111
+    } else if (isBufferish(p)) {
112
+      bufs.push(bufferFrom(p))
113
+    } else {
114
+      bufs.push(bufferFrom(String(p)))
115
+    }
116
+  }
117
+  return Buffer.concat(bufs)
118
+}
119
+
120
+function arrayConcat (parts) {
121
+  var res = []
122
+  for (var i = 0; i < parts.length; i++) {
123
+    res.push.apply(res, parts[i])
124
+  }
125
+  return res
126
+}
127
+
128
+function u8Concat (parts) {
129
+  var len = 0
130
+  for (var i = 0; i < parts.length; i++) {
131
+    if (typeof parts[i] === 'string') {
132
+      parts[i] = bufferFrom(parts[i])
133
+    }
134
+    len += parts[i].length
135
+  }
136
+  var u8 = new U8(len)
137
+  for (var i = 0, offset = 0; i < parts.length; i++) {
138
+    var part = parts[i]
139
+    for (var j = 0; j < part.length; j++) {
140
+      u8[offset++] = part[j]
141
+    }
142
+  }
143
+  return u8
144
+}

+ 84 - 0
node_modules/concat-stream/package.json View File

@@ -0,0 +1,84 @@
1
+{
2
+  "_from": "concat-stream@^1.6.2",
3
+  "_id": "concat-stream@1.6.2",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==",
6
+  "_location": "/concat-stream",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "concat-stream@^1.6.2",
12
+    "name": "concat-stream",
13
+    "escapedName": "concat-stream",
14
+    "rawSpec": "^1.6.2",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.6.2"
17
+  },
18
+  "_requiredBy": [
19
+    "/mqtt"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz",
22
+  "_shasum": "904bdf194cd3122fc675c77fc4ac3d4ff0fd1a34",
23
+  "_spec": "concat-stream@^1.6.2",
24
+  "_where": "/var/wss/node_modules/mqtt",
25
+  "author": {
26
+    "name": "Max Ogden",
27
+    "email": "max@maxogden.com"
28
+  },
29
+  "bugs": {
30
+    "url": "http://github.com/maxogden/concat-stream/issues"
31
+  },
32
+  "bundleDependencies": false,
33
+  "dependencies": {
34
+    "buffer-from": "^1.0.0",
35
+    "inherits": "^2.0.3",
36
+    "readable-stream": "^2.2.2",
37
+    "typedarray": "^0.0.6"
38
+  },
39
+  "deprecated": false,
40
+  "description": "writable stream that concatenates strings or binary data and calls a callback with the result",
41
+  "devDependencies": {
42
+    "tape": "^4.6.3"
43
+  },
44
+  "engines": [
45
+    "node >= 0.8"
46
+  ],
47
+  "files": [
48
+    "index.js"
49
+  ],
50
+  "homepage": "https://github.com/maxogden/concat-stream#readme",
51
+  "license": "MIT",
52
+  "main": "index.js",
53
+  "name": "concat-stream",
54
+  "repository": {
55
+    "type": "git",
56
+    "url": "git+ssh://git@github.com/maxogden/concat-stream.git"
57
+  },
58
+  "scripts": {
59
+    "test": "tape test/*.js test/server/*.js"
60
+  },
61
+  "tags": [
62
+    "stream",
63
+    "simple",
64
+    "util",
65
+    "utility"
66
+  ],
67
+  "testling": {
68
+    "files": "test/*.js",
69
+    "browsers": [
70
+      "ie/8..latest",
71
+      "firefox/17..latest",
72
+      "firefox/nightly",
73
+      "chrome/22..latest",
74
+      "chrome/canary",
75
+      "opera/12..latest",
76
+      "opera/next",
77
+      "safari/5.1..latest",
78
+      "ipad/6.0..latest",
79
+      "iphone/6.0..latest",
80
+      "android-browser/4.2..latest"
81
+    ]
82
+  },
83
+  "version": "1.6.2"
84
+}

+ 102 - 0
node_modules/concat-stream/readme.md View File

@@ -0,0 +1,102 @@
1
+# concat-stream
2
+
3
+Writable stream that concatenates all the data from a stream and calls a callback with the result. Use this when you want to collect all the data from a stream into a single buffer.
4
+
5
+[![Build Status](https://travis-ci.org/maxogden/concat-stream.svg?branch=master)](https://travis-ci.org/maxogden/concat-stream)
6
+
7
+[![NPM](https://nodei.co/npm/concat-stream.png)](https://nodei.co/npm/concat-stream/)
8
+
9
+### description
10
+
11
+Streams emit many buffers. If you want to collect all of the buffers, and when the stream ends concatenate all of the buffers together and receive a single buffer then this is the module for you.
12
+
13
+Only use this if you know you can fit all of the output of your stream into a single Buffer (e.g. in RAM).
14
+
15
+There are also `objectMode` streams that emit things other than Buffers, and you can concatenate these too. See below for details.
16
+
17
+## Related
18
+
19
+`concat-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.
20
+
21
+### examples
22
+
23
+#### Buffers
24
+
25
+```js
26
+var fs = require('fs')
27
+var concat = require('concat-stream')
28
+
29
+var readStream = fs.createReadStream('cat.png')
30
+var concatStream = concat(gotPicture)
31
+
32
+readStream.on('error', handleError)
33
+readStream.pipe(concatStream)
34
+
35
+function gotPicture(imageBuffer) {
36
+  // imageBuffer is all of `cat.png` as a node.js Buffer
37
+}
38
+
39
+function handleError(err) {
40
+  // handle your error appropriately here, e.g.:
41
+  console.error(err) // print the error to STDERR
42
+  process.exit(1) // exit program with non-zero exit code
43
+}
44
+
45
+```
46
+
47
+#### Arrays
48
+
49
+```js
50
+var write = concat(function(data) {})
51
+write.write([1,2,3])
52
+write.write([4,5,6])
53
+write.end()
54
+// data will be [1,2,3,4,5,6] in the above callback
55
+```
56
+
57
+#### Uint8Arrays
58
+
59
+```js
60
+var write = concat(function(data) {})
61
+var a = new Uint8Array(3)
62
+a[0] = 97; a[1] = 98; a[2] = 99
63
+write.write(a)
64
+write.write('!')
65
+write.end(Buffer.from('!!1'))
66
+```
67
+
68
+See `test/` for more examples
69
+
70
+# methods
71
+
72
+```js
73
+var concat = require('concat-stream')
74
+```
75
+
76
+## var writable = concat(opts={}, cb)
77
+
78
+Return a `writable` stream that will fire `cb(data)` with all of the data that
79
+was written to the stream. Data can be written to `writable` as strings,
80
+Buffers, arrays of byte integers, and Uint8Arrays. 
81
+
82
+By default `concat-stream` will give you back the same data type as the type of the first buffer written to the stream. Use `opts.encoding` to set what format `data` should be returned as, e.g. if you if you don't want to rely on the built-in type checking or for some other reason.
83
+
84
+* `string` - get a string
85
+* `buffer` - get back a Buffer
86
+* `array` - get an array of byte integers
87
+* `uint8array`, `u8`, `uint8` - get back a Uint8Array
88
+* `object`, get back an array of Objects
89
+
90
+If you don't specify an encoding, and the types can't be inferred (e.g. you write things that aren't in the list above), it will try to convert concat them into a `Buffer`.
91
+
92
+If nothing is written to `writable` then `data` will be an empty array `[]`.
93
+
94
+# error handling
95
+
96
+`concat-stream` does not handle errors for you, so you must handle errors on whatever streams you pipe into `concat-stream`. This is a general rule when programming with node.js streams: always handle errors on each and every stream. Since `concat-stream` is not itself a stream it does not emit errors.
97
+
98
+We recommend using [`end-of-stream`](https://npmjs.org/end-of-stream) or [`pump`](https://npmjs.org/pump) for writing error tolerant stream code.
99
+
100
+# license
101
+
102
+MIT LICENSE

+ 19 - 0
node_modules/core-util-is/LICENSE View File

@@ -0,0 +1,19 @@
1
+Copyright Node.js contributors. All rights reserved.
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
5
+deal in the Software without restriction, including without limitation the
6
+rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
7
+sell 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
18
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
19
+IN THE SOFTWARE.

+ 3 - 0
node_modules/core-util-is/README.md View File

@@ -0,0 +1,3 @@
1
+# core-util-is
2
+
3
+The `util.is*` functions introduced in Node v0.12.

+ 604 - 0
node_modules/core-util-is/float.patch View File

@@ -0,0 +1,604 @@
1
+diff --git a/lib/util.js b/lib/util.js
2
+index a03e874..9074e8e 100644
3
+--- a/lib/util.js
4
++++ b/lib/util.js
5
+@@ -19,430 +19,6 @@
6
+ // OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
7
+ // USE OR OTHER DEALINGS IN THE SOFTWARE.
8
+
9
+-var formatRegExp = /%[sdj%]/g;
10
+-exports.format = function(f) {
11
+-  if (!isString(f)) {
12
+-    var objects = [];
13
+-    for (var i = 0; i < arguments.length; i++) {
14
+-      objects.push(inspect(arguments[i]));
15
+-    }
16
+-    return objects.join(' ');
17
+-  }
18
+-
19
+-  var i = 1;
20
+-  var args = arguments;
21
+-  var len = args.length;
22
+-  var str = String(f).replace(formatRegExp, function(x) {
23
+-    if (x === '%%') return '%';
24
+-    if (i >= len) return x;
25
+-    switch (x) {
26
+-      case '%s': return String(args[i++]);
27
+-      case '%d': return Number(args[i++]);
28
+-      case '%j':
29
+-        try {
30
+-          return JSON.stringify(args[i++]);
31
+-        } catch (_) {
32
+-          return '[Circular]';
33
+-        }
34
+-      default:
35
+-        return x;
36
+-    }
37
+-  });
38
+-  for (var x = args[i]; i < len; x = args[++i]) {
39
+-    if (isNull(x) || !isObject(x)) {
40
+-      str += ' ' + x;
41
+-    } else {
42
+-      str += ' ' + inspect(x);
43
+-    }
44
+-  }
45
+-  return str;
46
+-};
47
+-
48
+-
49
+-// Mark that a method should not be used.
50
+-// Returns a modified function which warns once by default.
51
+-// If --no-deprecation is set, then it is a no-op.
52
+-exports.deprecate = function(fn, msg) {
53
+-  // Allow for deprecating things in the process of starting up.
54
+-  if (isUndefined(global.process)) {
55
+-    return function() {
56
+-      return exports.deprecate(fn, msg).apply(this, arguments);
57
+-    };
58
+-  }
59
+-
60
+-  if (process.noDeprecation === true) {
61
+-    return fn;
62
+-  }
63
+-
64
+-  var warned = false;
65
+-  function deprecated() {
66
+-    if (!warned) {
67
+-      if (process.throwDeprecation) {
68
+-        throw new Error(msg);
69
+-      } else if (process.traceDeprecation) {
70
+-        console.trace(msg);
71
+-      } else {
72
+-        console.error(msg);
73
+-      }
74
+-      warned = true;
75
+-    }
76
+-    return fn.apply(this, arguments);
77
+-  }
78
+-
79
+-  return deprecated;
80
+-};
81
+-
82
+-
83
+-var debugs = {};
84
+-var debugEnviron;
85
+-exports.debuglog = function(set) {
86
+-  if (isUndefined(debugEnviron))
87
+-    debugEnviron = process.env.NODE_DEBUG || '';
88
+-  set = set.toUpperCase();
89
+-  if (!debugs[set]) {
90
+-    if (new RegExp('\\b' + set + '\\b', 'i').test(debugEnviron)) {
91
+-      var pid = process.pid;
92
+-      debugs[set] = function() {
93
+-        var msg = exports.format.apply(exports, arguments);
94
+-        console.error('%s %d: %s', set, pid, msg);
95
+-      };
96
+-    } else {
97
+-      debugs[set] = function() {};
98
+-    }
99
+-  }
100
+-  return debugs[set];
101
+-};
102
+-
103
+-
104
+-/**
105
+- * Echos the value of a value. Trys to print the value out
106
+- * in the best way possible given the different types.
107
+- *
108
+- * @param {Object} obj The object to print out.
109
+- * @param {Object} opts Optional options object that alters the output.
110
+- */
111
+-/* legacy: obj, showHidden, depth, colors*/
112
+-function inspect(obj, opts) {
113
+-  // default options
114
+-  var ctx = {
115
+-    seen: [],
116
+-    stylize: stylizeNoColor
117
+-  };
118
+-  // legacy...
119
+-  if (arguments.length >= 3) ctx.depth = arguments[2];
120
+-  if (arguments.length >= 4) ctx.colors = arguments[3];
121
+-  if (isBoolean(opts)) {
122
+-    // legacy...
123
+-    ctx.showHidden = opts;
124
+-  } else if (opts) {
125
+-    // got an "options" object
126
+-    exports._extend(ctx, opts);
127
+-  }
128
+-  // set default options
129
+-  if (isUndefined(ctx.showHidden)) ctx.showHidden = false;
130
+-  if (isUndefined(ctx.depth)) ctx.depth = 2;
131
+-  if (isUndefined(ctx.colors)) ctx.colors = false;
132
+-  if (isUndefined(ctx.customInspect)) ctx.customInspect = true;
133
+-  if (ctx.colors) ctx.stylize = stylizeWithColor;
134
+-  return formatValue(ctx, obj, ctx.depth);
135
+-}
136
+-exports.inspect = inspect;
137
+-
138
+-
139
+-// http://en.wikipedia.org/wiki/ANSI_escape_code#graphics
140
+-inspect.colors = {
141
+-  'bold' : [1, 22],
142
+-  'italic' : [3, 23],
143
+-  'underline' : [4, 24],
144
+-  'inverse' : [7, 27],
145
+-  'white' : [37, 39],
146
+-  'grey' : [90, 39],
147
+-  'black' : [30, 39],
148
+-  'blue' : [34, 39],
149
+-  'cyan' : [36, 39],
150
+-  'green' : [32, 39],
151
+-  'magenta' : [35, 39],
152
+-  'red' : [31, 39],
153
+-  'yellow' : [33, 39]
154
+-};
155
+-
156
+-// Don't use 'blue' not visible on cmd.exe
157
+-inspect.styles = {
158
+-  'special': 'cyan',
159
+-  'number': 'yellow',
160
+-  'boolean': 'yellow',
161
+-  'undefined': 'grey',
162
+-  'null': 'bold',
163
+-  'string': 'green',
164
+-  'date': 'magenta',
165
+-  // "name": intentionally not styling
166
+-  'regexp': 'red'
167
+-};
168
+-
169
+-
170
+-function stylizeWithColor(str, styleType) {
171
+-  var style = inspect.styles[styleType];
172
+-
173
+-  if (style) {
174
+-    return '\u001b[' + inspect.colors[style][0] + 'm' + str +
175
+-           '\u001b[' + inspect.colors[style][1] + 'm';
176
+-  } else {
177
+-    return str;
178
+-  }
179
+-}
180
+-
181
+-
182
+-function stylizeNoColor(str, styleType) {
183
+-  return str;
184
+-}
185
+-
186
+-
187
+-function arrayToHash(array) {
188
+-  var hash = {};
189
+-
190
+-  array.forEach(function(val, idx) {
191
+-    hash[val] = true;
192
+-  });
193
+-
194
+-  return hash;
195
+-}
196
+-
197
+-
198
+-function formatValue(ctx, value, recurseTimes) {
199
+-  // Provide a hook for user-specified inspect functions.
200
+-  // Check that value is an object with an inspect function on it
201
+-  if (ctx.customInspect &&
202
+-      value &&
203
+-      isFunction(value.inspect) &&
204
+-      // Filter out the util module, it's inspect function is special
205
+-      value.inspect !== exports.inspect &&
206
+-      // Also filter out any prototype objects using the circular check.
207
+-      !(value.constructor && value.constructor.prototype === value)) {
208
+-    var ret = value.inspect(recurseTimes, ctx);
209
+-    if (!isString(ret)) {
210
+-      ret = formatValue(ctx, ret, recurseTimes);
211
+-    }
212
+-    return ret;
213
+-  }
214
+-
215
+-  // Primitive types cannot have properties
216
+-  var primitive = formatPrimitive(ctx, value);
217
+-  if (primitive) {
218
+-    return primitive;
219
+-  }
220
+-
221
+-  // Look up the keys of the object.
222
+-  var keys = Object.keys(value);
223
+-  var visibleKeys = arrayToHash(keys);
224
+-
225
+-  if (ctx.showHidden) {
226
+-    keys = Object.getOwnPropertyNames(value);
227
+-  }
228
+-
229
+-  // Some type of object without properties can be shortcutted.
230
+-  if (keys.length === 0) {
231
+-    if (isFunction(value)) {
232
+-      var name = value.name ? ': ' + value.name : '';
233
+-      return ctx.stylize('[Function' + name + ']', 'special');
234
+-    }
235
+-    if (isRegExp(value)) {
236
+-      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
237
+-    }
238
+-    if (isDate(value)) {
239
+-      return ctx.stylize(Date.prototype.toString.call(value), 'date');
240
+-    }
241
+-    if (isError(value)) {
242
+-      return formatError(value);
243
+-    }
244
+-  }
245
+-
246
+-  var base = '', array = false, braces = ['{', '}'];
247
+-
248
+-  // Make Array say that they are Array
249
+-  if (isArray(value)) {
250
+-    array = true;
251
+-    braces = ['[', ']'];
252
+-  }
253
+-
254
+-  // Make functions say that they are functions
255
+-  if (isFunction(value)) {
256
+-    var n = value.name ? ': ' + value.name : '';
257
+-    base = ' [Function' + n + ']';
258
+-  }
259
+-
260
+-  // Make RegExps say that they are RegExps
261
+-  if (isRegExp(value)) {
262
+-    base = ' ' + RegExp.prototype.toString.call(value);
263
+-  }
264
+-
265
+-  // Make dates with properties first say the date
266
+-  if (isDate(value)) {
267
+-    base = ' ' + Date.prototype.toUTCString.call(value);
268
+-  }
269
+-
270
+-  // Make error with message first say the error
271
+-  if (isError(value)) {
272
+-    base = ' ' + formatError(value);
273
+-  }
274
+-
275
+-  if (keys.length === 0 && (!array || value.length == 0)) {
276
+-    return braces[0] + base + braces[1];
277
+-  }
278
+-
279
+-  if (recurseTimes < 0) {
280
+-    if (isRegExp(value)) {
281
+-      return ctx.stylize(RegExp.prototype.toString.call(value), 'regexp');
282
+-    } else {
283
+-      return ctx.stylize('[Object]', 'special');
284
+-    }
285
+-  }
286
+-
287
+-  ctx.seen.push(value);
288
+-
289
+-  var output;
290
+-  if (array) {
291
+-    output = formatArray(ctx, value, recurseTimes, visibleKeys, keys);
292
+-  } else {
293
+-    output = keys.map(function(key) {
294
+-      return formatProperty(ctx, value, recurseTimes, visibleKeys, key, array);
295
+-    });
296
+-  }
297
+-
298
+-  ctx.seen.pop();
299
+-
300
+-  return reduceToSingleString(output, base, braces);
301
+-}
302
+-
303
+-
304
+-function formatPrimitive(ctx, value) {
305
+-  if (isUndefined(value))
306
+-    return ctx.stylize('undefined', 'undefined');
307
+-  if (isString(value)) {
308
+-    var simple = '\'' + JSON.stringify(value).replace(/^"|"$/g, '')
309
+-                                             .replace(/'/g, "\\'")
310
+-                                             .replace(/\\"/g, '"') + '\'';
311
+-    return ctx.stylize(simple, 'string');
312
+-  }
313
+-  if (isNumber(value)) {
314
+-    // Format -0 as '-0'. Strict equality won't distinguish 0 from -0,
315
+-    // so instead we use the fact that 1 / -0 < 0 whereas 1 / 0 > 0 .
316
+-    if (value === 0 && 1 / value < 0)
317
+-      return ctx.stylize('-0', 'number');
318
+-    return ctx.stylize('' + value, 'number');
319
+-  }
320
+-  if (isBoolean(value))
321
+-    return ctx.stylize('' + value, 'boolean');
322
+-  // For some reason typeof null is "object", so special case here.
323
+-  if (isNull(value))
324
+-    return ctx.stylize('null', 'null');
325
+-}
326
+-
327
+-
328
+-function formatError(value) {
329
+-  return '[' + Error.prototype.toString.call(value) + ']';
330
+-}
331
+-
332
+-
333
+-function formatArray(ctx, value, recurseTimes, visibleKeys, keys) {
334
+-  var output = [];
335
+-  for (var i = 0, l = value.length; i < l; ++i) {
336
+-    if (hasOwnProperty(value, String(i))) {
337
+-      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
338
+-          String(i), true));
339
+-    } else {
340
+-      output.push('');
341
+-    }
342
+-  }
343
+-  keys.forEach(function(key) {
344
+-    if (!key.match(/^\d+$/)) {
345
+-      output.push(formatProperty(ctx, value, recurseTimes, visibleKeys,
346
+-          key, true));
347
+-    }
348
+-  });
349
+-  return output;
350
+-}
351
+-
352
+-
353
+-function formatProperty(ctx, value, recurseTimes, visibleKeys, key, array) {
354
+-  var name, str, desc;
355
+-  desc = Object.getOwnPropertyDescriptor(value, key) || { value: value[key] };
356
+-  if (desc.get) {
357
+-    if (desc.set) {
358
+-      str = ctx.stylize('[Getter/Setter]', 'special');
359
+-    } else {
360
+-      str = ctx.stylize('[Getter]', 'special');
361
+-    }
362
+-  } else {
363
+-    if (desc.set) {
364
+-      str = ctx.stylize('[Setter]', 'special');
365
+-    }
366
+-  }
367
+-  if (!hasOwnProperty(visibleKeys, key)) {
368
+-    name = '[' + key + ']';
369
+-  }
370
+-  if (!str) {
371
+-    if (ctx.seen.indexOf(desc.value) < 0) {
372
+-      if (isNull(recurseTimes)) {
373
+-        str = formatValue(ctx, desc.value, null);
374
+-      } else {
375
+-        str = formatValue(ctx, desc.value, recurseTimes - 1);
376
+-      }
377
+-      if (str.indexOf('\n') > -1) {
378
+-        if (array) {
379
+-          str = str.split('\n').map(function(line) {
380
+-            return '  ' + line;
381
+-          }).join('\n').substr(2);
382
+-        } else {
383
+-          str = '\n' + str.split('\n').map(function(line) {
384
+-            return '   ' + line;
385
+-          }).join('\n');
386
+-        }
387
+-      }
388
+-    } else {
389
+-      str = ctx.stylize('[Circular]', 'special');
390
+-    }
391
+-  }
392
+-  if (isUndefined(name)) {
393
+-    if (array && key.match(/^\d+$/)) {
394
+-      return str;
395
+-    }
396
+-    name = JSON.stringify('' + key);
397
+-    if (name.match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)) {
398
+-      name = name.substr(1, name.length - 2);
399
+-      name = ctx.stylize(name, 'name');
400
+-    } else {
401
+-      name = name.replace(/'/g, "\\'")
402
+-                 .replace(/\\"/g, '"')
403
+-                 .replace(/(^"|"$)/g, "'");
404
+-      name = ctx.stylize(name, 'string');
405
+-    }
406
+-  }
407
+-
408
+-  return name + ': ' + str;
409
+-}
410
+-
411
+-
412
+-function reduceToSingleString(output, base, braces) {
413
+-  var numLinesEst = 0;
414
+-  var length = output.reduce(function(prev, cur) {
415
+-    numLinesEst++;
416
+-    if (cur.indexOf('\n') >= 0) numLinesEst++;
417
+-    return prev + cur.replace(/\u001b\[\d\d?m/g, '').length + 1;
418
+-  }, 0);
419
+-
420
+-  if (length > 60) {
421
+-    return braces[0] +
422
+-           (base === '' ? '' : base + '\n ') +
423
+-           ' ' +
424
+-           output.join(',\n  ') +
425
+-           ' ' +
426
+-           braces[1];
427
+-  }
428
+-
429
+-  return braces[0] + base + ' ' + output.join(', ') + ' ' + braces[1];
430
+-}
431
+-
432
+-
433
+ // NOTE: These type checking functions intentionally don't use `instanceof`
434
+ // because it is fragile and can be easily faked with `Object.create()`.
435
+ function isArray(ar) {
436
+@@ -522,166 +98,10 @@ function isPrimitive(arg) {
437
+ exports.isPrimitive = isPrimitive;
438
+
439
+ function isBuffer(arg) {
440
+-  return arg instanceof Buffer;
441
++  return Buffer.isBuffer(arg);
442
+ }
443
+ exports.isBuffer = isBuffer;
444
+
445
+ function objectToString(o) {
446
+   return Object.prototype.toString.call(o);
447
+-}
448
+-
449
+-
450
+-function pad(n) {
451
+-  return n < 10 ? '0' + n.toString(10) : n.toString(10);
452
+-}
453
+-
454
+-
455
+-var months = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep',
456
+-              'Oct', 'Nov', 'Dec'];
457
+-
458
+-// 26 Feb 16:19:34
459
+-function timestamp() {
460
+-  var d = new Date();
461
+-  var time = [pad(d.getHours()),
462
+-              pad(d.getMinutes()),
463
+-              pad(d.getSeconds())].join(':');
464
+-  return [d.getDate(), months[d.getMonth()], time].join(' ');
465
+-}
466
+-
467
+-
468
+-// log is just a thin wrapper to console.log that prepends a timestamp
469
+-exports.log = function() {
470
+-  console.log('%s - %s', timestamp(), exports.format.apply(exports, arguments));
471
+-};
472
+-
473
+-
474
+-/**
475
+- * Inherit the prototype methods from one constructor into another.
476
+- *
477
+- * The Function.prototype.inherits from lang.js rewritten as a standalone
478
+- * function (not on Function.prototype). NOTE: If this file is to be loaded
479
+- * during bootstrapping this function needs to be rewritten using some native
480
+- * functions as prototype setup using normal JavaScript does not work as
481
+- * expected during bootstrapping (see mirror.js in r114903).
482
+- *
483
+- * @param {function} ctor Constructor function which needs to inherit the
484
+- *     prototype.
485
+- * @param {function} superCtor Constructor function to inherit prototype from.
486
+- */
487
+-exports.inherits = function(ctor, superCtor) {
488
+-  ctor.super_ = superCtor;
489
+-  ctor.prototype = Object.create(superCtor.prototype, {
490
+-    constructor: {
491
+-      value: ctor,
492
+-      enumerable: false,
493
+-      writable: true,
494
+-      configurable: true
495
+-    }
496
+-  });
497
+-};
498
+-
499
+-exports._extend = function(origin, add) {
500
+-  // Don't do anything if add isn't an object
501
+-  if (!add || !isObject(add)) return origin;
502
+-
503
+-  var keys = Object.keys(add);
504
+-  var i = keys.length;
505
+-  while (i--) {
506
+-    origin[keys[i]] = add[keys[i]];
507
+-  }
508
+-  return origin;
509
+-};
510
+-
511
+-function hasOwnProperty(obj, prop) {
512
+-  return Object.prototype.hasOwnProperty.call(obj, prop);
513
+-}
514
+-
515
+-
516
+-// Deprecated old stuff.
517
+-
518
+-exports.p = exports.deprecate(function() {
519
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
520
+-    console.error(exports.inspect(arguments[i]));
521
+-  }
522
+-}, 'util.p: Use console.error() instead');
523
+-
524
+-
525
+-exports.exec = exports.deprecate(function() {
526
+-  return require('child_process').exec.apply(this, arguments);
527
+-}, 'util.exec is now called `child_process.exec`.');
528
+-
529
+-
530
+-exports.print = exports.deprecate(function() {
531
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
532
+-    process.stdout.write(String(arguments[i]));
533
+-  }
534
+-}, 'util.print: Use console.log instead');
535
+-
536
+-
537
+-exports.puts = exports.deprecate(function() {
538
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
539
+-    process.stdout.write(arguments[i] + '\n');
540
+-  }
541
+-}, 'util.puts: Use console.log instead');
542
+-
543
+-
544
+-exports.debug = exports.deprecate(function(x) {
545
+-  process.stderr.write('DEBUG: ' + x + '\n');
546
+-}, 'util.debug: Use console.error instead');
547
+-
548
+-
549
+-exports.error = exports.deprecate(function(x) {
550
+-  for (var i = 0, len = arguments.length; i < len; ++i) {
551
+-    process.stderr.write(arguments[i] + '\n');
552
+-  }
553
+-}, 'util.error: Use console.error instead');
554
+-
555
+-
556
+-exports.pump = exports.deprecate(function(readStream, writeStream, callback) {
557
+-  var callbackCalled = false;
558
+-
559
+-  function call(a, b, c) {
560
+-    if (callback && !callbackCalled) {
561
+-      callback(a, b, c);
562
+-      callbackCalled = true;
563
+-    }
564
+-  }
565
+-
566
+-  readStream.addListener('data', function(chunk) {
567
+-    if (writeStream.write(chunk) === false) readStream.pause();
568
+-  });
569
+-
570
+-  writeStream.addListener('drain', function() {
571
+-    readStream.resume();
572
+-  });
573
+-
574
+-  readStream.addListener('end', function() {
575
+-    writeStream.end();
576
+-  });
577
+-
578
+-  readStream.addListener('close', function() {
579
+-    call();
580
+-  });
581
+-
582
+-  readStream.addListener('error', function(err) {
583
+-    writeStream.end();
584
+-    call(err);
585
+-  });
586
+-
587
+-  writeStream.addListener('error', function(err) {
588
+-    readStream.destroy();
589
+-    call(err);
590
+-  });
591
+-}, 'util.pump(): Use readableStream.pipe() instead');
592
+-
593
+-
594
+-var uv;
595
+-exports._errnoException = function(err, syscall) {
596
+-  if (isUndefined(uv)) uv = process.binding('uv');
597
+-  var errname = uv.errname(err);
598
+-  var e = new Error(syscall + ' ' + errname);
599
+-  e.code = errname;
600
+-  e.errno = errname;
601
+-  e.syscall = syscall;
602
+-  return e;
603
+-};
604
++}

+ 107 - 0
node_modules/core-util-is/lib/util.js View File

@@ -0,0 +1,107 @@
1
+// Copyright Joyent, Inc. and other Node contributors.
2
+//
3
+// Permission is hereby granted, free of charge, to any person obtaining a
4
+// copy of this software and associated documentation files (the
5
+// "Software"), to deal in the Software without restriction, including
6
+// without limitation the rights to use, copy, modify, merge, publish,
7
+// distribute, sublicense, and/or sell copies of the Software, and to permit
8
+// persons to whom the Software is furnished to do so, subject to the
9
+// following conditions:
10
+//
11
+// The above copyright notice and this permission notice shall be included
12
+// in all copies or substantial portions of the Software.
13
+//
14
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15
+// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
16
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN
17
+// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
18
+// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19
+// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20
+// USE OR OTHER DEALINGS IN THE SOFTWARE.
21
+
22
+// NOTE: These type checking functions intentionally don't use `instanceof`
23
+// because it is fragile and can be easily faked with `Object.create()`.
24
+
25
+function isArray(arg) {
26
+  if (Array.isArray) {
27
+    return Array.isArray(arg);
28
+  }
29
+  return objectToString(arg) === '[object Array]';
30
+}
31
+exports.isArray = isArray;
32
+
33
+function isBoolean(arg) {
34
+  return typeof arg === 'boolean';
35
+}
36
+exports.isBoolean = isBoolean;
37
+
38
+function isNull(arg) {
39
+  return arg === null;
40
+}
41
+exports.isNull = isNull;
42
+
43
+function isNullOrUndefined(arg) {
44
+  return arg == null;
45
+}
46
+exports.isNullOrUndefined = isNullOrUndefined;
47
+
48
+function isNumber(arg) {
49
+  return typeof arg === 'number';
50
+}
51
+exports.isNumber = isNumber;
52
+
53
+function isString(arg) {
54
+  return typeof arg === 'string';
55
+}
56
+exports.isString = isString;
57
+
58
+function isSymbol(arg) {
59
+  return typeof arg === 'symbol';
60
+}
61
+exports.isSymbol = isSymbol;
62
+
63
+function isUndefined(arg) {
64
+  return arg === void 0;
65
+}
66
+exports.isUndefined = isUndefined;
67
+
68
+function isRegExp(re) {
69
+  return objectToString(re) === '[object RegExp]';
70
+}
71
+exports.isRegExp = isRegExp;
72
+
73
+function isObject(arg) {
74
+  return typeof arg === 'object' && arg !== null;
75
+}
76
+exports.isObject = isObject;
77
+
78
+function isDate(d) {
79
+  return objectToString(d) === '[object Date]';
80
+}
81
+exports.isDate = isDate;
82
+
83
+function isError(e) {
84
+  return (objectToString(e) === '[object Error]' || e instanceof Error);
85
+}
86
+exports.isError = isError;
87
+
88
+function isFunction(arg) {
89
+  return typeof arg === 'function';
90
+}
91
+exports.isFunction = isFunction;
92
+
93
+function isPrimitive(arg) {
94
+  return arg === null ||
95
+         typeof arg === 'boolean' ||
96
+         typeof arg === 'number' ||
97
+         typeof arg === 'string' ||
98
+         typeof arg === 'symbol' ||  // ES6 symbol
99
+         typeof arg === 'undefined';
100
+}
101
+exports.isPrimitive = isPrimitive;
102
+
103
+exports.isBuffer = Buffer.isBuffer;
104
+
105
+function objectToString(o) {
106
+  return Object.prototype.toString.call(o);
107
+}

+ 62 - 0
node_modules/core-util-is/package.json View File

@@ -0,0 +1,62 @@
1
+{
2
+  "_from": "core-util-is@~1.0.0",
3
+  "_id": "core-util-is@1.0.2",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=",
6
+  "_location": "/core-util-is",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "core-util-is@~1.0.0",
12
+    "name": "core-util-is",
13
+    "escapedName": "core-util-is",
14
+    "rawSpec": "~1.0.0",
15
+    "saveSpec": null,
16
+    "fetchSpec": "~1.0.0"
17
+  },
18
+  "_requiredBy": [
19
+    "/readable-stream"
20
+  ],
21
+  "_resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz",
22
+  "_shasum": "b5fd54220aa2bc5ab57aab7140c940754503c1a7",
23
+  "_spec": "core-util-is@~1.0.0",
24
+  "_where": "/var/wss/node_modules/readable-stream",
25
+  "author": {
26
+    "name": "Isaac Z. Schlueter",
27
+    "email": "i@izs.me",
28
+    "url": "http://blog.izs.me/"
29
+  },
30
+  "bugs": {
31
+    "url": "https://github.com/isaacs/core-util-is/issues"
32
+  },
33
+  "bundleDependencies": false,
34
+  "deprecated": false,
35
+  "description": "The `util.is*` functions introduced in Node v0.12.",
36
+  "devDependencies": {
37
+    "tap": "^2.3.0"
38
+  },
39
+  "homepage": "https://github.com/isaacs/core-util-is#readme",
40
+  "keywords": [
41
+    "util",
42
+    "isBuffer",
43
+    "isArray",
44
+    "isNumber",
45
+    "isString",
46
+    "isRegExp",
47
+    "isThis",
48
+    "isThat",
49
+    "polyfill"
50
+  ],
51
+  "license": "MIT",
52
+  "main": "lib/util.js",
53
+  "name": "core-util-is",
54
+  "repository": {
55
+    "type": "git",
56
+    "url": "git://github.com/isaacs/core-util-is.git"
57
+  },
58
+  "scripts": {
59
+    "test": "tap test.js"
60
+  },
61
+  "version": "1.0.2"
62
+}

+ 68 - 0
node_modules/core-util-is/test.js View File

@@ -0,0 +1,68 @@
1
+var assert = require('tap');
2
+
3
+var t = require('./lib/util');
4
+
5
+assert.equal(t.isArray([]), true);
6
+assert.equal(t.isArray({}), false);
7
+
8
+assert.equal(t.isBoolean(null), false);
9
+assert.equal(t.isBoolean(true), true);
10
+assert.equal(t.isBoolean(false), true);
11
+
12
+assert.equal(t.isNull(null), true);
13
+assert.equal(t.isNull(undefined), false);
14
+assert.equal(t.isNull(false), false);
15
+assert.equal(t.isNull(), false);
16
+
17
+assert.equal(t.isNullOrUndefined(null), true);
18
+assert.equal(t.isNullOrUndefined(undefined), true);
19
+assert.equal(t.isNullOrUndefined(false), false);
20
+assert.equal(t.isNullOrUndefined(), true);
21
+
22
+assert.equal(t.isNumber(null), false);
23
+assert.equal(t.isNumber('1'), false);
24
+assert.equal(t.isNumber(1), true);
25
+
26
+assert.equal(t.isString(null), false);
27
+assert.equal(t.isString('1'), true);
28
+assert.equal(t.isString(1), false);
29
+
30
+assert.equal(t.isSymbol(null), false);
31
+assert.equal(t.isSymbol('1'), false);
32
+assert.equal(t.isSymbol(1), false);
33
+assert.equal(t.isSymbol(Symbol()), true);
34
+
35
+assert.equal(t.isUndefined(null), false);
36
+assert.equal(t.isUndefined(undefined), true);
37
+assert.equal(t.isUndefined(false), false);
38
+assert.equal(t.isUndefined(), true);
39
+
40
+assert.equal(t.isRegExp(null), false);
41
+assert.equal(t.isRegExp('1'), false);
42
+assert.equal(t.isRegExp(new RegExp()), true);
43
+
44
+assert.equal(t.isObject({}), true);
45
+assert.equal(t.isObject([]), true);
46
+assert.equal(t.isObject(new RegExp()), true);
47
+assert.equal(t.isObject(new Date()), true);
48
+
49
+assert.equal(t.isDate(null), false);
50
+assert.equal(t.isDate('1'), false);
51
+assert.equal(t.isDate(new Date()), true);
52
+
53
+assert.equal(t.isError(null), false);
54
+assert.equal(t.isError({ err: true }), false);
55
+assert.equal(t.isError(new Error()), true);
56
+
57
+assert.equal(t.isFunction(null), false);
58
+assert.equal(t.isFunction({ }), false);
59
+assert.equal(t.isFunction(function() {}), true);
60
+
61
+assert.equal(t.isPrimitive(null), true);
62
+assert.equal(t.isPrimitive(''), true);
63
+assert.equal(t.isPrimitive(0), true);
64
+assert.equal(t.isPrimitive(new Date()), false);
65
+
66
+assert.equal(t.isBuffer(null), false);
67
+assert.equal(t.isBuffer({}), false);
68
+assert.equal(t.isBuffer(new Buffer(0)), true);

+ 6 - 0
node_modules/duplexify/.travis.yml View File

@@ -0,0 +1,6 @@
1
+language: node_js
2
+node_js:
3
+  - "0.10"
4
+  - "0.12"
5
+  - "4"
6
+  - "6"

+ 21 - 0
node_modules/duplexify/LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2014 Mathias Buus
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in
13
+all copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+THE SOFTWARE.

+ 97 - 0
node_modules/duplexify/README.md View File

@@ -0,0 +1,97 @@
1
+# duplexify
2
+
3
+Turn a writeable and readable stream into a single streams2 duplex stream.
4
+
5
+Similar to [duplexer2](https://github.com/deoxxa/duplexer2) except it supports both streams2 and streams1 as input
6
+and it allows you to set the readable and writable part asynchronously using `setReadable(stream)` and `setWritable(stream)`
7
+
8
+```
9
+npm install duplexify
10
+```
11
+
12
+[![build status](http://img.shields.io/travis/mafintosh/duplexify.svg?style=flat)](http://travis-ci.org/mafintosh/duplexify)
13
+
14
+## Usage
15
+
16
+Use `duplexify(writable, readable, streamOptions)` (or `duplexify.obj(writable, readable)` to create an object stream)
17
+
18
+``` js
19
+var duplexify = require('duplexify')
20
+
21
+// turn writableStream and readableStream into a single duplex stream
22
+var dup = duplexify(writableStream, readableStream)
23
+
24
+dup.write('hello world') // will write to writableStream
25
+dup.on('data', function(data) {
26
+  // will read from readableStream
27
+})
28
+```
29
+
30
+You can also set the readable and writable parts asynchronously
31
+
32
+``` js
33
+var dup = duplexify()
34
+
35
+dup.write('hello world') // write will buffer until the writable
36
+                         // part has been set
37
+
38
+// wait a bit ...
39
+dup.setReadable(readableStream)
40
+
41
+// maybe wait some more?
42
+dup.setWritable(writableStream)
43
+```
44
+
45
+If you call `setReadable` or `setWritable` multiple times it will unregister the previous readable/writable stream.
46
+To disable the readable or writable part call `setReadable` or `setWritable` with `null`.
47
+
48
+If the readable or writable streams emits an error or close it will destroy both streams and bubble up the event.
49
+You can also explicitly destroy the streams by calling `dup.destroy()`. The `destroy` method optionally takes an
50
+error object as argument, in which case the error is emitted as part of the `error` event.
51
+
52
+``` js
53
+dup.on('error', function(err) {
54
+  console.log('readable or writable emitted an error - close will follow')
55
+})
56
+
57
+dup.on('close', function() {
58
+  console.log('the duplex stream is destroyed')
59
+})
60
+
61
+dup.destroy() // calls destroy on the readable and writable part (if present)
62
+```
63
+
64
+## HTTP request example
65
+
66
+Turn a node core http request into a duplex stream is as easy as
67
+
68
+``` js
69
+var duplexify = require('duplexify')
70
+var http = require('http')
71
+
72
+var request = function(opts) {
73
+  var req = http.request(opts)
74
+  var dup = duplexify(req)
75
+  req.on('response', function(res) {
76
+    dup.setReadable(res)
77
+  })
78
+  return dup
79
+}
80
+
81
+var req = request({
82
+  method: 'GET',
83
+  host: 'www.google.com',
84
+  port: 80
85
+})
86
+
87
+req.end()
88
+req.pipe(process.stdout)
89
+```
90
+
91
+## License
92
+
93
+MIT
94
+
95
+## Related
96
+
97
+`duplexify` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.

+ 21 - 0
node_modules/duplexify/example.js View File

@@ -0,0 +1,21 @@
1
+var duplexify = require('duplexify')
2
+var http = require('http')
3
+
4
+var request = function(opts) {
5
+  var req = http.request(opts)
6
+  var dup = duplexify()
7
+  dup.setWritable(req)
8
+  req.on('response', function(res) {
9
+    dup.setReadable(res)
10
+  })
11
+  return dup
12
+}
13
+
14
+var req = request({
15
+  method: 'GET',
16
+  host: 'www.google.com',
17
+  port: 80
18
+})
19
+
20
+req.end()
21
+req.pipe(process.stdout)

+ 235 - 0
node_modules/duplexify/index.js View File

@@ -0,0 +1,235 @@
1
+var stream = require('readable-stream')
2
+var eos = require('end-of-stream')
3
+var inherits = require('inherits')
4
+var shift = require('stream-shift')
5
+
6
+var SIGNAL_FLUSH = (Buffer.from && Buffer.from !== Uint8Array.from)
7
+  ? Buffer.from([0])
8
+  : new Buffer([0])
9
+
10
+var onuncork = function(self, fn) {
11
+  if (self._corked) self.once('uncork', fn)
12
+  else fn()
13
+}
14
+
15
+var autoDestroy = function (self, err) {
16
+  if (self._autoDestroy) self.destroy(err)
17
+}
18
+
19
+var destroyer = function(self, end) {
20
+  return function(err) {
21
+    if (err) autoDestroy(self, err.message === 'premature close' ? null : err)
22
+    else if (end && !self._ended) self.end()
23
+  }
24
+}
25
+
26
+var end = function(ws, fn) {
27
+  if (!ws) return fn()
28
+  if (ws._writableState && ws._writableState.finished) return fn()
29
+  if (ws._writableState) return ws.end(fn)
30
+  ws.end()
31
+  fn()
32
+}
33
+
34
+var toStreams2 = function(rs) {
35
+  return new (stream.Readable)({objectMode:true, highWaterMark:16}).wrap(rs)
36
+}
37
+
38
+var Duplexify = function(writable, readable, opts) {
39
+  if (!(this instanceof Duplexify)) return new Duplexify(writable, readable, opts)
40
+  stream.Duplex.call(this, opts)
41
+
42
+  this._writable = null
43
+  this._readable = null
44
+  this._readable2 = null
45
+
46
+  this._autoDestroy = !opts || opts.autoDestroy !== false
47
+  this._forwardDestroy = !opts || opts.destroy !== false
48
+  this._forwardEnd = !opts || opts.end !== false
49
+  this._corked = 1 // start corked
50
+  this._ondrain = null
51
+  this._drained = false
52
+  this._forwarding = false
53
+  this._unwrite = null
54
+  this._unread = null
55
+  this._ended = false
56
+
57
+  this.destroyed = false
58
+
59
+  if (writable) this.setWritable(writable)
60
+  if (readable) this.setReadable(readable)
61
+}
62
+
63
+inherits(Duplexify, stream.Duplex)
64
+
65
+Duplexify.obj = function(writable, readable, opts) {
66
+  if (!opts) opts = {}
67
+  opts.objectMode = true
68
+  opts.highWaterMark = 16
69
+  return new Duplexify(writable, readable, opts)
70
+}
71
+
72
+Duplexify.prototype.cork = function() {
73
+  if (++this._corked === 1) this.emit('cork')
74
+}
75
+
76
+Duplexify.prototype.uncork = function() {
77
+  if (this._corked && --this._corked === 0) this.emit('uncork')
78
+}
79
+
80
+Duplexify.prototype.setWritable = function(writable) {
81
+  if (this._unwrite) this._unwrite()
82
+
83
+  if (this.destroyed) {
84
+    if (writable && writable.destroy) writable.destroy()
85
+    return
86
+  }
87
+
88
+  if (writable === null || writable === false) {
89
+    this.end()
90
+    return
91
+  }
92
+
93
+  var self = this
94
+  var unend = eos(writable, {writable:true, readable:false}, destroyer(this, this._forwardEnd))
95
+
96
+  var ondrain = function() {
97
+    var ondrain = self._ondrain
98
+    self._ondrain = null
99
+    if (ondrain) ondrain()
100
+  }
101
+
102
+  var clear = function() {
103
+    self._writable.removeListener('drain', ondrain)
104
+    unend()
105
+  }
106
+
107
+  if (this._unwrite) process.nextTick(ondrain) // force a drain on stream reset to avoid livelocks
108
+
109
+  this._writable = writable
110
+  this._writable.on('drain', ondrain)
111
+  this._unwrite = clear
112
+
113
+  this.uncork() // always uncork setWritable
114
+}
115
+
116
+Duplexify.prototype.setReadable = function(readable) {
117
+  if (this._unread) this._unread()
118
+
119
+  if (this.destroyed) {
120
+    if (readable && readable.destroy) readable.destroy()
121
+    return
122
+  }
123
+
124
+  if (readable === null || readable === false) {
125
+    this.push(null)
126
+    this.resume()
127
+    return
128
+  }
129
+
130
+  var self = this
131
+  var unend = eos(readable, {writable:false, readable:true}, destroyer(this))
132
+
133
+  var onreadable = function() {
134
+    self._forward()
135
+  }
136
+
137
+  var onend = function() {
138
+    self.push(null)
139
+  }
140
+
141
+  var clear = function() {
142
+    self._readable2.removeListener('readable', onreadable)
143
+    self._readable2.removeListener('end', onend)
144
+    unend()
145
+  }
146
+
147
+  this._drained = true
148
+  this._readable = readable
149
+  this._readable2 = readable._readableState ? readable : toStreams2(readable)
150
+  this._readable2.on('readable', onreadable)
151
+  this._readable2.on('end', onend)
152
+  this._unread = clear
153
+
154
+  this._forward()
155
+}
156
+
157
+Duplexify.prototype._read = function() {
158
+  this._drained = true
159
+  this._forward()
160
+}
161
+
162
+Duplexify.prototype._forward = function() {
163
+  if (this._forwarding || !this._readable2 || !this._drained) return
164
+  this._forwarding = true
165
+
166
+  var data
167
+
168
+  while (this._drained && (data = shift(this._readable2)) !== null) {
169
+    if (this.destroyed) continue
170
+    this._drained = this.push(data)
171
+  }
172
+
173
+  this._forwarding = false
174
+}
175
+
176
+Duplexify.prototype.destroy = function(err) {
177
+  if (this.destroyed) return
178
+  this.destroyed = true
179
+
180
+  var self = this
181
+  process.nextTick(function() {
182
+    self._destroy(err)
183
+  })
184
+}
185
+
186
+Duplexify.prototype._destroy = function(err) {
187
+  if (err) {
188
+    var ondrain = this._ondrain
189
+    this._ondrain = null
190
+    if (ondrain) ondrain(err)
191
+    else this.emit('error', err)
192
+  }
193
+
194
+  if (this._forwardDestroy) {
195
+    if (this._readable && this._readable.destroy) this._readable.destroy()
196
+    if (this._writable && this._writable.destroy) this._writable.destroy()
197
+  }
198
+
199
+  this.emit('close')
200
+}
201
+
202
+Duplexify.prototype._write = function(data, enc, cb) {
203
+  if (this.destroyed) return cb()
204
+  if (this._corked) return onuncork(this, this._write.bind(this, data, enc, cb))
205
+  if (data === SIGNAL_FLUSH) return this._finish(cb)
206
+  if (!this._writable) return cb()
207
+
208
+  if (this._writable.write(data) === false) this._ondrain = cb
209
+  else cb()
210
+}
211
+
212
+
213
+Duplexify.prototype._finish = function(cb) {
214
+  var self = this
215
+  this.emit('preend')
216
+  onuncork(this, function() {
217
+    end(self._forwardEnd && self._writable, function() {
218
+      // haxx to not emit prefinish twice
219
+      if (self._writableState.prefinished === false) self._writableState.prefinished = true
220
+      self.emit('prefinish')
221
+      onuncork(self, cb)
222
+    })
223
+  })
224
+}
225
+
226
+Duplexify.prototype.end = function(data, enc, cb) {
227
+  if (typeof data === 'function') return this.end(null, null, data)
228
+  if (typeof enc === 'function') return this.end(data, null, enc)
229
+  this._ended = true
230
+  if (data) this.write(data)
231
+  if (!this._writableState.ending) this.write(SIGNAL_FLUSH)
232
+  return stream.Writable.prototype.end.call(this, cb)
233
+}
234
+
235
+module.exports = Duplexify

+ 67 - 0
node_modules/duplexify/package.json View File

@@ -0,0 +1,67 @@
1
+{
2
+  "_from": "duplexify@^3.6.0",
3
+  "_id": "duplexify@3.6.0",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-fO3Di4tBKJpYTFHAxTU00BcfWMY9w24r/x21a6rZRbsD/ToUgGxsMbiGRmB7uVAXeGKXD9MwiLZa5E97EVgIRQ==",
6
+  "_location": "/duplexify",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "duplexify@^3.6.0",
12
+    "name": "duplexify",
13
+    "escapedName": "duplexify",
14
+    "rawSpec": "^3.6.0",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^3.6.0"
17
+  },
18
+  "_requiredBy": [
19
+    "/pumpify",
20
+    "/websocket-stream"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.6.0.tgz",
23
+  "_shasum": "592903f5d80b38d037220541264d69a198fb3410",
24
+  "_spec": "duplexify@^3.6.0",
25
+  "_where": "/var/wss/node_modules/pumpify",
26
+  "author": {
27
+    "name": "Mathias Buus"
28
+  },
29
+  "bugs": {
30
+    "url": "https://github.com/mafintosh/duplexify/issues"
31
+  },
32
+  "bundleDependencies": false,
33
+  "dependencies": {
34
+    "end-of-stream": "^1.0.0",
35
+    "inherits": "^2.0.1",
36
+    "readable-stream": "^2.0.0",
37
+    "stream-shift": "^1.0.0"
38
+  },
39
+  "deprecated": false,
40
+  "description": "Turn a writable and readable stream into a streams2 duplex stream with support for async initialization and streams1/streams2 input",
41
+  "devDependencies": {
42
+    "concat-stream": "^1.5.2",
43
+    "tape": "^4.0.0",
44
+    "through2": "^2.0.0"
45
+  },
46
+  "homepage": "https://github.com/mafintosh/duplexify",
47
+  "keywords": [
48
+    "duplex",
49
+    "streams2",
50
+    "streams",
51
+    "stream",
52
+    "writable",
53
+    "readable",
54
+    "async"
55
+  ],
56
+  "license": "MIT",
57
+  "main": "index.js",
58
+  "name": "duplexify",
59
+  "repository": {
60
+    "type": "git",
61
+    "url": "git://github.com/mafintosh/duplexify.git"
62
+  },
63
+  "scripts": {
64
+    "test": "tape test.js"
65
+  },
66
+  "version": "3.6.0"
67
+}

+ 291 - 0
node_modules/duplexify/test.js View File

@@ -0,0 +1,291 @@
1
+var tape = require('tape')
2
+var through = require('through2')
3
+var concat = require('concat-stream')
4
+var net = require('net')
5
+var duplexify = require('./')
6
+
7
+tape('passthrough', function(t) {
8
+  t.plan(2)
9
+
10
+  var pt = through()
11
+  var dup = duplexify(pt, pt)
12
+
13
+  dup.end('hello world')
14
+  dup.on('finish', function() {
15
+    t.ok(true, 'should finish')
16
+  })
17
+  dup.pipe(concat(function(data) {
18
+    t.same(data.toString(), 'hello world', 'same in as out')
19
+  }))
20
+})
21
+
22
+tape('passthrough + double end', function(t) {
23
+  t.plan(2)
24
+
25
+  var pt = through()
26
+  var dup = duplexify(pt, pt)
27
+
28
+  dup.end('hello world')
29
+  dup.end()
30
+
31
+  dup.on('finish', function() {
32
+    t.ok(true, 'should finish')
33
+  })
34
+  dup.pipe(concat(function(data) {
35
+    t.same(data.toString(), 'hello world', 'same in as out')
36
+  }))
37
+})
38
+
39
+tape('async passthrough + end', function(t) {
40
+  t.plan(2)
41
+
42
+  var pt = through.obj({highWaterMark:1}, function(data, enc, cb) {
43
+    setTimeout(function() {
44
+      cb(null, data)
45
+    }, 100)
46
+  })
47
+
48
+  var dup = duplexify(pt, pt)
49
+
50
+  dup.write('hello ')
51
+  dup.write('world')
52
+  dup.end()
53
+
54
+  dup.on('finish', function() {
55
+    t.ok(true, 'should finish')
56
+  })
57
+  dup.pipe(concat(function(data) {
58
+    t.same(data.toString(), 'hello world', 'same in as out')
59
+  }))
60
+})
61
+
62
+tape('duplex', function(t) {
63
+  var readExpected = ['read-a', 'read-b', 'read-c']
64
+  var writeExpected = ['write-a', 'write-b', 'write-c']
65
+
66
+  t.plan(readExpected.length+writeExpected.length+2)
67
+
68
+  var readable = through.obj()
69
+  var writable = through.obj(function(data, enc, cb) {
70
+    t.same(data, writeExpected.shift(), 'onwrite should match')
71
+    cb()
72
+  })
73
+
74
+  var dup = duplexify.obj(writable, readable)
75
+
76
+  readExpected.slice().forEach(function(data) {
77
+    readable.write(data)
78
+  })
79
+  readable.end()
80
+
81
+  writeExpected.slice().forEach(function(data) {
82
+    dup.write(data)
83
+  })
84
+  dup.end()
85
+
86
+  dup.on('data', function(data) {
87
+    t.same(data, readExpected.shift(), 'ondata should match')
88
+  })
89
+  dup.on('end', function() {
90
+    t.ok(true, 'should end')
91
+  })
92
+  dup.on('finish', function() {
93
+    t.ok(true, 'should finish')
94
+  })
95
+})
96
+
97
+tape('async', function(t) {
98
+  var dup = duplexify()
99
+  var pt = through()
100
+
101
+  dup.pipe(concat(function(data) {
102
+    t.same(data.toString(), 'i was async', 'same in as out')
103
+    t.end()
104
+  }))
105
+
106
+  dup.write('i')
107
+  dup.write(' was ')
108
+  dup.end('async')
109
+
110
+  setTimeout(function() {
111
+    dup.setWritable(pt)
112
+    setTimeout(function() {
113
+      dup.setReadable(pt)
114
+    }, 50)
115
+  }, 50)
116
+})
117
+
118
+tape('destroy', function(t) {
119
+  t.plan(2)
120
+
121
+  var write = through()
122
+  var read = through()
123
+  var dup = duplexify(write, read)
124
+
125
+  write.destroy = function() {
126
+    t.ok(true, 'write destroyed')
127
+  }
128
+
129
+  dup.on('close', function() {
130
+    t.ok(true, 'close emitted')
131
+  })
132
+
133
+  dup.destroy()
134
+  dup.destroy() // should only work once
135
+})
136
+
137
+tape('destroy both', function(t) {
138
+  t.plan(3)
139
+
140
+  var write = through()
141
+  var read = through()
142
+  var dup = duplexify(write, read)
143
+
144
+  write.destroy = function() {
145
+    t.ok(true, 'write destroyed')
146
+  }
147
+
148
+  read.destroy = function() {
149
+    t.ok(true, 'read destroyed')
150
+  }
151
+
152
+  dup.on('close', function() {
153
+    t.ok(true, 'close emitted')
154
+  })
155
+
156
+  dup.destroy()
157
+  dup.destroy() // should only work once
158
+})
159
+
160
+tape('bubble read errors', function(t) {
161
+  t.plan(2)
162
+
163
+  var write = through()
164
+  var read = through()
165
+  var dup = duplexify(write, read)
166
+
167
+  dup.on('error', function(err) {
168
+    t.same(err.message, 'read-error', 'received read error')
169
+  })
170
+  dup.on('close', function() {
171
+    t.ok(true, 'close emitted')
172
+  })
173
+
174
+  read.emit('error', new Error('read-error'))
175
+  write.emit('error', new Error('write-error')) // only emit first error
176
+})
177
+
178
+tape('bubble write errors', function(t) {
179
+  t.plan(2)
180
+
181
+  var write = through()
182
+  var read = through()
183
+  var dup = duplexify(write, read)
184
+
185
+  dup.on('error', function(err) {
186
+    t.same(err.message, 'write-error', 'received write error')
187
+  })
188
+  dup.on('close', function() {
189
+    t.ok(true, 'close emitted')
190
+  })
191
+
192
+  write.emit('error', new Error('write-error'))
193
+  read.emit('error', new Error('read-error')) // only emit first error
194
+})
195
+
196
+tape('reset writable / readable', function(t) {
197
+  t.plan(3)
198
+
199
+  var toUpperCase = function(data, enc, cb) {
200
+    cb(null, data.toString().toUpperCase())
201
+  }
202
+
203
+  var passthrough = through()
204
+  var upper = through(toUpperCase)
205
+  var dup = duplexify(passthrough, passthrough)
206
+
207
+  dup.once('data', function(data) {
208
+    t.same(data.toString(), 'hello')
209
+    dup.setWritable(upper)
210
+    dup.setReadable(upper)
211
+    dup.once('data', function(data) {
212
+      t.same(data.toString(), 'HELLO')
213
+      dup.once('data', function(data) {
214
+        t.same(data.toString(), 'HI')
215
+        t.end()
216
+      })
217
+    })
218
+    dup.write('hello')
219
+    dup.write('hi')
220
+  })
221
+  dup.write('hello')
222
+})
223
+
224
+tape('cork', function(t) {
225
+  var passthrough = through()
226
+  var dup = duplexify(passthrough, passthrough)
227
+  var ok = false
228
+
229
+  dup.on('prefinish', function() {
230
+    dup.cork()
231
+    setTimeout(function() {
232
+      ok = true
233
+      dup.uncork()
234
+    }, 100)
235
+  })
236
+  dup.on('finish', function() {
237
+    t.ok(ok)
238
+    t.end()
239
+  })
240
+  dup.end()
241
+})
242
+
243
+tape('prefinish not twice', function(t) {
244
+  var passthrough = through()
245
+  var dup = duplexify(passthrough, passthrough)
246
+  var prefinished = false
247
+
248
+  dup.on('prefinish', function() {
249
+    t.ok(!prefinished, 'only prefinish once')
250
+    prefinished = true
251
+  })
252
+
253
+  dup.on('finish', function() {
254
+    t.end()
255
+  })
256
+
257
+  dup.end()
258
+})
259
+
260
+tape('close', function(t) {
261
+  var passthrough = through()
262
+  var dup = duplexify(passthrough, passthrough)
263
+
264
+  passthrough.emit('close')
265
+  dup.on('close', function() {
266
+    t.ok(true, 'should forward close')
267
+    t.end()
268
+  })
269
+})
270
+
271
+tape('works with node native streams (net)', function(t) {
272
+  t.plan(1)
273
+
274
+  var server = net.createServer(function(socket) {
275
+    var dup = duplexify(socket, socket)
276
+
277
+    dup.once('data', function(chunk) {
278
+      t.same(chunk, Buffer('hello world'))
279
+      server.close()
280
+      socket.end()
281
+      t.end()
282
+    })
283
+  })
284
+
285
+  server.listen(0, function () {
286
+    var socket = net.connect(server.address().port)
287
+    var dup = duplexify(socket, socket)
288
+
289
+    dup.write(Buffer('hello world'))
290
+  })
291
+})

+ 1 - 0
node_modules/encoding/.npmignore View File

@@ -0,0 +1 @@
1
+node_modules

+ 25 - 0
node_modules/encoding/.travis.yml View File

@@ -0,0 +1,25 @@
1
+language: node_js
2
+sudo: false
3
+node_js:
4
+  - "0.10"
5
+  - 0.12
6
+  - iojs
7
+  - 4
8
+  - 5
9
+env:
10
+  - CXX=g++-4.8
11
+addons:
12
+  apt:
13
+    sources:
14
+      - ubuntu-toolchain-r-test
15
+    packages:
16
+      - g++-4.8
17
+notifications:
18
+  email:
19
+    - andris@kreata.ee
20
+  webhooks:
21
+    urls:
22
+      - https://webhooks.gitter.im/e/0ed18fd9b3e529b3c2cc
23
+    on_success: change  # options: [always|never|change] default: always
24
+    on_failure: always  # options: [always|never|change] default: always
25
+    on_start: false     # default: false

+ 16 - 0
node_modules/encoding/LICENSE View File

@@ -0,0 +1,16 @@
1
+Copyright (c) 2012-2014 Andris Reinman
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 SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
11
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
12
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
13
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
14
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
15
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
16
+SOFTWARE.

+ 52 - 0
node_modules/encoding/README.md View File

@@ -0,0 +1,52 @@
1
+# Encoding
2
+
3
+**encoding** is a simple wrapper around [node-iconv](https://github.com/bnoordhuis/node-iconv) and [iconv-lite](https://github.com/ashtuchkin/iconv-lite/) to convert strings from one encoding to another. If node-iconv is not available for some reason,
4
+iconv-lite will be used instead of it as a fallback.
5
+
6
+[![Build Status](https://secure.travis-ci.org/andris9/encoding.svg)](http://travis-ci.org/andris9/Nodemailer)
7
+[![npm version](https://badge.fury.io/js/encoding.svg)](http://badge.fury.io/js/encoding)
8
+
9
+## Install
10
+
11
+Install through npm
12
+
13
+    npm install encoding
14
+
15
+## Usage
16
+
17
+Require the module
18
+
19
+    var encoding = require("encoding");
20
+
21
+Convert with encoding.convert()
22
+
23
+    var resultBuffer = encoding.convert(text, toCharset, fromCharset);
24
+
25
+Where
26
+
27
+  * **text** is either a Buffer or a String to be converted
28
+  * **toCharset** is the characterset to convert the string
29
+  * **fromCharset** (*optional*, defaults to UTF-8) is the source charset
30
+
31
+Output of the conversion is always a Buffer object.
32
+
33
+Example
34
+
35
+    var result = encoding.convert("ÕÄÖÜ", "Latin_1");
36
+    console.log(result); //<Buffer d5 c4 d6 dc>
37
+
38
+## iconv support
39
+
40
+By default only iconv-lite is bundled. If you need node-iconv support, you need to add it
41
+as an additional dependency for your project:
42
+
43
+    ...,
44
+    "dependencies":{
45
+        "encoding": "*",
46
+        "iconv": "*"
47
+    },
48
+    ...
49
+
50
+## License
51
+
52
+**MIT**

+ 113 - 0
node_modules/encoding/lib/encoding.js View File

@@ -0,0 +1,113 @@
1
+'use strict';
2
+
3
+var iconvLite = require('iconv-lite');
4
+// Load Iconv from an external file to be able to disable Iconv for webpack
5
+// Add /\/iconv-loader$/ to webpack.IgnorePlugin to ignore it
6
+var Iconv = require('./iconv-loader');
7
+
8
+// Expose to the world
9
+module.exports.convert = convert;
10
+
11
+/**
12
+ * Convert encoding of an UTF-8 string or a buffer
13
+ *
14
+ * @param {String|Buffer} str String to be converted
15
+ * @param {String} to Encoding to be converted to
16
+ * @param {String} [from='UTF-8'] Encoding to be converted from
17
+ * @param {Boolean} useLite If set to ture, force to use iconvLite
18
+ * @return {Buffer} Encoded string
19
+ */
20
+function convert(str, to, from, useLite) {
21
+    from = checkEncoding(from || 'UTF-8');
22
+    to = checkEncoding(to || 'UTF-8');
23
+    str = str || '';
24
+
25
+    var result;
26
+
27
+    if (from !== 'UTF-8' && typeof str === 'string') {
28
+        str = new Buffer(str, 'binary');
29
+    }
30
+
31
+    if (from === to) {
32
+        if (typeof str === 'string') {
33
+            result = new Buffer(str);
34
+        } else {
35
+            result = str;
36
+        }
37
+    } else if (Iconv && !useLite) {
38
+        try {
39
+            result = convertIconv(str, to, from);
40
+        } catch (E) {
41
+            console.error(E);
42
+            try {
43
+                result = convertIconvLite(str, to, from);
44
+            } catch (E) {
45
+                console.error(E);
46
+                result = str;
47
+            }
48
+        }
49
+    } else {
50
+        try {
51
+            result = convertIconvLite(str, to, from);
52
+        } catch (E) {
53
+            console.error(E);
54
+            result = str;
55
+        }
56
+    }
57
+
58
+
59
+    if (typeof result === 'string') {
60
+        result = new Buffer(result, 'utf-8');
61
+    }
62
+
63
+    return result;
64
+}
65
+
66
+/**
67
+ * Convert encoding of a string with node-iconv (if available)
68
+ *
69
+ * @param {String|Buffer} str String to be converted
70
+ * @param {String} to Encoding to be converted to
71
+ * @param {String} [from='UTF-8'] Encoding to be converted from
72
+ * @return {Buffer} Encoded string
73
+ */
74
+function convertIconv(str, to, from) {
75
+    var response, iconv;
76
+    iconv = new Iconv(from, to + '//TRANSLIT//IGNORE');
77
+    response = iconv.convert(str);
78
+    return response.slice(0, response.length);
79
+}
80
+
81
+/**
82
+ * Convert encoding of astring with iconv-lite
83
+ *
84
+ * @param {String|Buffer} str String to be converted
85
+ * @param {String} to Encoding to be converted to
86
+ * @param {String} [from='UTF-8'] Encoding to be converted from
87
+ * @return {Buffer} Encoded string
88
+ */
89
+function convertIconvLite(str, to, from) {
90
+    if (to === 'UTF-8') {
91
+        return iconvLite.decode(str, from);
92
+    } else if (from === 'UTF-8') {
93
+        return iconvLite.encode(str, to);
94
+    } else {
95
+        return iconvLite.encode(iconvLite.decode(str, from), to);
96
+    }
97
+}
98
+
99
+/**
100
+ * Converts charset name if needed
101
+ *
102
+ * @param {String} name Character set
103
+ * @return {String} Character set name
104
+ */
105
+function checkEncoding(name) {
106
+    return (name || '').toString().trim().
107
+    replace(/^latin[\-_]?(\d+)$/i, 'ISO-8859-$1').
108
+    replace(/^win(?:dows)?[\-_]?(\d+)$/i, 'WINDOWS-$1').
109
+    replace(/^utf[\-_]?(\d+)$/i, 'UTF-$1').
110
+    replace(/^ks_c_5601\-1987$/i, 'CP949').
111
+    replace(/^us[\-_]?ascii$/i, 'ASCII').
112
+    toUpperCase();
113
+}

+ 14 - 0
node_modules/encoding/lib/iconv-loader.js View File

@@ -0,0 +1,14 @@
1
+'use strict';
2
+
3
+var iconv_package;
4
+var Iconv;
5
+
6
+try {
7
+    // this is to fool browserify so it doesn't try (in vain) to install iconv.
8
+    iconv_package = 'iconv';
9
+    Iconv = require(iconv_package).Iconv;
10
+} catch (E) {
11
+    // node-iconv not present
12
+}
13
+
14
+module.exports = Iconv;

+ 54 - 0
node_modules/encoding/package.json View File

@@ -0,0 +1,54 @@
1
+{
2
+  "_from": "encoding",
3
+  "_id": "encoding@0.1.12",
4
+  "_inBundle": false,
5
+  "_integrity": "sha1-U4tm8+5izRq1HsMjgp0flIDHS+s=",
6
+  "_location": "/encoding",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "tag",
10
+    "registry": true,
11
+    "raw": "encoding",
12
+    "name": "encoding",
13
+    "escapedName": "encoding",
14
+    "rawSpec": "",
15
+    "saveSpec": null,
16
+    "fetchSpec": "latest"
17
+  },
18
+  "_requiredBy": [
19
+    "#USER",
20
+    "/"
21
+  ],
22
+  "_resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.12.tgz",
23
+  "_shasum": "538b66f3ee62cd1ab51ec323829d1f9480c74beb",
24
+  "_spec": "encoding",
25
+  "_where": "/var/wss",
26
+  "author": {
27
+    "name": "Andris Reinman"
28
+  },
29
+  "bugs": {
30
+    "url": "https://github.com/andris9/encoding/issues"
31
+  },
32
+  "bundleDependencies": false,
33
+  "dependencies": {
34
+    "iconv-lite": "~0.4.13"
35
+  },
36
+  "deprecated": false,
37
+  "description": "Convert encodings, uses iconv by default and fallbacks to iconv-lite if needed",
38
+  "devDependencies": {
39
+    "iconv": "~2.1.11",
40
+    "nodeunit": "~0.9.1"
41
+  },
42
+  "homepage": "https://github.com/andris9/encoding#readme",
43
+  "license": "MIT",
44
+  "main": "lib/encoding.js",
45
+  "name": "encoding",
46
+  "repository": {
47
+    "type": "git",
48
+    "url": "git+https://github.com/andris9/encoding.git"
49
+  },
50
+  "scripts": {
51
+    "test": "nodeunit test"
52
+  },
53
+  "version": "0.1.12"
54
+}

+ 75 - 0
node_modules/encoding/test/test.js View File

@@ -0,0 +1,75 @@
1
+'use strict';
2
+
3
+var Iconv = require('../lib/iconv-loader');
4
+var encoding = require('../lib/encoding');
5
+
6
+exports['General tests'] = {
7
+
8
+    'Iconv is available': function (test) {
9
+        test.ok(Iconv);
10
+        test.done();
11
+    },
12
+
13
+    'From UTF-8 to Latin_1 with Iconv': function (test) {
14
+        var input = 'ÕÄÖÜ',
15
+            expected = new Buffer([0xd5, 0xc4, 0xd6, 0xdc]);
16
+        test.deepEqual(encoding.convert(input, 'latin1'), expected);
17
+        test.done();
18
+    },
19
+
20
+    'From Latin_1 to UTF-8 with Iconv': function (test) {
21
+        var input = new Buffer([0xd5, 0xc4, 0xd6, 0xdc]),
22
+            expected = 'ÕÄÖÜ';
23
+        test.deepEqual(encoding.convert(input, 'utf-8', 'latin1').toString(), expected);
24
+        test.done();
25
+    },
26
+
27
+    'From UTF-8 to UTF-8 with Iconv': function (test) {
28
+        var input = 'ÕÄÖÜ',
29
+            expected = new Buffer('ÕÄÖÜ');
30
+        test.deepEqual(encoding.convert(input, 'utf-8', 'utf-8'), expected);
31
+        test.done();
32
+    },
33
+
34
+    'From Latin_13 to Latin_15 with Iconv': function (test) {
35
+        var input = new Buffer([0xd5, 0xc4, 0xd6, 0xdc, 0xd0]),
36
+            expected = new Buffer([0xd5, 0xc4, 0xd6, 0xdc, 0xA6]);
37
+        test.deepEqual(encoding.convert(input, 'latin_15', 'latin13'), expected);
38
+        test.done();
39
+    },
40
+
41
+    'From ISO-2022-JP to UTF-8 with Iconv': function (test) {
42
+        var input = new Buffer('GyRCM1g5OzU7PVEwdzgmPSQ4IUYkMnFKczlwGyhC', 'base64'),
43
+            expected = new Buffer('5a2m5qCh5oqA6KGT5ZOh56CU5L+u5qSc6KiO5Lya5aCx5ZGK', 'base64');
44
+        test.deepEqual(encoding.convert(input, 'utf-8', 'ISO-2022-JP'), expected);
45
+        test.done();
46
+    },
47
+
48
+    'From UTF-8 to Latin_1 with iconv-lite': function (test) {
49
+        var input = 'ÕÄÖÜ',
50
+            expected = new Buffer([0xd5, 0xc4, 0xd6, 0xdc]);
51
+        test.deepEqual(encoding.convert(input, 'latin1', false, true), expected);
52
+        test.done();
53
+    },
54
+
55
+    'From Latin_1 to UTF-8 with iconv-lite': function (test) {
56
+        var input = new Buffer([0xd5, 0xc4, 0xd6, 0xdc]),
57
+            expected = 'ÕÄÖÜ';
58
+        test.deepEqual(encoding.convert(input, 'utf-8', 'latin1', true).toString(), expected);
59
+        test.done();
60
+    },
61
+
62
+    'From UTF-8 to UTF-8 with iconv-lite': function (test) {
63
+        var input = 'ÕÄÖÜ',
64
+            expected = new Buffer('ÕÄÖÜ');
65
+        test.deepEqual(encoding.convert(input, 'utf-8', 'utf-8', true), expected);
66
+        test.done();
67
+    },
68
+
69
+    'From Latin_13 to Latin_15 with iconv-lite': function (test) {
70
+        var input = new Buffer([0xd5, 0xc4, 0xd6, 0xdc, 0xd0]),
71
+            expected = new Buffer([0xd5, 0xc4, 0xd6, 0xdc, 0xA6]);
72
+        test.deepEqual(encoding.convert(input, 'latin_15', 'latin13', true), expected);
73
+        test.done();
74
+    }
75
+};

+ 21 - 0
node_modules/end-of-stream/LICENSE View File

@@ -0,0 +1,21 @@
1
+The MIT License (MIT)
2
+
3
+Copyright (c) 2014 Mathias Buus
4
+
5
+Permission is hereby granted, free of charge, to any person obtaining a copy
6
+of this software and associated documentation files (the "Software"), to deal
7
+in the Software without restriction, including without limitation the rights
8
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+copies of the Software, and to permit persons to whom the Software is
10
+furnished to do so, subject to the following conditions:
11
+
12
+The above copyright notice and this permission notice shall be included in
13
+all copies or substantial portions of the Software.
14
+
15
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+THE SOFTWARE.

+ 52 - 0
node_modules/end-of-stream/README.md View File

@@ -0,0 +1,52 @@
1
+# end-of-stream
2
+
3
+A node module that calls a callback when a readable/writable/duplex stream has completed or failed.
4
+
5
+	npm install end-of-stream
6
+
7
+## Usage
8
+
9
+Simply pass a stream and a callback to the `eos`.
10
+Both legacy streams, streams2 and stream3 are supported.
11
+
12
+``` js
13
+var eos = require('end-of-stream');
14
+
15
+eos(readableStream, function(err) {
16
+  // this will be set to the stream instance
17
+	if (err) return console.log('stream had an error or closed early');
18
+	console.log('stream has ended', this === readableStream);
19
+});
20
+
21
+eos(writableStream, function(err) {
22
+	if (err) return console.log('stream had an error or closed early');
23
+	console.log('stream has finished', this === writableStream);
24
+});
25
+
26
+eos(duplexStream, function(err) {
27
+	if (err) return console.log('stream had an error or closed early');
28
+	console.log('stream has ended and finished', this === duplexStream);
29
+});
30
+
31
+eos(duplexStream, {readable:false}, function(err) {
32
+	if (err) return console.log('stream had an error or closed early');
33
+	console.log('stream has finished but might still be readable');
34
+});
35
+
36
+eos(duplexStream, {writable:false}, function(err) {
37
+	if (err) return console.log('stream had an error or closed early');
38
+	console.log('stream has ended but might still be writable');
39
+});
40
+
41
+eos(readableStream, {error:false}, function(err) {
42
+	// do not treat emit('error', err) as a end-of-stream
43
+});
44
+```
45
+
46
+## License
47
+
48
+MIT
49
+
50
+## Related
51
+
52
+`end-of-stream` is part of the [mississippi stream utility collection](https://github.com/maxogden/mississippi) which includes more useful stream modules similar to this one.

+ 87 - 0
node_modules/end-of-stream/index.js View File

@@ -0,0 +1,87 @@
1
+var once = require('once');
2
+
3
+var noop = function() {};
4
+
5
+var isRequest = function(stream) {
6
+	return stream.setHeader && typeof stream.abort === 'function';
7
+};
8
+
9
+var isChildProcess = function(stream) {
10
+	return stream.stdio && Array.isArray(stream.stdio) && stream.stdio.length === 3
11
+};
12
+
13
+var eos = function(stream, opts, callback) {
14
+	if (typeof opts === 'function') return eos(stream, null, opts);
15
+	if (!opts) opts = {};
16
+
17
+	callback = once(callback || noop);
18
+
19
+	var ws = stream._writableState;
20
+	var rs = stream._readableState;
21
+	var readable = opts.readable || (opts.readable !== false && stream.readable);
22
+	var writable = opts.writable || (opts.writable !== false && stream.writable);
23
+
24
+	var onlegacyfinish = function() {
25
+		if (!stream.writable) onfinish();
26
+	};
27
+
28
+	var onfinish = function() {
29
+		writable = false;
30
+		if (!readable) callback.call(stream);
31
+	};
32
+
33
+	var onend = function() {
34
+		readable = false;
35
+		if (!writable) callback.call(stream);
36
+	};
37
+
38
+	var onexit = function(exitCode) {
39
+		callback.call(stream, exitCode ? new Error('exited with error code: ' + exitCode) : null);
40
+	};
41
+
42
+	var onerror = function(err) {
43
+		callback.call(stream, err);
44
+	};
45
+
46
+	var onclose = function() {
47
+		if (readable && !(rs && rs.ended)) return callback.call(stream, new Error('premature close'));
48
+		if (writable && !(ws && ws.ended)) return callback.call(stream, new Error('premature close'));
49
+	};
50
+
51
+	var onrequest = function() {
52
+		stream.req.on('finish', onfinish);
53
+	};
54
+
55
+	if (isRequest(stream)) {
56
+		stream.on('complete', onfinish);
57
+		stream.on('abort', onclose);
58
+		if (stream.req) onrequest();
59
+		else stream.on('request', onrequest);
60
+	} else if (writable && !ws) { // legacy streams
61
+		stream.on('end', onlegacyfinish);
62
+		stream.on('close', onlegacyfinish);
63
+	}
64
+
65
+	if (isChildProcess(stream)) stream.on('exit', onexit);
66
+
67
+	stream.on('end', onend);
68
+	stream.on('finish', onfinish);
69
+	if (opts.error !== false) stream.on('error', onerror);
70
+	stream.on('close', onclose);
71
+
72
+	return function() {
73
+		stream.removeListener('complete', onfinish);
74
+		stream.removeListener('abort', onclose);
75
+		stream.removeListener('request', onrequest);
76
+		if (stream.req) stream.req.removeListener('finish', onfinish);
77
+		stream.removeListener('end', onlegacyfinish);
78
+		stream.removeListener('close', onlegacyfinish);
79
+		stream.removeListener('finish', onfinish);
80
+		stream.removeListener('exit', onexit);
81
+		stream.removeListener('end', onend);
82
+		stream.removeListener('error', onerror);
83
+		stream.removeListener('close', onclose);
84
+	};
85
+};
86
+
87
+module.exports = eos;

+ 65 - 0
node_modules/end-of-stream/package.json View File

@@ -0,0 +1,65 @@
1
+{
2
+  "_from": "end-of-stream@^1.4.1",
3
+  "_id": "end-of-stream@1.4.1",
4
+  "_inBundle": false,
5
+  "_integrity": "sha512-1MkrZNvWTKCaigbn+W15elq2BB/L22nqrSY5DKlo3X6+vclJm8Bb5djXJBmEX6fS3+zCh/F4VBK5Z2KxJt4s2Q==",
6
+  "_location": "/end-of-stream",
7
+  "_phantomChildren": {},
8
+  "_requested": {
9
+    "type": "range",
10
+    "registry": true,
11
+    "raw": "end-of-stream@^1.4.1",
12
+    "name": "end-of-stream",
13
+    "escapedName": "end-of-stream",
14
+    "rawSpec": "^1.4.1",
15
+    "saveSpec": null,
16
+    "fetchSpec": "^1.4.1"
17
+  },
18
+  "_requiredBy": [
19
+    "/duplexify",
20
+    "/mqtt",
21
+    "/pump",
22
+    "/pumpify/pump"
23
+  ],
24
+  "_resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.1.tgz",
25
+  "_shasum": "ed29634d19baba463b6ce6b80a37213eab71ec43",
26
+  "_spec": "end-of-stream@^1.4.1",
27
+  "_where": "/var/wss/node_modules/mqtt",
28
+  "author": {
29
+    "name": "Mathias Buus",
30
+    "email": "mathiasbuus@gmail.com"
31
+  },
32
+  "bugs": {
33
+    "url": "https://github.com/mafintosh/end-of-stream/issues"
34
+  },
35
+  "bundleDependencies": false,
36
+  "dependencies": {
37
+    "once": "^1.4.0"
38
+  },
39
+  "deprecated": false,
40
+  "description": "Call a callback when a readable/writable/duplex stream has completed or failed.",
41
+  "files": [
42
+    "index.js"
43
+  ],
44
+  "homepage": "https://github.com/mafintosh/end-of-stream",
45
+  "keywords": [
46
+    "stream",
47
+    "streams",
48
+    "callback",
49
+    "finish",
50
+    "close",
51
+    "end",
52
+    "wait"
53
+  ],
54
+  "license": "MIT",
55
+  "main": "index.js",
56
+  "name": "end-of-stream",
57
+  "repository": {
58
+    "type": "git",
59
+    "url": "git://github.com/mafintosh/end-of-stream.git"
60
+  },
61
+  "scripts": {
62
+    "test": "node test.js"
63
+  },
64
+  "version": "1.4.1"
65
+}

+ 17 - 0
node_modules/extend/.eslintrc View File

@@ -0,0 +1,17 @@
1
+{
2
+	"root": true,
3
+
4
+	"extends": "@ljharb",
5
+
6
+	"rules": {
7
+		"complexity": [2, 15],
8
+		"eqeqeq": [2, "allow-null"],
9
+		"func-name-matching": [1],
10
+		"max-depth": [1, 4],
11
+		"max-statements": [2, 26],
12
+		"no-extra-parens": [1],
13
+		"no-magic-numbers": [0],
14
+		"no-restricted-syntax": [2, "BreakStatement", "ContinueStatement", "DebuggerStatement", "LabeledStatement", "WithStatement"],
15
+		"sort-keys": [0],
16
+	}
17
+}

+ 175 - 0
node_modules/extend/.jscs.json View File

@@ -0,0 +1,175 @@
1
+{
2
+	"es3": true,
3
+
4
+	"additionalRules": [],
5
+
6
+	"requireSemicolons": true,
7
+
8
+	"disallowMultipleSpaces": true,
9
+
10
+	"disallowIdentifierNames": [],
11
+
12
+	"requireCurlyBraces": {
13
+		"allExcept": [],
14
+		"keywords": ["if", "else", "for", "while", "do", "try", "catch"]
15
+	},
16
+
17
+	"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch", "function"],
18
+
19
+	"disallowSpaceAfterKeywords": [],
20
+
21
+	"disallowSpaceBeforeComma": true,
22
+	"disallowSpaceAfterComma": false,
23
+	"disallowSpaceBeforeSemicolon": true,
24
+
25
+	"disallowNodeTypes": [
26
+		"DebuggerStatement",
27
+		"LabeledStatement",
28
+		"SwitchCase",
29
+		"SwitchStatement",
30
+		"WithStatement"
31
+	],
32
+
33
+	"requireObjectKeysOnNewLine": { "allExcept": ["sameLine"] },
34
+
35
+	"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningRoundBrace": true, "beforeOpeningCurlyBrace": true },
36
+	"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
37
+	"disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true },
38
+	"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
39
+	"disallowSpacesInFunctionDeclaration": { "beforeOpeningRoundBrace": true },
40
+
41
+	"requireSpaceBetweenArguments": true,
42
+
43
+	"disallowSpacesInsideParentheses": true,
44
+
45
+	"disallowSpacesInsideArrayBrackets": true,
46
+
47
+	"disallowQuotedKeysInObjects": { "allExcept": ["reserved"] },
48
+
49
+	"disallowSpaceAfterObjectKeys": true,
50
+
51
+	"requireCommaBeforeLineBreak": true,
52
+
53
+	"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
54
+	"requireSpaceAfterPrefixUnaryOperators": [],
55
+
56
+	"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
57
+	"requireSpaceBeforePostfixUnaryOperators": [],
58
+
59
+	"disallowSpaceBeforeBinaryOperators": [],
60
+	"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
61
+
62
+	"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
63
+	"disallowSpaceAfterBinaryOperators": [],
64
+
65
+	"disallowImplicitTypeConversion": ["binary", "string"],
66
+
67
+	"disallowKeywords": ["with", "eval"],
68
+
69
+	"requireKeywordsOnNewLine": [],
70
+	"disallowKeywordsOnNewLine": ["else"],
71
+
72
+	"requireLineFeedAtFileEnd": true,
73
+
74
+	"disallowTrailingWhitespace": true,
75
+
76
+	"disallowTrailingComma": true,
77
+
78
+	"excludeFiles": ["node_modules/**", "vendor/**"],
79
+
80
+	"disallowMultipleLineStrings": true,
81
+
82
+	"requireDotNotation": { "allExcept": ["keywords"] },
83
+
84
+	"requireParenthesesAroundIIFE": true,
85
+
86
+	"validateLineBreaks": "LF",
87
+
88
+	"validateQuoteMarks": {
89
+		"escape": true,
90
+		"mark": "'"
91
+	},
92
+
93
+	"disallowOperatorBeforeLineBreak": [],
94
+
95
+	"requireSpaceBeforeKeywords": [
96
+		"do",
97
+		"for",
98
+		"if",
99
+		"else",
100
+		"switch",
101
+		"case",
102
+		"try",
103
+		"catch",
104
+		"finally",
105
+		"while",
106
+		"with",
107
+		"return"
108
+	],
109
+
110
+	"validateAlignedFunctionParameters": {
111
+		"lineBreakAfterOpeningBraces": true,
112
+		"lineBreakBeforeClosingBraces": true
113
+	},
114
+
115
+	"requirePaddingNewLinesBeforeExport": true,
116
+
117
+	"validateNewlineAfterArrayElements": {
118
+		"maximum": 6
119
+	},
120
+
121
+	"requirePaddingNewLinesAfterUseStrict": true,
122
+
123
+	"disallowArrowFunctions": true,
124
+
125
+	"disallowMultiLineTernary": true,
126
+
127
+	"validateOrderInObjectKeys": false,
128
+
129
+	"disallowIdenticalDestructuringNames": true,
130
+
131
+	"disallowNestedTernaries": { "maxLevel": 1 },
132
+
133
+	"requireSpaceAfterComma": { "allExcept": ["trailing"] },
134
+	"requireAlignedMultilineParams": false,
135
+
136
+	"requireSpacesInGenerator": {
137
+		"afterStar": true
138
+	},
139
+
140
+	"disallowSpacesInGenerator": {
141
+		"beforeStar": true
142
+	},
143
+
144
+	"disallowVar": false,
145
+
146
+	"requireArrayDestructuring": false,
147
+
148
+	"requireEnhancedObjectLiterals": false,
149
+
150
+	"requireObjectDestructuring": false,
151
+
152
+	"requireEarlyReturn": false,
153
+
154
+	"requireCapitalizedConstructorsNew": {
155
+		"allExcept": ["Function", "String", "Object", "Symbol", "Number", "Date", "RegExp", "Error", "Boolean", "Array"]
156
+	},
157
+
158
+	"requireImportAlphabetized": false,
159
+
160
+    "requireSpaceBeforeObjectValues": true,
161
+    "requireSpaceBeforeDestructuredValues": true,
162
+
163
+	"disallowSpacesInsideTemplateStringPlaceholders": true,
164
+
165
+    "disallowArrayDestructuringReturn": false,
166
+
167
+    "requireNewlineBeforeSingleStatementsInIf": false,
168
+
169
+	"disallowUnusedVariables": true,
170
+
171
+	"requireSpacesInsideImportedObjectBraces": true,
172
+
173
+	"requireUseStrict": true
174
+}
175
+

+ 1 - 0
node_modules/extend/.npmignore View File

@@ -0,0 +1 @@
1
+test

+ 179 - 0
node_modules/extend/.travis.yml View File

@@ -0,0 +1,179 @@
1
+language: node_js
2
+os:
3
+ - linux
4
+node_js:
5
+  - "7.9"
6
+  - "6.10"
7
+  - "5.12"
8
+  - "4.8"
9
+  - "iojs-v3.3"
10
+  - "iojs-v2.5"
11
+  - "iojs-v1.8"
12
+  - "0.12"
13
+  - "0.10"
14
+  - "0.8"
15
+before_install:
16
+  - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then npm install -g npm@1.3 ; elif [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then case "$(npm --version)" in 1.*) npm install -g npm@1.4.28 ;; 2.*) npm install -g npm@2 ;; esac ; fi'
17
+  - 'if [ "${TRAVIS_NODE_VERSION}" != "0.6" ] && [ "${TRAVIS_NODE_VERSION}" != "0.9" ]; then npm install -g npm; fi'
18
+install:
19
+  - 'if [ "${TRAVIS_NODE_VERSION}" = "0.6" ]; then nvm install 0.8 && npm install -g npm@1.3 && npm install -g npm@1.4.28 && npm install -g npm@2 && npm install && nvm use "${TRAVIS_NODE_VERSION}"; else npm install; fi;'
20
+script:
21
+  - 'if [ -n "${PRETEST-}" ]; then npm run pretest ; fi'
22
+  - 'if [ -n "${POSTTEST-}" ]; then npm run posttest ; fi'
23
+  - 'if [ -n "${COVERAGE-}" ]; then npm run coverage ; fi'
24
+  - 'if [ -n "${TEST-}" ]; then npm run tests-only ; fi'
25
+sudo: false
26
+env:
27
+  - TEST=true
28
+matrix:
29
+  fast_finish: true
30
+  include:
31
+    - node_js: "node"
32
+      env: PRETEST=true
33
+    - node_js: "node"
34
+      env: COVERAGE=true
35
+    - node_js: "7.8"
36
+      env: TEST=true ALLOW_FAILURE=true
37
+    - node_js: "7.7"
38
+      env: TEST=true ALLOW_FAILURE=true
39
+    - node_js: "7.6"
40
+      env: TEST=true ALLOW_FAILURE=true
41
+    - node_js: "7.5"
42
+      env: TEST=true ALLOW_FAILURE=true
43
+    - node_js: "7.4"
44
+      env: TEST=true ALLOW_FAILURE=true
45
+    - node_js: "7.3"
46
+      env: TEST=true ALLOW_FAILURE=true
47
+    - node_js: "7.2"
48
+      env: TEST=true ALLOW_FAILURE=true
49
+    - node_js: "7.1"
50
+      env: TEST=true ALLOW_FAILURE=true
51
+    - node_js: "7.0"
52
+      env: TEST=true ALLOW_FAILURE=true
53
+    - node_js: "6.9"
54
+      env: TEST=true ALLOW_FAILURE=true
55
+    - node_js: "6.8"
56
+      env: TEST=true ALLOW_FAILURE=true
57
+    - node_js: "6.7"
58
+      env: TEST=true ALLOW_FAILURE=true
59
+    - node_js: "6.6"
60
+      env: TEST=true ALLOW_FAILURE=true
61
+    - node_js: "6.5"
62
+      env: TEST=true ALLOW_FAILURE=true
63
+    - node_js: "6.4"
64
+      env: TEST=true ALLOW_FAILURE=true
65
+    - node_js: "6.3"
66
+      env: TEST=true ALLOW_FAILURE=true
67
+    - node_js: "6.2"
68
+      env: TEST=true ALLOW_FAILURE=true
69
+    - node_js: "6.1"
70
+      env: TEST=true ALLOW_FAILURE=true
71
+    - node_js: "6.0"
72
+      env: TEST=true ALLOW_FAILURE=true
73
+    - node_js: "5.11"
74
+      env: TEST=true ALLOW_FAILURE=true
75
+    - node_js: "5.10"
76
+      env: TEST=true ALLOW_FAILURE=true
77
+    - node_js: "5.9"
78
+      env: TEST=true ALLOW_FAILURE=true
79
+    - node_js: "5.8"
80
+      env: TEST=true ALLOW_FAILURE=true
81
+    - node_js: "5.7"
82
+      env: TEST=true ALLOW_FAILURE=true
83
+    - node_js: "5.6"
84
+      env: TEST=true ALLOW_FAILURE=true
85
+    - node_js: "5.5"
86
+      env: TEST=true ALLOW_FAILURE=true
87
+    - node_js: "5.4"
88
+      env: TEST=true ALLOW_FAILURE=true
89
+    - node_js: "5.3"
90
+      env: TEST=true ALLOW_FAILURE=true
91
+    - node_js: "5.2"
92
+      env: TEST=true ALLOW_FAILURE=true
93
+    - node_js: "5.1"
94
+      env: TEST=true ALLOW_FAILURE=true
95
+    - node_js: "5.0"
96
+      env: TEST=true ALLOW_FAILURE=true
97
+    - node_js: "4.7"
98
+      env: TEST=true ALLOW_FAILURE=true
99
+    - node_js: "4.6"
100
+      env: TEST=true ALLOW_FAILURE=true
101
+    - node_js: "4.5"
102
+      env: TEST=true ALLOW_FAILURE=true
103
+    - node_js: "4.4"
104
+      env: TEST=true ALLOW_FAILURE=true
105
+    - node_js: "4.3"
106
+      env: TEST=true ALLOW_FAILURE=true
107
+    - node_js: "4.2"
108
+      env: TEST=true ALLOW_FAILURE=true
109
+    - node_js: "4.1"
110
+      env: TEST=true ALLOW_FAILURE=true
111
+    - node_js: "4.0"
112
+      env: TEST=true ALLOW_FAILURE=true
113
+    - node_js: "iojs-v3.2"
114
+      env: TEST=true ALLOW_FAILURE=true
115
+    - node_js: "iojs-v3.1"
116
+      env: TEST=true ALLOW_FAILURE=true
117
+    - node_js: "iojs-v3.0"
118
+      env: TEST=true ALLOW_FAILURE=true
119
+    - node_js: "iojs-v2.4"
120
+      env: TEST=true ALLOW_FAILURE=true
121
+    - node_js: "iojs-v2.3"
122
+      env: TEST=true ALLOW_FAILURE=true
123
+    - node_js: "iojs-v2.2"
124
+      env: TEST=true ALLOW_FAILURE=true
125
+    - node_js: "iojs-v2.1"
126
+      env: TEST=true ALLOW_FAILURE=true
127
+    - node_js: "iojs-v2.0"
128
+      env: TEST=true ALLOW_FAILURE=true
129
+    - node_js: "iojs-v1.7"
130
+      env: TEST=true ALLOW_FAILURE=true
131
+    - node_js: "iojs-v1.6"
132
+      env: TEST=true ALLOW_FAILURE=true
133
+    - node_js: "iojs-v1.5"
134
+      env: TEST=true ALLOW_FAILURE=true
135
+    - node_js: "iojs-v1.4"
136
+      env: TEST=true ALLOW_FAILURE=true
137
+    - node_js: "iojs-v1.3"
138
+      env: TEST=true ALLOW_FAILURE=true
139
+    - node_js: "iojs-v1.2"
140
+      env: TEST=true ALLOW_FAILURE=true
141
+    - node_js: "iojs-v1.1"
142
+      env: TEST=true ALLOW_FAILURE=true
143
+    - node_js: "iojs-v1.0"
144
+      env: TEST=true ALLOW_FAILURE=true
145
+    - node_js: "0.11"
146
+      env: TEST=true ALLOW_FAILURE=true
147
+    - node_js: "0.9"
148
+      env: TEST=true ALLOW_FAILURE=true
149
+    - node_js: "0.6"
150
+      env: TEST=true ALLOW_FAILURE=true
151
+    - node_js: "0.4"
152
+      env: TEST=true ALLOW_FAILURE=true
153
+    ##- node_js: "7"
154
+      #env: TEST=true
155
+      #os: osx
156
+    #- node_js: "6"
157
+      #env: TEST=true
158
+      #os: osx
159
+    #- node_js: "5"
160
+      #env: TEST=true
161
+      #os: osx
162
+    #- node_js: "4"
163
+      #env: TEST=true
164
+      #os: osx
165
+    #- node_js: "iojs"
166
+      #env: TEST=true
167
+      #os: osx
168
+    #- node_js: "0.12"
169
+      #env: TEST=true
170
+      #os: osx
171
+    #- node_js: "0.10"
172
+      #env: TEST=true
173
+      #os: osx
174
+    #- node_js: "0.8"
175
+      #env: TEST=true
176
+      #os: osx
177
+  allow_failures:
178
+    - os: osx
179
+    - env: TEST=true ALLOW_FAILURE=true

+ 0 - 0
node_modules/extend/CHANGELOG.md View File


Some files were not shown because too many files changed in this diff