fsevents 1.0.7 → 1.0.8
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.
- package/node_modules/ansi/History.md +7 -0
- package/node_modules/ansi/LICENSE +24 -0
- package/node_modules/ansi/lib/ansi.js +2 -2
- package/node_modules/ansi/package.json +15 -10
- package/node_modules/ansi-regex/package.json +1 -0
- package/node_modules/ansi-styles/package.json +1 -0
- package/node_modules/are-we-there-yet/.npmignore +2 -0
- package/node_modules/are-we-there-yet/index.js +20 -18
- package/node_modules/are-we-there-yet/package.json +15 -13
- package/node_modules/asn1/package.json +3 -1
- package/node_modules/assert-plus/README.md +50 -21
- package/node_modules/assert-plus/assert.js +168 -207
- package/node_modules/assert-plus/package.json +55 -15
- package/node_modules/async/README.md +86 -4
- package/node_modules/async/dist/async.js +4 -3
- package/node_modules/async/dist/async.min.js +1 -1
- package/node_modules/async/lib/async.js +4 -3
- package/node_modules/async/package.json +10 -10
- package/node_modules/aws-sign2/package.json +1 -0
- package/node_modules/aws4/.npmignore +3 -0
- package/node_modules/aws4/.tern-port +1 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match → aws4}/.travis.yml +2 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/LICENSE.md → aws4/LICENSE} +1 -3
- package/node_modules/aws4/README.md +510 -0
- package/node_modules/aws4/aws4.js +313 -0
- package/node_modules/aws4/example.js +372 -0
- package/node_modules/aws4/node_modules/lru-cache/.npmignore +1 -0
- package/node_modules/aws4/node_modules/lru-cache/.travis.yml +8 -0
- package/node_modules/aws4/node_modules/lru-cache/CONTRIBUTORS +14 -0
- package/node_modules/aws4/node_modules/lru-cache/README.md +137 -0
- package/node_modules/aws4/node_modules/lru-cache/lib/lru-cache.js +334 -0
- package/node_modules/aws4/node_modules/lru-cache/package.json +66 -0
- package/node_modules/aws4/node_modules/lru-cache/test/basic.js +396 -0
- package/node_modules/aws4/node_modules/lru-cache/test/foreach.js +120 -0
- package/node_modules/aws4/node_modules/lru-cache/test/memory-leak.js +51 -0
- package/node_modules/aws4/node_modules/lru-cache/test/serialize.js +216 -0
- package/node_modules/aws4/package.json +113 -0
- package/node_modules/bl/.travis.yml +5 -6
- package/node_modules/bl/bl.js +5 -0
- package/node_modules/bl/package.json +16 -13
- package/node_modules/bl/test/test.js +554 -6
- package/node_modules/block-stream/package.json +1 -0
- package/node_modules/boom/package.json +1 -0
- package/node_modules/caseless/package.json +1 -0
- package/node_modules/chalk/package.json +1 -0
- package/node_modules/combined-stream/package.json +1 -0
- package/node_modules/commander/package.json +1 -0
- package/node_modules/core-util-is/package.json +2 -2
- package/node_modules/cryptiles/package.json +1 -0
- package/node_modules/dashdash/README.md +70 -7
- package/node_modules/dashdash/etc/dashdash.bash_completion.in +388 -0
- package/node_modules/dashdash/lib/dashdash.js +202 -2
- package/node_modules/dashdash/package.json +12 -9
- package/node_modules/debug/.jshintrc +3 -0
- package/node_modules/debug/.npmignore +6 -0
- package/node_modules/debug/History.md +195 -0
- package/node_modules/debug/Makefile +36 -0
- package/node_modules/debug/Readme.md +86 -13
- package/node_modules/debug/bower.json +28 -0
- package/node_modules/debug/browser.js +168 -0
- package/node_modules/debug/component.json +19 -0
- package/node_modules/debug/debug.js +132 -72
- package/node_modules/debug/node.js +209 -0
- package/node_modules/debug/package.json +32 -22
- package/node_modules/deep-extend/README.md +51 -50
- package/node_modules/deep-extend/package.json +14 -16
- package/node_modules/delayed-stream/package.json +1 -0
- package/node_modules/delegates/History.md +6 -0
- package/node_modules/delegates/License +20 -0
- package/node_modules/delegates/package.json +17 -13
- package/node_modules/ecc-jsbn/package.json +3 -1
- package/node_modules/escape-string-regexp/package.json +2 -2
- package/node_modules/extend/package.json +1 -0
- package/node_modules/extsprintf/package.json +4 -2
- package/node_modules/forever-agent/package.json +1 -0
- package/node_modules/form-data/package.json +1 -0
- package/node_modules/fstream/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/node_modules/brace-expansion/package.json +1 -0
- package/node_modules/fstream-ignore/node_modules/minimatch/package.json +1 -0
- package/node_modules/fstream-ignore/package.json +3 -1
- package/node_modules/gauge/package.json +14 -12
- package/node_modules/gauge/progress-bar.js +4 -5
- package/node_modules/gauge/test/progress-bar.js +1 -1
- package/node_modules/generate-function/package.json +1 -0
- package/node_modules/generate-object-property/package.json +1 -0
- package/node_modules/graceful-fs/README.md +17 -0
- package/node_modules/graceful-fs/graceful-fs.js +2 -0
- package/node_modules/graceful-fs/package.json +16 -11
- package/node_modules/graceful-readlink/package.json +1 -0
- package/node_modules/har-validator/README.md +45 -122
- package/node_modules/har-validator/package.json +16 -16
- package/node_modules/has-ansi/package.json +1 -0
- package/node_modules/has-unicode/README.md +6 -3
- package/node_modules/has-unicode/index.js +7 -3
- package/node_modules/has-unicode/package.json +15 -13
- package/node_modules/has-unicode/test/index.js +1 -1
- package/node_modules/hawk/README.md +634 -634
- package/node_modules/hawk/bower.json +24 -24
- package/node_modules/hawk/component.json +18 -18
- package/node_modules/hawk/dist/client.js +343 -340
- package/node_modules/hawk/example/usage.js +78 -78
- package/node_modules/hawk/lib/browser.js +637 -637
- package/node_modules/hawk/lib/client.js +369 -369
- package/node_modules/hawk/lib/crypto.js +126 -126
- package/node_modules/hawk/lib/index.js +15 -15
- package/node_modules/hawk/lib/server.js +548 -540
- package/node_modules/hawk/lib/utils.js +184 -164
- package/node_modules/hawk/package.json +9 -8
- package/node_modules/hawk/test/browser.js +1492 -1492
- package/node_modules/hawk/test/client.js +440 -440
- package/node_modules/hawk/test/crypto.js +70 -70
- package/node_modules/hawk/test/index.js +378 -378
- package/node_modules/hawk/test/readme.js +95 -95
- package/node_modules/hawk/test/server.js +1329 -1302
- package/node_modules/hawk/test/uri.js +838 -838
- package/node_modules/hawk/test/utils.js +149 -121
- package/node_modules/hoek/package.json +1 -0
- package/node_modules/http-signature/CHANGES.md +7 -0
- package/node_modules/http-signature/http_signing.md +71 -3
- package/node_modules/http-signature/lib/signer.js +5 -0
- package/node_modules/http-signature/package.json +13 -11
- package/node_modules/ini/package.json +3 -1
- package/node_modules/is-my-json-valid/formats.js +1 -1
- package/node_modules/is-my-json-valid/package.json +11 -10
- package/node_modules/is-property/package.json +1 -0
- package/node_modules/is-typedarray/package.json +3 -1
- package/node_modules/isarray/package.json +2 -2
- package/node_modules/isstream/package.json +1 -0
- package/node_modules/jodid25519/package.json +3 -1
- package/node_modules/jsbn/package.json +3 -1
- package/node_modules/json-schema/package.json +2 -1
- package/node_modules/json-stringify-safe/package.json +1 -0
- package/node_modules/jsonpointer/package.json +1 -0
- package/node_modules/jsprim/package.json +3 -1
- package/node_modules/lodash._basetostring/package.json +4 -4
- package/node_modules/lodash._createpadding/package.json +3 -2
- package/node_modules/lodash._root/LICENSE +22 -0
- package/node_modules/lodash._root/README.md +18 -0
- package/node_modules/lodash._root/index.js +53 -0
- package/node_modules/lodash._root/package.json +77 -0
- package/node_modules/lodash.pad/LICENSE +2 -2
- package/node_modules/lodash.pad/README.md +4 -6
- package/node_modules/lodash.pad/index.js +347 -15
- package/node_modules/lodash.pad/package.json +20 -34
- package/node_modules/lodash.padleft/package.json +3 -1
- package/node_modules/lodash.padright/package.json +3 -1
- package/node_modules/lodash.repeat/LICENSE +2 -2
- package/node_modules/lodash.repeat/README.md +4 -6
- package/node_modules/lodash.repeat/index.js +262 -11
- package/node_modules/lodash.repeat/package.json +21 -34
- package/node_modules/mime-db/package.json +2 -2
- package/node_modules/mime-types/package.json +2 -2
- package/node_modules/ms/.npmignore +5 -0
- package/node_modules/{deep-extend → ms}/LICENSE +2 -2
- package/node_modules/ms/README.md +35 -0
- package/node_modules/ms/index.js +125 -0
- package/node_modules/ms/package.json +56 -0
- package/node_modules/node-pre-gyp/CHANGELOG.md +8 -0
- package/node_modules/node-pre-gyp/LICENSE +27 -0
- package/node_modules/node-pre-gyp/lib/util/abi_crosswalk.json +36 -0
- package/node_modules/node-pre-gyp/package.json +23 -22
- package/node_modules/node-uuid/package.json +1 -0
- package/node_modules/npmlog/package.json +18 -16
- package/node_modules/oauth-sign/index.js +2 -0
- package/node_modules/oauth-sign/package.json +10 -9
- package/node_modules/once/README.md +18 -0
- package/node_modules/once/once.js +8 -6
- package/node_modules/once/package.json +20 -12
- package/node_modules/pinkie/index.js +3 -3
- package/node_modules/pinkie/package.json +10 -9
- package/node_modules/pinkie/readme.md +1 -1
- package/node_modules/pinkie-promise/package.json +1 -0
- package/node_modules/process-nextick-args/package.json +2 -2
- package/node_modules/qs/.eslintrc +17 -0
- package/node_modules/qs/.travis.yml +66 -5
- package/node_modules/qs/CHANGELOG.md +86 -75
- package/node_modules/qs/README.md +85 -81
- package/node_modules/qs/bower.json +1 -1
- package/node_modules/qs/component.json +1 -1
- package/node_modules/qs/dist/qs.js +108 -177
- package/node_modules/qs/lib/index.js +1 -7
- package/node_modules/qs/lib/parse.js +26 -49
- package/node_modules/qs/lib/stringify.js +22 -46
- package/node_modules/qs/lib/utils.js +45 -73
- package/node_modules/qs/package.json +51 -28
- package/node_modules/qs/test/index.js +5 -0
- package/node_modules/qs/test/parse.js +236 -321
- package/node_modules/qs/test/stringify.js +139 -197
- package/node_modules/qs/test/utils.js +6 -25
- package/node_modules/rc/node_modules/minimist/package.json +1 -0
- package/node_modules/rc/package.json +1 -0
- package/node_modules/readable-stream/package.json +1 -0
- package/node_modules/request/CHANGELOG.md +16 -1
- package/node_modules/request/README.md +1 -1
- package/node_modules/request/lib/har.js +3 -2
- package/node_modules/request/lib/multipart.js +3 -0
- package/node_modules/request/lib/tunnel.js +0 -2
- package/node_modules/request/package.json +20 -17
- package/node_modules/request/request.js +50 -26
- package/node_modules/rimraf/README.md +1 -1
- package/node_modules/rimraf/node_modules/glob/README.md +2 -2
- package/node_modules/rimraf/node_modules/glob/glob.js +14 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +2 -1
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +1 -0
- package/node_modules/rimraf/node_modules/glob/package.json +11 -11
- package/node_modules/rimraf/package.json +13 -12
- package/node_modules/semver/package.json +3 -1
- package/node_modules/sntp/package.json +1 -0
- package/node_modules/sshpk/.npmignore +1 -0
- package/node_modules/sshpk/bin/sshpk-sign +176 -0
- package/node_modules/sshpk/bin/sshpk-verify +166 -0
- package/node_modules/sshpk/lib/ed-compat.js +2 -0
- package/node_modules/sshpk/lib/key.js +6 -0
- package/node_modules/sshpk/man/man1/sshpk-conv.1 +135 -0
- package/node_modules/sshpk/man/man1/sshpk-sign.1 +81 -0
- package/node_modules/sshpk/man/man1/sshpk-verify.1 +68 -0
- package/node_modules/sshpk/package.json +18 -9
- package/node_modules/string_decoder/package.json +2 -2
- package/node_modules/stringstream/package.json +1 -0
- package/node_modules/strip-ansi/package.json +1 -0
- package/node_modules/strip-json-comments/package.json +1 -0
- package/node_modules/supports-color/package.json +1 -0
- package/node_modules/tar/package.json +1 -0
- package/node_modules/tar-pack/README.md +2 -2
- package/node_modules/tar-pack/package.json +25 -26
- package/node_modules/tough-cookie/package.json +1 -0
- package/node_modules/tunnel-agent/package.json +1 -0
- package/node_modules/tweetnacl/README.md +1 -1
- package/node_modules/tweetnacl/package.json +13 -11
- package/node_modules/uid-number/package.json +14 -13
- package/node_modules/uid-number/uid-number.js +9 -4
- package/node_modules/util-deprecate/package.json +2 -2
- package/node_modules/verror/package.json +1 -0
- package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy → wrappy}/package.json +3 -2
- package/node_modules/xtend/package.json +1 -0
- package/package.json +2 -2
- package/node_modules/are-we-there-yet/README.md~ +0 -183
- package/node_modules/bl/test/basic-test.js +0 -541
- package/node_modules/bl/test/sauce.js +0 -38
- package/node_modules/debug/index.js +0 -5
- package/node_modules/debug/lib/debug.js +0 -147
- package/node_modules/deep-extend/test/index.spec.js +0 -220
- package/node_modules/deep-extend/test/mocha.opts +0 -1
- package/node_modules/gauge/README.md~ +0 -161
- package/node_modules/has-unicode/README.md~ +0 -4
- package/node_modules/once/LICENSE +0 -27
- package/node_modules/once/test/once.js +0 -18
- package/node_modules/sshpk/node_modules/assert-plus/README.md +0 -155
- package/node_modules/sshpk/node_modules/assert-plus/assert.js +0 -206
- package/node_modules/sshpk/node_modules/assert-plus/package.json +0 -88
- package/node_modules/tar-pack/node_modules/rimraf/README.md +0 -43
- package/node_modules/tar-pack/node_modules/rimraf/bin.js +0 -40
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/README.md +0 -359
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/common.js +0 -226
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/glob.js +0 -752
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/.eslintrc +0 -17
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/README.md +0 -37
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/inflight.js +0 -44
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy/package.json +0 -58
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/package.json +0 -67
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/test.js +0 -97
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/LICENSE +0 -16
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/README.md +0 -42
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits.js +0 -1
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/inherits_browser.js +0 -23
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/package.json +0 -58
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inherits/test.js +0 -25
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/README.md +0 -216
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/minimatch.js +0 -912
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/.npmignore +0 -3
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/README.md +0 -122
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/example.js +0 -8
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/index.js +0 -191
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/.npmignore +0 -2
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/Makefile +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/README.md +0 -89
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/example.js +0 -5
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/index.js +0 -50
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/package.json +0 -79
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/balanced-match/test/balanced.js +0 -84
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/.travis.yml +0 -4
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/LICENSE +0 -18
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/README.markdown +0 -62
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/example/map.js +0 -6
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/index.js +0 -13
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/package.json +0 -90
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/node_modules/concat-map/test/map.js +0 -39
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/node_modules/brace-expansion/package.json +0 -81
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/minimatch/package.json +0 -66
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/README.md +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/LICENSE +0 -15
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/README.md +0 -36
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/test/basic.js +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/node_modules/wrappy/wrappy.js +0 -33
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/once.js +0 -21
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/once/package.json +0 -70
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/index.js +0 -20
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/package.json +0 -78
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/node_modules/path-is-absolute/readme.md +0 -51
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/package.json +0 -79
- package/node_modules/tar-pack/node_modules/rimraf/node_modules/glob/sync.js +0 -460
- package/node_modules/tar-pack/node_modules/rimraf/package.json +0 -69
- package/node_modules/tar-pack/node_modules/rimraf/rimraf.js +0 -333
- package/node_modules/uid-number/LICENCE +0 -25
- /package/node_modules/{sshpk/node_modules/assert-plus → assert-plus}/AUTHORS +0 -0
- /package/node_modules/{sshpk/node_modules/assert-plus → assert-plus}/CHANGES.md +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf → aws4/node_modules/lru-cache}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight → uid-number}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/LICENSE +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/README.md +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/test/basic.js +0 -0
- /package/node_modules/{tar-pack/node_modules/rimraf/node_modules/glob/node_modules/inflight/node_modules/wrappy → wrappy}/wrappy.js +0 -0
@@ -580,7 +580,7 @@
|
|
580
580
|
var dep;
|
581
581
|
while (len--) {
|
582
582
|
if (!(dep = tasks[requires[len]])) {
|
583
|
-
throw new Error('Has
|
583
|
+
throw new Error('Has nonexistent dependency in ' + requires.join(', '));
|
584
584
|
}
|
585
585
|
if (_isArray(dep) && _indexOf(dep, k) >= 0) {
|
586
586
|
throw new Error('Has cyclic dependencies');
|
@@ -1085,16 +1085,17 @@
|
|
1085
1085
|
async.memoize = function (fn, hasher) {
|
1086
1086
|
var memo = {};
|
1087
1087
|
var queues = {};
|
1088
|
+
var has = Object.prototype.hasOwnProperty;
|
1088
1089
|
hasher = hasher || identity;
|
1089
1090
|
var memoized = _restParam(function memoized(args) {
|
1090
1091
|
var callback = args.pop();
|
1091
1092
|
var key = hasher.apply(null, args);
|
1092
|
-
if (key
|
1093
|
+
if (has.call(memo, key)) {
|
1093
1094
|
async.setImmediate(function () {
|
1094
1095
|
callback.apply(null, memo[key]);
|
1095
1096
|
});
|
1096
1097
|
}
|
1097
|
-
else if (key
|
1098
|
+
else if (has.call(queues, key)) {
|
1098
1099
|
queues[key].push(callback);
|
1099
1100
|
}
|
1100
1101
|
else {
|
@@ -1,2 +1,2 @@
|
|
1
|
-
!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function a(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function f(n){return a(Array(n),function(n,t){return t})}function l(n,t,e){return c(n,function(n,r,u){e=t(e,n,r,u)}),e}function s(n,t){c(W(n),function(e){t(n[e],e)})}function p(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function h(n){var t,e,r=-1;return o(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(C.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(C.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function I(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function x(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?C.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void C.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){for(;!s.paused&&f<s.concurrency&&s.tasks.length;){var n=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=a(n,function(n){return n.data});0===s.tasks.length&&s.empty(),f+=1,l.push(n[0]);var r=u(o(s,n));t(e,r)}},length:function(){return s.tasks.length},running:function(){return f},workersList:function(){return l},idle:function(){return s.tasks.length+f===0},pause:function(){s.paused=!0},resume:function(){if(s.paused!==!1){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),t=1;n>=t;t++)C.setImmediate(s.process)}}};return s}function j(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?C.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,C={},P="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=P&&(q=P.async),C.noConflict=function(){return P.async=q,C};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?C.nextTick=process.nextTick:C.nextTick=D,C.setImmediate=B?D:C.nextTick,C.forEach=C.each=function(n,t,e){return C.eachOf(n,y(t),e)},C.forEachSeries=C.eachSeries=function(n,t,e){return C.eachOfSeries(n,y(t),e)},C.forEachLimit=C.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},C.forEachOf=C.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},C.forEachOfSeries=C.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?C.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},C.forEachOfLimit=C.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},C.map=d(b),C.mapSeries=k(b),C.mapLimit=g(b),C.inject=C.foldl=C.reduce=function(n,t,e,r){C.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},C.foldr=C.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();C.reduce(i,e,r,u)},C.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),C.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},C.select=C.filter=d(w),C.selectLimit=C.filterLimit=g(w),C.selectSeries=C.filterSeries=k(w),C.reject=d(O),C.rejectLimit=g(O),C.rejectSeries=k(O),C.any=C.some=S(C.eachOf,e,t),C.someLimit=S(C.eachOfLimit,e,t),C.all=C.every=S(C.eachOf,r,r),C.everyLimit=S(C.eachOfLimit,r,r),C.detect=S(C.eachOf,t,E),C.detectSeries=S(C.eachOfSeries,t,E),C.detectLimit=S(C.eachOfLimit,t,E),C.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}C.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},C.auto=function(t,e,r){function u(n){g.unshift(n)}function o(n){var t=p(g,n);t>=0&&g.splice(t,1)}function a(){h--,c(g.slice(0),function(n){n()})}"function"==typeof arguments[1]&&(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,g=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(k,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](g,y))}if(!d){for(var f,h=M(t[n])?t[n]:[t[n]],g=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,d=!0,r(t,u)}else y[n]=e,C.setImmediate(a)}),k=h.slice(0,h.length-1),b=k.length;b--;){if(!(f=t[k[b]]))throw new Error("Has inexistant dependency");if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](g,y)):u(c)}})},C.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}C.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},C.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(C.iterator(t))():e()},C.parallel=function(n,t){L(C.eachOf,n,t)},C.parallelLimit=function(n,t,e){L(v(t),n,e)},C.series=function(n,t){L(C.eachOfSeries,n,t)},C.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},C.apply=m(function(n,t){return m(function(e){return n.apply(null,t.concat(e))})}),C.concat=d(I),C.concatSeries=k(I),C.whilst=function(t,e,r){if(r=r||n,t()){var u=m(function(n,i){n?r(n):t.apply(this,i)?e(u):r.apply(null,[null].concat(i))});e(u)}else r(null)},C.doWhilst=function(n,t,e){var r=0;return C.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},C.until=function(n,t,e){return C.whilst(function(){return!n.apply(this,arguments)},t,e)},C.doUntil=function(n,t,e){return C.doWhilst(n,function(){return!t.apply(this,arguments)},e)},C.during=function(t,e,r){r=r||n;var u=m(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},C.doDuring=function(n,t,e){var r=0;C.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},C.queue=function(n,t){var e=x(function(t,e){n(t[0],e)},t,1);return e},C.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?C.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),C.setImmediate(t.process)})}var o=C.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},C.cargo=function(n,t){return x(n,1,t)},C.log=j("log"),C.dir=j("dir"),C.memoize=function(n,e){var r={},u={};e=e||t;var i=m(function(t){var i=t.pop(),o=e.apply(null,t);o in r?C.setImmediate(function(){i.apply(null,r[o])}):o in u?u[o].push(i):(u[o]=[i],n.apply(null,t.concat([m(function(n){r[o]=n;var t=u[o];delete u[o];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return i.memo=r,i.unmemoized=n,i},C.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},C.times=A(C.map),C.timesSeries=A(C.mapSeries),C.timesLimit=function(n,t,e,r){return C.mapLimit(f(n),t,e,r)},C.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,C.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},C.compose=function(){return C.seq.apply(null,Array.prototype.reverse.call(arguments))},C.applyEach=T(C.eachOf),C.applyEachSeries=T(C.eachOfSeries),C.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},C.ensureAsync=z,C.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),C.wrapSync=C.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=C:"function"==typeof define&&define.amd?define([],function(){return C}):P.async=C}();
|
1
|
+
!function(){function n(){}function t(n){return n}function e(n){return!!n}function r(n){return!n}function u(n){return function(){if(null===n)throw new Error("Callback was already called.");n.apply(this,arguments),n=null}}function i(n){return function(){null!==n&&(n.apply(this,arguments),n=null)}}function o(n){return M(n)||"number"==typeof n.length&&n.length>=0&&n.length%1===0}function c(n,t){for(var e=-1,r=n.length;++e<r;)t(n[e],e,n)}function a(n,t){for(var e=-1,r=n.length,u=Array(r);++e<r;)u[e]=t(n[e],e,n);return u}function f(n){return a(Array(n),function(n,t){return t})}function l(n,t,e){return c(n,function(n,r,u){e=t(e,n,r,u)}),e}function s(n,t){c(W(n),function(e){t(n[e],e)})}function p(n,t){for(var e=0;e<n.length;e++)if(n[e]===t)return e;return-1}function h(n){var t,e,r=-1;return o(n)?(t=n.length,function(){return r++,t>r?r:null}):(e=W(n),t=e.length,function(){return r++,t>r?e[r]:null})}function m(n,t){return t=null==t?n.length-1:+t,function(){for(var e=Math.max(arguments.length-t,0),r=Array(e),u=0;e>u;u++)r[u]=arguments[u+t];switch(t){case 0:return n.call(this,r);case 1:return n.call(this,arguments[0],r)}}}function y(n){return function(t,e,r){return n(t,r)}}function v(t){return function(e,r,o){o=i(o||n),e=e||[];var c=h(e);if(0>=t)return o(null);var a=!1,f=0,l=!1;!function s(){if(a&&0>=f)return o(null);for(;t>f&&!l;){var n=c();if(null===n)return a=!0,void(0>=f&&o(null));f+=1,r(e[n],n,u(function(n){f-=1,n?(o(n),l=!0):s()}))}}()}}function d(n){return function(t,e,r){return n(P.eachOf,t,e,r)}}function g(n){return function(t,e,r,u){return n(v(e),t,r,u)}}function k(n){return function(t,e,r){return n(P.eachOfSeries,t,e,r)}}function b(t,e,r,u){u=i(u||n),e=e||[];var c=o(e)?[]:{};t(e,function(n,t,e){r(n,function(n,r){c[t]=r,e(n)})},function(n){u(n,c)})}function w(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(e){e&&u.push({index:t,value:n}),r()})},function(){r(a(u.sort(function(n,t){return n.index-t.index}),function(n){return n.value}))})}function O(n,t,e,r){w(n,t,function(n,t){e(n,function(n){t(!n)})},r)}function S(n,t,e){return function(r,u,i,o){function c(){o&&o(e(!1,void 0))}function a(n,r,u){return o?void i(n,function(r){o&&t(r)&&(o(e(!0,n)),o=i=!1),u()}):u()}arguments.length>3?n(r,u,a,c):(o=i,i=u,n(r,a,c))}}function E(n,t){return t}function L(t,e,r){r=r||n;var u=o(e)?[]:{};t(e,function(n,t,e){n(m(function(n,r){r.length<=1&&(r=r[0]),u[t]=r,e(n)}))},function(n){r(n,u)})}function j(n,t,e,r){var u=[];n(t,function(n,t,r){e(n,function(n,t){u=u.concat(t||[]),r(n)})},function(n){r(n,u)})}function I(t,e,r){function i(t,e,r,u){if(null!=u&&"function"!=typeof u)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length&&t.idle()?P.setImmediate(function(){t.drain()}):(c(e,function(e){var i={data:e,callback:u||n};r?t.tasks.unshift(i):t.tasks.push(i),t.tasks.length===t.concurrency&&t.saturated()}),void P.setImmediate(t.process))}function o(n,t){return function(){f-=1;var e=!1,r=arguments;c(t,function(n){c(l,function(t,r){t!==n||e||(l.splice(r,1),e=!0)}),n.callback.apply(n,r)}),n.tasks.length+f===0&&n.drain(),n.process()}}if(null==e)e=1;else if(0===e)throw new Error("Concurrency must not be zero");var f=0,l=[],s={tasks:[],concurrency:e,payload:r,saturated:n,empty:n,drain:n,started:!1,paused:!1,push:function(n,t){i(s,n,!1,t)},kill:function(){s.drain=n,s.tasks=[]},unshift:function(n,t){i(s,n,!0,t)},process:function(){for(;!s.paused&&f<s.concurrency&&s.tasks.length;){var n=s.payload?s.tasks.splice(0,s.payload):s.tasks.splice(0,s.tasks.length),e=a(n,function(n){return n.data});0===s.tasks.length&&s.empty(),f+=1,l.push(n[0]);var r=u(o(s,n));t(e,r)}},length:function(){return s.tasks.length},running:function(){return f},workersList:function(){return l},idle:function(){return s.tasks.length+f===0},pause:function(){s.paused=!0},resume:function(){if(s.paused!==!1){s.paused=!1;for(var n=Math.min(s.concurrency,s.tasks.length),t=1;n>=t;t++)P.setImmediate(s.process)}}};return s}function x(n){return m(function(t,e){t.apply(null,e.concat([m(function(t,e){"object"==typeof console&&(t?console.error&&console.error(t):console[n]&&c(e,function(t){console[n](t)}))})]))})}function A(n){return function(t,e,r){n(f(t),e,r)}}function T(n){return m(function(t,e){var r=m(function(e){var r=this,u=e.pop();return n(t,function(n,t,u){n.apply(r,e.concat([u]))},u)});return e.length?r.apply(this,e):r})}function z(n){return m(function(t){var e=t.pop();t.push(function(){var n=arguments;r?P.setImmediate(function(){e.apply(null,n)}):e.apply(null,n)});var r=!0;n.apply(this,t),r=!1})}var q,P={},C="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||this;null!=C&&(q=C.async),P.noConflict=function(){return C.async=q,P};var H=Object.prototype.toString,M=Array.isArray||function(n){return"[object Array]"===H.call(n)},U=function(n){var t=typeof n;return"function"===t||"object"===t&&!!n},W=Object.keys||function(n){var t=[];for(var e in n)n.hasOwnProperty(e)&&t.push(e);return t},B="function"==typeof setImmediate&&setImmediate,D=B?function(n){B(n)}:function(n){setTimeout(n,0)};"object"==typeof process&&"function"==typeof process.nextTick?P.nextTick=process.nextTick:P.nextTick=D,P.setImmediate=B?D:P.nextTick,P.forEach=P.each=function(n,t,e){return P.eachOf(n,y(t),e)},P.forEachSeries=P.eachSeries=function(n,t,e){return P.eachOfSeries(n,y(t),e)},P.forEachLimit=P.eachLimit=function(n,t,e,r){return v(t)(n,y(e),r)},P.forEachOf=P.eachOf=function(t,e,r){function o(n){f--,n?r(n):null===c&&0>=f&&r(null)}r=i(r||n),t=t||[];for(var c,a=h(t),f=0;null!=(c=a());)f+=1,e(t[c],c,u(o));0===f&&r(null)},P.forEachOfSeries=P.eachOfSeries=function(t,e,r){function o(){var n=!0;return null===a?r(null):(e(t[a],a,u(function(t){if(t)r(t);else{if(a=c(),null===a)return r(null);n?P.setImmediate(o):o()}})),void(n=!1))}r=i(r||n),t=t||[];var c=h(t),a=c();o()},P.forEachOfLimit=P.eachOfLimit=function(n,t,e,r){v(t)(n,e,r)},P.map=d(b),P.mapSeries=k(b),P.mapLimit=g(b),P.inject=P.foldl=P.reduce=function(n,t,e,r){P.eachOfSeries(n,function(n,r,u){e(t,n,function(n,e){t=e,u(n)})},function(n){r(n,t)})},P.foldr=P.reduceRight=function(n,e,r,u){var i=a(n,t).reverse();P.reduce(i,e,r,u)},P.transform=function(n,t,e,r){3===arguments.length&&(r=e,e=t,t=M(n)?[]:{}),P.eachOf(n,function(n,r,u){e(t,n,r,u)},function(n){r(n,t)})},P.select=P.filter=d(w),P.selectLimit=P.filterLimit=g(w),P.selectSeries=P.filterSeries=k(w),P.reject=d(O),P.rejectLimit=g(O),P.rejectSeries=k(O),P.any=P.some=S(P.eachOf,e,t),P.someLimit=S(P.eachOfLimit,e,t),P.all=P.every=S(P.eachOf,r,r),P.everyLimit=S(P.eachOfLimit,r,r),P.detect=S(P.eachOf,t,E),P.detectSeries=S(P.eachOfSeries,t,E),P.detectLimit=S(P.eachOfLimit,t,E),P.sortBy=function(n,t,e){function r(n,t){var e=n.criteria,r=t.criteria;return r>e?-1:e>r?1:0}P.map(n,function(n,e){t(n,function(t,r){t?e(t):e(null,{value:n,criteria:r})})},function(n,t){return n?e(n):void e(null,a(t.sort(r),function(n){return n.value}))})},P.auto=function(t,e,r){function u(n){g.unshift(n)}function o(n){var t=p(g,n);t>=0&&g.splice(t,1)}function a(){h--,c(g.slice(0),function(n){n()})}"function"==typeof arguments[1]&&(r=e,e=null),r=i(r||n);var f=W(t),h=f.length;if(!h)return r(null);e||(e=h);var y={},v=0,d=!1,g=[];u(function(){h||r(null,y)}),c(f,function(n){function i(){return e>v&&l(k,function(n,t){return n&&y.hasOwnProperty(t)},!0)&&!y.hasOwnProperty(n)}function c(){i()&&(v++,o(c),h[h.length-1](g,y))}if(!d){for(var f,h=M(t[n])?t[n]:[t[n]],g=m(function(t,e){if(v--,e.length<=1&&(e=e[0]),t){var u={};s(y,function(n,t){u[t]=n}),u[n]=e,d=!0,r(t,u)}else y[n]=e,P.setImmediate(a)}),k=h.slice(0,h.length-1),b=k.length;b--;){if(!(f=t[k[b]]))throw new Error("Has nonexistent dependency in "+k.join(", "));if(M(f)&&p(f,n)>=0)throw new Error("Has cyclic dependencies")}i()?(v++,h[h.length-1](g,y)):u(c)}})},P.retry=function(n,t,e){function r(n,t){if("number"==typeof t)n.times=parseInt(t,10)||i;else{if("object"!=typeof t)throw new Error("Unsupported argument type for 'times': "+typeof t);n.times=parseInt(t.times,10)||i,n.interval=parseInt(t.interval,10)||o}}function u(n,t){function e(n,e){return function(r){n(function(n,t){r(!n||e,{err:n,result:t})},t)}}function r(n){return function(t){setTimeout(function(){t(null)},n)}}for(;a.times;){var u=!(a.times-=1);c.push(e(a.task,u)),!u&&a.interval>0&&c.push(r(a.interval))}P.series(c,function(t,e){e=e[e.length-1],(n||a.callback)(e.err,e.result)})}var i=5,o=0,c=[],a={times:i,interval:o},f=arguments.length;if(1>f||f>3)throw new Error("Invalid arguments - must be either (task), (task, callback), (times, task) or (times, task, callback)");return 2>=f&&"function"==typeof n&&(e=t,t=n),"function"!=typeof n&&r(a,n),a.callback=e,a.task=t,a.callback?u():u},P.waterfall=function(t,e){function r(n){return m(function(t,u){if(t)e.apply(null,[t].concat(u));else{var i=n.next();i?u.push(r(i)):u.push(e),z(n).apply(null,u)}})}if(e=i(e||n),!M(t)){var u=new Error("First argument to waterfall must be an array of functions");return e(u)}return t.length?void r(P.iterator(t))():e()},P.parallel=function(n,t){L(P.eachOf,n,t)},P.parallelLimit=function(n,t,e){L(v(t),n,e)},P.series=function(n,t){L(P.eachOfSeries,n,t)},P.iterator=function(n){function t(e){function r(){return n.length&&n[e].apply(null,arguments),r.next()}return r.next=function(){return e<n.length-1?t(e+1):null},r}return t(0)},P.apply=m(function(n,t){return m(function(e){return n.apply(null,t.concat(e))})}),P.concat=d(j),P.concatSeries=k(j),P.whilst=function(t,e,r){if(r=r||n,t()){var u=m(function(n,i){n?r(n):t.apply(this,i)?e(u):r.apply(null,[null].concat(i))});e(u)}else r(null)},P.doWhilst=function(n,t,e){var r=0;return P.whilst(function(){return++r<=1||t.apply(this,arguments)},n,e)},P.until=function(n,t,e){return P.whilst(function(){return!n.apply(this,arguments)},t,e)},P.doUntil=function(n,t,e){return P.doWhilst(n,function(){return!t.apply(this,arguments)},e)},P.during=function(t,e,r){r=r||n;var u=m(function(n,e){n?r(n):(e.push(i),t.apply(this,e))}),i=function(n,t){n?r(n):t?e(u):r(null)};t(i)},P.doDuring=function(n,t,e){var r=0;P.during(function(n){r++<1?n(null,!0):t.apply(this,arguments)},n,e)},P.queue=function(n,t){var e=I(function(t,e){n(t[0],e)},t,1);return e},P.priorityQueue=function(t,e){function r(n,t){return n.priority-t.priority}function u(n,t,e){for(var r=-1,u=n.length-1;u>r;){var i=r+(u-r+1>>>1);e(t,n[i])>=0?r=i:u=i-1}return r}function i(t,e,i,o){if(null!=o&&"function"!=typeof o)throw new Error("task callback must be a function");return t.started=!0,M(e)||(e=[e]),0===e.length?P.setImmediate(function(){t.drain()}):void c(e,function(e){var c={data:e,priority:i,callback:"function"==typeof o?o:n};t.tasks.splice(u(t.tasks,c,r)+1,0,c),t.tasks.length===t.concurrency&&t.saturated(),P.setImmediate(t.process)})}var o=P.queue(t,e);return o.push=function(n,t,e){i(o,n,t,e)},delete o.unshift,o},P.cargo=function(n,t){return I(n,1,t)},P.log=x("log"),P.dir=x("dir"),P.memoize=function(n,e){var r={},u={},i=Object.prototype.hasOwnProperty;e=e||t;var o=m(function(t){var o=t.pop(),c=e.apply(null,t);i.call(r,c)?P.setImmediate(function(){o.apply(null,r[c])}):i.call(u,c)?u[c].push(o):(u[c]=[o],n.apply(null,t.concat([m(function(n){r[c]=n;var t=u[c];delete u[c];for(var e=0,i=t.length;i>e;e++)t[e].apply(null,n)})])))});return o.memo=r,o.unmemoized=n,o},P.unmemoize=function(n){return function(){return(n.unmemoized||n).apply(null,arguments)}},P.times=A(P.map),P.timesSeries=A(P.mapSeries),P.timesLimit=function(n,t,e,r){return P.mapLimit(f(n),t,e,r)},P.seq=function(){var t=arguments;return m(function(e){var r=this,u=e[e.length-1];"function"==typeof u?e.pop():u=n,P.reduce(t,e,function(n,t,e){t.apply(r,n.concat([m(function(n,t){e(n,t)})]))},function(n,t){u.apply(r,[n].concat(t))})})},P.compose=function(){return P.seq.apply(null,Array.prototype.reverse.call(arguments))},P.applyEach=T(P.eachOf),P.applyEachSeries=T(P.eachOfSeries),P.forever=function(t,e){function r(n){return n?i(n):void o(r)}var i=u(e||n),o=z(t);r()},P.ensureAsync=z,P.constant=m(function(n){var t=[null].concat(n);return function(n){return n.apply(this,t)}}),P.wrapSync=P.asyncify=function(n){return m(function(t){var e,r=t.pop();try{e=n.apply(this,t)}catch(u){return r(u)}U(e)&&"function"==typeof e.then?e.then(function(n){r(null,n)})["catch"](function(n){r(n.message?n:new Error(n))}):r(null,e)})},"object"==typeof module&&module.exports?module.exports=P:"function"==typeof define&&define.amd?define([],function(){return P}):C.async=P}();
|
2
2
|
//# sourceMappingURL=dist/async.min.map
|
@@ -580,7 +580,7 @@
|
|
580
580
|
var dep;
|
581
581
|
while (len--) {
|
582
582
|
if (!(dep = tasks[requires[len]])) {
|
583
|
-
throw new Error('Has
|
583
|
+
throw new Error('Has nonexistent dependency in ' + requires.join(', '));
|
584
584
|
}
|
585
585
|
if (_isArray(dep) && _indexOf(dep, k) >= 0) {
|
586
586
|
throw new Error('Has cyclic dependencies');
|
@@ -1085,16 +1085,17 @@
|
|
1085
1085
|
async.memoize = function (fn, hasher) {
|
1086
1086
|
var memo = {};
|
1087
1087
|
var queues = {};
|
1088
|
+
var has = Object.prototype.hasOwnProperty;
|
1088
1089
|
hasher = hasher || identity;
|
1089
1090
|
var memoized = _restParam(function memoized(args) {
|
1090
1091
|
var callback = args.pop();
|
1091
1092
|
var key = hasher.apply(null, args);
|
1092
|
-
if (key
|
1093
|
+
if (has.call(memo, key)) {
|
1093
1094
|
async.setImmediate(function () {
|
1094
1095
|
callback.apply(null, memo[key]);
|
1095
1096
|
});
|
1096
1097
|
}
|
1097
|
-
else if (key
|
1098
|
+
else if (has.call(queues, key)) {
|
1098
1099
|
queues[key].push(callback);
|
1099
1100
|
}
|
1100
1101
|
else {
|
@@ -1,8 +1,8 @@
|
|
1
1
|
{
|
2
2
|
"_from": "async@^1.4.0",
|
3
|
-
"_id": "async@1.5.
|
3
|
+
"_id": "async@1.5.2",
|
4
4
|
"_location": "/async",
|
5
|
-
"_nodeVersion": "4.2.
|
5
|
+
"_nodeVersion": "4.2.3",
|
6
6
|
"_npmUser": {
|
7
7
|
"email": "alexander.early@gmail.com",
|
8
8
|
"name": "aearly"
|
@@ -12,8 +12,9 @@
|
|
12
12
|
"_requiredBy": [
|
13
13
|
"/form-data"
|
14
14
|
],
|
15
|
-
"_resolved": "https://registry.npmjs.org/async/-/async-1.5.
|
16
|
-
"_shasum": "
|
15
|
+
"_resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz",
|
16
|
+
"_shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
|
17
|
+
"_shrinkwrap": null,
|
17
18
|
"author": {
|
18
19
|
"name": "Caolan McMahon"
|
19
20
|
},
|
@@ -49,15 +50,15 @@
|
|
49
50
|
},
|
50
51
|
"directories": {},
|
51
52
|
"dist": {
|
52
|
-
"shasum": "
|
53
|
-
"tarball": "http://registry.npmjs.org/async/-/async-1.5.
|
53
|
+
"shasum": "ec6a61ae56480c0c3cb241c95618e20892f9672a",
|
54
|
+
"tarball": "http://registry.npmjs.org/async/-/async-1.5.2.tgz"
|
54
55
|
},
|
55
56
|
"files": [
|
56
57
|
"dist/async.js",
|
57
58
|
"dist/async.min.js",
|
58
59
|
"lib"
|
59
60
|
],
|
60
|
-
"gitHead": "
|
61
|
+
"gitHead": "9ab5c67b7cb3a4c3dad4a2d4552a2f6775545d6c",
|
61
62
|
"homepage": "https://github.com/caolan/async#readme",
|
62
63
|
"jam": {
|
63
64
|
"categories": [
|
@@ -98,8 +99,7 @@
|
|
98
99
|
],
|
99
100
|
"name": "async",
|
100
101
|
"optionalDependencies": {},
|
101
|
-
"readme": "# Async.js\n\n[![Build Status via Travis CI](https://travis-ci.org/caolan/async.svg?branch=master)](https://travis-ci.org/caolan/async)\n[![NPM version](http://img.shields.io/npm/v/async.svg)](https://www.npmjs.org/package/async)\n[![Coverage Status](https://coveralls.io/repos/caolan/async/badge.svg?branch=master)](https://coveralls.io/r/caolan/async?branch=master)\n[![Join the chat at https://gitter.im/caolan/async](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/caolan/async?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)\n\n\nAsync is a utility module which provides straight-forward, powerful functions\nfor working with asynchronous JavaScript. Although originally designed for\nuse with [Node.js](http://nodejs.org) and installable via `npm install async`,\nit can also be used directly in the browser.\n\nAsync is also installable via:\n\n- [bower](http://bower.io/): `bower install async`\n- [component](https://github.com/component/component): `component install\n caolan/async`\n- [jam](http://jamjs.org/): `jam install async`\n- [spm](http://spmjs.io/): `spm install async`\n\nAsync provides around 20 functions that include the usual 'functional'\nsuspects (`map`, `reduce`, `filter`, `each`…) as well as some common patterns\nfor asynchronous control flow (`parallel`, `series`, `waterfall`…). All these\nfunctions assume you follow the Node.js convention of providing a single\ncallback as the last argument of your `async` function.\n\n\n## Quick Examples\n\n```javascript\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n\nasync.parallel([\n function(){ ... },\n function(){ ... }\n], callback);\n\nasync.series([\n function(){ ... },\n function(){ ... }\n]);\n```\n\nThere are many more functions available so take a look at the docs below for a\nfull list. This module aims to be comprehensive, so if you feel anything is\nmissing please create a GitHub issue for it.\n\n## Common Pitfalls <sub>[(StackOverflow)](http://stackoverflow.com/questions/tagged/async.js)</sub>\n### Synchronous iteration functions\n\nIf you get an error like `RangeError: Maximum call stack size exceeded.` or other stack overflow issues when using async, you are likely using a synchronous iterator. By *synchronous* we mean a function that calls its callback on the same tick in the javascript event loop, without doing any I/O or using any timers. Calling many callbacks iteratively will quickly overflow the stack. If you run into this issue, just defer your callback with `async.setImmediate` to start a new call stack on the next tick of the event loop.\n\nThis can also arise by accident if you callback early in certain cases:\n\n```js\nasync.eachSeries(hugeArray, function iterator(item, callback) {\n if (inCache(item)) {\n callback(null, cache[item]); // if many items are cached, you'll overflow\n } else {\n doSomeIO(item, callback);\n }\n}, function done() {\n //...\n});\n```\n\nJust change it to:\n\n```js\nasync.eachSeries(hugeArray, function iterator(item, callback) {\n if (inCache(item)) {\n async.setImmediate(function () {\n callback(null, cache[item]);\n });\n } else {\n doSomeIO(item, callback);\n //...\n```\n\nAsync guards against synchronous functions in some, but not all, cases. If you are still running into stack overflows, you can defer as suggested above, or wrap functions with [`async.ensureAsync`](#ensureAsync) Functions that are asynchronous by their nature do not have this problem and don't need the extra callback deferral.\n\nIf JavaScript's event loop is still a bit nebulous, check out [this article](http://blog.carbonfive.com/2013/10/27/the-javascript-event-loop-explained/) or [this talk](http://2014.jsconf.eu/speakers/philip-roberts-what-the-heck-is-the-event-loop-anyway.html) for more detailed information about how it works.\n\n\n### Multiple callbacks\n\nMake sure to always `return` when calling a callback early, otherwise you will cause multiple callbacks and unpredictable behavior in many cases.\n\n```js\nasync.waterfall([\n function (callback) {\n getSomething(options, function (err, result) {\n if (err) {\n callback(new Error(\"failed getting something:\" + err.message));\n // we should return here\n }\n // since we did not return, this callback still will be called and\n // `processData` will be called twice\n callback(null, result);\n });\n },\n processData\n], done)\n```\n\nIt is always good practice to `return callback(err, result)` whenever a callback call is not the last statement of a function.\n\n\n### Binding a context to an iterator\n\nThis section is really about `bind`, not about `async`. If you are wondering how to\nmake `async` execute your iterators in a given context, or are confused as to why\na method of another library isn't working as an iterator, study this example:\n\n```js\n// Here is a simple object with an (unnecessarily roundabout) squaring method\nvar AsyncSquaringLibrary = {\n squareExponent: 2,\n square: function(number, callback){\n var result = Math.pow(number, this.squareExponent);\n setTimeout(function(){\n callback(null, result);\n }, 200);\n }\n};\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square, function(err, result){\n // result is [NaN, NaN, NaN]\n // This fails because the `this.squareExponent` expression in the square\n // function is not evaluated in the context of AsyncSquaringLibrary, and is\n // therefore undefined.\n});\n\nasync.map([1, 2, 3], AsyncSquaringLibrary.square.bind(AsyncSquaringLibrary), function(err, result){\n // result is [1, 4, 9]\n // With the help of bind we can attach a context to the iterator before\n // passing it to async. Now the square function will be executed in its\n // 'home' AsyncSquaringLibrary context and the value of `this.squareExponent`\n // will be as expected.\n});\n```\n\n## Download\n\nThe source is available for download from\n[GitHub](https://github.com/caolan/async/blob/master/lib/async.js).\nAlternatively, you can install using Node Package Manager (`npm`):\n\n npm install async\n\nAs well as using Bower:\n\n bower install async\n\n__Development:__ [async.js](https://github.com/caolan/async/raw/master/lib/async.js) - 29.6kb Uncompressed\n\n## In the Browser\n\nSo far it's been tested in IE6, IE7, IE8, FF3.6 and Chrome 5.\n\nUsage:\n\n```html\n<script type=\"text/javascript\" src=\"async.js\"></script>\n<script type=\"text/javascript\">\n\n async.map(data, asyncProcess, function(err, results){\n alert(results);\n });\n\n</script>\n```\n\n## Documentation\n\nSome functions are also available in the following forms:\n* `<name>Series` - the same as `<name>` but runs only a single async operation at a time\n* `<name>Limit` - the same as `<name>` but runs a maximum of `limit` async operations at a time\n\n### Collections\n\n* [`each`](#each), `eachSeries`, `eachLimit`\n* [`forEachOf`](#forEachOf), `forEachOfSeries`, `forEachOfLimit`\n* [`map`](#map), `mapSeries`, `mapLimit`\n* [`filter`](#filter), `filterSeries`, `filterLimit`\n* [`reject`](#reject), `rejectSeries`, `rejectLimit`\n* [`reduce`](#reduce), [`reduceRight`](#reduceRight)\n* [`detect`](#detect), `detectSeries`, `detectLimit`\n* [`sortBy`](#sortBy)\n* [`some`](#some), `someLimit`\n* [`every`](#every), `everyLimit`\n* [`concat`](#concat), `concatSeries`\n\n### Control Flow\n\n* [`series`](#seriestasks-callback)\n* [`parallel`](#parallel), `parallelLimit`\n* [`whilst`](#whilst), [`doWhilst`](#doWhilst)\n* [`until`](#until), [`doUntil`](#doUntil)\n* [`during`](#during), [`doDuring`](#doDuring)\n* [`forever`](#forever)\n* [`waterfall`](#waterfall)\n* [`compose`](#compose)\n* [`seq`](#seq)\n* [`applyEach`](#applyEach), `applyEachSeries`\n* [`queue`](#queue), [`priorityQueue`](#priorityQueue)\n* [`cargo`](#cargo)\n* [`auto`](#auto)\n* [`retry`](#retry)\n* [`iterator`](#iterator)\n* [`times`](#times), `timesSeries`, `timesLimit`\n\n### Utils\n\n* [`apply`](#apply)\n* [`nextTick`](#nextTick)\n* [`memoize`](#memoize)\n* [`unmemoize`](#unmemoize)\n* [`ensureAsync`](#ensureAsync)\n* [`constant`](#constant)\n* [`asyncify`](#asyncify)\n* [`wrapSync`](#wrapSync)\n* [`log`](#log)\n* [`dir`](#dir)\n* [`noConflict`](#noConflict)\n\n## Collections\n\n<a name=\"forEach\" />\n<a name=\"each\" />\n### each(arr, iterator, [callback])\n\nApplies the function `iterator` to each item in `arr`, in parallel.\nThe `iterator` is called with an item from the list, and a callback for when it\nhas finished. If the `iterator` passes an error to its `callback`, the main\n`callback` (for the `each` function) is immediately called with the error.\n\nNote, that since this function applies `iterator` to each item in parallel,\nthere is no guarantee that the iterator functions will complete in order.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err)` which must be called once it has\n completed. If no error has occurred, the `callback` should be run without\n arguments or with an explicit `null` argument. The array index is not passed\n to the iterator. If you need the index, use [`forEachOf`](#forEachOf).\n* `callback(err)` - *Optional* A callback which is called when all `iterator` functions\n have finished, or an error occurs.\n\n__Examples__\n\n\n```js\n// assuming openFiles is an array of file names and saveFile is a function\n// to save the modified contents of that file:\n\nasync.each(openFiles, saveFile, function(err){\n // if any of the saves produced an error, err would equal that error\n});\n```\n\n```js\n// assuming openFiles is an array of file names\n\nasync.each(openFiles, function(file, callback) {\n\n // Perform operation on file here.\n console.log('Processing file ' + file);\n\n if( file.length > 32 ) {\n console.log('This file name is too long');\n callback('File name too long');\n } else {\n // Do work to process file here\n console.log('File processed');\n callback();\n }\n}, function(err){\n // if any of the file processing produced an error, err would equal that error\n if( err ) {\n // One of the iterations produced an error.\n // All processing will now stop.\n console.log('A file failed to process');\n } else {\n console.log('All files have been processed successfully');\n }\n});\n```\n\n__Related__\n\n* eachSeries(arr, iterator, [callback])\n* eachLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"forEachOf\" />\n<a name=\"eachOf\" />\n\n### forEachOf(obj, iterator, [callback])\n\nLike `each`, except that it iterates over objects, and passes the key as the second argument to the iterator.\n\n__Arguments__\n\n* `obj` - An object or array to iterate over.\n* `iterator(item, key, callback)` - A function to apply to each item in `obj`.\nThe `key` is the item's key, or index in the case of an array. The iterator is\npassed a `callback(err)` which must be called once it has completed. If no\nerror has occurred, the callback should be run without arguments or with an\nexplicit `null` argument.\n* `callback(err)` - *Optional* A callback which is called when all `iterator` functions have finished, or an error occurs.\n\n__Example__\n\n```js\nvar obj = {dev: \"/dev.json\", test: \"/test.json\", prod: \"/prod.json\"};\nvar configs = {};\n\nasync.forEachOf(obj, function (value, key, callback) {\n fs.readFile(__dirname + value, \"utf8\", function (err, data) {\n if (err) return callback(err);\n try {\n configs[key] = JSON.parse(data);\n } catch (e) {\n return callback(e);\n }\n callback();\n })\n}, function (err) {\n if (err) console.error(err.message);\n // configs is now a map of JSON data\n doSomethingWith(configs);\n})\n```\n\n__Related__\n\n* forEachOfSeries(obj, iterator, [callback])\n* forEachOfLimit(obj, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"map\" />\n### map(arr, iterator, [callback])\n\nProduces a new array of values by mapping each value in `arr` through\nthe `iterator` function. The `iterator` is called with an item from `arr` and a\ncallback for when it has finished processing. Each of these callback takes 2 arguments:\nan `error`, and the transformed item from `arr`. If `iterator` passes an error to its\ncallback, the main `callback` (for the `map` function) is immediately called with the error.\n\nNote, that since this function applies the `iterator` to each item in parallel,\nthere is no guarantee that the `iterator` functions will complete in order.\nHowever, the results array will be in the same order as the original `arr`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, transformed)` which must be called once\n it has completed with an error (which can be `null`) and a transformed item.\n* `callback(err, results)` - *Optional* A callback which is called when all `iterator`\n functions have finished, or an error occurs. Results is an array of the\n transformed items from the `arr`.\n\n__Example__\n\n```js\nasync.map(['file1','file2','file3'], fs.stat, function(err, results){\n // results is now an array of stats for each file\n});\n```\n\n__Related__\n* mapSeries(arr, iterator, [callback])\n* mapLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"select\" />\n<a name=\"filter\" />\n### filter(arr, iterator, [callback])\n\n__Alias:__ `select`\n\nReturns a new array of all the values in `arr` which pass an async truth test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. This operation is\nperformed in parallel, but the results array will be in the same order as the\noriginal.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The `iterator` is passed a `callback(truthValue)`, which must be called with a\n boolean argument once it has completed.\n* `callback(results)` - *Optional* A callback which is called after all the `iterator`\n functions have finished.\n\n__Example__\n\n```js\nasync.filter(['file1','file2','file3'], fs.exists, function(results){\n // results now equals an array of the existing files\n});\n```\n\n__Related__\n\n* filterSeries(arr, iterator, [callback])\n* filterLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"reject\" />\n### reject(arr, iterator, [callback])\n\nThe opposite of [`filter`](#filter). Removes values that pass an `async` truth test.\n\n__Related__\n\n* rejectSeries(arr, iterator, [callback])\n* rejectLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"reduce\" />\n### reduce(arr, memo, iterator, [callback])\n\n__Aliases:__ `inject`, `foldl`\n\nReduces `arr` into a single value using an async `iterator` to return\neach successive step. `memo` is the initial state of the reduction.\nThis function only operates in series.\n\nFor performance reasons, it may make sense to split a call to this function into\na parallel map, and then use the normal `Array.prototype.reduce` on the results.\nThis function is for situations where each step in the reduction needs to be async;\nif you can get the data before reducing it, then it's probably a good idea to do so.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `memo` - The initial state of the reduction.\n* `iterator(memo, item, callback)` - A function applied to each item in the\n array to produce the next step in the reduction. The `iterator` is passed a\n `callback(err, reduction)` which accepts an optional error as its first\n argument, and the state of the reduction as the second. If an error is\n passed to the callback, the reduction is stopped and the main `callback` is\n immediately called with the error.\n* `callback(err, result)` - *Optional* A callback which is called after all the `iterator`\n functions have finished. Result is the reduced value.\n\n__Example__\n\n```js\nasync.reduce([1,2,3], 0, function(memo, item, callback){\n // pointless async:\n process.nextTick(function(){\n callback(null, memo + item)\n });\n}, function(err, result){\n // result is now equal to the last value of memo, which is 6\n});\n```\n\n---------------------------------------\n\n<a name=\"reduceRight\" />\n### reduceRight(arr, memo, iterator, [callback])\n\n__Alias:__ `foldr`\n\nSame as [`reduce`](#reduce), only operates on `arr` in reverse order.\n\n\n---------------------------------------\n\n<a name=\"detect\" />\n### detect(arr, iterator, [callback])\n\nReturns the first value in `arr` that passes an async truth test. The\n`iterator` is applied in parallel, meaning the first iterator to return `true` will\nfire the detect `callback` with that result. That means the result might not be\nthe first item in the original `arr` (in terms of order) that passes the test.\n\nIf order within the original `arr` is important, then look at [`detectSeries`](#detectSeries).\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in `arr`.\n The iterator is passed a `callback(truthValue)` which must be called with a\n boolean argument once it has completed. **Note: this callback does not take an error as its first argument.**\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n `true`, or after all the `iterator` functions have finished. Result will be\n the first item in the array that passes the truth test (iterator) or the\n value `undefined` if none passed. **Note: this callback does not take an error as its first argument.**\n\n__Example__\n\n```js\nasync.detect(['file1','file2','file3'], fs.exists, function(result){\n // result now equals the first file in the list that exists\n});\n```\n\n__Related__\n\n* detectSeries(arr, iterator, [callback])\n* detectLimit(arr, limit, iterator, [callback])\n\n---------------------------------------\n\n<a name=\"sortBy\" />\n### sortBy(arr, iterator, [callback])\n\nSorts a list by the results of running each `arr` value through an async `iterator`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, sortValue)` which must be called once it\n has completed with an error (which can be `null`) and a value to use as the sort\n criteria.\n* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is the items from\n the original `arr` sorted by the values returned by the `iterator` calls.\n\n__Example__\n\n```js\nasync.sortBy(['file1','file2','file3'], function(file, callback){\n fs.stat(file, function(err, stats){\n callback(err, stats.mtime);\n });\n}, function(err, results){\n // results is now the original array of files sorted by\n // modified date\n});\n```\n\n__Sort Order__\n\nBy modifying the callback parameter the sorting order can be influenced:\n\n```js\n//ascending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(null, x);\n}, function(err,result){\n //result callback\n} );\n\n//descending order\nasync.sortBy([1,9,3,5], function(x, callback){\n callback(null, x*-1); //<- x*-1 instead of x, turns the order around\n}, function(err,result){\n //result callback\n} );\n```\n\n---------------------------------------\n\n<a name=\"some\" />\n### some(arr, iterator, [callback])\n\n__Alias:__ `any`\n\nReturns `true` if at least one element in the `arr` satisfies an async test.\n_The callback for each iterator call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`. Once any iterator\ncall returns `true`, the main `callback` is immediately called.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a `callback(truthValue)`` which must be\n called with a boolean argument once it has completed.\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n `true`, or after all the iterator functions have finished. Result will be\n either `true` or `false` depending on the values of the async tests.\n\n **Note: the callbacks do not take an error as their first argument.**\n__Example__\n\n```js\nasync.some(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then at least one of the files exists\n});\n```\n\n__Related__\n\n* someLimit(arr, limit, iterator, callback)\n\n---------------------------------------\n\n<a name=\"every\" />\n### every(arr, iterator, [callback])\n\n__Alias:__ `all`\n\nReturns `true` if every element in `arr` satisfies an async test.\n_The callback for each `iterator` call only accepts a single argument of `true` or\n`false`; it does not accept an error argument first!_ This is in-line with the\nway node libraries work with truth tests like `fs.exists`.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A truth test to apply to each item in the array\n in parallel. The iterator is passed a `callback(truthValue)` which must be\n called with a boolean argument once it has completed.\n* `callback(result)` - *Optional* A callback which is called as soon as any iterator returns\n `false`, or after all the iterator functions have finished. Result will be\n either `true` or `false` depending on the values of the async tests.\n\n **Note: the callbacks do not take an error as their first argument.**\n\n__Example__\n\n```js\nasync.every(['file1','file2','file3'], fs.exists, function(result){\n // if result is true then every file exists\n});\n```\n\n__Related__\n\n* everyLimit(arr, limit, iterator, callback)\n\n---------------------------------------\n\n<a name=\"concat\" />\n### concat(arr, iterator, [callback])\n\nApplies `iterator` to each item in `arr`, concatenating the results. Returns the\nconcatenated list. The `iterator`s are called in parallel, and the results are\nconcatenated as they return. There is no guarantee that the results array will\nbe returned in the original order of `arr` passed to the `iterator` function.\n\n__Arguments__\n\n* `arr` - An array to iterate over.\n* `iterator(item, callback)` - A function to apply to each item in `arr`.\n The iterator is passed a `callback(err, results)` which must be called once it\n has completed with an error (which can be `null`) and an array of results.\n* `callback(err, results)` - *Optional* A callback which is called after all the `iterator`\n functions have finished, or an error occurs. Results is an array containing\n the concatenated results of the `iterator` function.\n\n__Example__\n\n```js\nasync.concat(['dir1','dir2','dir3'], fs.readdir, function(err, files){\n // files is now a list of filenames that exist in the 3 directories\n});\n```\n\n__Related__\n\n* concatSeries(arr, iterator, [callback])\n\n\n## Control Flow\n\n<a name=\"series\" />\n### series(tasks, [callback])\n\nRun the functions in the `tasks` array in series, each one running once the previous\nfunction has completed. If any functions in the series pass an error to its\ncallback, no more functions are run, and `callback` is immediately called with the value of the error.\nOtherwise, `callback` receives an array of results when `tasks` have completed.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function, and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`series`](#series).\n\n**Note** that while many implementations preserve the order of object properties, the\n[ECMAScript Language Specification](http://www.ecma-international.org/ecma-262/5.1/#sec-8.6)\nexplicitly states that\n\n> The mechanics and order of enumerating the properties is not specified.\n\nSo if you rely on the order in which your series of functions are executed, and want\nthis to work on all platforms, consider using an array.\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run, each function is passed\n a `callback(err, result)` it must call on completion with an error `err` (which can\n be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed. This function gets a results array (or object) containing all\n the result arguments passed to the `task` callbacks.\n\n__Example__\n\n```js\nasync.series([\n function(callback){\n // do some stuff ...\n callback(null, 'one');\n },\n function(callback){\n // do some more stuff ...\n callback(null, 'two');\n }\n],\n// optional callback\nfunction(err, results){\n // results is now equal to ['one', 'two']\n});\n\n\n// an example using an object instead of an array\nasync.series({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equal to: {one: 1, two: 2}\n});\n```\n\n---------------------------------------\n\n<a name=\"parallel\" />\n### parallel(tasks, [callback])\n\nRun the `tasks` array of functions in parallel, without waiting until the previous\nfunction has completed. If any of the functions pass an error to its\ncallback, the main `callback` is immediately called with the value of the error.\nOnce the `tasks` have completed, the results are passed to the final `callback` as an\narray.\n\n**Note:** `parallel` is about kicking-off I/O tasks in parallel, not about parallel execution of code. If your tasks do not use any timers or perform any I/O, they will actually be executed in series. Any synchronous setup sections for each task will happen one after the other. JavaScript remains single-threaded.\n\nIt is also possible to use an object instead of an array. Each property will be\nrun as a function and the results will be passed to the final `callback` as an object\ninstead of an array. This can be a more readable way of handling results from\n[`parallel`](#parallel).\n\n\n__Arguments__\n\n* `tasks` - An array or object containing functions to run. Each function is passed\n a `callback(err, result)` which it must call on completion with an error `err`\n (which can be `null`) and an optional `result` value.\n* `callback(err, results)` - An optional callback to run once all the functions\n have completed successfully. This function gets a results array (or object) containing all\n the result arguments passed to the task callbacks.\n\n__Example__\n\n```js\nasync.parallel([\n function(callback){\n setTimeout(function(){\n callback(null, 'one');\n }, 200);\n },\n function(callback){\n setTimeout(function(){\n callback(null, 'two');\n }, 100);\n }\n],\n// optional callback\nfunction(err, results){\n // the results array will equal ['one','two'] even though\n // the second function had a shorter timeout.\n});\n\n\n// an example using an object instead of an array\nasync.parallel({\n one: function(callback){\n setTimeout(function(){\n callback(null, 1);\n }, 200);\n },\n two: function(callback){\n setTimeout(function(){\n callback(null, 2);\n }, 100);\n }\n},\nfunction(err, results) {\n // results is now equals to: {one: 1, two: 2}\n});\n```\n\n__Related__\n\n* parallelLimit(tasks, limit, [callback])\n\n---------------------------------------\n\n<a name=\"whilst\" />\n### whilst(test, fn, callback)\n\nRepeatedly call `fn`, while `test` returns `true`. Calls `callback` when stopped,\nor an error occurs.\n\n__Arguments__\n\n* `test()` - synchronous truth test to perform before each execution of `fn`.\n* `fn(callback)` - A function which is called each time `test` passes. The function is\n passed a `callback(err)`, which must be called once it has completed with an\n optional `err` argument.\n* `callback(err, [results])` - A callback which is called after the test\n function has failed and repeated execution of `fn` has stopped. `callback`\n will be passed an error and any arguments passed to the final `fn`'s callback.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.whilst(\n function () { return count < 5; },\n function (callback) {\n count++;\n setTimeout(function () {\n callback(null, count);\n }, 1000);\n },\n function (err, n) {\n // 5 seconds have passed, n = 5\n }\n);\n```\n\n---------------------------------------\n\n<a name=\"doWhilst\" />\n### doWhilst(fn, test, callback)\n\nThe post-check version of [`whilst`](#whilst). To reflect the difference in\nthe order of operations, the arguments `test` and `fn` are switched.\n\n`doWhilst` is to `whilst` as `do while` is to `while` in plain JavaScript.\n\n---------------------------------------\n\n<a name=\"until\" />\n### until(test, fn, callback)\n\nRepeatedly call `fn` until `test` returns `true`. Calls `callback` when stopped,\nor an error occurs. `callback` will be passed an error and any arguments passed\nto the final `fn`'s callback.\n\nThe inverse of [`whilst`](#whilst).\n\n---------------------------------------\n\n<a name=\"doUntil\" />\n### doUntil(fn, test, callback)\n\nLike [`doWhilst`](#doWhilst), except the `test` is inverted. Note the argument ordering differs from `until`.\n\n---------------------------------------\n\n<a name=\"during\" />\n### during(test, fn, callback)\n\nLike [`whilst`](#whilst), except the `test` is an asynchronous function that is passed a callback in the form of `function (err, truth)`. If error is passed to `test` or `fn`, the main callback is immediately called with the value of the error.\n\n__Example__\n\n```js\nvar count = 0;\n\nasync.during(\n function (callback) {\n return callback(null, count < 5);\n },\n function (callback) {\n count++;\n setTimeout(callback, 1000);\n },\n function (err) {\n // 5 seconds have passed\n }\n);\n```\n\n---------------------------------------\n\n<a name=\"doDuring\" />\n### doDuring(fn, test, callback)\n\nThe post-check version of [`during`](#during). To reflect the difference in\nthe order of operations, the arguments `test` and `fn` are switched.\n\nAlso a version of [`doWhilst`](#doWhilst) with asynchronous `test` function.\n\n---------------------------------------\n\n<a name=\"forever\" />\n### forever(fn, [errback])\n\nCalls the asynchronous function `fn` with a callback parameter that allows it to\ncall itself again, in series, indefinitely.\n\nIf an error is passed to the callback then `errback` is called with the\nerror, and execution stops, otherwise it will never be called.\n\n```js\nasync.forever(\n function(next) {\n // next is suitable for passing to things that need a callback(err [, whatever]);\n // it will result in this function being called again.\n },\n function(err) {\n // if next is called with a value in its first parameter, it will appear\n // in here as 'err', and execution will stop.\n }\n);\n```\n\n---------------------------------------\n\n<a name=\"waterfall\" />\n### waterfall(tasks, [callback])\n\nRuns the `tasks` array of functions in series, each passing their results to the next in\nthe array. However, if any of the `tasks` pass an error to their own callback, the\nnext function is not executed, and the main `callback` is immediately called with\nthe error.\n\n__Arguments__\n\n* `tasks` - An array of functions to run, each function is passed a\n `callback(err, result1, result2, ...)` it must call on completion. The first\n argument is an error (which can be `null`) and any further arguments will be\n passed as arguments in order to the next task.\n* `callback(err, [results])` - An optional callback to run once all the functions\n have completed. This will be passed the results of the last task's callback.\n\n\n\n__Example__\n\n```js\nasync.waterfall([\n function(callback) {\n callback(null, 'one', 'two');\n },\n function(arg1, arg2, callback) {\n // arg1 now equals 'one' and arg2 now equals 'two'\n callback(null, 'three');\n },\n function(arg1, callback) {\n // arg1 now equals 'three'\n callback(null, 'done');\n }\n], function (err, result) {\n // result now equals 'done'\n});\n```\n\n---------------------------------------\n<a name=\"compose\" />\n### compose(fn1, fn2...)\n\nCreates a function which is a composition of the passed asynchronous\nfunctions. Each function consumes the return value of the function that\nfollows. Composing functions `f()`, `g()`, and `h()` would produce the result of\n`f(g(h()))`, only this version uses callbacks to obtain the return values.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\nfunction add1(n, callback) {\n setTimeout(function () {\n callback(null, n + 1);\n }, 10);\n}\n\nfunction mul3(n, callback) {\n setTimeout(function () {\n callback(null, n * 3);\n }, 10);\n}\n\nvar add1mul3 = async.compose(mul3, add1);\n\nadd1mul3(4, function (err, result) {\n // result now equals 15\n});\n```\n\n---------------------------------------\n<a name=\"seq\" />\n### seq(fn1, fn2...)\n\nVersion of the compose function that is more natural to read.\nEach function consumes the return value of the previous function.\nIt is the equivalent of [`compose`](#compose) with the arguments reversed.\n\nEach function is executed with the `this` binding of the composed function.\n\n__Arguments__\n\n* `functions...` - the asynchronous functions to compose\n\n\n__Example__\n\n```js\n// Requires lodash (or underscore), express3 and dresende's orm2.\n// Part of an app, that fetches cats of the logged user.\n// This example uses `seq` function to avoid overnesting and error\n// handling clutter.\napp.get('/cats', function(request, response) {\n var User = request.models.User;\n async.seq(\n _.bind(User.get, User), // 'User.get' has signature (id, callback(err, data))\n function(user, fn) {\n user.getCats(fn); // 'getCats' has signature (callback(err, data))\n }\n )(req.session.user_id, function (err, cats) {\n if (err) {\n console.error(err);\n response.json({ status: 'error', message: err.message });\n } else {\n response.json({ status: 'ok', message: 'Cats found', data: cats });\n }\n });\n});\n```\n\n---------------------------------------\n<a name=\"applyEach\" />\n### applyEach(fns, args..., callback)\n\nApplies the provided arguments to each function in the array, calling\n`callback` after all functions have completed. If you only provide the first\nargument, then it will return a function which lets you pass in the\narguments as if it were a single function call.\n\n__Arguments__\n\n* `fns` - the asynchronous functions to all call with the same arguments\n* `args...` - any number of separate arguments to pass to the function\n* `callback` - the final argument should be the callback, called when all\n functions have completed processing\n\n\n__Example__\n\n```js\nasync.applyEach([enableSearch, updateSchema], 'bucket', callback);\n\n// partial application example:\nasync.each(\n buckets,\n async.applyEach([enableSearch, updateSchema]),\n callback\n);\n```\n\n__Related__\n\n* applyEachSeries(tasks, args..., [callback])\n\n---------------------------------------\n\n<a name=\"queue\" />\n### queue(worker, [concurrency])\n\nCreates a `queue` object with the specified `concurrency`. Tasks added to the\n`queue` are processed in parallel (up to the `concurrency` limit). If all\n`worker`s are in progress, the task is queued until one becomes available.\nOnce a `worker` completes a `task`, that `task`'s callback is called.\n\n__Arguments__\n\n* `worker(task, callback)` - An asynchronous function for processing a queued\n task, which must call its `callback(err)` argument when finished, with an\n optional `error` as an argument. If you want to handle errors from an individual task, pass a callback to `q.push()`.\n* `concurrency` - An `integer` for determining how many `worker` functions should be\n run in parallel. If omitted, the concurrency defaults to `1`. If the concurrency is `0`, an error is thrown.\n\n__Queue objects__\n\nThe `queue` object returned by this function has the following properties and\nmethods:\n\n* `length()` - a function returning the number of items waiting to be processed.\n* `started` - a function returning whether or not any items have been pushed and processed by the queue\n* `running()` - a function returning the number of items currently being processed.\n* `workersList()` - a function returning the array of items currently being processed.\n* `idle()` - a function returning false if there are items waiting or being processed, or true if not.\n* `concurrency` - an integer for determining how many `worker` functions should be\n run in parallel. This property can be changed after a `queue` is created to\n alter the concurrency on-the-fly.\n* `push(task, [callback])` - add a new task to the `queue`. Calls `callback` once\n the `worker` has finished processing the task. Instead of a single task, a `tasks` array\n can be submitted. The respective callback is used for every task in the list.\n* `unshift(task, [callback])` - add a new task to the front of the `queue`.\n* `saturated` - a callback that is called when the `queue` length hits the `concurrency` limit,\n and further tasks will be queued.\n* `empty` - a callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - a callback that is called when the last item from the `queue` has returned from the `worker`.\n* `paused` - a boolean for determining whether the queue is in a paused state\n* `pause()` - a function that pauses the processing of tasks until `resume()` is called.\n* `resume()` - a function that resumes the processing of queued tasks when the queue is paused.\n* `kill()` - a function that removes the `drain` callback and empties remaining tasks from the queue forcing it to go idle.\n\n__Example__\n\n```js\n// create a queue object with concurrency 2\n\nvar q = async.queue(function (task, callback) {\n console.log('hello ' + task.name);\n callback();\n}, 2);\n\n\n// assign a callback\nq.drain = function() {\n console.log('all items have been processed');\n}\n\n// add some items to the queue\n\nq.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\nq.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n\n// add some items to the queue (batch-wise)\n\nq.push([{name: 'baz'},{name: 'bay'},{name: 'bax'}], function (err) {\n console.log('finished processing item');\n});\n\n// add some items to the front of the queue\n\nq.unshift({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\n```\n\n\n---------------------------------------\n\n<a name=\"priorityQueue\" />\n### priorityQueue(worker, concurrency)\n\nThe same as [`queue`](#queue) only tasks are assigned a priority and completed in ascending priority order. There are two differences between `queue` and `priorityQueue` objects:\n\n* `push(task, priority, [callback])` - `priority` should be a number. If an array of\n `tasks` is given, all tasks will be assigned the same priority.\n* The `unshift` method was removed.\n\n---------------------------------------\n\n<a name=\"cargo\" />\n### cargo(worker, [payload])\n\nCreates a `cargo` object with the specified payload. Tasks added to the\ncargo will be processed altogether (up to the `payload` limit). If the\n`worker` is in progress, the task is queued until it becomes available. Once\nthe `worker` has completed some tasks, each callback of those tasks is called.\nCheck out [these](https://camo.githubusercontent.com/6bbd36f4cf5b35a0f11a96dcd2e97711ffc2fb37/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130382f62626330636662302d356632392d313165322d393734662d3333393763363464633835382e676966) [animations](https://camo.githubusercontent.com/f4810e00e1c5f5f8addbe3e9f49064fd5d102699/68747470733a2f2f662e636c6f75642e6769746875622e636f6d2f6173736574732f313637363837312f36383130312f38346339323036362d356632392d313165322d383134662d3964336430323431336266642e676966) for how `cargo` and `queue` work.\n\nWhile [queue](#queue) passes only one task to one of a group of workers\nat a time, cargo passes an array of tasks to a single worker, repeating\nwhen the worker is finished.\n\n__Arguments__\n\n* `worker(tasks, callback)` - An asynchronous function for processing an array of\n queued tasks, which must call its `callback(err)` argument when finished, with\n an optional `err` argument.\n* `payload` - An optional `integer` for determining how many tasks should be\n processed per round; if omitted, the default is unlimited.\n\n__Cargo objects__\n\nThe `cargo` object returned by this function has the following properties and\nmethods:\n\n* `length()` - A function returning the number of items waiting to be processed.\n* `payload` - An `integer` for determining how many tasks should be\n process per round. This property can be changed after a `cargo` is created to\n alter the payload on-the-fly.\n* `push(task, [callback])` - Adds `task` to the `queue`. The callback is called\n once the `worker` has finished processing the task. Instead of a single task, an array of `tasks`\n can be submitted. The respective callback is used for every task in the list.\n* `saturated` - A callback that is called when the `queue.length()` hits the concurrency and further tasks will be queued.\n* `empty` - A callback that is called when the last item from the `queue` is given to a `worker`.\n* `drain` - A callback that is called when the last item from the `queue` has returned from the `worker`.\n* `idle()`, `pause()`, `resume()`, `kill()` - cargo inherits all of the same methods and event calbacks as [`queue`](#queue)\n\n__Example__\n\n```js\n// create a cargo object with payload 2\n\nvar cargo = async.cargo(function (tasks, callback) {\n for(var i=0; i<tasks.length; i++){\n console.log('hello ' + tasks[i].name);\n }\n callback();\n}, 2);\n\n\n// add some items\n\ncargo.push({name: 'foo'}, function (err) {\n console.log('finished processing foo');\n});\ncargo.push({name: 'bar'}, function (err) {\n console.log('finished processing bar');\n});\ncargo.push({name: 'baz'}, function (err) {\n console.log('finished processing baz');\n});\n```\n\n---------------------------------------\n\n<a name=\"auto\" />\n### auto(tasks, [concurrency], [callback])\n\nDetermines the best order for running the functions in `tasks`, based on their requirements. Each function can optionally depend on other functions being completed first, and each function is run as soon as its requirements are satisfied.\n\nIf any of the functions pass an error to their callback, the `auto` sequence will stop. Further tasks will not execute (so any other functions depending on it will not run), and the main `callback` is immediately called with the error. Functions also receive an object containing the results of functions which have completed so far.\n\nNote, all functions are called with a `results` object as a second argument,\nso it is unsafe to pass functions in the `tasks` object which cannot handle the\nextra argument.\n\nFor example, this snippet of code:\n\n```js\nasync.auto({\n readData: async.apply(fs.readFile, 'data.txt', 'utf-8')\n}, callback);\n```\n\nwill have the effect of calling `readFile` with the results object as the last\nargument, which will fail:\n\n```js\nfs.readFile('data.txt', 'utf-8', cb, {});\n```\n\nInstead, wrap the call to `readFile` in a function which does not forward the\n`results` object:\n\n```js\nasync.auto({\n readData: function(cb, results){\n fs.readFile('data.txt', 'utf-8', cb);\n }\n}, callback);\n```\n\n__Arguments__\n\n* `tasks` - An object. Each of its properties is either a function or an array of\n requirements, with the function itself the last item in the array. The object's key\n of a property serves as the name of the task defined by that property,\n i.e. can be used when specifying requirements for other tasks.\n The function receives two arguments: (1) a `callback(err, result)` which must be\n called when finished, passing an `error` (which can be `null`) and the result of\n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions.\n* `concurrency` - An optional `integer` for determining the maximum number of tasks that can be run in parallel. By default, as many as possible.\n* `callback(err, results)` - An optional callback which is called when all the\n tasks have been completed. It receives the `err` argument if any `tasks`\n pass an error to their callback. Results are always returned; however, if\n an error occurs, no further `tasks` will be performed, and the results\n object will only contain partial results.\n\n\n__Example__\n\n```js\nasync.auto({\n get_data: function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n make_folder: function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n },\n write_file: ['get_data', 'make_folder', function(callback, results){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n callback(null, 'filename');\n }],\n email_link: ['write_file', function(callback, results){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n // results.write_file contains the filename returned by write_file.\n callback(null, {'file':results.write_file, 'email':'user@example.com'});\n }]\n}, function(err, results) {\n console.log('err = ', err);\n console.log('results = ', results);\n});\n```\n\nThis is a fairly trivial example, but to do this using the basic parallel and\nseries functions would look like this:\n\n```js\nasync.parallel([\n function(callback){\n console.log('in get_data');\n // async code to get some data\n callback(null, 'data', 'converted to array');\n },\n function(callback){\n console.log('in make_folder');\n // async code to create a directory to store a file in\n // this is run at the same time as getting the data\n callback(null, 'folder');\n }\n],\nfunction(err, results){\n async.series([\n function(callback){\n console.log('in write_file', JSON.stringify(results));\n // once there is some data and the directory exists,\n // write the data to a file in the directory\n results.push('filename');\n callback(null);\n },\n function(callback){\n console.log('in email_link', JSON.stringify(results));\n // once the file is written let's email a link to it...\n callback(null, {'file':results.pop(), 'email':'user@example.com'});\n }\n ]);\n});\n```\n\nFor a complicated series of `async` tasks, using the [`auto`](#auto) function makes adding\nnew tasks much easier (and the code more readable).\n\n\n---------------------------------------\n\n<a name=\"retry\" />\n### retry([opts = {times: 5, interval: 0}| 5], task, [callback])\n\nAttempts to get a successful response from `task` no more than `times` times before\nreturning an error. If the task is successful, the `callback` will be passed the result\nof the successful task. If all attempts fail, the callback will be passed the error and\nresult (if any) of the final attempt.\n\n__Arguments__\n\n* `opts` - Can be either an object with `times` and `interval` or a number. `times` is how many attempts should be made before giving up. `interval` is how long to wait inbetween attempts. Defaults to {times: 5, interval: 0}\n * if a number is passed in it sets `times` only (with `interval` defaulting to 0).\n* `task(callback, results)` - A function which receives two arguments: (1) a `callback(err, result)`\n which must be called when finished, passing `err` (which can be `null`) and the `result` of\n the function's execution, and (2) a `results` object, containing the results of\n the previously executed functions (if nested inside another control flow).\n* `callback(err, results)` - An optional callback which is called when the\n task has succeeded, or after the final failed attempt. It receives the `err` and `result` arguments of the last attempt at completing the `task`.\n\nThe [`retry`](#retry) function can be used as a stand-alone control flow by passing a\ncallback, as shown below:\n\n```js\nasync.retry(3, apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\n```js\nasync.retry({times: 3, interval: 200}, apiMethod, function(err, result) {\n // do something with the result\n});\n```\n\nIt can also be embedded within other control flow functions to retry individual methods\nthat are not as reliable, like this:\n\n```js\nasync.auto({\n users: api.getUsers.bind(api),\n payments: async.retry(3, api.getPayments.bind(api))\n}, function(err, results) {\n // do something with the results\n});\n```\n\n\n---------------------------------------\n\n<a name=\"iterator\" />\n### iterator(tasks)\n\nCreates an iterator function which calls the next function in the `tasks` array,\nreturning a continuation to call the next one after that. It's also possible to\n“peek” at the next iterator with `iterator.next()`.\n\nThis function is used internally by the `async` module, but can be useful when\nyou want to manually control the flow of functions in series.\n\n__Arguments__\n\n* `tasks` - An array of functions to run.\n\n__Example__\n\n```js\nvar iterator = async.iterator([\n function(){ sys.p('one'); },\n function(){ sys.p('two'); },\n function(){ sys.p('three'); }\n]);\n\nnode> var iterator2 = iterator();\n'one'\nnode> var iterator3 = iterator2();\n'two'\nnode> iterator3();\n'three'\nnode> var nextfn = iterator2.next();\nnode> nextfn();\n'three'\n```\n\n---------------------------------------\n\n<a name=\"apply\" />\n### apply(function, arguments..)\n\nCreates a continuation function with some arguments already applied.\n\nUseful as a shorthand when combined with other control flow functions. Any arguments\npassed to the returned function are added to the arguments originally passed\nto apply.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to automatically apply when the\n continuation is called.\n\n__Example__\n\n```js\n// using apply\n\nasync.parallel([\n async.apply(fs.writeFile, 'testfile1', 'test1'),\n async.apply(fs.writeFile, 'testfile2', 'test2'),\n]);\n\n\n// the same process without using apply\n\nasync.parallel([\n function(callback){\n fs.writeFile('testfile1', 'test1', callback);\n },\n function(callback){\n fs.writeFile('testfile2', 'test2', callback);\n }\n]);\n```\n\nIt's possible to pass any number of additional arguments when calling the\ncontinuation:\n\n```js\nnode> var fn = async.apply(sys.puts, 'one');\nnode> fn('two', 'three');\none\ntwo\nthree\n```\n\n---------------------------------------\n\n<a name=\"nextTick\" />\n### nextTick(callback), setImmediate(callback)\n\nCalls `callback` on a later loop around the event loop. In Node.js this just\ncalls `process.nextTick`; in the browser it falls back to `setImmediate(callback)`\nif available, otherwise `setTimeout(callback, 0)`, which means other higher priority\nevents may precede the execution of `callback`.\n\nThis is used internally for browser-compatibility purposes.\n\n__Arguments__\n\n* `callback` - The function to call on a later loop around the event loop.\n\n__Example__\n\n```js\nvar call_order = [];\nasync.nextTick(function(){\n call_order.push('two');\n // call_order now equals ['one','two']\n});\ncall_order.push('one')\n```\n\n<a name=\"times\" />\n### times(n, iterator, [callback])\n\nCalls the `iterator` function `n` times, and accumulates results in the same manner\nyou would use with [`map`](#map).\n\n__Arguments__\n\n* `n` - The number of times to run the function.\n* `iterator` - The function to call `n` times.\n* `callback` - see [`map`](#map)\n\n__Example__\n\n```js\n// Pretend this is some complicated async factory\nvar createUser = function(id, callback) {\n callback(null, {\n id: 'user' + id\n })\n}\n// generate 5 users\nasync.times(5, function(n, next){\n createUser(n, function(err, user) {\n next(err, user)\n })\n}, function(err, users) {\n // we should now have 5 users\n});\n```\n\n__Related__\n\n* timesSeries(n, iterator, [callback])\n* timesLimit(n, limit, iterator, [callback])\n\n\n## Utils\n\n<a name=\"memoize\" />\n### memoize(fn, [hasher])\n\nCaches the results of an `async` function. When creating a hash to store function\nresults against, the callback is omitted from the hash and an optional hash\nfunction can be used.\n\nIf no hash function is specified, the first argument is used as a hash key, which may work reasonably if it is a string or a data type that converts to a distinct string. Note that objects and arrays will not behave reasonably. Neither will cases where the other arguments are significant. In such cases, specify your own hash function.\n\nThe cache of results is exposed as the `memo` property of the function returned\nby `memoize`.\n\n__Arguments__\n\n* `fn` - The function to proxy and cache results from.\n* `hasher` - An optional function for generating a custom hash for storing\n results. It has all the arguments applied to it apart from the callback, and\n must be synchronous.\n\n__Example__\n\n```js\nvar slow_fn = function (name, callback) {\n // do something\n callback(null, result);\n};\nvar fn = async.memoize(slow_fn);\n\n// fn can now be used as if it were slow_fn\nfn('some name', function () {\n // callback\n});\n```\n\n<a name=\"unmemoize\" />\n### unmemoize(fn)\n\nUndoes a [`memoize`](#memoize)d function, reverting it to the original, unmemoized\nform. Handy for testing.\n\n__Arguments__\n\n* `fn` - the memoized function\n\n---------------------------------------\n\n<a name=\"ensureAsync\" />\n### ensureAsync(fn)\n\nWrap an async function and ensure it calls its callback on a later tick of the event loop. If the function already calls its callback on a next tick, no extra deferral is added. This is useful for preventing stack overflows (`RangeError: Maximum call stack size exceeded`) and generally keeping [Zalgo](http://blog.izs.me/post/59142742143/designing-apis-for-asynchrony) contained.\n\n__Arguments__\n\n* `fn` - an async function, one that expects a node-style callback as its last argument\n\nReturns a wrapped function with the exact same call signature as the function passed in.\n\n__Example__\n\n```js\nfunction sometimesAsync(arg, callback) {\n if (cache[arg]) {\n return callback(null, cache[arg]); // this would be synchronous!!\n } else {\n doSomeIO(arg, callback); // this IO would be asynchronous\n }\n}\n\n// this has a risk of stack overflows if many results are cached in a row\nasync.mapSeries(args, sometimesAsync, done);\n\n// this will defer sometimesAsync's callback if necessary,\n// preventing stack overflows\nasync.mapSeries(args, async.ensureAsync(sometimesAsync), done);\n\n```\n\n---------------------------------------\n\n<a name=\"constant\">\n### constant(values...)\n\nReturns a function that when called, calls-back with the values provided. Useful as the first function in a `waterfall`, or for plugging values in to `auto`.\n\n__Example__\n\n```js\nasync.waterfall([\n async.constant(42),\n function (value, next) {\n // value === 42\n },\n //...\n], callback);\n\nasync.waterfall([\n async.constant(filename, \"utf8\"),\n fs.readFile,\n function (fileData, next) {\n //...\n }\n //...\n], callback);\n\nasync.auto({\n hostname: async.constant(\"https://server.net/\"),\n port: findFreePort,\n launchServer: [\"hostname\", \"port\", function (cb, options) {\n startServer(options, cb);\n }],\n //...\n}, callback);\n\n```\n\n---------------------------------------\n\n<a name=\"asyncify\">\n<a name=\"wrapSync\">\n### asyncify(func)\n\n__Alias:__ `wrapSync`\n\nTake a sync function and make it async, passing its return value to a callback. This is useful for plugging sync functions into a waterfall, series, or other async functions. Any arguments passed to the generated function will be passed to the wrapped function (except for the final callback argument). Errors thrown will be passed to the callback.\n\n__Example__\n\n```js\nasync.waterfall([\n async.apply(fs.readFile, filename, \"utf8\"),\n async.asyncify(JSON.parse),\n function (data, next) {\n // data is the result of parsing the text.\n // If there was a parsing error, it would have been caught.\n }\n], callback)\n```\n\n---------------------------------------\n\n<a name=\"log\" />\n### log(function, arguments)\n\nLogs the result of an `async` function to the `console`. Only works in Node.js or\nin browsers that support `console.log` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.log` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, 'hello ' + name);\n }, 1000);\n};\n```\n```js\nnode> async.log(hello, 'world');\n'hello world'\n```\n\n---------------------------------------\n\n<a name=\"dir\" />\n### dir(function, arguments)\n\nLogs the result of an `async` function to the `console` using `console.dir` to\ndisplay the properties of the resulting object. Only works in Node.js or\nin browsers that support `console.dir` and `console.error` (such as FF and Chrome).\nIf multiple arguments are returned from the async function, `console.dir` is\ncalled on each argument in order.\n\n__Arguments__\n\n* `function` - The function you want to eventually apply all arguments to.\n* `arguments...` - Any number of arguments to apply to the function.\n\n__Example__\n\n```js\nvar hello = function(name, callback){\n setTimeout(function(){\n callback(null, {hello: name});\n }, 1000);\n};\n```\n```js\nnode> async.dir(hello, 'world');\n{hello: 'world'}\n```\n\n---------------------------------------\n\n<a name=\"noConflict\" />\n### noConflict()\n\nChanges the value of `async` back to its original value, returning a reference to the\n`async` object.\n",
|
102
|
-
"readmeFilename": "README.md",
|
102
|
+
"readme": "ERROR: No README data found!",
|
103
103
|
"repository": {
|
104
104
|
"type": "git",
|
105
105
|
"url": "git+https://github.com/caolan/async.git"
|
@@ -117,7 +117,7 @@
|
|
117
117
|
"spm": {
|
118
118
|
"main": "lib/async.js"
|
119
119
|
},
|
120
|
-
"version": "1.5.
|
120
|
+
"version": "1.5.2",
|
121
121
|
"volo": {
|
122
122
|
"ignore": [
|
123
123
|
"**/.*",
|
@@ -0,0 +1 @@
|
|
1
|
+
62638
|
@@ -1,6 +1,4 @@
|
|
1
|
-
(
|
2
|
-
|
3
|
-
Copyright (c) 2013 Julian Gruber <julian@juliangruber.com>
|
1
|
+
Copyright 2013 Michael Hart (michael.hart.au@gmail.com)
|
4
2
|
|
5
3
|
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
6
4
|
this software and associated documentation files (the "Software"), to deal in
|