Socket
Socket
Sign inDemoInstall

forEachAsync

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

forEachAsync - npm Package Compare versions

Comparing version 3.0.0-rc1 to 3.0.0

bower.json

4

forEachAsync.js
/*jshint -W054 */
(function (exports) {
"use strict";
;(function (exports) {
'use strict';

@@ -5,0 +5,0 @@ function forEachAsync(arr, fn, thisArg) {

{
"name": "forEachAsync",
"version": "3.0.0-rc1",
"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",

@@ -17,2 +18,3 @@ "directories": {

"keywords": [
"futuresjs",
"forEach",

@@ -23,6 +25,5 @@ "for",

"futures",
"futuresjs",
"each"
],
"author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.info/)",
"author": "AJ ONeal <coolaj86@gmail.com> (http://coolaj86.com/)",
"license": "Apache2",

@@ -29,0 +30,0 @@ "bugs": {

@@ -20,3 +20,13 @@ forEachAsync

```javascript
// an asynchronous web request
// waits for one request to finish before beginning the next
forEachAsync(['dogs', 'cats', 'octocats'], function (next, element, index, array) {
getPics(element, next);
// then after all of the elements have been handled
// the final callback fires to let you know it's all done
}).then(function () {
console.log('All requests have finished');
});
// where `getPics` might be an asynchronous web request such as this
function getPics(animal, cb) {

@@ -36,12 +46,2 @@ var flickerAPI = "http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=?";

}
// waits for one request to finish before beginning the next
forEachAsync(['dogs', 'cats', 'octocats'], function (next, element, index, array) {
getPics(element, next);
// then after all of the elements have been handled
// the final callback fires to let you know it's all done
}).then(function () {
console.log('All requests have finished');
});
```

@@ -53,8 +53,14 @@

You can download and include `forEachAsync.js`:
You can install from bower:
```html
<script src="https://raw.github.com/FuturesJS/forEachAsync/master/forEachAsync.js"></script>
```bash
bower install forEachAsync
```
Or download the raw file from <https://raw.github.com/FuturesJS/forEachAsync/master/forEachAsync.js>:
```bash
wget https://raw.github.com/FuturesJS/forEachAsync/master/forEachAsync.js
```
```javascript

@@ -75,3 +81,3 @@ (function () {

npm install -g pakmanager
npm install forEachAsync@3.x --save
npm install forEachAsync --save
pakmanager -e browser build

@@ -78,0 +84,0 @@ ```

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc