{
  "_id": "foreachasync",
  "maintainers": [
    {
      "email": "coolaj86@gmail.com",
      "name": "coolaj86"
    }
  ],
  "keywords": [
    "futuresjs",
    "forEach",
    "for",
    "forEachAsync",
    "async",
    "futures",
    "promise",
    "promises",
    "each"
  ],
  "dist-tags": {
    "latest": "5.1.3"
  },
  "author": {
    "name": "AJ ONeal",
    "email": "coolaj86@gmail.com",
    "url": "https://coolaj86.com/"
  },
  "_rev": "40-f60235be47fa16b49776bcbe563c2f72",
  "description": "A node- and browser-ready async (now with promises) counterpart of Array.prototype.forEach",
  "readme": "forEachAsync.js\n===\n\n| A [Root](https://rootprojects.org) project\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\nFor cases where you want to loop through batches of items at once (as opposed to strictly one-by-one as forEachAsync does), check out [`forAllAsync`](https://github.com/FuturesJS/forAllAsync) and [`lateral`](https://github.com/FuturesJS/lateral).\n\nFor cases where you want to loop through all items at once and we able to know when they're all done see [`join`](https://github.com/FuturesJS/join)\n\nv5.x\n----\n\nWe jumped from 3.x to 5.x because I'm considering creating a backwards-and-forwards compatible 4.x that\nuses AngularJS-style function introspection to allow for having the next param.\nStraight up, that's probably a bad idea and waste of time so I hope I don't actually do it.\n\nScreencast\n---\n\n<https://youtu.be/O7egvEz4scA>\n\nUsage\n-----\n\n```javascript\n  // EXAMPLE ASYNC FUNCTION\n\n  function getPicsAsync(animal) {\n    var flickerApi = \"http://api.flickr.com/services/feeds/photos_public.gne?tagmode=any&format=json&tags=\" + animal;\n\n    return requestAsync({ url: flickerApi });\n  }\n```\n\n```javascript\n  forEachAsync(['dogs', 'cats', 'octocats'], function (element) {\n    return getPicsAsync(element);\n  }).then(function () {\n    // then after all of the elements have been handled\n    // the final callback fires to let you know it's all done\n    console.log('All requests have finished');\n  });\n```\n\n### Supplying your own Promises Implementation\n\nIf native ES6 promises are not available, then you should supply your own Promises/A+\nimplementation like so:\n\n```javascript\n  forEachAsync = forEachAsync.create(window.Promise || require('bluebird'));\n```\n\nBrowser Installation\n===\n\nYou can install from bower:\n\n```bash\nbower install --save forEachAsync@5.x\n```\n\nOr download the raw file from <https://git.coolaj86.com/coolaj86/foreachasync.js/raw/branch/master/foreachasync.js>:\n\n```bash\nwget https://git.coolaj86.com/coolaj86/foreachasync.js/raw/branch/master/foreachasync.js\n```\n\n```javascript\n(function () {\n  'use strict';\n\n  var forEachAsync = window.forEachAsync;\n\n  // do stuff ...\n}());\n```\n\n**Note**: If you need both 3.x/4.x and 5.x version of `forEachAsync` in the browser... good luck with that...\n\nNode Installation\n===\n\n```bash\nnpm install --save foreachasync@5.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    * `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 [`ArrayAsync`](https://github.com/FuturesJS/ArrayAsync)`.someAsync` or [`ArrayAsync`](https://github.com/FuturesJS/ArrayAsync)`.everyAsync` instead.\n",
  "repository": {
    "type": "git",
    "url": "https://git.coolaj86.com/coolaj86/foreachasync.js.git"
  },
  "bugs": {
    "url": "https://git.coolaj86.com/coolaj86/foreachasync.js/issues"
  },
  "license": "(MIT OR Apache-2.0)",
  "versions": {
    "3.0.0": {
      "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"
      },
      "_id": "foreachasync@3.0.0",
      "dist": {
        "shasum": "5502987dc8714be3392097f32e0071c9dee07cf6",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/foreachasync/-/foreachasync-3.0.0.tgz",
        "integrity": "sha512-J+ler7Ta54FwwNcx6wQRDhTIbNeyDcARMkOcguEqnEdtm0jKvN3Li3PDAb2Du3ubJYEWfYL83XMROXdsXAXycw==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIA1F7luKO4whDf3cKdc38QjPms9sb2cC/d+5rB0uxAMnAiBYpt3/YAzXhBUC725WKUO0/5wjCoY4r3EwZdL5q35t4w=="
          }
        ]
      },
      "_from": "./",
      "_npmVersion": "1.3.22",
      "_npmUser": {
        "name": "coolaj86",
        "email": "coolaj86@gmail.com"
      },
      "maintainers": [
        {
          "name": "coolaj86",
          "email": "coolaj86@gmail.com"
        }
      ]
    },
    "5.0.4": {
      "name": "foreachasync",
      "version": "5.0.4",
      "description": "A node- and browser-ready async (now with promises) 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",
        "promise",
        "promises",
        "each"
      ],
      "optionalDependencies": {
        "bluebird": "^2.5.3"
      },
      "author": {
        "name": "AJ ONeal",
        "email": "coolaj86@gmail.com",
        "url": "http://coolaj86.com/"
      },
      "license": "Apache2",
      "bugs": {
        "url": "https://github.com/FuturesJS/forEachAsync/issues"
      },
      "dependencies": {
        "bluebird": "^2.5.3"
      },
      "gitHead": "7218a5348757526dc43647219d7433324e7ec65e",
      "_id": "foreachasync@5.0.4",
      "_shasum": "2b5b9dfe3f55f2608196d3d9cf9701cdb537b49f",
      "_from": ".",
      "_npmVersion": "2.0.0",
      "_npmUser": {
        "name": "coolaj86",
        "email": "coolaj86@gmail.com"
      },
      "maintainers": [
        {
          "name": "coolaj86",
          "email": "coolaj86@gmail.com"
        }
      ],
      "dist": {
        "shasum": "2b5b9dfe3f55f2608196d3d9cf9701cdb537b49f",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/foreachasync/-/foreachasync-5.0.4.tgz",
        "integrity": "sha512-fF0g15MmYl74O/Wu+ka5Fg2Qu7tkLkt213+pHWppvLnPYodQd7iU31V52OrwSxFUKAqQYxuJEJ6lUdQWYYky/w==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEMCIHgEb+FHcZuOf92ozImu1NBjIVOt2/k7kYc5DywzJUj0Ah8qubd0sycX7gBqsaALbpTrqWP6lujF+EyA/lcc0YlY"
          }
        ]
      }
    },
    "5.0.5": {
      "name": "foreachasync",
      "version": "5.0.5",
      "description": "A node- and browser-ready async (now with promises) 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",
        "promise",
        "promises",
        "each"
      ],
      "optionalDependencies": {
        "bluebird": "^2.5.3"
      },
      "author": {
        "name": "AJ ONeal",
        "email": "coolaj86@gmail.com",
        "url": "http://coolaj86.com/"
      },
      "license": "Apache2",
      "bugs": {
        "url": "https://github.com/FuturesJS/forEachAsync/issues"
      },
      "dependencies": {
        "bluebird": "^2.5.3"
      },
      "gitHead": "ba81917d4f979b68ac06c7eab05d97fea252b32b",
      "_id": "foreachasync@5.0.5",
      "_shasum": "6524613ae08de21e6f40f224a4888fb3f607fe80",
      "_from": ".",
      "_npmVersion": "2.0.0",
      "_npmUser": {
        "name": "coolaj86",
        "email": "coolaj86@gmail.com"
      },
      "maintainers": [
        {
          "name": "coolaj86",
          "email": "coolaj86@gmail.com"
        }
      ],
      "dist": {
        "shasum": "6524613ae08de21e6f40f224a4888fb3f607fe80",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/foreachasync/-/foreachasync-5.0.5.tgz",
        "integrity": "sha512-tQ8M7Gc/95sJx2Y4HpRUFxzFt0glMcTz1qtdlGQI3t2hJgoT7FbZL7QIfsFZgmVbSzpM4QRrkshuQtF0Meb5RQ==",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIQCGnEzT40sduE7VY9u665vPSkJA5merp66Xs7YIj3uKQAIgCyDqCGoqrLx2KzgrK1XBh5VuJZDMWIHXpRFNodLaiG8="
          }
        ]
      }
    },
    "5.1.2": {
      "name": "foreachasync",
      "version": "5.1.2",
      "description": "A node- and browser-ready async (now with promises) counterpart of Array.prototype.forEach",
      "homepage": "https://git.coolaj86.com/coolaj86/foreachasync.js",
      "main": "foreachasync.js",
      "directories": {
        "test": "test"
      },
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "repository": {
        "type": "git",
        "url": "git://git.coolaj86.com/coolaj86/foreachasync.js.git"
      },
      "keywords": [
        "futuresjs",
        "forEach",
        "for",
        "forEachAsync",
        "async",
        "futures",
        "promise",
        "promises",
        "each"
      ],
      "optionalDependencies": {
        "bluebird": "^3.5.1"
      },
      "author": {
        "name": "AJ ONeal",
        "email": "coolaj86@gmail.com",
        "url": "https://coolaj86.com/"
      },
      "license": "(MIT or Apache-2.0)",
      "bugs": {
        "url": "https://git.coolaj86.com/coolaj86/foreachasync.js/issues"
      },
      "dependencies": {
        "bluebird": "^3.5.1"
      },
      "gitHead": "34d8d7bbc5601875913476ea935d2bada18adf9d",
      "_id": "foreachasync@5.1.2",
      "_npmVersion": "5.6.0",
      "_nodeVersion": "8.9.4",
      "_npmUser": {
        "name": "coolaj86",
        "email": "coolaj86@gmail.com"
      },
      "dist": {
        "integrity": "sha512-801fq36drEil6qqAp5CJnXKl+0NtBL4uU1Rw9wSp6ajjLgLty9pTV90D9Xpm1ToEVOKJzrfY7+np7KZyE0H5gA==",
        "shasum": "4ba7c0610098831f96a4e421e9e30cbc74eb0408",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/foreachasync/-/foreachasync-5.1.2.tgz",
        "fileCount": 14,
        "unpackedSize": 22099,
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEUCIQCMdusUKCm4uGi7i3Mfod6bAjaQbNZa29/ZLfYR7ut0pAIgf4cz2UnO+VwffZJD44WJGtjo3/BsGYcOQ7Gsy5ffIyY="
          }
        ]
      },
      "maintainers": [
        {
          "name": "coolaj86",
          "email": "coolaj86@gmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/foreachasync_5.1.2_1522216362409_0.14996650795361366"
      },
      "_hasShrinkwrap": false
    },
    "5.1.3": {
      "name": "foreachasync",
      "version": "5.1.3",
      "description": "A node- and browser-ready async (now with promises) counterpart of Array.prototype.forEach",
      "homepage": "https://git.coolaj86.com/coolaj86/foreachasync.js",
      "main": "foreachasync.js",
      "directories": {
        "test": "test"
      },
      "scripts": {
        "test": "echo \"Error: no test specified\" && exit 1"
      },
      "repository": {
        "type": "git",
        "url": "https://git.coolaj86.com/coolaj86/foreachasync.js.git"
      },
      "keywords": [
        "futuresjs",
        "forEach",
        "for",
        "forEachAsync",
        "async",
        "futures",
        "promise",
        "promises",
        "each"
      ],
      "trulyOptionalDependencies": {
        "bluebird": "^3.5.1"
      },
      "author": {
        "name": "AJ ONeal",
        "email": "coolaj86@gmail.com",
        "url": "https://coolaj86.com/"
      },
      "license": "(MIT OR Apache-2.0)",
      "bugs": {
        "url": "https://git.coolaj86.com/coolaj86/foreachasync.js/issues"
      },
      "dependencies": {},
      "gitHead": "e534d3a4b3e0f1e0c441dfedcf80a5894e897296",
      "_id": "foreachasync@5.1.3",
      "_npmVersion": "6.4.1",
      "_nodeVersion": "10.13.0",
      "_npmUser": {
        "name": "coolaj86",
        "email": "coolaj86@gmail.com"
      },
      "dist": {
        "integrity": "sha512-q3/l5D2pyZG8aYe9xZQDAnS/KyP7QJakLUNrU/qGkd4bQUTzCUmvVFjagRggoxxjtb1ZrJB+jQeG4ojOLWkztw==",
        "shasum": "b40ee0031bd3256b317c3197672a564d8d8c7ad4",
        "tarball": "https://archive.ito.gov.ir/npm/_packages/foreachasync/-/foreachasync-5.1.3.tgz",
        "fileCount": 4,
        "unpackedSize": 16480,
        "npm-signature": "-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.4\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJcp6R6CRA9TVsSAnZWagAABMMP/iCMm3dYA2VYEPaVSix4\nAWlMVec7mZgY+RlwedDdpgAU+bKizuKtjdnzxehBXc6nPPNz+j4vXaPEnYxb\nwFgqofwFCuMBQknRfqn6BAgV+o01Zky44uFQTjTNIRD/nVMxiKlF2/ugIFBh\n3zQ6JpyF3+HogxeAYBGj2m3AS1i8wJNs5EyeA6305EPjukh5x0lu907+4iTk\nzQs4xFl+D6rkexUxE8wXw97Wdfvm7/gD+xOp/TbZ63SoRNuHS67NvSZqIu79\n/cOXq13pJVSkEGp2yZFk2olk7bjevzMOo5MR72p8TT4wc8lYTdGKJzJB7B7R\nN4CPuUkZr1XBn4/6LkP47ph7Vm/XFdk/Njf7e+S0JGDws6hGa7tL/Vn7cFeK\n6g2cuCLbkUzuTCx7Yn66pBqUltiJoe2tCISOBXTNEMCejS5e7pm30vYixfIF\nwv3XoYzMhx6tdBYDr5KkquCkYCS04TWTPe15osRMbRcSrsIoCzkFogZECcAn\nTAon+1gZ37sTMrEaeXFQXz5nN28npmOJlh9XwcTImkIuWgcKf35cnbvY1/tX\nab+JDOJ2NoG8B3gnWQ2UZkZzfJHNNWqheMJZ41/9sfVmDcl6WTYOqfaPofci\nu1GfOUSFlv27LWFcmyiDW4AG5Uqszz0wuEMzhqdwXqlMMWz0Wr3jkU/oogFs\nZiDY\r\n=mVOh\r\n-----END PGP SIGNATURE-----\r\n",
        "signatures": [
          {
            "keyid": "SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA",
            "sig": "MEQCIAmOakCEv5pmyTaLMozoHtQ2GAGOLM8ei0HcQ2J3hqH6AiATUSNQAcMbejDlvIZ0KZAFwrguQHjkajrjsdc4Zyqifg=="
          }
        ]
      },
      "maintainers": [
        {
          "name": "coolaj86",
          "email": "coolaj86@gmail.com"
        }
      ],
      "_npmOperationalInternal": {
        "host": "s3://npm-registry-packages",
        "tmp": "tmp/foreachasync_5.1.3_1554490490007_0.45320862086837144"
      },
      "_hasShrinkwrap": false
    }
  },
  "name": "foreachasync",
  "time": {
    "modified": "2026-05-20T20:11:00.075Z",
    "created": "2014-01-22T19:47:04.311Z",
    "3.0.0": "2014-01-22T19:47:04.311Z",
    "5.0.0": "2015-01-03T01:10:24.261Z",
    "5.0.1": "2015-01-03T01:13:08.183Z",
    "5.0.2": "2015-01-03T01:41:46.225Z",
    "5.0.3": "2015-01-06T06:23:31.486Z",
    "5.0.4": "2015-01-06T06:24:33.399Z",
    "5.0.5": "2015-01-07T07:57:59.033Z",
    "5.1.0": "2018-03-28T05:42:29.885Z",
    "5.1.1": "2018-03-28T05:51:11.356Z",
    "5.1.2": "2018-03-28T05:52:42.452Z",
    "5.1.3": "2019-04-05T18:54:50.283Z"
  },
  "readmeFilename": "README.md",
  "homepage": "https://git.coolaj86.com/coolaj86/foreachasync.js"
}