https://github.com/parro-it/async-iterable-map
map for async iterables
https://github.com/parro-it/async-iterable-map
Last synced: 10 months ago
JSON representation
map for async iterables
- Host: GitHub
- URL: https://github.com/parro-it/async-iterable-map
- Owner: parro-it
- License: mit
- Created: 2017-03-30T20:49:55.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-03-31T07:43:24.000Z (almost 9 years ago)
- Last Synced: 2024-04-15T00:06:07.320Z (almost 2 years ago)
- Language: JavaScript
- Size: 5.86 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# async-iterable-map
[](https://greenkeeper.io/)
> An iterable transform that spread each iterable received and emit its items
background details relevant to understanding what this module does
## Usage
Let's spread the `arr` array, each item of `arr` will became an item of resulting iterable:
```js
const spread = require('async-iterable-map');
const arr = [1, 2, 3];
for (const item of spread([arr, 42, 43])) {
console.log({item});
}
```
This will output
```
{item :1}
{item :2}
{item :3}
{item :42}
{item :43}
```
[](http://travis-ci.org/parro-it/async-iterable-map)
[](https://npmjs.org/package/async-iterable-map)
## API
```js
const spread = (iterable: Iterable): Iterable
```
Given a source iterable, return an iterable with all source item that are iterable spreaded.
## Install
With [npm](https://npmjs.org/) installed, run
```
$ npm install async-iterable-map
```
## See Also
- [`noffle/common-readme`](https://github.com/noffle/common-readme)
## License
MIT