fsevents 1.2.6 → 1.2.7

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of fsevents might be problematic. Click here for more details.

Files changed (526) hide show
  1. package/node_modules/abbrev/LICENSE +46 -0
  2. package/node_modules/abbrev/README.md +23 -0
  3. package/node_modules/abbrev/abbrev.js +61 -0
  4. package/node_modules/abbrev/package.json +57 -0
  5. package/node_modules/ansi-regex/index.js +4 -0
  6. package/node_modules/ansi-regex/license +21 -0
  7. package/node_modules/ansi-regex/package.json +108 -0
  8. package/node_modules/ansi-regex/readme.md +39 -0
  9. package/node_modules/aproba/LICENSE +14 -0
  10. package/node_modules/aproba/README.md +94 -0
  11. package/node_modules/aproba/index.js +105 -0
  12. package/node_modules/aproba/package.json +62 -0
  13. package/node_modules/are-we-there-yet/CHANGES.md +37 -0
  14. package/node_modules/are-we-there-yet/LICENSE +5 -0
  15. package/node_modules/are-we-there-yet/README.md +195 -0
  16. package/node_modules/are-we-there-yet/index.js +4 -0
  17. package/node_modules/are-we-there-yet/package.json +63 -0
  18. package/node_modules/are-we-there-yet/tracker-base.js +11 -0
  19. package/node_modules/are-we-there-yet/tracker-group.js +107 -0
  20. package/node_modules/are-we-there-yet/tracker-stream.js +36 -0
  21. package/node_modules/are-we-there-yet/tracker.js +30 -0
  22. package/node_modules/balanced-match/.npmignore +5 -0
  23. package/node_modules/balanced-match/LICENSE.md +21 -0
  24. package/node_modules/balanced-match/README.md +91 -0
  25. package/node_modules/balanced-match/index.js +59 -0
  26. package/node_modules/balanced-match/package.json +77 -0
  27. package/node_modules/brace-expansion/LICENSE +21 -0
  28. package/node_modules/brace-expansion/README.md +129 -0
  29. package/node_modules/brace-expansion/index.js +201 -0
  30. package/node_modules/brace-expansion/package.json +75 -0
  31. package/node_modules/chownr/LICENSE +15 -0
  32. package/node_modules/chownr/README.md +3 -0
  33. package/node_modules/chownr/chownr.js +88 -0
  34. package/node_modules/chownr/package.json +59 -0
  35. package/node_modules/code-point-at/index.js +32 -0
  36. package/node_modules/code-point-at/license +21 -0
  37. package/node_modules/code-point-at/package.json +70 -0
  38. package/node_modules/code-point-at/readme.md +32 -0
  39. package/node_modules/concat-map/.travis.yml +4 -0
  40. package/node_modules/concat-map/LICENSE +18 -0
  41. package/node_modules/concat-map/README.markdown +62 -0
  42. package/node_modules/concat-map/example/map.js +6 -0
  43. package/node_modules/concat-map/index.js +13 -0
  44. package/node_modules/concat-map/package.json +88 -0
  45. package/node_modules/concat-map/test/map.js +39 -0
  46. package/node_modules/console-control-strings/LICENSE +13 -0
  47. package/node_modules/console-control-strings/README.md +145 -0
  48. package/node_modules/console-control-strings/README.md~ +140 -0
  49. package/node_modules/console-control-strings/index.js +125 -0
  50. package/node_modules/console-control-strings/package.json +61 -0
  51. package/node_modules/core-util-is/LICENSE +19 -0
  52. package/node_modules/core-util-is/README.md +3 -0
  53. package/node_modules/core-util-is/float.patch +604 -0
  54. package/node_modules/core-util-is/lib/util.js +107 -0
  55. package/node_modules/core-util-is/package.json +62 -0
  56. package/node_modules/core-util-is/test.js +68 -0
  57. package/node_modules/debug/.coveralls.yml +1 -0
  58. package/node_modules/debug/.eslintrc +11 -0
  59. package/node_modules/debug/.npmignore +9 -0
  60. package/node_modules/debug/.travis.yml +14 -0
  61. package/node_modules/debug/CHANGELOG.md +362 -0
  62. package/node_modules/debug/LICENSE +19 -0
  63. package/node_modules/debug/Makefile +50 -0
  64. package/node_modules/debug/README.md +312 -0
  65. package/node_modules/debug/component.json +19 -0
  66. package/node_modules/debug/karma.conf.js +70 -0
  67. package/node_modules/debug/node.js +1 -0
  68. package/node_modules/debug/package.json +88 -0
  69. package/node_modules/debug/src/browser.js +185 -0
  70. package/node_modules/debug/src/debug.js +202 -0
  71. package/node_modules/debug/src/index.js +10 -0
  72. package/node_modules/debug/src/inspector-log.js +15 -0
  73. package/node_modules/debug/src/node.js +248 -0
  74. package/node_modules/deep-extend/CHANGELOG.md +46 -0
  75. package/node_modules/deep-extend/LICENSE +20 -0
  76. package/node_modules/deep-extend/README.md +91 -0
  77. package/node_modules/deep-extend/index.js +1 -0
  78. package/node_modules/deep-extend/lib/deep-extend.js +150 -0
  79. package/node_modules/deep-extend/package.json +92 -0
  80. package/node_modules/delegates/.npmignore +1 -0
  81. package/node_modules/delegates/History.md +22 -0
  82. package/node_modules/delegates/License +20 -0
  83. package/node_modules/delegates/Makefile +8 -0
  84. package/node_modules/delegates/Readme.md +94 -0
  85. package/node_modules/delegates/index.js +121 -0
  86. package/node_modules/delegates/package.json +48 -0
  87. package/node_modules/delegates/test/index.js +94 -0
  88. package/node_modules/detect-libc/.npmignore +7 -0
  89. package/node_modules/detect-libc/LICENSE +201 -0
  90. package/node_modules/detect-libc/README.md +78 -0
  91. package/node_modules/detect-libc/bin/detect-libc.js +18 -0
  92. package/node_modules/detect-libc/lib/detect-libc.js +92 -0
  93. package/node_modules/detect-libc/package.json +70 -0
  94. package/node_modules/fs-minipass/LICENSE +15 -0
  95. package/node_modules/fs-minipass/README.md +70 -0
  96. package/node_modules/fs-minipass/index.js +386 -0
  97. package/node_modules/fs-minipass/package.json +62 -0
  98. package/node_modules/fs.realpath/LICENSE +43 -0
  99. package/node_modules/fs.realpath/README.md +33 -0
  100. package/node_modules/fs.realpath/index.js +66 -0
  101. package/node_modules/fs.realpath/old.js +303 -0
  102. package/node_modules/fs.realpath/package.json +59 -0
  103. package/node_modules/gauge/CHANGELOG.md +160 -0
  104. package/node_modules/gauge/LICENSE +13 -0
  105. package/node_modules/gauge/README.md +399 -0
  106. package/node_modules/gauge/base-theme.js +14 -0
  107. package/node_modules/gauge/error.js +24 -0
  108. package/node_modules/gauge/has-color.js +12 -0
  109. package/node_modules/gauge/index.js +233 -0
  110. package/node_modules/gauge/package.json +91 -0
  111. package/node_modules/gauge/plumbing.js +48 -0
  112. package/node_modules/gauge/process.js +3 -0
  113. package/node_modules/gauge/progress-bar.js +35 -0
  114. package/node_modules/gauge/render-template.js +181 -0
  115. package/node_modules/gauge/set-immediate.js +7 -0
  116. package/node_modules/gauge/set-interval.js +3 -0
  117. package/node_modules/gauge/spin.js +5 -0
  118. package/node_modules/gauge/template-item.js +73 -0
  119. package/node_modules/gauge/theme-set.js +115 -0
  120. package/node_modules/gauge/themes.js +54 -0
  121. package/node_modules/gauge/wide-truncate.js +25 -0
  122. package/node_modules/glob/LICENSE +15 -0
  123. package/node_modules/glob/README.md +368 -0
  124. package/node_modules/glob/changelog.md +67 -0
  125. package/node_modules/glob/common.js +240 -0
  126. package/node_modules/glob/glob.js +790 -0
  127. package/node_modules/glob/package.json +76 -0
  128. package/node_modules/glob/sync.js +486 -0
  129. package/node_modules/has-unicode/LICENSE +14 -0
  130. package/node_modules/has-unicode/README.md +43 -0
  131. package/node_modules/has-unicode/index.js +16 -0
  132. package/node_modules/has-unicode/package.json +58 -0
  133. package/node_modules/iconv-lite/Changelog.md +162 -0
  134. package/node_modules/iconv-lite/LICENSE +21 -0
  135. package/node_modules/iconv-lite/README.md +156 -0
  136. package/node_modules/iconv-lite/encodings/dbcs-codec.js +555 -0
  137. package/node_modules/iconv-lite/encodings/dbcs-data.js +176 -0
  138. package/node_modules/iconv-lite/encodings/index.js +22 -0
  139. package/node_modules/iconv-lite/encodings/internal.js +188 -0
  140. package/node_modules/iconv-lite/encodings/sbcs-codec.js +72 -0
  141. package/node_modules/iconv-lite/encodings/sbcs-data-generated.js +451 -0
  142. package/node_modules/iconv-lite/encodings/sbcs-data.js +174 -0
  143. package/node_modules/iconv-lite/encodings/tables/big5-added.json +122 -0
  144. package/node_modules/iconv-lite/encodings/tables/cp936.json +264 -0
  145. package/node_modules/iconv-lite/encodings/tables/cp949.json +273 -0
  146. package/node_modules/iconv-lite/encodings/tables/cp950.json +177 -0
  147. package/node_modules/iconv-lite/encodings/tables/eucjp.json +182 -0
  148. package/node_modules/iconv-lite/encodings/tables/gb18030-ranges.json +1 -0
  149. package/node_modules/iconv-lite/encodings/tables/gbk-added.json +55 -0
  150. package/node_modules/iconv-lite/encodings/tables/shiftjis.json +125 -0
  151. package/node_modules/iconv-lite/encodings/utf16.js +177 -0
  152. package/node_modules/iconv-lite/encodings/utf7.js +290 -0
  153. package/node_modules/iconv-lite/lib/bom-handling.js +52 -0
  154. package/node_modules/iconv-lite/lib/extend-node.js +217 -0
  155. package/node_modules/iconv-lite/lib/index.d.ts +24 -0
  156. package/node_modules/iconv-lite/lib/index.js +153 -0
  157. package/node_modules/iconv-lite/lib/streams.js +121 -0
  158. package/node_modules/iconv-lite/package.json +76 -0
  159. package/node_modules/ignore-walk/LICENSE +15 -0
  160. package/node_modules/ignore-walk/README.md +60 -0
  161. package/node_modules/ignore-walk/index.js +265 -0
  162. package/node_modules/ignore-walk/package.json +71 -0
  163. package/node_modules/inflight/LICENSE +15 -0
  164. package/node_modules/inflight/README.md +37 -0
  165. package/node_modules/inflight/inflight.js +54 -0
  166. package/node_modules/inflight/package.json +58 -0
  167. package/node_modules/inherits/LICENSE +16 -0
  168. package/node_modules/inherits/README.md +42 -0
  169. package/node_modules/inherits/inherits.js +7 -0
  170. package/node_modules/inherits/inherits_browser.js +23 -0
  171. package/node_modules/inherits/package.json +64 -0
  172. package/node_modules/ini/LICENSE +15 -0
  173. package/node_modules/ini/README.md +102 -0
  174. package/node_modules/ini/ini.js +194 -0
  175. package/node_modules/ini/package.json +63 -0
  176. package/node_modules/is-fullwidth-code-point/index.js +46 -0
  177. package/node_modules/is-fullwidth-code-point/license +21 -0
  178. package/node_modules/is-fullwidth-code-point/package.json +77 -0
  179. package/node_modules/is-fullwidth-code-point/readme.md +39 -0
  180. package/node_modules/isarray/.npmignore +1 -0
  181. package/node_modules/isarray/.travis.yml +4 -0
  182. package/node_modules/isarray/Makefile +6 -0
  183. package/node_modules/isarray/README.md +60 -0
  184. package/node_modules/isarray/component.json +19 -0
  185. package/node_modules/isarray/index.js +5 -0
  186. package/node_modules/isarray/package.json +73 -0
  187. package/node_modules/isarray/test.js +20 -0
  188. package/node_modules/minimatch/LICENSE +15 -0
  189. package/node_modules/minimatch/README.md +209 -0
  190. package/node_modules/minimatch/minimatch.js +923 -0
  191. package/node_modules/minimatch/package.json +64 -0
  192. package/node_modules/minimist/.travis.yml +4 -0
  193. package/node_modules/minimist/LICENSE +18 -0
  194. package/node_modules/minimist/example/parse.js +2 -0
  195. package/node_modules/minimist/index.js +187 -0
  196. package/node_modules/minimist/package.json +71 -0
  197. package/node_modules/minimist/readme.markdown +73 -0
  198. package/node_modules/minimist/test/dash.js +24 -0
  199. package/node_modules/minimist/test/default_bool.js +20 -0
  200. package/node_modules/minimist/test/dotted.js +16 -0
  201. package/node_modules/minimist/test/long.js +31 -0
  202. package/node_modules/minimist/test/parse.js +318 -0
  203. package/node_modules/minimist/test/parse_modified.js +9 -0
  204. package/node_modules/minimist/test/short.js +67 -0
  205. package/node_modules/minimist/test/whitespace.js +8 -0
  206. package/node_modules/minipass/LICENSE +15 -0
  207. package/node_modules/minipass/README.md +124 -0
  208. package/node_modules/minipass/index.js +375 -0
  209. package/node_modules/minipass/package.json +69 -0
  210. package/node_modules/minizlib/LICENSE +26 -0
  211. package/node_modules/minizlib/README.md +44 -0
  212. package/node_modules/minizlib/constants.js +46 -0
  213. package/node_modules/minizlib/index.js +335 -0
  214. package/node_modules/minizlib/package.json +71 -0
  215. package/node_modules/mkdirp/.travis.yml +8 -0
  216. package/node_modules/mkdirp/LICENSE +21 -0
  217. package/node_modules/mkdirp/bin/cmd.js +33 -0
  218. package/node_modules/mkdirp/bin/usage.txt +12 -0
  219. package/node_modules/mkdirp/examples/pow.js +6 -0
  220. package/node_modules/mkdirp/index.js +98 -0
  221. package/node_modules/mkdirp/package.json +64 -0
  222. package/node_modules/mkdirp/readme.markdown +100 -0
  223. package/node_modules/mkdirp/test/chmod.js +41 -0
  224. package/node_modules/mkdirp/test/clobber.js +38 -0
  225. package/node_modules/mkdirp/test/mkdirp.js +28 -0
  226. package/node_modules/mkdirp/test/opts_fs.js +29 -0
  227. package/node_modules/mkdirp/test/opts_fs_sync.js +27 -0
  228. package/node_modules/mkdirp/test/perm.js +32 -0
  229. package/node_modules/mkdirp/test/perm_sync.js +36 -0
  230. package/node_modules/mkdirp/test/race.js +37 -0
  231. package/node_modules/mkdirp/test/rel.js +32 -0
  232. package/node_modules/mkdirp/test/return.js +25 -0
  233. package/node_modules/mkdirp/test/return_sync.js +24 -0
  234. package/node_modules/mkdirp/test/root.js +19 -0
  235. package/node_modules/mkdirp/test/sync.js +32 -0
  236. package/node_modules/mkdirp/test/umask.js +28 -0
  237. package/node_modules/mkdirp/test/umask_sync.js +32 -0
  238. package/node_modules/ms/index.js +152 -0
  239. package/node_modules/ms/license.md +21 -0
  240. package/node_modules/ms/package.json +69 -0
  241. package/node_modules/ms/readme.md +51 -0
  242. package/node_modules/needle/README.md +594 -0
  243. package/node_modules/needle/bin/needle +40 -0
  244. package/node_modules/needle/examples/deflated-stream.js +22 -0
  245. package/node_modules/needle/examples/digest-auth.js +16 -0
  246. package/node_modules/needle/examples/download-to-file.js +18 -0
  247. package/node_modules/needle/examples/multipart-stream.js +25 -0
  248. package/node_modules/needle/examples/parsed-stream.js +23 -0
  249. package/node_modules/needle/examples/parsed-stream2.js +21 -0
  250. package/node_modules/needle/examples/stream-events.js +23 -0
  251. package/node_modules/needle/examples/stream-to-file.js +14 -0
  252. package/node_modules/needle/examples/upload-image.js +51 -0
  253. package/node_modules/needle/lib/auth.js +110 -0
  254. package/node_modules/needle/lib/cookies.js +79 -0
  255. package/node_modules/needle/lib/decoder.js +53 -0
  256. package/node_modules/needle/lib/multipart.js +98 -0
  257. package/node_modules/needle/lib/needle.js +795 -0
  258. package/node_modules/needle/lib/parsers.js +120 -0
  259. package/node_modules/needle/lib/querystring.js +49 -0
  260. package/node_modules/needle/license.txt +19 -0
  261. package/node_modules/needle/note.xml +7 -0
  262. package/node_modules/needle/note.xml.1 +7 -0
  263. package/node_modules/needle/package.json +102 -0
  264. package/node_modules/needle/test/basic_auth_spec.js +196 -0
  265. package/node_modules/needle/test/compression_spec.js +94 -0
  266. package/node_modules/needle/test/cookies_spec.js +305 -0
  267. package/node_modules/needle/test/decoder_spec.js +86 -0
  268. package/node_modules/needle/test/errors_spec.js +286 -0
  269. package/node_modules/needle/test/headers_spec.js +198 -0
  270. package/node_modules/needle/test/helpers.js +72 -0
  271. package/node_modules/needle/test/long_string_spec.js +34 -0
  272. package/node_modules/needle/test/output_spec.js +254 -0
  273. package/node_modules/needle/test/parsing_spec.js +494 -0
  274. package/node_modules/needle/test/post_data_spec.js +1021 -0
  275. package/node_modules/needle/test/proxy_spec.js +202 -0
  276. package/node_modules/needle/test/querystring_spec.js +128 -0
  277. package/node_modules/needle/test/redirect_spec.js +392 -0
  278. package/node_modules/needle/test/redirect_with_timeout.js +45 -0
  279. package/node_modules/needle/test/request_stream_spec.js +202 -0
  280. package/node_modules/needle/test/response_stream_spec.js +139 -0
  281. package/node_modules/needle/test/socket_pool_spec.js +66 -0
  282. package/node_modules/needle/test/url_spec.js +155 -0
  283. package/node_modules/needle/test/utils/formidable.js +17 -0
  284. package/node_modules/needle/test/utils/proxy.js +62 -0
  285. package/node_modules/needle/test/utils/test.js +104 -0
  286. package/node_modules/node-pre-gyp/CHANGELOG.md +422 -0
  287. package/node_modules/node-pre-gyp/LICENSE +27 -0
  288. package/node_modules/node-pre-gyp/README.md +658 -0
  289. package/node_modules/node-pre-gyp/appveyor.yml +30 -0
  290. package/node_modules/node-pre-gyp/bin/node-pre-gyp +134 -0
  291. package/node_modules/node-pre-gyp/bin/node-pre-gyp.cmd +2 -0
  292. package/node_modules/node-pre-gyp/contributing.md +10 -0
  293. package/node_modules/node-pre-gyp/lib/build.js +51 -0
  294. package/node_modules/node-pre-gyp/lib/clean.js +32 -0
  295. package/node_modules/node-pre-gyp/lib/configure.js +52 -0
  296. package/node_modules/node-pre-gyp/lib/info.js +40 -0
  297. package/node_modules/node-pre-gyp/lib/install.js +243 -0
  298. package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +203 -0
  299. package/node_modules/node-pre-gyp/lib/package.js +56 -0
  300. package/node_modules/node-pre-gyp/lib/pre-binding.js +30 -0
  301. package/node_modules/node-pre-gyp/lib/publish.js +79 -0
  302. package/node_modules/node-pre-gyp/lib/rebuild.js +21 -0
  303. package/node_modules/node-pre-gyp/lib/reinstall.js +20 -0
  304. package/node_modules/node-pre-gyp/lib/reveal.js +33 -0
  305. package/node_modules/node-pre-gyp/lib/testbinary.js +81 -0
  306. package/node_modules/node-pre-gyp/lib/testpackage.js +55 -0
  307. package/node_modules/node-pre-gyp/lib/unpublish.js +43 -0
  308. package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +1782 -0
  309. package/node_modules/node-pre-gyp/lib/util/compile.js +87 -0
  310. package/node_modules/node-pre-gyp/lib/util/handle_gyp_opts.js +100 -0
  311. package/node_modules/node-pre-gyp/lib/util/napi.js +156 -0
  312. package/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/index.html +26 -0
  313. package/node_modules/node-pre-gyp/lib/util/nw-pre-gyp/package.json +9 -0
  314. package/node_modules/node-pre-gyp/lib/util/s3_setup.js +27 -0
  315. package/node_modules/node-pre-gyp/lib/util/versioning.js +330 -0
  316. package/node_modules/node-pre-gyp/package.json +86 -0
  317. package/node_modules/nopt/.npmignore +1 -0
  318. package/node_modules/nopt/.travis.yml +8 -0
  319. package/node_modules/nopt/CHANGELOG.md +58 -0
  320. package/node_modules/nopt/LICENSE +15 -0
  321. package/node_modules/nopt/README.md +213 -0
  322. package/node_modules/nopt/bin/nopt.js +54 -0
  323. package/node_modules/nopt/examples/my-program.js +30 -0
  324. package/node_modules/nopt/lib/nopt.js +436 -0
  325. package/node_modules/nopt/package.json +58 -0
  326. package/node_modules/nopt/test/basic.js +303 -0
  327. package/node_modules/npm-bundled/LICENSE +15 -0
  328. package/node_modules/npm-bundled/README.md +48 -0
  329. package/node_modules/npm-bundled/index.js +229 -0
  330. package/node_modules/npm-bundled/package.json +60 -0
  331. package/node_modules/npm-packlist/LICENSE +15 -0
  332. package/node_modules/npm-packlist/README.md +68 -0
  333. package/node_modules/npm-packlist/index.js +229 -0
  334. package/node_modules/npm-packlist/package.json +66 -0
  335. package/node_modules/npmlog/CHANGELOG.md +49 -0
  336. package/node_modules/npmlog/LICENSE +15 -0
  337. package/node_modules/npmlog/README.md +216 -0
  338. package/node_modules/npmlog/log.js +309 -0
  339. package/node_modules/npmlog/package.json +61 -0
  340. package/node_modules/number-is-nan/index.js +4 -0
  341. package/node_modules/number-is-nan/license +21 -0
  342. package/node_modules/number-is-nan/package.json +67 -0
  343. package/node_modules/number-is-nan/readme.md +28 -0
  344. package/node_modules/object-assign/index.js +90 -0
  345. package/node_modules/object-assign/license +21 -0
  346. package/node_modules/object-assign/package.json +74 -0
  347. package/node_modules/object-assign/readme.md +61 -0
  348. package/node_modules/once/LICENSE +15 -0
  349. package/node_modules/once/README.md +79 -0
  350. package/node_modules/once/once.js +42 -0
  351. package/node_modules/once/package.json +67 -0
  352. package/node_modules/os-homedir/index.js +24 -0
  353. package/node_modules/os-homedir/license +21 -0
  354. package/node_modules/os-homedir/package.json +73 -0
  355. package/node_modules/os-homedir/readme.md +31 -0
  356. package/node_modules/os-tmpdir/index.js +25 -0
  357. package/node_modules/os-tmpdir/license +21 -0
  358. package/node_modules/os-tmpdir/package.json +73 -0
  359. package/node_modules/os-tmpdir/readme.md +32 -0
  360. package/node_modules/osenv/LICENSE +15 -0
  361. package/node_modules/osenv/README.md +63 -0
  362. package/node_modules/osenv/osenv.js +72 -0
  363. package/node_modules/osenv/package.json +73 -0
  364. package/node_modules/path-is-absolute/index.js +20 -0
  365. package/node_modules/path-is-absolute/license +21 -0
  366. package/node_modules/path-is-absolute/package.json +75 -0
  367. package/node_modules/path-is-absolute/readme.md +59 -0
  368. package/node_modules/process-nextick-args/index.js +44 -0
  369. package/node_modules/process-nextick-args/license.md +19 -0
  370. package/node_modules/process-nextick-args/package.json +50 -0
  371. package/node_modules/process-nextick-args/readme.md +18 -0
  372. package/node_modules/rc/LICENSE.APACHE2 +15 -0
  373. package/node_modules/rc/LICENSE.BSD +26 -0
  374. package/node_modules/rc/LICENSE.MIT +24 -0
  375. package/node_modules/rc/README.md +227 -0
  376. package/node_modules/rc/browser.js +7 -0
  377. package/node_modules/rc/cli.js +4 -0
  378. package/node_modules/rc/index.js +53 -0
  379. package/node_modules/rc/lib/utils.js +104 -0
  380. package/node_modules/rc/node_modules/minimist/.travis.yml +8 -0
  381. package/node_modules/rc/node_modules/minimist/LICENSE +18 -0
  382. package/node_modules/rc/node_modules/minimist/example/parse.js +2 -0
  383. package/node_modules/rc/node_modules/minimist/index.js +236 -0
  384. package/node_modules/rc/node_modules/minimist/package.json +73 -0
  385. package/node_modules/rc/node_modules/minimist/readme.markdown +91 -0
  386. package/node_modules/rc/node_modules/minimist/test/all_bool.js +32 -0
  387. package/node_modules/rc/node_modules/minimist/test/bool.js +166 -0
  388. package/node_modules/rc/node_modules/minimist/test/dash.js +31 -0
  389. package/node_modules/rc/node_modules/minimist/test/default_bool.js +35 -0
  390. package/node_modules/rc/node_modules/minimist/test/dotted.js +22 -0
  391. package/node_modules/rc/node_modules/minimist/test/kv_short.js +16 -0
  392. package/node_modules/rc/node_modules/minimist/test/long.js +31 -0
  393. package/node_modules/rc/node_modules/minimist/test/num.js +36 -0
  394. package/node_modules/rc/node_modules/minimist/test/parse.js +197 -0
  395. package/node_modules/rc/node_modules/minimist/test/parse_modified.js +9 -0
  396. package/node_modules/rc/node_modules/minimist/test/short.js +67 -0
  397. package/node_modules/rc/node_modules/minimist/test/stop_early.js +15 -0
  398. package/node_modules/rc/node_modules/minimist/test/unknown.js +102 -0
  399. package/node_modules/rc/node_modules/minimist/test/whitespace.js +8 -0
  400. package/node_modules/rc/package.json +64 -0
  401. package/node_modules/rc/test/ini.js +16 -0
  402. package/node_modules/rc/test/nested-env-vars.js +50 -0
  403. package/node_modules/rc/test/test.js +59 -0
  404. package/node_modules/readable-stream/.travis.yml +55 -0
  405. package/node_modules/readable-stream/CONTRIBUTING.md +38 -0
  406. package/node_modules/readable-stream/GOVERNANCE.md +136 -0
  407. package/node_modules/readable-stream/LICENSE +47 -0
  408. package/node_modules/readable-stream/README.md +58 -0
  409. package/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +60 -0
  410. package/node_modules/readable-stream/duplex-browser.js +1 -0
  411. package/node_modules/readable-stream/duplex.js +1 -0
  412. package/node_modules/readable-stream/lib/_stream_duplex.js +131 -0
  413. package/node_modules/readable-stream/lib/_stream_passthrough.js +47 -0
  414. package/node_modules/readable-stream/lib/_stream_readable.js +1019 -0
  415. package/node_modules/readable-stream/lib/_stream_transform.js +214 -0
  416. package/node_modules/readable-stream/lib/_stream_writable.js +687 -0
  417. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +79 -0
  418. package/node_modules/readable-stream/lib/internal/streams/destroy.js +74 -0
  419. package/node_modules/readable-stream/lib/internal/streams/stream-browser.js +1 -0
  420. package/node_modules/readable-stream/lib/internal/streams/stream.js +1 -0
  421. package/node_modules/readable-stream/package.json +81 -0
  422. package/node_modules/readable-stream/passthrough.js +1 -0
  423. package/node_modules/readable-stream/readable-browser.js +7 -0
  424. package/node_modules/readable-stream/readable.js +19 -0
  425. package/node_modules/readable-stream/transform.js +1 -0
  426. package/node_modules/readable-stream/writable-browser.js +1 -0
  427. package/node_modules/readable-stream/writable.js +8 -0
  428. package/node_modules/rimraf/LICENSE +15 -0
  429. package/node_modules/rimraf/README.md +101 -0
  430. package/node_modules/rimraf/bin.js +50 -0
  431. package/node_modules/rimraf/package.json +67 -0
  432. package/node_modules/rimraf/rimraf.js +364 -0
  433. package/node_modules/safe-buffer/LICENSE +21 -0
  434. package/node_modules/safe-buffer/README.md +584 -0
  435. package/node_modules/safe-buffer/index.d.ts +187 -0
  436. package/node_modules/safe-buffer/index.js +62 -0
  437. package/node_modules/safe-buffer/package.json +65 -0
  438. package/node_modules/safer-buffer/LICENSE +21 -0
  439. package/node_modules/safer-buffer/Porting-Buffer.md +268 -0
  440. package/node_modules/safer-buffer/Readme.md +156 -0
  441. package/node_modules/safer-buffer/dangerous.js +58 -0
  442. package/node_modules/safer-buffer/package.json +60 -0
  443. package/node_modules/safer-buffer/safer.js +77 -0
  444. package/node_modules/safer-buffer/tests.js +406 -0
  445. package/node_modules/sax/LICENSE +41 -0
  446. package/node_modules/sax/README.md +225 -0
  447. package/node_modules/sax/lib/sax.js +1565 -0
  448. package/node_modules/sax/package.json +61 -0
  449. package/node_modules/semver/LICENSE +15 -0
  450. package/node_modules/semver/README.md +399 -0
  451. package/node_modules/semver/bin/semver +153 -0
  452. package/node_modules/semver/package.json +54 -0
  453. package/node_modules/semver/range.bnf +16 -0
  454. package/node_modules/semver/semver.js +1352 -0
  455. package/node_modules/set-blocking/CHANGELOG.md +26 -0
  456. package/node_modules/set-blocking/LICENSE.txt +14 -0
  457. package/node_modules/set-blocking/README.md +31 -0
  458. package/node_modules/set-blocking/index.js +7 -0
  459. package/node_modules/set-blocking/package.json +70 -0
  460. package/node_modules/signal-exit/CHANGELOG.md +27 -0
  461. package/node_modules/signal-exit/LICENSE.txt +16 -0
  462. package/node_modules/signal-exit/README.md +40 -0
  463. package/node_modules/signal-exit/index.js +157 -0
  464. package/node_modules/signal-exit/package.json +66 -0
  465. package/node_modules/signal-exit/signals.js +53 -0
  466. package/node_modules/string-width/index.js +37 -0
  467. package/node_modules/string-width/license +21 -0
  468. package/node_modules/string-width/package.json +89 -0
  469. package/node_modules/string-width/readme.md +42 -0
  470. package/node_modules/string_decoder/.travis.yml +50 -0
  471. package/node_modules/string_decoder/LICENSE +48 -0
  472. package/node_modules/string_decoder/README.md +47 -0
  473. package/node_modules/string_decoder/lib/string_decoder.js +296 -0
  474. package/node_modules/string_decoder/package.json +59 -0
  475. package/node_modules/strip-ansi/index.js +6 -0
  476. package/node_modules/strip-ansi/license +21 -0
  477. package/node_modules/strip-ansi/package.json +102 -0
  478. package/node_modules/strip-ansi/readme.md +33 -0
  479. package/node_modules/strip-json-comments/index.js +70 -0
  480. package/node_modules/strip-json-comments/license +21 -0
  481. package/node_modules/strip-json-comments/package.json +74 -0
  482. package/node_modules/strip-json-comments/readme.md +64 -0
  483. package/node_modules/tar/LICENSE +15 -0
  484. package/node_modules/tar/README.md +954 -0
  485. package/node_modules/tar/index.js +18 -0
  486. package/node_modules/tar/lib/buffer.js +11 -0
  487. package/node_modules/tar/lib/create.js +105 -0
  488. package/node_modules/tar/lib/extract.js +112 -0
  489. package/node_modules/tar/lib/header.js +289 -0
  490. package/node_modules/tar/lib/high-level-opt.js +29 -0
  491. package/node_modules/tar/lib/large-numbers.js +92 -0
  492. package/node_modules/tar/lib/list.js +130 -0
  493. package/node_modules/tar/lib/mkdir.js +206 -0
  494. package/node_modules/tar/lib/mode-fix.js +14 -0
  495. package/node_modules/tar/lib/pack.js +404 -0
  496. package/node_modules/tar/lib/parse.js +423 -0
  497. package/node_modules/tar/lib/pax.js +146 -0
  498. package/node_modules/tar/lib/read-entry.js +94 -0
  499. package/node_modules/tar/lib/replace.js +220 -0
  500. package/node_modules/tar/lib/types.js +44 -0
  501. package/node_modules/tar/lib/unpack.js +621 -0
  502. package/node_modules/tar/lib/update.js +36 -0
  503. package/node_modules/tar/lib/warn-mixin.js +14 -0
  504. package/node_modules/tar/lib/winchars.js +23 -0
  505. package/node_modules/tar/lib/write-entry.js +422 -0
  506. package/node_modules/tar/package.json +78 -0
  507. package/node_modules/util-deprecate/History.md +16 -0
  508. package/node_modules/util-deprecate/LICENSE +24 -0
  509. package/node_modules/util-deprecate/README.md +53 -0
  510. package/node_modules/util-deprecate/browser.js +67 -0
  511. package/node_modules/util-deprecate/node.js +6 -0
  512. package/node_modules/util-deprecate/package.json +56 -0
  513. package/node_modules/wide-align/LICENSE +14 -0
  514. package/node_modules/wide-align/README.md +47 -0
  515. package/node_modules/wide-align/align.js +65 -0
  516. package/node_modules/wide-align/package.json +66 -0
  517. package/node_modules/wrappy/LICENSE +15 -0
  518. package/node_modules/wrappy/README.md +36 -0
  519. package/node_modules/wrappy/package.json +59 -0
  520. package/node_modules/wrappy/wrappy.js +33 -0
  521. package/node_modules/yallist/LICENSE +15 -0
  522. package/node_modules/yallist/README.md +204 -0
  523. package/node_modules/yallist/iterator.js +8 -0
  524. package/node_modules/yallist/package.json +63 -0
  525. package/node_modules/yallist/yallist.js +376 -0
  526. package/package.json +1 -1
