{"_id":"j-async","_rev":"7-4e536acd5a93f2a8a49c1422ce79b3e5","name":"j-async","description":"异步并发控制","dist-tags":{"latest":"1.0.4"},"versions":{"1.0.0":{"name":"j-async","version":"1.0.0","description":"## 使用方法 ```javascript const urls = [   'http://placehold.it/1300x1600/E97452/fff',   'http://placehold.it/1300x1300/4C6EB4/fff',   'http://placehold.it/1300x1250/449F93/fff',   'http://placehold.it/dsadsa/936FBC/fff',   'http://placehold.it/1000x500/D2506","main":"index.js","directories":{"lib":"lib"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Jasonzj/asyncLimit.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/Jasonzj/asyncLimit/issues"},"homepage":"https://github.com/Jasonzj/asyncLimit#readme","gitHead":"f4ccae9958521a104695ca8e69f8e33af082eeda","_id":"j-async@1.0.0","_npmVersion":"5.4.2","_nodeVersion":"7.0.0","_npmUser":{"name":"jasonzj","email":"jason925645402@gmail.com"},"dist":{"integrity":"sha512-9BS8j4+x+M+6UxtYpsFNhO13tCwuhKjk5HYhtjVJWTLPtwNw8QHqMiIG/dxSZB+ApefueXuYiO5c9EhXYUL9qg==","shasum":"f12bb1b08e6fe67690096639ce2f822acd7738aa","tarball":"https://registry.npmjs.org/j-async/-/j-async-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDeGCjp0UNsCXdBD1qV9c6W5BueGqzuIyri4d6cV0AYnAIhAO5H341oU/FagTWnEbLfocGbrP9UU4wRnmZ8AGMZYzfa"}]},"maintainers":[{"name":"jasonzj","email":"jason925645402@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/j-async-1.0.0.tgz_1508225253929_0.9882784045767039"}},"1.0.1":{"name":"j-async","version":"1.0.1","description":"异步并发控制","main":"index.js","directories":{"lib":"lib"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Jasonzj/asyncLimit.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/Jasonzj/asyncLimit/issues"},"homepage":"https://github.com/Jasonzj/asyncLimit#readme","gitHead":"f4ccae9958521a104695ca8e69f8e33af082eeda","_id":"j-async@1.0.1","_npmVersion":"5.4.2","_nodeVersion":"7.0.0","_npmUser":{"name":"jasonzj","email":"jason925645402@gmail.com"},"dist":{"integrity":"sha512-73+x2JRb8KxhLQzjuHOv1k1jHfucIYftjRJEkMF0+eAFcwZ0VKJkVkwB/zd6oeU1XpV0Xhi4LD5nPcobGrUguw==","shasum":"fd174d19bd5e2bf753e083f9da100de1ae2e20f4","tarball":"https://registry.npmjs.org/j-async/-/j-async-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFBpwvDch20oOivh3Bzyqden/MIlgIGSFl3lsjgBmHA9AiEAk2/0eFMWXWIvc+duPwL2zaSJLxNdY2Pd2Iv3dx8RnG0="}]},"maintainers":[{"name":"jasonzj","email":"jason925645402@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/j-async-1.0.1.tgz_1508225356989_0.7062124209478498"}},"1.0.2":{"name":"j-async","version":"1.0.2","description":"异步并发控制","main":"index.js","directories":{"lib":"lib"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Jasonzj/asyncLimit.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/Jasonzj/asyncLimit/issues"},"homepage":"https://github.com/Jasonzj/asyncLimit#readme","gitHead":"0da310f852b0ef4aa8b023233db3a73ad5098730","_id":"j-async@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"jasonzj","email":"jason925645402@gmail.com"},"dist":{"integrity":"sha512-4vvWzIQhP14xkgWGlkwa7bAwzUiCjR3gQvX9kKZgzPF1JKT+jQj5RWG68vvJrZMy9ZlitqHcvESVPqP+qDDniQ==","shasum":"fba912222ddc66d55593e0281200c02a66b1d8a2","tarball":"https://registry.npmjs.org/j-async/-/j-async-1.0.2.tgz","fileCount":5,"unpackedSize":4032,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF+0WJgLvupiLvEbnHNd/ukU5x1grR1fz32ghWtSjf5+AiEArKsziQBKzDieMcerv96X5BLWP1Vj5yvOOkwxGfTrNuM="}]},"maintainers":[{"name":"jasonzj","email":"jason925645402@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/j-async_1.0.2_1522756517794_0.581553981675496"},"_hasShrinkwrap":false},"1.0.3":{"name":"j-async","version":"1.0.3","description":"异步并发控制","main":"index.js","directories":{"lib":"lib"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Jasonzj/asyncLimit.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/Jasonzj/asyncLimit/issues"},"homepage":"https://github.com/Jasonzj/asyncLimit#readme","gitHead":"46447d0bb92ab69df0583594a6013cedeb840d41","_id":"j-async@1.0.3","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"jasonzj","email":"jason925645402@gmail.com"},"dist":{"integrity":"sha512-gSPdbnAObdfqv/MUh+B+ONNaqCYGPuACZhBrm67za+zRQ4/dcNbczSwlYXmdlL6H1eJTZZwR3B5gFmQUXIkZCg==","shasum":"709df45fc1b07323e4b882eeb28b3dc804e461a1","tarball":"https://registry.npmjs.org/j-async/-/j-async-1.0.3.tgz","fileCount":5,"unpackedSize":4035,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDN+bkR+v5QhQF+FknBATQWKoLpQY0DDx6wqQRAbvl6IQIhANAxOfyGbbdSasS7MA9PIbcCn62RQiXGPHFbpzuWGs1z"}]},"maintainers":[{"name":"jasonzj","email":"jason925645402@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/j-async_1.0.3_1522835355220_0.34196761693042"},"_hasShrinkwrap":false},"1.0.4":{"name":"j-async","version":"1.0.4","description":"异步并发控制","main":"index.js","directories":{"lib":"lib"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git+https://github.com/Jasonzj/asyncLimit.git"},"keywords":[],"author":"","license":"ISC","bugs":{"url":"https://github.com/Jasonzj/asyncLimit/issues"},"homepage":"https://github.com/Jasonzj/asyncLimit#readme","gitHead":"8b736567d6a1b77ce8fb7061c5fe2289304d3b02","_id":"j-async@1.0.4","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"jasonzj","email":"jason925645402@gmail.com"},"dist":{"integrity":"sha512-9IQiI81WKsLZMBU/MQDxAoCPiL4i4zgEoKHpfqoBYCQI+NmQVkbGBu3Vr1Xy3MaiuRUscAXiFoJUd1cJQJiedA==","shasum":"afb626cb550b5efa72b6b3dac1c9abc96489234b","tarball":"https://registry.npmjs.org/j-async/-/j-async-1.0.4.tgz","fileCount":5,"unpackedSize":4084,"signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCsFmPltx9ihNXxEdS74KbIi7Z5wa6VwRnQJP8h8d6VNgIgToQBd3sJkaLkE9cjygJKjFPK754jHVy955ACxY1fiIk="}]},"maintainers":[{"name":"jasonzj","email":"jason925645402@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/j-async_1.0.4_1522865180748_0.1180364758544512"},"_hasShrinkwrap":false}},"readme":"# j-async\n\n## 使用方法\n\n使用NPM安装\n```shell\nnpm install j-async --save-dev\n```\n\n引入j-async\n\n```javascript\n// ES5\nvar asyncLimit = require('j-async')\n```\n```javascript\n// ES6\nimport asyncLimit from 'j-async'\n```\n\n```javascript\nconst urls = [\n  'http://placehold.it/1300x1600/E97452/fff',\n  'http://placehold.it/1300x1300/4C6EB4/fff',\n  'http://placehold.it/1300x1250/449F93/fff',\n  'http://placehold.it/dsadsa/936FBC/fff',\n  'http://placehold.it/1000x500/D25064/fff',\n  'http://placehold.it/1300x1200/D25064/fff',\n  'http://placehold.it/749x1327/D25064/fff'\n]\n\n// handler\nconst loadImg = (url) => {\n  return new Promise((res, rej) => {\n    const img = new Image()\n    img.src = url\n    img.onload = () => res(img)\n    img.onerror = rej\n  })\n}\n\n// promise\nasyncLimit(\n  urls,             // 请求的url数组\n  loadImg,          // 请求的处理方法(要求返回Promise对象)\n  4,                // 并发数限制值\n  (data, err) => {  // 单个请求回调\n    // ...\n  }\n)\n.then(results => {  // 所有请求完成回调\n  // ...\n})\n\n// async/await\n;(async () => {\n  const res = await asyncLimit(\n    urls, \n    loadImg, \n    4,             \n    (data, err) => {  \n      // ...\n    }\n  )\n\n  // ...\n})()\n```\n\n\n","maintainers":[{"name":"jasonzj","email":"jason925645402@gmail.com"}],"time":{"modified":"2022-05-06T08:58:04.229Z","created":"2017-10-17T07:27:34.390Z","1.0.0":"2017-10-17T07:27:34.390Z","1.0.1":"2017-10-17T07:29:17.069Z","1.0.2":"2018-04-03T11:55:17.879Z","1.0.3":"2018-04-04T09:49:15.259Z","1.0.4":"2018-04-04T18:06:20.802Z"},"homepage":"https://github.com/Jasonzj/asyncLimit#readme","keywords":[],"repository":{"type":"git","url":"git+https://github.com/Jasonzj/asyncLimit.git"},"bugs":{"url":"https://github.com/Jasonzj/asyncLimit/issues"},"license":"ISC","readmeFilename":"README.md","users":{"jasonzj":true}}