forEachAsync
Advanced tools
Comparing version 3.0.0-rc1 to 3.0.0
/*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 @@ ``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Deprecated
MaintenanceThe maintainer of the package marked it as deprecated. This could indicate that a single version should not be used, or that the package is no longer maintained and any new vulnerabilities will not be fixed.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No License Found
License(Experimental) License information could not be found.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
16012
6
0
79
1
135
1