{"_id":"items-promise","_rev":"1516074","name":"items-promise","description":"Bare minimum async methods using promises","dist-tags":{"latest":"1.0.0"},"maintainers":[{"name":"pi0","email":"pooya@pi0.ir"}],"time":{"modified":"2021-11-10T06:21:05.000Z","created":"2017-09-03T11:13:02.233Z","1.0.0":"2017-09-03T11:13:02.233Z"},"users":{},"author":{"name":"Pooya Parsa","email":"pooya@pi0.ir"},"repository":{"type":"git","url":"git+https://github.com/pi0/items-promise.git"},"versions":{"1.0.0":{"name":"items-promise","version":"1.0.0","description":"Bare minimum async methods using promises","main":"lib/index.js","repository":{"type":"git","url":"git+https://github.com/pi0/items-promise.git"},"author":{"name":"Pooya Parsa","email":"pooya@pi0.ir"},"license":"MIT","gitHead":"953445813d545dcd768625c350bc092dd2912ccd","bugs":{"url":"https://github.com/pi0/items-promise/issues"},"homepage":"https://github.com/pi0/items-promise#readme","_id":"items-promise@1.0.0","_npmVersion":"5.3.0","_nodeVersion":"8.3.0","_npmUser":{"name":"pi0","email":"pyapar@gmail.com"},"dist":{"shasum":"a71ff03063078eb82db468f1e2f12df4da34dc01","size":1523,"noattachment":false,"key":"/items-promise/-/items-promise-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/items-promise/download/items-promise-1.0.0.tgz"},"maintainers":[{"name":"pi0","email":"pooya@pi0.ir"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/items-promise-1.0.0.tgz_1504437181313_0.7281142233405262"},"directories":{},"publish_time":1504437182233,"_hasShrinkwrap":false,"_cnpm_publish_time":1504437182233}},"readme":"# items-promise\nBare minimum async methods using promises. (Inspired by [items](https://www.npmjs.com/package/items))\n\n```bash\n>_ yarn add items-promise\n```\n\nOR using NPM\n\n```bash\n>_ npm install items-promise\n```\n\n```js\nconst { serial, parallel } = require('items-promise')\n\n// OR\n\nimport { serial, parallel } from 'items-promise'\n```\n\n# Usage\n`tasks` should be always an array and `fn` should be a function witch returns a **Promise** object.\n\n## serial(tasks, fn)\n\nRun tasks one by one by calling `fn(task, previous)` in a promise chain.\n\nReturn value is of type `Promise<*>` which resolves to the **last** fn result.\n\n## parallel(tasks, fn)\n\nRun all tasks in parallel by calling `fn(tasks)` and await using `Promise.all`.\n\nReturn value is of type `Promise<Array[*]>` which resolves to results of **all** fns in an array.\n\n\n# License\nReleased under The MIT [LICENSE](./LICENSE)\n\nCopyright (c) 2017 Pooya Parsa\n","_attachments":{},"homepage":"https://github.com/pi0/items-promise#readme","bugs":{"url":"https://github.com/pi0/items-promise/issues"},"license":"MIT"}