{"_id":"@carrotwu/promise-tools","_rev":"5-80c176b915b6523f1262b07cf5620426","name":"@carrotwu/promise-tools","dist-tags":{"latest":"1.1.0"},"versions":{"1.0.1":{"name":"@carrotwu/promise-tools","version":"1.0.1","description":"### warmAll(task, [options]) + task: promiseLike函数即可 + options.race: 最大超时时间 伪取消请求 请求依然会发出正常处理，知识如果等待时间超过超时时间那么返回的res数组就是error类型 + options.limit: 最大并发数","main":"dist/index.main.js","jsnext:main":"dist/index.esm.js","module":"dist/index.esm.js","browser":"dist/index.umd.js","publishConfig":{"access":"public"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","watch":"rollup -c --watch","lint":"eslint src --ext .ts --fix","publish":"yarn build && npm publish"},"author":{"name":"carrotwu"},"license":"ISC","devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.11","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-node-resolve":"^11.0.1","@rollup/plugin-replace":"^2.3.4","@rollup/plugin-alias":"^3.1.1","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","core-js":"3","eslint":"^7.17.0","eslint-config-airbnb-base":"^14.2.1","eslint-config-prettier":"^7.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.3.1","prettier":"^2.2.1","rollup":"^2.36.1","rollup-plugin-inject":"^3.0.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","typescript":"^4.1.3"},"dependencies":{},"_id":"@carrotwu/promise-tools@1.0.1","dist":{"shasum":"82cdee898dbf01fa49cd446e950f834d901976ed","integrity":"sha512-1RGxgfOmYpCAcoB1k/iF1k4NNfWxxv4ktwl0fIP0GqRoXz4/o7io+l3etsSHDkDtO+s7hHmQi0/a7jQccbDsLg==","tarball":"https://registry.npmjs.org/@carrotwu/promise-tools/-/promise-tools-1.0.1.tgz","fileCount":31,"unpackedSize":91075,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCqH+CRA9TVsSAnZWagAAvH8P+gJxt3tEeo9j18ssZjRm\nntjnx5NynYLrtMIay9h8vvoPJed2A74BQcDChrqALInSMQsnv1ymT77d7KYp\npx3gCfetakpcTb5ZU8jZgcak55N1BUSPXnP9+ufzSH7ps/OtSatjo6XrRgCn\nWgqQ6S6L5oCf5UTh8cVtoKYB3kQS0QpikDcsB8K0eKF+GkAuhJGrVfrZdJBo\nUcztdZsO8x+aPFQO6ncaaTivl+U2ShOdulpD2Gf9UuUNVO15ATJ3F3WmbHQl\nYaWKQN7aiFcl384sS7I3/dI5vV6G9wL4zYdzzpaTBQXAhVd1Pw9ByMxBipDx\nyHbBy//iNFp2I0Zs9mS0mKK4mdPcEC/FNybE+Hvjl5thylpmB1ngQ/fcA/Lv\nhdDFmPgVSe0dTfHXZAVqw4Op8hUbSx7HHVkeWOBHjUtZ6UwTrRYIsj9g9j6l\nPcCWPiVnefbDXVWuzUEyHJIVIYeN1+AYJL7h2PyWsri4ytIu1/poEP6rKtgk\nuTpNEnoqoseuIzFxdO/hTv5G3NvOZbkj3r0oBuwSsPG0KatgH1sMhICq2k4T\npECrrdEq9Oepxrds0QVnjGSqHoVF/mBQgH56rKbyTnuTZpuEzOvIp26xMScb\nNG0RYmZCy3eT9ce3ITyQVtWXGTCJmFoKEr2nNEhpSwNINHIjJ9VEy0/cRwYv\n0Dqe\r\n=6aOz\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQClqgBoCooPRDj5IosHPOeIUC8pyifdYJ2TjprP12gvTAIhAONrwYwgqseylEYumMFkijWG3vLqGzMXcLLTBjXkhWCB"}]},"_npmUser":{"name":"carrotwu","email":"542425997@qq.com"},"directories":{},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-tools_1.0.1_1611309565769_0.1938087354217588"},"_hasShrinkwrap":false},"1.0.0":{"name":"@carrotwu/promise-tools","version":"1.0.0","description":"### warmAll(task, [options]) + task: promiseLike函数即可 + options.race: 最大超时时间 伪取消请求 请求依然会发出正常处理，知识如果等待时间超过超时时间那么返回的res数组就是error类型 + options.limit: 最大并发数","main":"dist/index.main.js","jsnext:main":"dist/index.esm.js","module":"dist/index.esm.js","browser":"dist/index.umd.js","publishConfig":{"access":"public"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","watch":"rollup -c --watch","lint":"eslint src --ext .ts --fix","publish":"npm run build && npm publish"},"author":{"name":"carrotwu"},"license":"ISC","devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.11","@babel/preset-typescript":"^7.12.7","@rollup/plugin-alias":"^3.1.1","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-node-resolve":"^11.0.1","@rollup/plugin-replace":"^2.3.4","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","core-js":"3","eslint":"^7.17.0","eslint-config-airbnb-base":"^14.2.1","eslint-config-prettier":"^7.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.3.1","prettier":"^2.2.1","rollup":"^2.36.1","rollup-plugin-inject":"^3.0.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","typescript":"^4.1.3"},"dependencies":{},"_id":"@carrotwu/promise-tools@1.0.0","dist":{"shasum":"9f6dd4520d27367ab855e55497b0174be6588164","integrity":"sha512-Otn4VE5veW95RuqTg2IhKtYSI/G6DA1tW8iaux/OjuKkETwoEU5veDcoq3AsAF1NDyLeSweXEIxralwejpTF0A==","tarball":"https://registry.npmjs.org/@carrotwu/promise-tools/-/promise-tools-1.0.0.tgz","fileCount":31,"unpackedSize":91078,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgCqI7CRA9TVsSAnZWagAAWyoP/RJBLH3T0xZQiJMQJrLq\nTlRMicVlretW0z/3VpizrfJZ9kjhiUsBXXUzr6afAvEGP5eP4uJzuh1T35oE\n5CiAC4osPFqj8QFB9T/OyqA/23X8YxWJf2uubDGBuBBgCCRJiuWzGSMGLDc5\nJXAYY96k/td2OgQ5i3L/KfB0V0EANHfHSbTk4dBixOuzCB2FATK4/IrhnteB\nylFr1hTEVCkRPAlFknY+QTHk78YmAyWW8dvgcYlMgQoDJaZQ7kWhSqZcXLPt\nG4FPQ6p3+QZ1Yyozmp5CoBXu7xzNkBB1OdzY1tnPHRkvFcsT1/birK0IRAC4\njPale/+16q6BhDcFJTa6FSU1EC5wxjF6K/McVZZYdr1yeYYUWqqs6Kwjdpk4\n0k5ALVDDdW9jxTtqLGWUozaT0eRB15tjrEte4Z3UNNgvOOffZm2KAsdqviUP\n1ckMC4xkm+IbnwIMV4C2BCKQjLn+aEinN6L++f7k7HBAVsWoaGbnGn8qE9mk\nzxP+OclUn3dr0Ctt5A9Mya9iVxSq96s0h/sXt1MiGz94HKBolX8MvYW3ulvp\nbKNr4WFz8CUhPWhwyZfES0QP8H+XiiEa4cniTVgOINENQzTr8d7fGULDH2cI\nrDmXI3znF77vYOtwaRA/AtztJy583gPYSoompZP5TA8i4yaeiita+qz0uBcd\ndem6\r\n=rx87\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFIzgTByyto03IsPK3OXiFkt0JU8EmftG5iE0DA/6ZgeAiAotc6gt4XUMqJkgMHzfF8ktgbEssu49V04WX8MmLEk2A=="}]},"_npmUser":{"name":"carrotwu","email":"542425997@qq.com"},"directories":{},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-tools_1.0.0_1611309626714_0.67652061189166"},"_hasShrinkwrap":false},"1.0.2":{"name":"@carrotwu/promise-tools","version":"1.0.2","description":"### warmAll(task, [options]) + task: promiseLike函数即可 + options.race: 最大超时时间 伪取消请求 请求依然会发出正常处理，知识如果等待时间超过超时时间那么返回的res数组就是error类型 + options.limit: 最大并发数","main":"dist/index.main.js","jsnext:main":"dist/index.esm.js","module":"dist/index.esm.js","browser":"dist/index.umd.js","typings":"dist/index.d.ts","publishConfig":{"access":"public"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","watch":"rollup -c --watch","lint":"eslint src --ext .ts --fix","publish":"yarn build && npm publish"},"author":{"name":"carrotwu"},"license":"ISC","devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.11","@babel/preset-typescript":"^7.12.7","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-node-resolve":"^11.0.1","@rollup/plugin-replace":"^2.3.4","@rollup/plugin-alias":"^3.1.1","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","core-js":"3","eslint":"^7.17.0","eslint-config-airbnb-base":"^14.2.1","eslint-config-prettier":"^7.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.3.1","prettier":"^2.2.1","rollup":"^2.36.1","rollup-plugin-inject":"^3.0.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","typescript":"^4.1.3"},"dependencies":{},"_id":"@carrotwu/promise-tools@1.0.2","dist":{"shasum":"83d9d8546bd4199201f0d12baad3b7b5279ffa81","integrity":"sha512-sFeUFfOzdyW9EfV/5i492qdkBhSgerlHDHBMQ66y4pxyU8KLPljc09aW4rO+8D6ukLks8ANuGxGx7C00Dt1w+g==","tarball":"https://registry.npmjs.org/@carrotwu/promise-tools/-/promise-tools-1.0.2.tgz","fileCount":31,"unpackedSize":115876,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCkJ+CRA9TVsSAnZWagAA/R0P+wXvJNZBFtDC0PCjc8Lp\nxdYsKxx4pfnwICA7w5f7xaf/AQQngHP/rxgukkYI5+qfP7IWRfFx16/wfLTA\n3nU9xGVnPV0zUzt7K8QUTyHnxmjPE7xpmrGjKwrVUn8HebcECb835FPIP4l4\nujPtHc5xhzW5XT94MSrNmoPtdEhhPnACVjOlfAN7ORUYIxufg1r6oR1P9/v3\nrhzxkRu3QRpBwryXTpSCB31X7RwQFKl65F1ZsW7G0N8sc/wyTiDH9q5u4MaY\nH3r3u+rQO6DhPt1Q05fzJzxCSJeScx3+Hs16JswdFMbojWItX/QYPgg10PnS\nk8noUV5NeqOU1sOlKfG27fspp1UwiLy927EEy/77HtqQ78xGbg8OuV2nEMDL\nrvk3zWuB4SejleJRK9TAu74YAekquvGFSnxkl7g6CyxtHLahw5ih0RTqg1Dm\nhUwwSPTu4e2Ja4LBdjDnmIDbIl2iYFTr16tpYMiX22so4TXEV/FESH4SIz0+\nGoJZroZl0fgDbXeeagy/LtWiXSeDibPrm9/FL17ukhkTudDX7OZ5b1ENZAZT\nrKYfHo6RXg6QvsaiopS0Dy8nDYlyWPCeq2swrJcqd/ep/4RdqCr897yQ1rEj\ndOcO1EXXQ/VbPNZpjT8MUwUgJsva8gEyTrNW+4FQQFDby3tCdvwM9x4UvLf5\nib65\r\n=c+PK\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAT3TDBzsb2Y3NPPoRWdjp4CKnmU7C2capm04l1aUZ1tAiEAhW5NuMyj/3Lwir03VPQMvLjhIUjMMW9FQRuvzjd+f7M="}]},"_npmUser":{"name":"carrotwu","email":"542425997@qq.com"},"directories":{},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-tools_1.0.2_1628062334753_0.45200845846173743"},"_hasShrinkwrap":false},"1.0.9":{"name":"@carrotwu/promise-tools","version":"1.0.9","description":"### warmAll(task, [options]) + task: promiseLike函数即可 + options.race: 最大超时时间 伪取消请求 请求依然会发出正常处理，知识如果等待时间超过超时时间那么返回的res数组就是error类型 + options.limit: 最大并发数","main":"dist/index.main.js","jsnext:main":"dist/index.esm.js","module":"dist/index.esm.js","browser":"dist/index.umd.js","typings":"dist/index.d.ts","publishConfig":{"access":"public"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","watch":"rollup -c --watch","lint":"eslint src --ext .ts --fix","publish":"yarn build && npm publish"},"author":{"name":"carrotwu"},"license":"ISC","devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.11","@babel/preset-typescript":"^7.12.7","@rollup/plugin-alias":"^3.1.1","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-node-resolve":"^11.0.1","@rollup/plugin-replace":"^2.3.4","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","core-js":"3","eslint":"^7.17.0","eslint-config-airbnb-base":"^14.2.1","eslint-config-prettier":"^7.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.3.1","prettier":"^2.2.1","rollup":"^2.36.1","rollup-plugin-inject":"^3.0.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","typescript":"^4.1.3"},"dependencies":{},"_id":"@carrotwu/promise-tools@1.0.9","dist":{"shasum":"5fecbf26726c4fdf4ada8889ccec90c48279c18e","integrity":"sha512-SoNaKrewIr+rkRTgjnNy2LLno9e8QMLACRYpUr1Mu2dESGZZN3QYe1B58pfAbLJB8zjGs/6K8xMjw9OFm/Qi6Q==","tarball":"https://registry.npmjs.org/@carrotwu/promise-tools/-/promise-tools-1.0.9.tgz","fileCount":31,"unpackedSize":91196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCkNDCRA9TVsSAnZWagAADPYP/1iRYfHpAfOogMOMpmrW\njz9l5+XyWlU3FHEVBV11inrKhPADdpVdvA7wU1pCtLDPZyD8zyCuhI7a9gK/\ngNKVn4mtsduTao0pNOWXTKasdS4VUnMiFgj2IFJB609pazB4pZMNTHGpyLPA\nop18u+GvBjKyXQSk4ORXpcjReFSnJeQv7E2zOe/r89JMQSfcp/qE0MVf2Q7a\ngn9KZ1S4iDJjWPkTXWgCFCImLBxPKXOsNr3XRgX1tVin2h7YDjcrKOWSEYZj\nhGlEAl5zhHDLB/AivJAPRk4PiPZbkzmc38kXwN/BrSNmUbc7MddxKm4GZxcS\nx8XYvSIoJwzOiZmG4uka/qkGPC3nEk4Zy2JezXssjLJh1EF0cKJNkGXcjFWN\nWEZ+k8KlAbt3n/cpf36m9P8eYES8A3lLEZh9kGufZQ3ZoiMVN+O2pOH+0wBN\nHya/sm2K55phlFwsmGjXfF5BlJ41igDsivU8cq+YQqTvPd4fyNruimDwcJnL\n6VT1F33lANar0v//nThOW1Uap2wLtqyqmHPC5e5KtE2NdkTPda3N1nv0ZfLz\nkUY3e+RxbfnPn8p7iVOfzPbpVN2Z2EOtuZQcDOQhtDp4nhkJ9hGW/MG1rB6w\n0unSOPD+frHGodHsIoMxnIIgNaE59a4HgaIMh7CZWgrOxVgecPb9gzaMYWfQ\n8IQe\r\n=RqYG\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQD0K349UIlg3TTE4nvYOssEQSu8cvlM9j0vVY7oqmrNmAIgPUrdUrbQXh9MSuXC4BDBWGBBesttRhLAdG0h/mOIxgQ="}]},"_npmUser":{"name":"carrotwu","email":"542425997@qq.com"},"directories":{},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-tools_1.0.9_1628062531223_0.08069148087436862"},"_hasShrinkwrap":false},"1.1.0":{"name":"@carrotwu/promise-tools","version":"1.1.0","description":"### warmAll(task, [options]) + task: promiseLike函数即可 + options.race: 最大超时时间 伪取消请求 请求依然会发出正常处理，知识如果等待时间超过超时时间那么返回的res数组就是error类型 + options.limit: 最大并发数","main":"dist/index.main.js","jsnext:main":"dist/index.esm.js","module":"dist/index.esm.js","browser":"dist/index.umd.js","typings":"dist/index.d.ts","publishConfig":{"access":"public"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1","build":"rollup -c","watch":"rollup -c --watch","lint":"eslint src --ext .ts --fix","publish":"yarn build && npm publish"},"author":{"name":"carrotwu"},"license":"ISC","devDependencies":{"@babel/core":"^7.12.10","@babel/preset-env":"^7.12.11","@babel/preset-typescript":"^7.12.7","@rollup/plugin-alias":"^3.1.1","@rollup/plugin-babel":"^5.2.2","@rollup/plugin-commonjs":"^17.0.0","@rollup/plugin-node-resolve":"^11.0.1","@rollup/plugin-replace":"^2.3.4","@typescript-eslint/eslint-plugin":"^4.13.0","@typescript-eslint/parser":"^4.13.0","core-js":"3","eslint":"^7.17.0","eslint-config-airbnb-base":"^14.2.1","eslint-config-prettier":"^7.1.0","eslint-plugin-import":"^2.22.1","eslint-plugin-prettier":"^3.3.1","prettier":"^2.2.1","rollup":"^2.36.1","rollup-plugin-inject":"^3.0.2","rollup-plugin-terser":"^7.0.2","rollup-plugin-typescript2":"^0.29.0","typescript":"^4.1.3"},"dependencies":{},"gitHead":"09531743f57a26760280f3983515313f8a5ce5a4","_id":"@carrotwu/promise-tools@1.1.0","_nodeVersion":"12.16.3","_npmVersion":"6.14.5","dist":{"integrity":"sha512-ojIz1YMPP4xy4GucSys370TiNfXFbnB4wlKwnSxcN0kXr0r1baoeSVkXRCThQ1X2pV+I6e0gu6hD1+OB7V65oA==","shasum":"f855b3f7f81ceea8a15e105f4fae3fc2bba74b53","tarball":"https://registry.npmjs.org/@carrotwu/promise-tools/-/promise-tools-1.1.0.tgz","fileCount":26,"unpackedSize":91196,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJhCkQZCRA9TVsSAnZWagAABHQP/jBOfPsUCcCdUDKnFm4v\nwMKxuxS4y9XWoqzrDNhSzg/jBXukfHBYx4A/Zdjsjfd+qHbJPIvBWzjcefMV\nsHiGKItCWvq1zv4K28kpczJ1Jx9TKkKgndPNcGi/5SsaizdgcGXt9Vw+CiWk\nilL1YUc8HkWAV+HImKT0PoPZwsfdTdaIYRCItAnX84E2O96sIIgeZXohmow9\nV1dK0CX0BPrKopSFFjDbzGqPoX6YgGlcKFaIvSnOjNv+j4msxGaamNrFHzUl\nDQTX5Q8UWAUlNIEW30m7nQybp2t5fgvKad/798fExqSGmete84LDaq3hq0tn\n3PVyjSFQ7V69sarj/SfGzo3B8Er2t4sWvaBSCu6Su8DxRGbme4/J79sxkzXB\nxe8xOFLi1Zx6ILJajSG1BCvNm2nqaej6Z3viIrJYtD1dZZKyz2jpN4Cc0kas\ndmX5WBbNv/LtUr2RpjvLBHyL8McbXunGG+FPq78dZidxDJgXaDHHIjw+hs/3\nEoD52Ojjuavl0pHlDgtCq3ShIPMCVlwKXOkJjVFV45fH/CErrBvwt0grvYEC\nAaQterd32WvjdWNx/4vY/Pknxc0EZMwV3KvgM5kosn0UlDfKu+n/NuJtO6PI\nO20Pj+7N4+X+8KjL6Yc5Y2Vs5wHyjfw6VFRDS9YNl5ybyzZS9yJr288HJ019\ndTlt\r\n=MFxv\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDeYBRix/0WtNt61oLroPU/RJR74SV4n2u76q6zdWi+RAiB/GWMd40gi8D522BbgeXSl3YVamnoWmDL82ePbg/jBfw=="}]},"_npmUser":{"name":"carrotwu","email":"542425997@qq.com"},"directories":{},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/promise-tools_1.1.0_1628062745596_0.5909860565785714"},"_hasShrinkwrap":false}},"time":{"created":"2021-01-22T09:59:25.713Z","1.0.1":"2021-01-22T09:59:25.925Z","modified":"2022-04-04T21:59:07.721Z","1.0.0":"2021-01-22T10:00:26.851Z","1.0.2":"2021-08-04T07:32:14.947Z","1.0.9":"2021-08-04T07:35:31.570Z","1.1.0":"2021-08-04T07:39:05.711Z"},"maintainers":[{"name":"carrotwu","email":"542425997@qq.com"}],"description":"### warmAll(task, [options]) + task: promiseLike函数即可 + options.race: 最大超时时间 伪取消请求 请求依然会发出正常处理，知识如果等待时间超过超时时间那么返回的res数组就是error类型 + options.limit: 最大并发数","author":{"name":"carrotwu"},"license":"ISC","readme":"\n## 个人通用promise库\n\n### warmAll(task, [options])\n+ task: promiseLike函数即可\n+ options.race: 最大超时时间 伪取消请求 请求依然会发出正常处理，知识如果等待时间超过超时时间那么返回的res数组就是error类型\n+ options.limit: 最大并发数\n\n增强级的`Promise.all`方法。\n1. 对每一个promise进行单独的错误处理，单一的task错误不再直接进行reject。\n2. 支持最大并发数limit\n3. 支持设置promise的超时时间race\n\n```js\nconst { sleep, warmAll } = require('./dist/index.main');\n\nconst testArray = Array.from({ length: 10 })\n  .fill(1)\n  .map((item, index) => async () => {\n    const time = ((index % 5) + 0.5) * 1000;\n    const res = await sleep(time);\n    console.log(`索引${index}`);\n    return res\n  });\n\nwarmAll(testArray, { race: 3000, limit: 5 }).then((res) => console.log(res));\n// [500, 1500, 2500, error, error, 500, 1500, 2500, error, error]\n```\n### retry(task, [options])\n+ task: promiseLike函数即可\n+ options.time: 抛出错误是支持自动重新发起请求的次数\n\n```js\nlet time = 0;\n\nretry(\n  async () => {\n    if (time >= 2) {\n      return Promise.resolve('成功');\n    }\n    time += 1;\n    console.log(`第${time}次失败`);\n    return Promise.reject(new Error(`第${time}次失败`));\n  },\n  { time: 3 },\n).then((res) => {\n  console.log(res);\n});\n\n// 第一次失败 第二次失败 成功\n\n```\n\n### sleep(delay)\n延迟时间task\n\n```js\n/**\n * 异步延迟函数\n * @param delay 延迟时间\n */\nexport const sleep = (delay: number) =>\n  new Promise((resolve) => {\n    setTimeout(() => {\n      resolve(delay);\n    }, delay);\n  });\n\n```\n\n### retry(task, [options])\n+ task: promiseLike函数即可\n+ options.time: 超时时间\n超时时间设置，超过了超时时间并不会abort掉发送的task请求，因为是通过race模拟的所以不推荐在task中写入业务逻辑。\n\n```js\n/**\n * 异步延迟函数\n * @param delay 延迟时间\n */\nexport const sleep = (delay: number) =>\n  new Promise((resolve) => {\n    setTimeout(() => {\n      resolve(delay);\n    }, delay);\n  });\n\n```\n","readmeFilename":"readme.md"}