@@ -0,0 +1,399 @@
1
+ gauge
2
+ =====
3
+
4
+ A nearly stateless terminal based horizontal gauge / progress bar.
5
+
6
+ ```javascript
7
+ var Gauge = require("gauge")
8
+
9
+ var gauge = new Gauge()
10
+
11
+ gauge.show("test", 0.20)
12
+
13
+ gauge.pulse("this")
14
+
15
+ gauge.hide()
16
+ ```
17
+
18
+ ![](gauge-demo.gif)
19
+
20
+
21
+ ### CHANGES FROM 1.x
22
+
23
+ Gauge 2.x is breaking release, please see the [changelog] for details on
24
+ what's changed if you were previously a user of this module.
25
+
26
+ [changelog]: CHANGELOG.md
27
+
28
+ ### THE GAUGE CLASS
29
+
30
+ This is the typical interface to the module– it provides a pretty
31
+ fire-and-forget interface to displaying your status information.
32
+
33
+ ```
34
+ var Gauge = require("gauge")
35
+
36
+ var gauge = new Gauge([stream], [options])
37
+ ```
38
+
39
+ * **stream** – *(optional, default STDERR)* A stream that progress bar
40
+ updates are to be written to. Gauge honors backpressure and will pause
41
+ most writing if it is indicated.
42
+ * **options** – *(optional)* An option object.
43
+
44
+ Constructs a new gauge. Gauges are drawn on a single line, and are not drawn
45
+ if **stream** isn't a tty and a tty isn't explicitly provided.
46
+
47
+ If **stream** is a terminal or if you pass in **tty** to **options** then we
48
+ will detect terminal resizes and redraw to fit. We do this by watching for
49
+ `resize` events on the tty. (To work around a bug in verisons of Node prior
50
+ to 2.5.0, we watch for them on stdout if the tty is stderr.) Resizes to
51
+ larger window sizes will be clean, but shrinking the window will always
52
+ result in some cruft.
53
+
54
+ **IMPORTANT:** If you prevously were passing in a non-tty stream but you still
55
+ want output (for example, a stream wrapped by the `ansi` module) then you
56
+ need to pass in the **tty** option below, as `gauge` needs access to
57
+ the underlying tty in order to do things like terminal resizes and terminal
58
+ width detection.
59
+
60
+ The **options** object can have the following properties, all of which are
61
+ optional:
62
+
63
+ * **updateInterval**: How often gauge updates should be drawn, in miliseconds.
64
+ * **fixedFramerate**: Defaults to false on node 0.8, true on everything
65
+ else. When this is true a timer is created to trigger once every
66
+ `updateInterval` ms, when false, updates are printed as soon as they come
67
+ in but updates more often than `updateInterval` are ignored. The reason
68
+ 0.8 doesn't have this set to true is that it can't `unref` its timer and
69
+ so it would stop your program from exiting– if you want to use this
70
+ feature with 0.8 just make sure you call `gauge.disable()` before you
71
+ expect your program to exit.
72
+ * **themes**: A themeset to use when selecting the theme to use. Defaults
73
+ to `gauge/themes`, see the [themes] documentation for details.
74
+ * **theme**: Select a theme for use, it can be a:
75
+ * Theme object, in which case the **themes** is not used.
76
+ * The name of a theme, which will be looked up in the current *themes*
77
+ object.
78
+ * A configuration object with any of `hasUnicode`, `hasColor` or
79
+ `platform` keys, which if wlll be used to override our guesses when making
80
+ a default theme selection.
81
+
82
+ If no theme is selected then a default is picked using a combination of our
83
+ best guesses at your OS, color support and unicode support.
84
+ * **template**: Describes what you want your gauge to look like. The
85
+ default is what npm uses. Detailed [documentation] is later in this
86
+ document.
87
+ * **hideCursor**: Defaults to true. If true, then the cursor will be hidden
88
+ while the gauge is displayed.
89
+ * **tty**: The tty that you're ultimately writing to. Defaults to the same
90
+ as **stream**. This is used for detecting the width of the terminal and
91
+ resizes. The width used is `tty.columns - 1`. If no tty is available then
92
+ a width of `79` is assumed.
93
+ * **enabled**: Defaults to true if `tty` is a TTY, false otherwise. If true
94
+ the gauge starts enabled. If disabled then all update commands are
95
+ ignored and no gauge will be printed until you call `.enable()`.
96
+ * **Plumbing**: The class to use to actually generate the gauge for
97
+ printing. This defaults to `require('gauge/plumbing')` and ordinarly you
98
+ shouldn't need to override this.
99
+ * **cleanupOnExit**: Defaults to true. Ordinarily we register an exit
100
+ handler to make sure your cursor is turned back on and the progress bar
101
+ erased when your process exits, even if you Ctrl-C out or otherwise exit
102
+ unexpectedly. You can disable this and it won't register the exit handler.
103
+
104
+ [has-unicode]: https://www.npmjs.com/package/has-unicode
105
+ [themes]: #themes
106
+ [documentation]: #templates
107
+
108
+ #### `gauge.show(section | status, [completed])`
109
+
110
+ The first argument is either the section, the name of the current thing
111
+ contributing to progress, or an object with keys like **section**,
112
+ **subsection** & **completed** (or any others you have types for in a custom
113
+ template). If you don't want to update or set any of these you can pass
114
+ `null` and it will be ignored.
115
+
116
+ The second argument is the percent completed as a value between 0 and 1.
117
+ Without it, completion is just not updated. You'll also note that completion
118
+ can be passed in as part of a status object as the first argument. If both
119
+ it and the completed argument are passed in, the completed argument wins.
120
+
121
+ #### `gauge.hide([cb])`
122
+
123
+ Removes the gauge from the terminal. Optionally, callback `cb` after IO has
124
+ had an opportunity to happen (currently this just means after `setImmediate`
125
+ has called back.)
126
+
127
+ It turns out this is important when you're pausing the progress bar on one
128
+ filehandle and printing to another– otherwise (with a big enough print) node
129
+ can end up printing the "end progress bar" bits to the progress bar filehandle
130
+ while other stuff is printing to another filehandle. These getting interleaved
131
+ can cause corruption in some terminals.
132
+
133
+ #### `gauge.pulse([subsection])`
134
+
135
+ * **subsection** – *(optional)* The specific thing that triggered this pulse
136
+
137
+ Spins the spinner in the gauge to show output. If **subsection** is
138
+ included then it will be combined with the last name passed to `gauge.show`.
139
+
140
+ #### `gauge.disable()`
141
+
142
+ Hides the gauge and ignores further calls to `show` or `pulse`.
143
+
144
+ #### `gauge.enable()`
145
+
146
+ Shows the gauge and resumes updating when `show` or `pulse` is called.
147
+
148
+ #### `gauge.isEnabled()`
149
+
150
+ Returns true if the gauge is enabled.
151
+
152
+ #### `gauge.setThemeset(themes)`
153
+
154
+ Change the themeset to select a theme from. The same as the `themes` option
155
+ used in the constructor. The theme will be reselected from this themeset.
156
+
157
+ #### `gauge.setTheme(theme)`
158
+
159
+ Change the active theme, will be displayed with the next show or pulse. This can be:
160
+
161
+ * Theme object, in which case the **themes** is not used.
162
+ * The name of a theme, which will be looked up in the current *themes*
163
+ object.
164
+ * A configuration object with any of `hasUnicode`, `hasColor` or
165
+ `platform` keys, which if wlll be used to override our guesses when making
166
+ a default theme selection.
167
+
168
+ If no theme is selected then a default is picked using a combination of our
169
+ best guesses at your OS, color support and unicode support.
170
+
171
+ #### `gauge.setTemplate(template)`
172
+
173
+ Change the active template, will be displayed with the next show or pulse
174
+
175
+ ### Tracking Completion
176
+
177
+ If you have more than one thing going on that you want to track completion
178
+ of, you may find the related [are-we-there-yet] helpful. It's `change`
179
+ event can be wired up to the `show` method to get a more traditional
180
+ progress bar interface.
181
+
182
+ [are-we-there-yet]: https://www.npmjs.com/package/are-we-there-yet
183
+
184
+ ### THEMES
185
+
186
+ ```
187
+ var themes = require('gauge/themes')
188
+
189
+ // fetch the default color unicode theme for this platform
190
+ var ourTheme = themes({hasUnicode: true, hasColor: true})
191
+
192
+ // fetch the default non-color unicode theme for osx
193
+ var ourTheme = themes({hasUnicode: true, hasColor: false, platform: 'darwin'})
194
+
195
+ // create a new theme based on the color ascii theme for this platform
196
+ // that brackets the progress bar with arrows
197
+ var ourTheme = themes.newTheme(theme(hasUnicode: false, hasColor: true}), {
198
+ preProgressbar: '→',
199
+ postProgressbar: '←'
200
+ })
201
+ ```
202
+
203
+ The object returned by `gauge/themes` is an instance of the `ThemeSet` class.
204
+
205
+ ```
206
+ var ThemeSet = require('gauge/theme-set')
207
+ var themes = new ThemeSet()
208
+ // or
209
+ var themes = require('gauge/themes')
210
+ var mythemes = themes.newThemeset() // creates a new themeset based on the default themes
211
+ ```
212
+
213
+ #### themes(opts)
214
+ #### themes.getDefault(opts)
215
+
216
+ Theme objects are a function that fetches the default theme based on
217
+ platform, unicode and color support.
218
+
219
+ Options is an object with the following properties:
220
+
221
+ * **hasUnicode** - If true, fetch a unicode theme, if no unicode theme is
222
+ available then a non-unicode theme will be used.
223
+ * **hasColor** - If true, fetch a color theme, if no color theme is
224
+ available a non-color theme will be used.
225
+ * **platform** (optional) - Defaults to `process.platform`. If no
226
+ platform match is available then `fallback` is used instead.
227
+
228
+ If no compatible theme can be found then an error will be thrown with a
229
+ `code` of `EMISSINGTHEME`.
230
+
231
+ #### themes.addTheme(themeName, themeObj)
232
+ #### themes.addTheme(themeName, [parentTheme], newTheme)
233
+
234
+ Adds a named theme to the themeset. You can pass in either a theme object,
235
+ as returned by `themes.newTheme` or the arguments you'd pass to
236
+ `themes.newTheme`.
237
+
238
+ #### themes.getThemeNames()
239
+
240
+ Return a list of all of the names of the themes in this themeset. Suitable
241
+ for use in `themes.getTheme(…)`.
242
+
243
+ #### themes.getTheme(name)
244
+
245
+ Returns the theme object from this theme set named `name`.
246
+
247
+ If `name` does not exist in this themeset an error will be thrown with
248
+ a `code` of `EMISSINGTHEME`.
249
+
250
+ #### themes.setDefault([opts], themeName)
251
+
252
+ `opts` is an object with the following properties.
253
+
254
+ * **platform** - Defaults to `'fallback'`. If your theme is platform
255
+ specific, specify that here with the platform from `process.platform`, eg,
256
+ `win32`, `darwin`, etc.
257
+ * **hasUnicode** - Defaults to `false`. If your theme uses unicode you
258
+ should set this to true.
259
+ * **hasColor** - Defaults to `false`. If your theme uses color you should
260
+ set this to true.
261
+
262
+ `themeName` is the name of the theme (as given to `addTheme`) to use for
263
+ this set of `opts`.
264
+
265
+ #### themes.newTheme([parentTheme,] newTheme)
266
+
267
+ Create a new theme object based on `parentTheme`. If no `parentTheme` is
268
+ provided then a minimal parentTheme that defines functions for rendering the
269
+ activity indicator (spinner) and progress bar will be defined. (This
270
+ fallback parent is defined in `gauge/base-theme`.)
271
+
272
+ newTheme should be a bare object– we'll start by discussing the properties
273
+ defined by the default themes:
274
+
275
+ * **preProgressbar** - displayed prior to the progress bar, if the progress
276
+ bar is displayed.
277
+ * **postProgressbar** - displayed after the progress bar, if the progress bar
278
+ is displayed.
279
+ * **progressBarTheme** - The subtheme passed through to the progress bar
280
+ renderer, it's an object with `complete` and `remaining` properties
281
+ that are the strings you want repeated for those sections of the progress
282
+ bar.
283
+ * **activityIndicatorTheme** - The theme for the activity indicator (spinner),
284
+ this can either be a string, in which each character is a different step, or
285
+ an array of strings.
286
+ * **preSubsection** - Displayed as a separator between the `section` and
287
+ `subsection` when the latter is printed.
288
+
289
+ More generally, themes can have any value that would be a valid value when rendering
290
+ templates. The properties in the theme are used when their name matches a type in
291
+ the template. Their values can be:
292
+
293
+ * **strings & numbers** - They'll be included as is
294
+ * **function (values, theme, width)** - Should return what you want in your output.
295
+ *values* is an object with values provided via `gauge.show`,
296
+ *theme* is the theme specific to this item (see below) or this theme object,
297
+ and *width* is the number of characters wide your result should be.
298
+
299
+ There are a couple of special prefixes:
300
+
301
+ * **pre** - Is shown prior to the property, if its displayed.
302
+ * **post** - Is shown after the property, if its displayed.
303
+
304
+ And one special suffix:
305
+
306
+ * **Theme** - Its value is passed to a function-type item as the theme.
307
+
308
+ #### themes.addToAllThemes(theme)
309
+
310
+ This *mixes-in* `theme` into all themes currently defined. It also adds it
311
+ to the default parent theme for this themeset, so future themes added to
312
+ this themeset will get the values from `theme` by default.
313
+
314
+ #### themes.newThemeset()
315
+
316
+ Copy the current themeset into a new one. This allows you to easily inherit
317
+ one themeset from another.
318
+
319
+ ### TEMPLATES
320
+
321
+ A template is an array of objects and strings that, after being evaluated,
322
+ will be turned into the gauge line. The default template is:
323
+
324
+ ```javascript
325
+ [
326
+ {type: 'progressbar', length: 20},
327
+ {type: 'activityIndicator', kerning: 1, length: 1},
328
+ {type: 'section', kerning: 1, default: ''},
329
+ {type: 'subsection', kerning: 1, default: ''}
330
+ ]
331
+ ```
332
+
333
+ The various template elements can either be **plain strings**, in which case they will
334
+ be be included verbatum in the output, or objects with the following properties:
335
+
336
+ * *type* can be any of the following plus any keys you pass into `gauge.show` plus
337
+ any keys you have on a custom theme.
338
+ * `section` – What big thing you're working on now.
339
+ * `subsection` – What component of that thing is currently working.
340
+ * `activityIndicator` – Shows a spinner using the `activityIndicatorTheme`
341
+ from your active theme.
342
+ * `progressbar` – A progress bar representing your current `completed`
343
+ using the `progressbarTheme` from your active theme.
344
+ * *kerning* – Number of spaces that must be between this item and other
345
+ items, if this item is displayed at all.
346
+ * *maxLength* – The maximum length for this element. If its value is longer it
347
+ will be truncated.
348
+ * *minLength* – The minimum length for this element. If its value is shorter it
349
+ will be padded according to the *align* value.
350
+ * *align* – (Default: left) Possible values "left", "right" and "center". Works
351
+ as you'd expect from word processors.
352
+ * *length* – Provides a single value for both *minLength* and *maxLength*. If both
353
+ *length* and *minLength or *maxLength* are specifed then the latter take precedence.
354
+ * *value* – A literal value to use for this template item.
355
+ * *default* – A default value to use for this template item if a value
356
+ wasn't otherwise passed in.
357
+
358
+ ### PLUMBING
359
+
360
+ This is the super simple, assume nothing, do no magic internals used by gauge to
361
+ implement its ordinary interface.
362
+
363
+ ```
364
+ var Plumbing = require('gauge/plumbing')
365
+ var gauge = new Plumbing(theme, template, width)
366
+ ```
367
+
368
+ * **theme**: The theme to use.
369
+ * **template**: The template to use.
370
+ * **width**: How wide your gauge should be
371
+
372
+ #### `gauge.setTheme(theme)`
373
+
374
+ Change the active theme.
375
+
376
+ #### `gauge.setTemplate(template)`
377
+
378
+ Change the active template.
379
+
380
+ #### `gauge.setWidth(width)`
381
+
382
+ Change the width to render at.
383
+
384
+ #### `gauge.hide()`
385
+
386
+ Return the string necessary to hide the progress bar
387
+
388
+ #### `gauge.hideCursor()`
389
+
390
+ Return a string to hide the cursor.
391
+
392
+ #### `gauge.showCursor()`
393
+
394
+ Return a string to show the cursor.
395
+
396
+ #### `gauge.show(status)`
397
+
398
+ Using `status` for values, render the provided template with the theme and return
399
+ a string that is suitable for printing to update the gauge.
@@ -0,0 +1,14 @@
1
+ 'use strict'
2
+ var spin = require('./spin.js')
3
+ var progressBar = require('./progress-bar.js')
4
+
5
+ module.exports = {
6
+ activityIndicator: function (values, theme, width) {
7
+ if (values.spun == null) return
8
+ return spin(theme, values.spun)
9
+ },
10
+ progressbar: function (values, theme, width) {
11
+ if (values.completed == null) return
12
+ return progressBar(theme, width, values.completed)
13
+ }
14
+ }
@@ -0,0 +1,24 @@
1
+ 'use strict'
2
+ var util = require('util')
3
+
4
+ var User = exports.User = function User (msg) {
5
+ var err = new Error(msg)
6
+ Error.captureStackTrace(err, User)
7
+ err.code = 'EGAUGE'
8
+ return err
9
+ }
10
+
11
+ exports.MissingTemplateValue = function MissingTemplateValue (item, values) {
12
+ var err = new User(util.format('Missing template value "%s"', item.type))
13
+ Error.captureStackTrace(err, MissingTemplateValue)
14
+ err.template = item
15
+ err.values = values
16
+ return err
17
+ }
18
+
19
+ exports.Internal = function Internal (msg) {
20
+ var err = new Error(msg)
21
+ Error.captureStackTrace(err, Internal)
22
+ err.code = 'EGAUGEINTERNAL'
23
+ return err
24
+ }
@@ -0,0 +1,12 @@
1
+ 'use strict'
2
+
3
+ module.exports = isWin32() || isColorTerm()
4
+
5
+ function isWin32 () {
6
+ return process.platform === 'win32'
7
+ }
8
+
9
+ function isColorTerm () {
10
+ var termHasColor = /^screen|^xterm|^vt100|color|ansi|cygwin|linux/i
11
+ return !!process.env.COLORTERM || termHasColor.test(process.env.TERM)
12
+ }
@@ -0,0 +1,233 @@
1
+ 'use strict'
2
+ var Plumbing = require('./plumbing.js')
3
+ var hasUnicode = require('has-unicode')
4
+ var hasColor = require('./has-color.js')
5
+ var onExit = require('signal-exit')
6
+ var defaultThemes = require('./themes')
7
+ var setInterval = require('./set-interval.js')
8
+ var process = require('./process.js')
9
+ var setImmediate = require('./set-immediate')
10
+
11
+ module.exports = Gauge
12
+
13
+ function callWith (obj, method) {
14
+ return function () {
15
+ return method.call(obj)
16
+ }
17
+ }
18
+
19
+ function Gauge (arg1, arg2) {
20
+ var options, writeTo
21
+ if (arg1 && arg1.write) {
22
+ writeTo = arg1
23
+ options = arg2 || {}
24
+ } else if (arg2 && arg2.write) {
25
+ writeTo = arg2
26
+ options = arg1 || {}
27
+ } else {
28
+ writeTo = process.stderr
29
+ options = arg1 || arg2 || {}
30
+ }
31
+
32
+ this._status = {
33
+ spun: 0,
34
+ section: '',
35
+ subsection: ''
36
+ }
37
+ this._paused = false // are we paused for back pressure?
38
+ this._disabled = true // are all progress bar updates disabled?
39
+ this._showing = false // do we WANT the progress bar on screen
40
+ this._onScreen = false // IS the progress bar on screen
41
+ this._needsRedraw = false // should we print something at next tick?
42
+ this._hideCursor = options.hideCursor == null ? true : options.hideCursor
43
+ this._fixedFramerate = options.fixedFramerate == null
44
+ ? !(/^v0\.8\./.test(process.version))
45
+ : options.fixedFramerate
46
+ this._lastUpdateAt = null
47
+ this._updateInterval = options.updateInterval == null ? 50 : options.updateInterval
48
+
49
+ this._themes = options.themes || defaultThemes
50
+ this._theme = options.theme
51
+ var theme = this._computeTheme(options.theme)
52
+ var template = options.template || [
53
+ {type: 'progressbar', length: 20},
54
+ {type: 'activityIndicator', kerning: 1, length: 1},
55
+ {type: 'section', kerning: 1, default: ''},
56
+ {type: 'subsection', kerning: 1, default: ''}
57
+ ]
58
+ this.setWriteTo(writeTo, options.tty)
59
+ var PlumbingClass = options.Plumbing || Plumbing
60
+ this._gauge = new PlumbingClass(theme, template, this.getWidth())
61
+
62
+ this._$$doRedraw = callWith(this, this._doRedraw)
63
+ this._$$handleSizeChange = callWith(this, this._handleSizeChange)
64
+
65
+ this._cleanupOnExit = options.cleanupOnExit == null || options.cleanupOnExit
66
+ this._removeOnExit = null
67
+
68
+ if (options.enabled || (options.enabled == null && this._tty && this._tty.isTTY)) {
69
+ this.enable()
70
+ } else {
71
+ this.disable()
72
+ }
73
+ }
74
+ Gauge.prototype = {}
75
+
76
+ Gauge.prototype.isEnabled = function () {
77
+ return !this._disabled
78
+ }
79
+
80
+ Gauge.prototype.setTemplate = function (template) {
81
+ this._gauge.setTemplate(template)
82
+ if (this._showing) this._requestRedraw()
83
+ }
84
+
85
+ Gauge.prototype._computeTheme = function (theme) {
86
+ if (!theme) theme = {}
87
+ if (typeof theme === 'string') {
88
+ theme = this._themes.getTheme(theme)
89
+ } else if (theme && (Object.keys(theme).length === 0 || theme.hasUnicode != null || theme.hasColor != null)) {
90
+ var useUnicode = theme.hasUnicode == null ? hasUnicode() : theme.hasUnicode
91
+ var useColor = theme.hasColor == null ? hasColor : theme.hasColor
92
+ theme = this._themes.getDefault({hasUnicode: useUnicode, hasColor: useColor, platform: theme.platform})
93
+ }
94
+ return theme
95
+ }
96
+
97
+ Gauge.prototype.setThemeset = function (themes) {
98
+ this._themes = themes
99
+ this.setTheme(this._theme)
100
+ }
101
+
102
+ Gauge.prototype.setTheme = function (theme) {
103
+ this._gauge.setTheme(this._computeTheme(theme))
104
+ if (this._showing) this._requestRedraw()
105
+ this._theme = theme
106
+ }
107
+
108
+ Gauge.prototype._requestRedraw = function () {
109
+ this._needsRedraw = true
110
+ if (!this._fixedFramerate) this._doRedraw()
111
+ }
112
+
113
+ Gauge.prototype.getWidth = function () {
114
+ return ((this._tty && this._tty.columns) || 80) - 1
115
+ }
116
+
117
+ Gauge.prototype.setWriteTo = function (writeTo, tty) {
118
+ var enabled = !this._disabled
119
+ if (enabled) this.disable()
120
+ this._writeTo = writeTo
121
+ this._tty = tty ||
122
+ (writeTo === process.stderr && process.stdout.isTTY && process.stdout) ||
123
+ (writeTo.isTTY && writeTo) ||
124
+ this._tty
125
+ if (this._gauge) this._gauge.setWidth(this.getWidth())
126
+ if (enabled) this.enable()
127
+ }
128
+
129
+ Gauge.prototype.enable = function () {
130
+ if (!this._disabled) return
131
+ this._disabled = false
132
+ if (this._tty) this._enableEvents()
133
+ if (this._showing) this.show()
134
+ }
135
+
136
+ Gauge.prototype.disable = function () {
137
+ if (this._disabled) return
138
+ if (this._showing) {
139
+ this._lastUpdateAt = null
140
+ this._showing = false
141
+ this._doRedraw()
142
+ this._showing = true
143
+ }
144
+ this._disabled = true
145
+ if (this._tty) this._disableEvents()
146
+ }
147
+
148
+ Gauge.prototype._enableEvents = function () {
149
+ if (this._cleanupOnExit) {
150
+ this._removeOnExit = onExit(callWith(this, this.disable))
151
+ }
152
+ this._tty.on('resize', this._$$handleSizeChange)
153
+ if (this._fixedFramerate) {
154
+ this.redrawTracker = setInterval(this._$$doRedraw, this._updateInterval)
155
+ if (this.redrawTracker.unref) this.redrawTracker.unref()
156
+ }
157
+ }
158
+
159
+ Gauge.prototype._disableEvents = function () {
160
+ this._tty.removeListener('resize', this._$$handleSizeChange)
161
+ if (this._fixedFramerate) clearInterval(this.redrawTracker)
162
+ if (this._removeOnExit) this._removeOnExit()
163
+ }
164
+
165
+ Gauge.prototype.hide = function (cb) {
166
+ if (this._disabled) return cb && process.nextTick(cb)
167
+ if (!this._showing) return cb && process.nextTick(cb)
168
+ this._showing = false
169
+ this._doRedraw()
170
+ cb && setImmediate(cb)
171
+ }
172
+
173
+ Gauge.prototype.show = function (section, completed) {
174
+ this._showing = true
175
+ if (typeof section === 'string') {
176
+ this._status.section = section
177
+ } else if (typeof section === 'object') {
178
+ var sectionKeys = Object.keys(section)
179
+ for (var ii = 0; ii < sectionKeys.length; ++ii) {
180
+ var key = sectionKeys[ii]
181
+ this._status[key] = section[key]
182
+ }
183
+ }
184
+ if (completed != null) this._status.completed = completed
185
+ if (this._disabled) return
186
+ this._requestRedraw()
187
+ }
188
+
189
+ Gauge.prototype.pulse = function (subsection) {
190
+ this._status.subsection = subsection || ''
191
+ this._status.spun ++
192
+ if (this._disabled) return
193
+ if (!this._showing) return
194
+ this._requestRedraw()
195
+ }
196
+
197
+ Gauge.prototype._handleSizeChange = function () {
198
+ this._gauge.setWidth(this._tty.columns - 1)
199
+ this._requestRedraw()
200
+ }
201
+
202
+ Gauge.prototype._doRedraw = function () {
203
+ if (this._disabled || this._paused) return
204
+ if (!this._fixedFramerate) {
205
+ var now = Date.now()
206
+ if (this._lastUpdateAt && now - this._lastUpdateAt < this._updateInterval) return
207
+ this._lastUpdateAt = now
208
+ }
209
+ if (!this._showing && this._onScreen) {
210
+ this._onScreen = false
211
+ var result = this._gauge.hide()
212
+ if (this._hideCursor) {
213
+ result += this._gauge.showCursor()
214
+ }
215
+ return this._writeTo.write(result)
216
+ }
217
+ if (!this._showing && !this._onScreen) return
218
+ if (this._showing && !this._onScreen) {
219
+ this._onScreen = true
220
+ this._needsRedraw = true
221
+ if (this._hideCursor) {
222
+ this._writeTo.write(this._gauge.hideCursor())
223
+ }
224
+ }
225
+ if (!this._needsRedraw) return
226
+ if (!this._writeTo.write(this._gauge.show(this._status))) {
227
+ this._paused = true
228
+ this._writeTo.on('drain', callWith(this, function () {
229
+ this._paused = false
230
+ this._doRedraw()
231
+ }))
232
+ }
233
+ }