Added logging, changed some directory structure

This commit is contained in:
2018-01-13 21:33:40 -05:00
parent f079a5f067
commit 8e72ffb917
73656 changed files with 35284 additions and 53718 deletions

View File

@@ -0,0 +1,3 @@
bower.json
component.json
CHANGELOG.md

View File

@@ -0,0 +1,23 @@
# async-each 1.0.0 (26 November 2015)
* Bumped version to 1.0.0 (no functional changes)
# async-each 0.1.6 (5 November 2014)
* Add license to package.json
# async-each 0.1.5 (22 October 2014)
* Clean up package.json to fix npm warning about `repo`
# async-each 0.1.4 (12 November 2013)
* Fixed AMD definition.
# async-each 0.1.3 (25 July 2013)
* Fixed double wrapping of errors.
# async-each 0.1.2 (7 July 2013)
* Fixed behaviour on empty arrays.
# async-each 0.1.1 (14 June 2013)
* Wrapped function in closure, enabled strict mode.
# async-each 0.1.0 (14 June 2013)
* Initial release.

View File

@@ -0,0 +1,38 @@
# async-each
No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach function for JavaScript.
We don't need junky 30K async libs. Really.
For browsers and node.js.
## Installation
* Just include async-each before your scripts.
* `npm install async-each` if youre using node.js.
* `bower install async-each` if youre using [Bower](http://bower.io).
## Usage
* `each(array, iterator, callback);``Array`, `Function`, `(optional) Function`
* `iterator(item, next)` receives current item and a callback that will mark the item as done. `next` callback receives optional `error, transformedItem` arguments.
* `callback(error, transformedArray)` optionally receives first error and transformed result `Array`.
Node.js:
```javascript
var each = require('async-each');
each(['a.js', 'b.js', 'c.js'], fs.readFile, function(error, contents) {
if (error) console.error(error);
console.log('Contents for a, b and c:', contents);
});
```
Browser:
```javascript
window.asyncEach(list, fn, callback);
```
## License
[The MIT License](https://raw.githubusercontent.com/paulmillr/mit/master/README.md)

View File

@@ -0,0 +1,38 @@
// async-each MIT license (by Paul Miller from http://paulmillr.com).
(function(globals) {
'use strict';
var each = function(items, next, callback) {
if (!Array.isArray(items)) throw new TypeError('each() expects array as first argument');
if (typeof next !== 'function') throw new TypeError('each() expects function as second argument');
if (typeof callback !== 'function') callback = Function.prototype; // no-op
if (items.length === 0) return callback(undefined, items);
var transformed = new Array(items.length);
var count = 0;
var returned = false;
items.forEach(function(item, index) {
next(item, function(error, transformedItem) {
if (returned) return;
if (error) {
returned = true;
return callback(error);
}
transformed[index] = transformedItem;
count += 1;
if (count === items.length) return callback(undefined, transformed);
});
});
};
if (typeof define !== 'undefined' && define.amd) {
define([], function() {
return each;
}); // RequireJS
} else if (typeof module !== 'undefined' && module.exports) {
module.exports = each; // CommonJS
} else {
globals.asyncEach = each; // <script>
}
})(this);

View File

@@ -0,0 +1,63 @@
{
"_args": [
[
"async-each@1.0.1",
"C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project"
]
],
"_from": "async-each@1.0.1",
"_id": "async-each@1.0.1",
"_inBundle": false,
"_integrity": "sha1-GdOGodntxufByF04iu28xW0zYC0=",
"_location": "/webpack/async-each",
"_phantomChildren": {},
"_requested": {
"type": "version",
"registry": true,
"raw": "async-each@1.0.1",
"name": "async-each",
"escapedName": "async-each",
"rawSpec": "1.0.1",
"saveSpec": null,
"fetchSpec": "1.0.1"
},
"_requiredBy": [
"/webpack/chokidar"
],
"_resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.1.tgz",
"_spec": "1.0.1",
"_where": "C:\\Users\\deranjer\\go\\src\\github.com\\deranjer\\goTorrent\\torrent-project",
"author": {
"name": "Paul Miller",
"url": "http://paulmillr.com/"
},
"bugs": {
"url": "https://github.com/paulmillr/async-each/issues"
},
"dependencies": {},
"description": "No-bullshit, ultra-simple, 35-lines-of-code async parallel forEach / map function for JavaScript.",
"homepage": "https://github.com/paulmillr/async-each/",
"keywords": [
"async",
"forEach",
"each",
"map",
"asynchronous",
"iteration",
"iterate",
"loop",
"parallel",
"concurrent",
"array",
"flow",
"control flow"
],
"license": "MIT",
"main": "index.js",
"name": "async-each",
"repository": {
"type": "git",
"url": "git://github.com/paulmillr/async-each.git"
},
"version": "1.0.1"
}