fsevents 1.0.15 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


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

Files changed (369) hide show
  1. package/fsevents.js +3 -0
  2. package/install.js +7 -0
  3. package/lib/binding/Release/node-v48-darwin-x64/fse.node +0 -0
  4. package/node_modules/abbrev/abbrev.js +0 -1
  5. package/node_modules/abbrev/package.json +32 -21
  6. package/node_modules/ansi-regex/index.js +1 -1
  7. package/node_modules/ansi-regex/package.json +61 -42
  8. package/node_modules/ansi-regex/readme.md +10 -2
  9. package/node_modules/ansi-styles/package.json +27 -19
  10. package/node_modules/aproba/README.md +33 -3
  11. package/node_modules/aproba/index.js +71 -30
  12. package/node_modules/aproba/package.json +30 -22
  13. package/node_modules/are-we-there-yet/package.json +14 -6
  14. package/node_modules/asn1/package.json +16 -8
  15. package/node_modules/assert-plus/package.json +16 -8
  16. package/node_modules/{node-uuid/LICENSE.md → asynckit/LICENSE} +1 -1
  17. package/node_modules/asynckit/README.md +233 -0
  18. package/node_modules/asynckit/bench.js +76 -0
  19. package/node_modules/asynckit/index.js +6 -0
  20. package/node_modules/asynckit/lib/abort.js +29 -0
  21. package/node_modules/asynckit/lib/async.js +34 -0
  22. package/node_modules/asynckit/lib/defer.js +26 -0
  23. package/node_modules/asynckit/lib/iterate.js +75 -0
  24. package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
  25. package/node_modules/asynckit/lib/readable_parallel.js +25 -0
  26. package/node_modules/asynckit/lib/readable_serial.js +25 -0
  27. package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
  28. package/node_modules/asynckit/lib/state.js +37 -0
  29. package/node_modules/asynckit/lib/streamify.js +141 -0
  30. package/node_modules/asynckit/lib/terminator.js +29 -0
  31. package/node_modules/asynckit/package.json +126 -0
  32. package/node_modules/asynckit/parallel.js +43 -0
  33. package/node_modules/asynckit/serial.js +17 -0
  34. package/node_modules/asynckit/serialOrdered.js +75 -0
  35. package/node_modules/asynckit/stream.js +21 -0
  36. package/node_modules/aws-sign2/package.json +15 -7
  37. package/node_modules/aws4/README.md +9 -0
  38. package/node_modules/aws4/aws4.js +21 -7
  39. package/node_modules/aws4/package.json +62 -54
  40. package/node_modules/balanced-match/package.json +27 -19
  41. package/node_modules/bcrypt-pbkdf/README.md +39 -0
  42. package/node_modules/bcrypt-pbkdf/index.js +556 -0
  43. package/node_modules/bcrypt-pbkdf/package.json +84 -0
  44. package/node_modules/block-stream/package.json +15 -7
  45. package/node_modules/boom/package.json +14 -6
  46. package/node_modules/brace-expansion/index.js +10 -0
  47. package/node_modules/brace-expansion/package.json +35 -27
  48. package/node_modules/buffer-shims/package.json +16 -7
  49. package/node_modules/caseless/package.json +18 -10
  50. package/node_modules/chalk/package.json +30 -22
  51. package/node_modules/code-point-at/index.js +3 -4
  52. package/node_modules/code-point-at/package.json +40 -30
  53. package/node_modules/code-point-at/readme.md +2 -4
  54. package/node_modules/combined-stream/package.json +15 -7
  55. package/node_modules/commander/package.json +16 -8
  56. package/node_modules/concat-map/package.json +30 -22
  57. package/node_modules/console-control-strings/package.json +15 -7
  58. package/node_modules/core-util-is/package.json +22 -14
  59. package/node_modules/cryptiles/package.json +14 -6
  60. package/node_modules/dashdash/CHANGES.md +364 -0
  61. package/node_modules/dashdash/LICENSE.txt +24 -0
  62. package/node_modules/dashdash/etc/dashdash.bash_completion.in +4 -3
  63. package/node_modules/dashdash/node_modules/assert-plus/package.json +16 -8
  64. package/node_modules/dashdash/package.json +33 -24
  65. package/node_modules/debug/package.json +20 -12
  66. package/node_modules/deep-extend/package.json +23 -15
  67. package/node_modules/delayed-stream/package.json +15 -7
  68. package/node_modules/delegates/package.json +14 -6
  69. package/node_modules/ecc-jsbn/package.json +17 -9
  70. package/node_modules/escape-string-regexp/package.json +20 -12
  71. package/node_modules/extend/package.json +16 -8
  72. package/node_modules/extsprintf/package.json +14 -6
  73. package/node_modules/forever-agent/package.json +15 -7
  74. package/node_modules/form-data/README.md +7 -8
  75. package/node_modules/form-data/lib/browser.js +1 -1
  76. package/node_modules/form-data/lib/form_data.js +101 -72
  77. package/node_modules/form-data/lib/populate.js +6 -5
  78. package/node_modules/form-data/package.json +68 -52
  79. package/node_modules/fs.realpath/package.json +19 -11
  80. package/node_modules/fstream/package.json +15 -7
  81. package/node_modules/fstream-ignore/package.json +15 -7
  82. package/node_modules/gauge/CHANGELOG.md +24 -0
  83. package/node_modules/gauge/README.md +4 -0
  84. package/node_modules/gauge/index.js +16 -9
  85. package/node_modules/gauge/package.json +37 -29
  86. package/node_modules/generate-function/package.json +16 -8
  87. package/node_modules/generate-object-property/package.json +14 -6
  88. package/node_modules/getpass/node_modules/assert-plus/package.json +16 -8
  89. package/node_modules/getpass/package.json +16 -8
  90. package/node_modules/glob/README.md +3 -0
  91. package/node_modules/glob/common.js +6 -1
  92. package/node_modules/glob/glob.js +23 -14
  93. package/node_modules/glob/package.json +29 -21
  94. package/node_modules/glob/sync.js +29 -11
  95. package/node_modules/graceful-fs/README.md +1 -1
  96. package/node_modules/graceful-fs/graceful-fs.js +23 -14
  97. package/node_modules/graceful-fs/package.json +35 -27
  98. package/node_modules/graceful-fs/polyfills.js +99 -21
  99. package/node_modules/graceful-readlink/package.json +14 -6
  100. package/node_modules/har-validator/package.json +16 -8
  101. package/node_modules/has-ansi/package.json +29 -21
  102. package/node_modules/has-unicode/package.json +18 -10
  103. package/node_modules/hawk/package.json +18 -10
  104. package/node_modules/hoek/package.json +14 -6
  105. package/node_modules/http-signature/package.json +14 -6
  106. package/node_modules/inflight/inflight.js +22 -12
  107. package/node_modules/inflight/package.json +28 -20
  108. package/node_modules/inherits/inherits.js +7 -1
  109. package/node_modules/inherits/package.json +41 -21
  110. package/node_modules/ini/package.json +15 -7
  111. package/node_modules/is-fullwidth-code-point/package.json +27 -19
  112. package/node_modules/is-my-json-valid/index.js +10 -0
  113. package/node_modules/is-my-json-valid/package.json +36 -20
  114. package/node_modules/is-my-json-valid/test/misc.js +24 -0
  115. package/node_modules/is-property/package.json +19 -11
  116. package/node_modules/is-typedarray/package.json +16 -8
  117. package/node_modules/isarray/package.json +28 -20
  118. package/node_modules/isstream/package.json +19 -11
  119. package/node_modules/jodid25519/package.json +18 -10
  120. package/node_modules/jsbn/index.js +8 -9
  121. package/node_modules/jsbn/package.json +30 -18
  122. package/node_modules/json-schema/lib/links.js +17 -3
  123. package/node_modules/json-schema/lib/validate.js +18 -5
  124. package/node_modules/json-schema/package.json +32 -18
  125. package/node_modules/json-stringify-safe/package.json +18 -10
  126. package/node_modules/{async/LICENSE → jsonpointer/LICENSE.md} +3 -1
  127. package/node_modules/jsonpointer/README.md +17 -10
  128. package/node_modules/jsonpointer/jsonpointer.js +73 -56
  129. package/node_modules/jsonpointer/package.json +47 -26
  130. package/node_modules/jsprim/CHANGES.md +4 -0
  131. package/node_modules/jsprim/package.json +25 -17
  132. package/node_modules/mime-db/HISTORY.md +50 -0
  133. package/node_modules/mime-db/db.json +126 -2
  134. package/node_modules/mime-db/package.json +43 -30
  135. package/node_modules/mime-types/HISTORY.md +19 -0
  136. package/node_modules/mime-types/index.js +8 -8
  137. package/node_modules/mime-types/package.json +32 -19
  138. package/node_modules/minimatch/minimatch.js +19 -20
  139. package/node_modules/minimatch/package.json +25 -17
  140. package/node_modules/minimist/package.json +24 -16
  141. package/node_modules/mkdirp/package.json +21 -13
  142. package/node_modules/ms/package.json +14 -6
  143. package/node_modules/node-pre-gyp/CHANGELOG.md +20 -0
  144. package/node_modules/node-pre-gyp/README.md +574 -0
  145. package/node_modules/node-pre-gyp/appveyor.yml +19 -9
  146. package/node_modules/node-pre-gyp/lib/install.js +31 -7
  147. package/node_modules/node-pre-gyp/lib/node-pre-gyp.js +3 -1
  148. package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +140 -0
  149. package/node_modules/node-pre-gyp/package.json +52 -48
  150. package/node_modules/nopt/package.json +19 -11
  151. package/node_modules/npmlog/CHANGELOG.md +9 -0
  152. package/node_modules/npmlog/README.md +7 -1
  153. package/node_modules/npmlog/log.js +12 -8
  154. package/node_modules/npmlog/package.json +30 -22
  155. package/node_modules/number-is-nan/package.json +39 -30
  156. package/node_modules/number-is-nan/readme.md +1 -3
  157. package/node_modules/oauth-sign/package.json +15 -7
  158. package/node_modules/object-assign/index.js +11 -4
  159. package/node_modules/object-assign/package.json +42 -30
  160. package/node_modules/object-assign/readme.md +8 -3
  161. package/node_modules/once/README.md +28 -0
  162. package/node_modules/once/once.js +21 -0
  163. package/node_modules/once/package.json +31 -20
  164. package/node_modules/path-is-absolute/index.js +5 -5
  165. package/node_modules/path-is-absolute/package.json +45 -31
  166. package/node_modules/path-is-absolute/readme.md +19 -11
  167. package/node_modules/pinkie/package.json +18 -10
  168. package/node_modules/pinkie-promise/package.json +18 -10
  169. package/node_modules/process-nextick-args/package.json +16 -8
  170. package/node_modules/punycode/LICENSE-MIT.txt +20 -0
  171. package/node_modules/punycode/README.md +176 -0
  172. package/node_modules/punycode/package.json +127 -0
  173. package/node_modules/punycode/punycode.js +533 -0
  174. package/node_modules/qs/.eslintrc +15 -15
  175. package/node_modules/qs/CHANGELOG.md +36 -0
  176. package/node_modules/qs/README.md +431 -0
  177. package/node_modules/qs/dist/qs.js +167 -67
  178. package/node_modules/qs/lib/formats.js +18 -0
  179. package/node_modules/qs/lib/index.js +6 -4
  180. package/node_modules/qs/lib/parse.js +31 -32
  181. package/node_modules/qs/lib/stringify.js +83 -20
  182. package/node_modules/qs/lib/utils.js +23 -7
  183. package/node_modules/qs/package.json +40 -30
  184. package/node_modules/qs/test/.eslintrc +10 -0
  185. package/node_modules/qs/test/index.js +2 -0
  186. package/node_modules/qs/test/parse.js +108 -47
  187. package/node_modules/qs/test/stringify.js +261 -28
  188. package/node_modules/qs/test/utils.js +13 -0
  189. package/node_modules/rc/node_modules/minimist/package.json +24 -16
  190. package/node_modules/rc/package.json +35 -23
  191. package/node_modules/readable-stream/.npmignore +1 -0
  192. package/node_modules/readable-stream/.travis.yml +2 -7
  193. package/node_modules/readable-stream/README.md +6 -2
  194. package/node_modules/readable-stream/lib/_stream_readable.js +158 -110
  195. package/node_modules/readable-stream/lib/_stream_transform.js +7 -5
  196. package/node_modules/readable-stream/lib/_stream_writable.js +35 -7
  197. package/node_modules/readable-stream/lib/internal/streams/BufferList.js +64 -0
  198. package/node_modules/readable-stream/package.json +34 -26
  199. package/node_modules/request/CHANGELOG.md +49 -18
  200. package/node_modules/request/README.md +3 -2
  201. package/node_modules/request/index.js +2 -3
  202. package/node_modules/request/lib/auth.js +1 -1
  203. package/node_modules/request/lib/helpers.js +4 -13
  204. package/node_modules/request/lib/multipart.js +1 -1
  205. package/node_modules/request/lib/oauth.js +1 -1
  206. package/node_modules/request/lib/redirect.js +5 -1
  207. package/node_modules/request/package.json +50 -31
  208. package/node_modules/request/request.js +84 -43
  209. package/node_modules/rimraf/package.json +28 -20
  210. package/node_modules/rimraf/rimraf.js +2 -2
  211. package/node_modules/semver/README.md +4 -0
  212. package/node_modules/semver/package.json +27 -19
  213. package/node_modules/semver/semver.js +14 -5
  214. package/node_modules/set-blocking/package.json +21 -13
  215. package/node_modules/signal-exit/CHANGELOG.md +10 -0
  216. package/node_modules/signal-exit/LICENSE.txt +2 -0
  217. package/node_modules/signal-exit/index.js +9 -0
  218. package/node_modules/signal-exit/package.json +32 -24
  219. package/node_modules/signal-exit/signals.js +5 -4
  220. package/node_modules/sntp/package.json +16 -8
  221. package/node_modules/sshpk/README.md +214 -3
  222. package/node_modules/sshpk/bin/sshpk-conv +6 -0
  223. package/node_modules/sshpk/lib/certificate.js +291 -0
  224. package/node_modules/sshpk/lib/errors.js +14 -1
  225. package/node_modules/sshpk/lib/fingerprint.js +28 -7
  226. package/node_modules/sshpk/lib/formats/openssh-cert.js +289 -0
  227. package/node_modules/sshpk/lib/formats/pem.js +2 -2
  228. package/node_modules/sshpk/lib/formats/pkcs8.js +2 -7
  229. package/node_modules/sshpk/lib/formats/ssh-private.js +140 -17
  230. package/node_modules/sshpk/lib/formats/x509-pem.js +77 -0
  231. package/node_modules/sshpk/lib/formats/x509.js +484 -0
  232. package/node_modules/sshpk/lib/identity.js +277 -0
  233. package/node_modules/sshpk/lib/index.js +13 -1
  234. package/node_modules/sshpk/lib/key.js +1 -0
  235. package/node_modules/sshpk/lib/signature.js +14 -6
  236. package/node_modules/sshpk/lib/ssh-buffer.js +24 -0
  237. package/node_modules/sshpk/lib/utils.js +43 -1
  238. package/node_modules/sshpk/node_modules/assert-plus/package.json +16 -8
  239. package/node_modules/sshpk/package.json +32 -22
  240. package/node_modules/string-width/index.js +5 -0
  241. package/node_modules/string-width/package.json +49 -36
  242. package/node_modules/string-width/readme.md +4 -3
  243. package/node_modules/string_decoder/package.json +19 -11
  244. package/node_modules/stringstream/package.json +18 -10
  245. package/node_modules/strip-ansi/package.json +29 -21
  246. package/node_modules/strip-json-comments/index.js +70 -0
  247. package/node_modules/strip-json-comments/package.json +49 -43
  248. package/node_modules/strip-json-comments/readme.md +12 -28
  249. package/node_modules/supports-color/package.json +26 -18
  250. package/node_modules/tar/package.json +19 -11
  251. package/node_modules/tar-pack/README.md +4 -1
  252. package/node_modules/tar-pack/index.js +17 -12
  253. package/node_modules/tar-pack/node_modules/once/LICENSE +15 -0
  254. package/node_modules/tar-pack/node_modules/once/README.md +51 -0
  255. package/node_modules/tar-pack/node_modules/once/once.js +21 -0
  256. package/node_modules/tar-pack/node_modules/once/package.json +96 -0
  257. package/node_modules/tar-pack/node_modules/readable-stream/.npmignore +8 -0
  258. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/.travis.yml +4 -7
  259. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/LICENSE +0 -0
  260. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/README.md +2 -2
  261. package/node_modules/tar-pack/node_modules/readable-stream/doc/stream.md +2015 -0
  262. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/doc/wg-meetings/2015-01-30.md +0 -0
  263. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/duplex.js +0 -0
  264. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_duplex.js +0 -0
  265. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_passthrough.js +0 -0
  266. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_readable.js +164 -107
  267. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_transform.js +3 -3
  268. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/lib/_stream_writable.js +25 -15
  269. package/node_modules/tar-pack/node_modules/readable-stream/lib/internal/streams/BufferList.js +64 -0
  270. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/package.json +50 -30
  271. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/passthrough.js +0 -0
  272. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/readable.js +4 -0
  273. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/transform.js +0 -0
  274. package/node_modules/{bl → tar-pack}/node_modules/readable-stream/writable.js +0 -0
  275. package/node_modules/tar-pack/package.json +39 -22
  276. package/node_modules/tar-pack/test/index.js +43 -1
  277. package/node_modules/tough-cookie/README.md +17 -3
  278. package/node_modules/tough-cookie/lib/cookie.js +6 -12
  279. package/node_modules/tough-cookie/package.json +50 -35
  280. package/node_modules/tunnel-agent/package.json +15 -7
  281. package/node_modules/tweetnacl/AUTHORS.md +28 -0
  282. package/node_modules/tweetnacl/CHANGELOG.md +93 -0
  283. package/node_modules/tweetnacl/LICENSE +24 -0
  284. package/node_modules/tweetnacl/PULL_REQUEST_TEMPLATE.md +20 -0
  285. package/node_modules/tweetnacl/README.md +57 -61
  286. package/node_modules/tweetnacl/nacl-fast.js +22 -52
  287. package/node_modules/tweetnacl/nacl-fast.min.js +2 -2
  288. package/node_modules/tweetnacl/nacl.d.ts +98 -0
  289. package/node_modules/tweetnacl/nacl.js +21 -51
  290. package/node_modules/tweetnacl/nacl.min.js +1 -1
  291. package/node_modules/tweetnacl/package.json +47 -46
  292. package/node_modules/uid-number/package.json +15 -7
  293. package/node_modules/util-deprecate/package.json +21 -13
  294. package/node_modules/uuid/.npmignore +8 -0
  295. package/node_modules/uuid/.travis.yml +5 -0
  296. package/node_modules/uuid/AUTHORS +5 -0
  297. package/node_modules/uuid/HISTORY.md +28 -0
  298. package/node_modules/uuid/LICENSE.md +21 -0
  299. package/node_modules/uuid/README.md +132 -0
  300. package/node_modules/{node-uuid → uuid}/bin/uuid +0 -0
  301. package/node_modules/uuid/index.js +8 -0
  302. package/node_modules/uuid/lib/bytesToUuid.js +23 -0
  303. package/node_modules/uuid/lib/rng-browser.js +33 -0
  304. package/node_modules/uuid/lib/rng.js +10 -0
  305. package/node_modules/uuid/package.json +122 -0
  306. package/node_modules/uuid/test/mocha.opts +3 -0
  307. package/node_modules/uuid/test/test.js +96 -0
  308. package/node_modules/uuid/v1.js +103 -0
  309. package/node_modules/uuid/v4.js +29 -0
  310. package/node_modules/verror/package.json +14 -6
  311. package/node_modules/wide-align/package.json +19 -11
  312. package/node_modules/wrappy/package.json +17 -8
  313. package/node_modules/xtend/package.json +29 -21
  314. package/package.json +2 -2
  315. package/node_modules/async/CHANGELOG.md +0 -125
  316. package/node_modules/async/README.md +0 -1877
  317. package/node_modules/async/dist/async.js +0 -1265
  318. package/node_modules/async/dist/async.min.js +0 -2
  319. package/node_modules/async/lib/async.js +0 -1265
  320. package/node_modules/async/package.json +0 -149
  321. package/node_modules/bl/.jshintrc +0 -59
  322. package/node_modules/bl/.npmignore +0 -1
  323. package/node_modules/bl/.travis.yml +0 -13
  324. package/node_modules/bl/LICENSE.md +0 -13
  325. package/node_modules/bl/README.md +0 -200
  326. package/node_modules/bl/bl.js +0 -243
  327. package/node_modules/bl/node_modules/readable-stream/.npmignore +0 -5
  328. package/node_modules/bl/node_modules/readable-stream/.zuul.yml +0 -1
  329. package/node_modules/bl/node_modules/readable-stream/doc/stream.markdown +0 -1760
  330. package/node_modules/bl/package.json +0 -96
  331. package/node_modules/bl/test/test.js +0 -640
  332. package/node_modules/form-data/.dockerignore +0 -7
  333. package/node_modules/form-data/.editorconfig +0 -10
  334. package/node_modules/form-data/.eslintignore +0 -1
  335. package/node_modules/form-data/.eslintrc +0 -64
  336. package/node_modules/form-data/wercker.yml +0 -36
  337. package/node_modules/gauge/CHANGELOG.md~ +0 -123
  338. package/node_modules/gauge/README.md~ +0 -393
  339. package/node_modules/has-color/index.js +0 -32
  340. package/node_modules/has-color/package.json +0 -97
  341. package/node_modules/has-color/readme.md +0 -30
  342. package/node_modules/inherits/test.js +0 -25
  343. package/node_modules/jsonpointer/.travis.yml +0 -10
  344. package/node_modules/jsonpointer/test.js +0 -98
  345. package/node_modules/node-uuid/.npmignore +0 -4
  346. package/node_modules/node-uuid/README.md +0 -254
  347. package/node_modules/node-uuid/benchmark/README.md +0 -53
  348. package/node_modules/node-uuid/benchmark/bench.gnu +0 -174
  349. package/node_modules/node-uuid/benchmark/bench.sh +0 -34
  350. package/node_modules/node-uuid/benchmark/benchmark-native.c +0 -34
  351. package/node_modules/node-uuid/benchmark/benchmark.js +0 -84
  352. package/node_modules/node-uuid/bower.json +0 -23
  353. package/node_modules/node-uuid/component.json +0 -25
  354. package/node_modules/node-uuid/package.json +0 -105
  355. package/node_modules/node-uuid/test/compare_v1.js +0 -63
  356. package/node_modules/node-uuid/test/test.html +0 -17
  357. package/node_modules/node-uuid/test/test.js +0 -231
  358. package/node_modules/node-uuid/uuid.js +0 -272
  359. package/node_modules/npmlog/CHANGELOG.md~ +0 -31
  360. package/node_modules/qs/.jscs.json +0 -176
  361. package/node_modules/qs/CONTRIBUTING.md +0 -1
  362. package/node_modules/readable-stream/doc/stream.md +0 -1772
  363. package/node_modules/request/.eslintrc +0 -45
  364. package/node_modules/request/.npmignore +0 -6
  365. package/node_modules/request/.travis.yml +0 -21
  366. package/node_modules/request/CONTRIBUTING.md +0 -81
  367. package/node_modules/request/codecov.yml +0 -2
  368. package/node_modules/strip-json-comments/cli.js +0 -41
  369. package/node_modules/strip-json-comments/strip-json-comments.js +0 -73
