-
Notifications
You must be signed in to change notification settings - Fork 5
/
index.js
38 lines (36 loc) · 945 Bytes
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
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) =>
run({
input,
fn,
opts
});
module.exports.series = require('./series');
module.exports.limit = require('./limit');