{"name":"forEachAsync","version":"3.0.0","description":"A node- and browser-ready async counterpart of Array.prototype.forEach","homepage":"https://github.com/FuturesJS/forEachAsync","main":"forEachAsync.js","directories":{"test":"test"},"scripts":{"test":"echo \"Error: no test specified\" && exit 1"},"repository":{"type":"git","url":"git://github.com/FuturesJS/forEachAsync.git"},"keywords":["futuresjs","forEach","for","forEachAsync","async","futures","each"],"author":{"name":"AJ ONeal","email":"coolaj86@gmail.com","url":"http://coolaj86.com/"},"license":"Apache2","bugs":{"url":"https://github.com/FuturesJS/forEachAsync/issues"},"readme":"forEachAsync\n===\n\nAs I do every few years, I decided to rewrite FuturesJS.\nThis year's remake is extremely lightweight.\n\nv3.x - Diet Cola Edition\n(published on npm as beta, so you must use the @3.x - and don't worry, v2.x is still supported)\n\nAnalogous to `[].forEach`, but handles items asynchronously with a final callback passed to `then`.\n\nThis is the most essential piece of the [`ArrayAsync`](https://github.com/FuturesJS/ArrayAsync) package.\n\nUsage\n===\n\nIt's as simple as you could guess:\n\n```javascript\n  // waits for one request to finish before beginning the next\n  forEachAsync(['dogs', 'cats', 'octocats'], function (next, element, index, array) {\n    getPics(element, next);\n  \n  // then after all of the elements have been handled\n  // the final callback fires to let you know it's all done\n  }).then(function () {\n    console.log('All requests have finished');\n  });\n\n  // where `getPics` might be an asynchronous web request such as this\n  function getPics(animal, cb) {\n    var flickerAPI = \"http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?\";\n    $.getJSON(\n      flickerAPI\n    , { tags: thing\n      , tagmode: \"any\"\n      , format: \"json\"\n      , success: function (data) {\n          console.log('teh animals:', data);\n        }\n      , complete: cb\n      }\n    );\n  }\n```\n\n\nBrowser Installation\n===\n\nYou can install from bower:\n\n```bash\nbower install forEachAsync\n```\n\nOr download the raw file from <https://raw.github.com/FuturesJS/forEachAsync/master/forEachAsync.js>:\n\n```bash\nwget https://raw.github.com/FuturesJS/forEachAsync/master/forEachAsync.js\n```\n\n```javascript\n(function () {\n  'use strict';\n\n  var forEachAsync = window.forEachAsync\n    ;\n\n  // do stuff ...\n}());\n```\n\nOr you can build it alongside other libraries:\n\n```bash\nnpm install -g pakmanager\nnpm install forEachAsync --save\npakmanager -e browser build\n```\n\n```html\n<script src=\"pakmanaged.js\"></script>\n```\n\n```javascript\n(function () {\n  'use strict';\n\n  var forEachAsync = require('forEachAsync').forEachAsync\n    ;\n\n  // do stuff ...\n}());\n```\n\n\nNode Installation\n===\n\n```bash\nnpm install --save forEachAsync@3.x\n```\n\nAPI\n===\n\n**`forEachAsync(array, callback[, thisArg])`**\n\nParameters\n\n  * `array` Array of elements to iterate over\n  * `callback` Function to execute for each element, takes 4 arguments\n    * `next` the function to call when the current element has been dealt with\n    * `element` a single element of the aforementioned array\n    * `index` the index of the current element\n    * `array` the same array mentioned above\n  * `thisArg` Object to use as `this` when executing `callback`\n\n**`forEachAsync#then(done)`**\n\nParameters\n\n  * `then` is in the return value of `forEachAsync` and accepts a final `done` callback.\n    * `done` called after `forEachAsync` is complete, takes no arguments\n\nInternal API\n===\n\n`forEachAsync.__BREAK`\n\nThis is used internally for the purposes of the `ArrayAsync` library.\n\nPlease don't `break` stuff; use `someAsync` or `everyAsync` instead.\n","readmeFilename":"README.md","_id":"forEachAsync@3.0.0","dist":{"shasum":"3475a95a77e4dc2d2800913e6824de77b00cd80a","tarball":"http://registry-npm.ywwl.com/forEachAsync/download/forEachAsync-3.0.0.tgz","integrity":"sha512-a6qFIJll2VuqpWNRvJfgT7pGgobR89qnARafcCkGg6q1BCWrowc3WvRoYidxtFWRwaeUpk+5kiKZtdlRLwSufQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBCL7EndRIlbTFoBi3xsTQpOtW7vtQQMjNdTJZYSuPS6AiEAtFH8Xi0ykH4KyQ8fuxQBcX7A3Hb8qESiLQnMpysuP10="}],"size":6329,"noattachment":false,"key":"/forEachAsync/-/forEachAsync-3.0.0.tgz"},"_from":"./","_npmVersion":"1.3.11","_npmUser":{"name":"coolaj86","email":"coolaj86@gmail.com"},"maintainers":[{"name":"coolaj86","email":"coolaj86@gmail.com"}],"deprecated":"Please use 'foreachasync' instead. See https://www.npmjs.com/package/foreachasync","publish_time":1389654442204,"_cnpm_publish_time":1389654442204,"dist-tags":{"beta":"3.0.0-rc1","latest":"3.0.0"}}