@@ -1,45 +1,53 @@
1
1
  {
2
2
  "_args": [
3
3
  [
4
- "aproba@^1.0.3",
4
+ {
5
+ "raw": "aproba@^1.0.3",
6
+ "scope": null,
7
+ "escapedName": "aproba",
8
+ "name": "aproba",
9
+ "rawSpec": "^1.0.3",
10
+ "spec": ">=1.0.3 <2.0.0",
11
+ "type": "range"
12
+ },
5
13
  "/Users/eshanker/Code/fsevents/node_modules/gauge"
6
14
  ]
7
15
  ],
8
16
  "_from": "aproba@>=1.0.3 <2.0.0",
9
- "_id": "aproba@1.0.4",
17
+ "_id": "aproba@1.1.1",
10
18
  "_inCache": true,
11
- "_installable": true,
12
19
  "_location": "/aproba",
13
- "_nodeVersion": "4.4.0",
20
+ "_nodeVersion": "7.5.0",
14
21
  "_npmOperationalInternal": {
15
- "host": "packages-12-west.internal.npmjs.com",
16
- "tmp": "tmp/aproba-1.0.4.tgz_1466718885402_0.5348939662799239"
22
+ "host": "packages-18-east.internal.npmjs.com",
23
+ "tmp": "tmp/aproba-1.1.1.tgz_1486593129508_0.5718816472217441"
17
24
  },
18
25
  "_npmUser": {
19
- "email": "me@re-becca.org",
20
- "name": "iarna"
26
+ "name": "iarna",
27
+ "email": "me@re-becca.org"
21
28
  },
22
- "_npmVersion": "3.10.2",
29
+ "_npmVersion": "4.2.0",
23
30
  "_phantomChildren": {},
24
31
  "_requested": {
25
- "name": "aproba",
26
32
  "raw": "aproba@^1.0.3",
27
- "rawSpec": "^1.0.3",
28
33
  "scope": null,
34
+ "escapedName": "aproba",
35
+ "name": "aproba",
36
+ "rawSpec": "^1.0.3",
29
37
  "spec": ">=1.0.3 <2.0.0",
30
38
  "type": "range"
31
39
  },
32
40
  "_requiredBy": [
33
41
  "/gauge"
34
42
  ],
35
- "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.0.4.tgz",
36
- "_shasum": "2713680775e7614c8ba186c065d4e2e52d1072c0",
43
+ "_resolved": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz",
44
+ "_shasum": "95d3600f07710aa0e9298c726ad5ecf2eacbabab",
37
45
  "_shrinkwrap": null,
38
46
  "_spec": "aproba@^1.0.3",
39
47
  "_where": "/Users/eshanker/Code/fsevents/node_modules/gauge",
40
48
  "author": {
41
- "email": "me@re-becca.org",
42
- "name": "Rebecca Turner"
49
+ "name": "Rebecca Turner",
50
+ "email": "me@re-becca.org"
43
51
  },
44
52
  "bugs": {
45
53
  "url": "https://github.com/iarna/aproba/issues"
@@ -47,20 +55,20 @@
47
55
  "dependencies": {},
48
56
  "description": "A rediculously light-weight argument validator",
49
57
  "devDependencies": {
50
- "standard": "^7.1.2",
51
- "tap": "^5.7.3"
58
+ "standard": "^8.6.0",
59
+ "tap": "^10.0.2"
52
60
  },
53
61
  "directories": {
54
62
  "test": "test"
55
63
  },
56
64
  "dist": {
57
- "shasum": "2713680775e7614c8ba186c065d4e2e52d1072c0",
58
- "tarball": "https://registry.npmjs.org/aproba/-/aproba-1.0.4.tgz"
65
+ "shasum": "95d3600f07710aa0e9298c726ad5ecf2eacbabab",
66
+ "tarball": "https://registry.npmjs.org/aproba/-/aproba-1.1.1.tgz"
59
67
  },
60
68
  "files": [
61
69
  "index.js"
62
70
  ],
63
- "gitHead": "c6c8f82d519b9ec3816f20f23a9101083c022200",
71
+ "gitHead": "e7c76b4b42356092db3cd9e2d9388a0134845eb2",
64
72
  "homepage": "https://github.com/iarna/aproba",
65
73
  "keywords": [
66
74
  "argument",
@@ -82,7 +90,7 @@
82
90
  "url": "git+https://github.com/iarna/aproba.git"
83
91
  },
84
92
  "scripts": {
85
- "test": "standard && tap test/*.js"
93
+ "test": "standard && tap -j3 test/*.js"
86
94
  },
87
- "version": "1.0.4"
95
+ "version": "1.1.1"
88
96
  }
@@ -1,14 +1,21 @@
1
1
  {
2
2
  "_args": [
3
3
  [
4
- "are-we-there-yet@~1.1.2",
4
+ {
5
+ "raw": "are-we-there-yet@~1.1.2",
6
+ "scope": null,
7
+ "escapedName": "are-we-there-yet",
8
+ "name": "are-we-there-yet",
9
+ "rawSpec": "~1.1.2",
10
+ "spec": ">=1.1.2 <1.2.0",
11
+ "type": "range"
12
+ },
5
13
  "/Users/eshanker/Code/fsevents/node_modules/npmlog"
6
14
  ]
7
15
  ],
8
16
  "_from": "are-we-there-yet@>=1.1.2 <1.2.0",
9
17
  "_id": "are-we-there-yet@1.1.2",
10
18
  "_inCache": true,
11
- "_installable": true,
12
19
  "_location": "/are-we-there-yet",
13
20
  "_nodeVersion": "4.2.2",
14
21
  "_npmOperationalInternal": {
@@ -16,16 +23,17 @@
16
23
  "tmp": "tmp/are-we-there-yet-1.1.2.tgz_1458084397358_0.15847722673788667"
17
24
  },
18
25
  "_npmUser": {
19
- "email": "me@re-becca.org",
20
- "name": "iarna"
26
+ "name": "iarna",
27
+ "email": "me@re-becca.org"
21
28
  },
22
29
  "_npmVersion": "3.8.1",
23
30
  "_phantomChildren": {},
24
31
  "_requested": {
25
- "name": "are-we-there-yet",
26
32
  "raw": "are-we-there-yet@~1.1.2",
27
- "rawSpec": "~1.1.2",
28
33
  "scope": null,
34
+ "escapedName": "are-we-there-yet",
35
+ "name": "are-we-there-yet",
36
+ "rawSpec": "~1.1.2",
29
37
  "spec": ">=1.1.2 <1.2.0",
30
38
  "type": "range"
31
39
  },
@@ -1,26 +1,34 @@
1
1
  {
2
2
  "_args": [
3
3
  [
4
- "asn1@~0.2.3",
4
+ {
5
+ "raw": "asn1@~0.2.3",
6
+ "scope": null,
7
+ "escapedName": "asn1",
8
+ "name": "asn1",
9
+ "rawSpec": "~0.2.3",
10
+ "spec": ">=0.2.3 <0.3.0",
11
+ "type": "range"
12
+ },
5
13
  "/Users/eshanker/Code/fsevents/node_modules/sshpk"
6
14
  ]
7
15
  ],
8
16
  "_from": "asn1@>=0.2.3 <0.3.0",
9
17
  "_id": "asn1@0.2.3",
10
18
  "_inCache": true,
11
- "_installable": true,
12
19
  "_location": "/asn1",
13
20
  "_npmUser": {
14
- "email": "patrick.f.mooney@gmail.com",
15
- "name": "pfmooney"
21
+ "name": "pfmooney",
22
+ "email": "patrick.f.mooney@gmail.com"
16
23
  },
17
24
  "_npmVersion": "1.4.28",
18
25
  "_phantomChildren": {},
19
26
  "_requested": {
20
- "name": "asn1",
21
27
  "raw": "asn1@~0.2.3",
22
- "rawSpec": "~0.2.3",
23
28
  "scope": null,
29
+ "escapedName": "asn1",
30
+ "name": "asn1",
31
+ "rawSpec": "~0.2.3",
24
32
  "spec": ">=0.2.3 <0.3.0",
25
33
  "type": "range"
26
34
  },
@@ -33,8 +41,8 @@
33
41
  "_spec": "asn1@~0.2.3",
34
42
  "_where": "/Users/eshanker/Code/fsevents/node_modules/sshpk",
35
43
  "author": {
36
- "email": "mcavage@gmail.com",
37
- "name": "Mark Cavage"
44
+ "name": "Mark Cavage",
45
+ "email": "mcavage@gmail.com"
38
46
  },
39
47
  "bugs": {
40
48
  "url": "https://github.com/mcavage/node-asn1/issues"
@@ -1,27 +1,35 @@
1
1
  {
2
2
  "_args": [
3
3
  [
4
- "assert-plus@^0.2.0",
4
+ {
5
+ "raw": "assert-plus@^0.2.0",
6
+ "scope": null,
7
+ "escapedName": "assert-plus",
8
+ "name": "assert-plus",
9
+ "rawSpec": "^0.2.0",
10
+ "spec": ">=0.2.0 <0.3.0",
11
+ "type": "range"
12
+ },
5
13
  "/Users/eshanker/Code/fsevents/node_modules/http-signature"
6
14
  ]
7
15
  ],
8
16
  "_from": "assert-plus@>=0.2.0 <0.3.0",
9
17
  "_id": "assert-plus@0.2.0",
10
18
  "_inCache": true,
11
- "_installable": true,
12
19
  "_location": "/assert-plus",
13
20
  "_nodeVersion": "0.10.36",
14
21
  "_npmUser": {
15
- "email": "patrick.f.mooney@gmail.com",
16
- "name": "pfmooney"
22
+ "name": "pfmooney",
23
+ "email": "patrick.f.mooney@gmail.com"
17
24
  },
18
25
  "_npmVersion": "3.3.8",
19
26
  "_phantomChildren": {},
20
27
  "_requested": {
21
- "name": "assert-plus",
22
28
  "raw": "assert-plus@^0.2.0",
23
- "rawSpec": "^0.2.0",
24
29
  "scope": null,
30
+ "escapedName": "assert-plus",
31
+ "name": "assert-plus",
32
+ "rawSpec": "^0.2.0",
25
33
  "spec": ">=0.2.0 <0.3.0",
26
34
  "type": "range"
27
35
  },
@@ -34,8 +42,8 @@
34
42
  "_spec": "assert-plus@^0.2.0",
35
43
  "_where": "/Users/eshanker/Code/fsevents/node_modules/http-signature",
36
44
  "author": {
37
- "email": "mcavage@gmail.com",
38
- "name": "Mark Cavage"
45
+ "name": "Mark Cavage",
46
+ "email": "mcavage@gmail.com"
39
47
  },
40
48
  "bugs": {
41
49
  "url": "https://github.com/mcavage/node-assert-plus/issues"
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2010-2012 Robert Kieffer
3
+ Copyright (c) 2016 Alex Indigo
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
@@ -0,0 +1,233 @@
1
+ # asynckit [![NPM Module](https://img.shields.io/npm/v/asynckit.svg?style=flat)](https://www.npmjs.com/package/asynckit)
2
+
3
+ Minimal async jobs utility library, with streams support.
4
+
5
+ [![PhantomJS Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=browser&style=flat)](https://travis-ci.org/alexindigo/asynckit)
6
+ [![Linux Build](https://img.shields.io/travis/alexindigo/asynckit/v0.4.0.svg?label=linux:0.12-6.x&style=flat)](https://travis-ci.org/alexindigo/asynckit)
7
+ [![Windows Build](https://img.shields.io/appveyor/ci/alexindigo/asynckit/v0.4.0.svg?label=windows:0.12-6.x&style=flat)](https://ci.appveyor.com/project/alexindigo/asynckit)
8
+
9
+ [![Coverage Status](https://img.shields.io/coveralls/alexindigo/asynckit/v0.4.0.svg?label=code+coverage&style=flat)](https://coveralls.io/github/alexindigo/asynckit?branch=master)
10
+ [![Dependency Status](https://img.shields.io/david/alexindigo/asynckit/v0.4.0.svg?style=flat)](https://david-dm.org/alexindigo/asynckit)
11
+ [![bitHound Overall Score](https://www.bithound.io/github/alexindigo/asynckit/badges/score.svg)](https://www.bithound.io/github/alexindigo/asynckit)
12
+
13
+ <!-- [![Readme](https://img.shields.io/badge/readme-tested-brightgreen.svg?style=flat)](https://www.npmjs.com/package/reamde) -->
14
+
15
+ AsyncKit provides harness for `parallel` and `serial` iterators over list of items represented by arrays or objects.
16
+ Optionally it accepts abort function (should be synchronously return by iterator for each item), and terminates left over jobs upon an error event. For specific iteration order built-in (`ascending` and `descending`) and custom sort helpers also supported, via `asynckit.serialOrdered` method.
17
+
18
+ It ensures async operations to keep behavior more stable and prevent `Maximum call stack size exceeded` errors, from sync iterators.
19
+
20
+ | compression | size |
21
+ | :----------------- | -------: |
22
+ | asynckit.js | 12.34 kB |
23
+ | asynckit.min.js | 4.11 kB |
24
+ | asynckit.min.js.gz | 1.47 kB |
25
+
26
+
27
+ ## Install
28
+
29
+ ```sh
30
+ $ npm install --save asynckit
31
+ ```
32
+
33
+ ## Examples
34
+
35
+ ### Parallel Jobs
36
+
37
+ Runs iterator over provided array in parallel. Stores output in the `result` array,
38
+ on the matching positions. In unlikely event of an error from one of the jobs,
39
+ will terminate rest of the active jobs (if abort function is provided)
40
+ and return error along with salvaged data to the main callback function.
41
+
42
+ #### Input Array
43
+
44
+ ```javascript
45
+ var parallel = require('asynckit').parallel
46
+ , assert = require('assert')
47
+ ;
48
+
49
+ var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
50
+ , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
51
+ , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
52
+ , target = []
53
+ ;
54
+
55
+ parallel(source, asyncJob, function(err, result)
56
+ {
57
+ assert.deepEqual(result, expectedResult);
58
+ assert.deepEqual(target, expectedTarget);
59
+ });
60
+
61
+ // async job accepts one element from the array
62
+ // and a callback function
63
+ function asyncJob(item, cb)
64
+ {
65
+ // different delays (in ms) per item
66
+ var delay = item * 25;
67
+
68
+ // pretend different jobs take different time to finish
69
+ // and not in consequential order
70
+ var timeoutId = setTimeout(function() {
71
+ target.push(item);
72
+ cb(null, item * 2);
73
+ }, delay);
74
+
75
+ // allow to cancel "leftover" jobs upon error
76
+ // return function, invoking of which will abort this job
77
+ return clearTimeout.bind(null, timeoutId);
78
+ }
79
+ ```
80
+
81
+ More examples could be found in [test/test-parallel-array.js](test/test-parallel-array.js).
82
+
83
+ #### Input Object
84
+
85
+ Also it supports named jobs, listed via object.
86
+
87
+ ```javascript
88
+ var parallel = require('asynckit/parallel')
89
+ , assert = require('assert')
90
+ ;
91
+
92
+ var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
93
+ , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
94
+ , expectedTarget = [ 1, 1, 2, 4, 8, 16, 32, 64 ]
95
+ , expectedKeys = [ 'first', 'one', 'two', 'four', 'eight', 'sixteen', 'thirtyTwo', 'sixtyFour' ]
96
+ , target = []
97
+ , keys = []
98
+ ;
99
+
100
+ parallel(source, asyncJob, function(err, result)
101
+ {
102
+ assert.deepEqual(result, expectedResult);
103
+ assert.deepEqual(target, expectedTarget);
104
+ assert.deepEqual(keys, expectedKeys);
105
+ });
106
+
107
+ // supports full value, key, callback (shortcut) interface
108
+ function asyncJob(item, key, cb)
109
+ {
110
+ // different delays (in ms) per item
111
+ var delay = item * 25;
112
+
113
+ // pretend different jobs take different time to finish
114
+ // and not in consequential order
115
+ var timeoutId = setTimeout(function() {
116
+ keys.push(key);
117
+ target.push(item);
118
+ cb(null, item * 2);
119
+ }, delay);
120
+
121
+ // allow to cancel "leftover" jobs upon error
122
+ // return function, invoking of which will abort this job
123
+ return clearTimeout.bind(null, timeoutId);
124
+ }
125
+ ```
126
+
127
+ More examples could be found in [test/test-parallel-object.js](test/test-parallel-object.js).
128
+
129
+ ### Serial Jobs
130
+
131
+ Runs iterator over provided array sequentially. Stores output in the `result` array,
132
+ on the matching positions. In unlikely event of an error from one of the jobs,
133
+ will not proceed to the rest of the items in the list
134
+ and return error along with salvaged data to the main callback function.
135
+
136
+ #### Input Array
137
+
138
+ ```javascript
139
+ var serial = require('asynckit/serial')
140
+ , assert = require('assert')
141
+ ;
142
+
143
+ var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
144
+ , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
145
+ , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
146
+ , target = []
147
+ ;
148
+
149
+ serial(source, asyncJob, function(err, result)
150
+ {
151
+ assert.deepEqual(result, expectedResult);
152
+ assert.deepEqual(target, expectedTarget);
153
+ });
154
+
155
+ // extended interface (item, key, callback)
156
+ // also supported for arrays
157
+ function asyncJob(item, key, cb)
158
+ {
159
+ target.push(key);
160
+
161
+ // it will be automatically made async
162
+ // even it iterator "returns" in the same event loop
163
+ cb(null, item * 2);
164
+ }
165
+ ```
166
+
167
+ More examples could be found in [test/test-serial-array.js](test/test-serial-array.js).
168
+
169
+ #### Input Object
170
+
171
+ Also it supports named jobs, listed via object.
172
+
173
+ ```javascript
174
+ var serial = require('asynckit').serial
175
+ , assert = require('assert')
176
+ ;
177
+
178
+ var source = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
179
+ , expectedResult = [ 2, 2, 8, 32, 128, 64, 16, 4 ]
180
+ , expectedTarget = [ 0, 1, 2, 3, 4, 5, 6, 7 ]
181
+ , target = []
182
+ ;
183
+
184
+ var source = { first: 1, one: 1, four: 4, sixteen: 16, sixtyFour: 64, thirtyTwo: 32, eight: 8, two: 2 }
185
+ , expectedResult = { first: 2, one: 2, four: 8, sixteen: 32, sixtyFour: 128, thirtyTwo: 64, eight: 16, two: 4 }
186
+ , expectedTarget = [ 1, 1, 4, 16, 64, 32, 8, 2 ]
187
+ , target = []
188
+ ;
189
+
190
+
191
+ serial(source, asyncJob, function(err, result)
192
+ {
193
+ assert.deepEqual(result, expectedResult);
194
+ assert.deepEqual(target, expectedTarget);
195
+ });
196
+
197
+ // shortcut interface (item, callback)
198
+ // works for object as well as for the arrays
199
+ function asyncJob(item, cb)
200
+ {
201
+ target.push(item);
202
+
203
+ // it will be automatically made async
204
+ // even it iterator "returns" in the same event loop
205
+ cb(null, item * 2);
206
+ }
207
+ ```
208
+
209
+ More examples could be found in [test/test-serial-object.js](test/test-serial-object.js).
210
+
211
+ _Note: Since _object_ is an _unordered_ collection of properties,
212
+ it may produce unexpected results with sequential iterations.
213
+ Whenever order of the jobs' execution is important please use `serialOrdered` method._
214
+
215
+ ### Ordered Serial Iterations
216
+
217
+ TBD
218
+
219
+ For example [compare-property](compare-property) package.
220
+
221
+ ### Streaming interface
222
+
223
+ TBD
224
+
225
+ ## Want to Know More?
226
+
227
+ More examples can be found in [test folder](test/).
228
+
229
+ Or open an [issue](https://github.com/alexindigo/asynckit/issues) with questions and/or suggestions.
230
+
231
+ ## License
232
+
233
+ AsyncKit is licensed under the MIT license.
@@ -0,0 +1,76 @@
1
+ /* eslint no-console: "off" */
2
+
3
+ var asynckit = require('./')
4
+ , async = require('async')
5
+ , assert = require('assert')
6
+ , expected = 0
7
+ ;
8
+
9
+ var Benchmark = require('benchmark');
10
+ var suite = new Benchmark.Suite;
11
+
12
+ var source = [];
13
+ for (var z = 1; z < 100; z++)
14
+ {
15
+ source.push(z);
16
+ expected += z;
17
+ }
18
+
19
+ suite
20
+ // add tests
21
+
22
+ .add('async.map', function(deferred)
23
+ {
24
+ var total = 0;
25
+
26
+ async.map(source,
27
+ function(i, cb)
28
+ {
29
+ setImmediate(function()
30
+ {
31
+ total += i;
32
+ cb(null, total);
33
+ });
34
+ },
35
+ function(err, result)
36
+ {
37
+ assert.ifError(err);
38
+ assert.equal(result[result.length - 1], expected);
39
+ deferred.resolve();
40
+ });
41
+ }, {'defer': true})
42
+
43
+
44
+ .add('asynckit.parallel', function(deferred)
45
+ {
46
+ var total = 0;
47
+
48
+ asynckit.parallel(source,
49
+ function(i, cb)
50
+ {
51
+ setImmediate(function()
52
+ {
53
+ total += i;
54
+ cb(null, total);
55
+ });
56
+ },
57
+ function(err, result)
58
+ {
59
+ assert.ifError(err);
60
+ assert.equal(result[result.length - 1], expected);
61
+ deferred.resolve();
62
+ });
63
+ }, {'defer': true})
64
+
65
+
66
+ // add listeners
67
+ .on('cycle', function(ev)
68
+ {
69
+ console.log(String(ev.target));
70
+ })
71
+ .on('complete', function()
72
+ {
73
+ console.log('Fastest is ' + this.filter('fastest').map('name'));
74
+ })
75
+ // run async
76
+ .run({ 'async': true });
@@ -0,0 +1,6 @@
1
+ module.exports =
2
+ {
3
+ parallel : require('./parallel.js'),
4
+ serial : require('./serial.js'),
5
+ serialOrdered : require('./serialOrdered.js')
6
+ };
@@ -0,0 +1,29 @@
1
+ // API
2
+ module.exports = abort;
3
+
4
+ /**
5
+ * Aborts leftover active jobs
6
+ *
7
+ * @param {object} state - current state object
8
+ */
9
+ function abort(state)
10
+ {
11
+ Object.keys(state.jobs).forEach(clean.bind(state));
12
+
13
+ // reset leftover jobs
14
+ state.jobs = {};
15
+ }
16
+
17
+ /**
18
+ * Cleans up leftover job by invoking abort function for the provided job id
19
+ *
20
+ * @this state
21
+ * @param {string|number} key - job id to abort
22
+ */
23
+ function clean(key)
24
+ {
25
+ if (typeof this.jobs[key] == 'function')
26
+ {
27
+ this.jobs[key]();
28
+ }
29
+ }
@@ -0,0 +1,34 @@
1
+ var defer = require('./defer.js');
2
+
3
+ // API
4
+ module.exports = async;
5
+
6
+ /**
7
+ * Runs provided callback asynchronously
8
+ * even if callback itself is not
9
+ *
10
+ * @param {function} callback - callback to invoke
11
+ * @returns {function} - augmented callback
12
+ */
13
+ function async(callback)
14
+ {
15
+ var isAsync = false;
16
+
17
+ // check if async happened
18
+ defer(function() { isAsync = true; });
19
+
20
+ return function async_callback(err, result)
21
+ {
22
+ if (isAsync)
23
+ {
24
+ callback(err, result);
25
+ }
26
+ else
27
+ {
28
+ defer(function nextTick_callback()
29
+ {
30
+ callback(err, result);
31
+ });
32
+ }
33
+ };
34
+ }
@@ -0,0 +1,26 @@
1
+ module.exports = defer;
2
+
3
+ /**
4
+ * Runs provided function on next iteration of the event loop
5
+ *
6
+ * @param {function} fn - function to run
7
+ */
8
+ function defer(fn)
9
+ {
10
+ var nextTick = typeof setImmediate == 'function'
11
+ ? setImmediate
12
+ : (
13
+ typeof process == 'object' && typeof process.nextTick == 'function'
14
+ ? process.nextTick
15
+ : null
16
+ );
17
+
18
+ if (nextTick)
19
+ {
20
+ nextTick(fn);
21
+ }
22
+ else
23
+ {
24
+ setTimeout(fn, 0);
25
+ }
26
+ }