Comparing version 1.0.1 to 1.0.2
27
index.js
const run = require('./run'); | ||
/** | ||
* <a id="map"></a> | ||
* Produces a new collection of values by mapping each value in `coll` through the `iteratee` function. | ||
* | ||
* [![](https://img.shields.io/npm/v/apr-map.svg?style=flat-square)](https://www.npmjs.com/package/apr-map) [![](https://img.shields.io/npm/l/apr-map.svg?style=flat-square)](https://www.npmjs.com/package/apr-map) | ||
* | ||
* @kind function | ||
* @name map | ||
* @param {Array|Object|Iterable} input | ||
* @param {Function} iteratee | ||
* @returns {Promise} | ||
* | ||
* @example | ||
* import awaitify from 'apr-awaitify'; | ||
* import map from 'apr-map'; | ||
* | ||
* const stat = awaitify(fs.stat); | ||
* const files = [ | ||
* 'file1', | ||
* 'file2', | ||
* 'file3' | ||
* ]; | ||
* | ||
* const stats = await map(files, async (file) => | ||
* await stat(file); | ||
* ); | ||
*/ | ||
module.exports = (input, fn, opts) => { | ||
@@ -4,0 +31,0 @@ return run({ |
10
limit.js
const defaults = require('lodash.defaults'); | ||
const run = require('./run'); | ||
/** | ||
* @kind function | ||
* @name limit | ||
* @memberof map | ||
* @param {Array|Object|Iterable} input | ||
* @param {Number} limit | ||
* @param {Function} iteratee | ||
* @returns {Promise} | ||
*/ | ||
module.exports = (input, limit, fn, opts) => { | ||
@@ -6,0 +14,0 @@ return run({ |
{ | ||
"name": "apr-map", | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "keywords": [], |
const limit = require('./limit'); | ||
/** | ||
* @kind function | ||
* @name series | ||
* @memberof map | ||
* @param {Array|Object|Iterable} input | ||
* @param {Function} iteratee | ||
* @returns {Promise} | ||
*/ | ||
module.exports = (input, fn, opts) => { | ||
return limit(input, 1, fn, opts); | ||
}; |
No README
QualityPackage does not have a README. This may indicate a failed publish or a low quality package.
Found 1 instance in 1 package
4639
6
82
1
53