Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/floatdrop/get-iterable
Get a iterable as a array of items
https://github.com/floatdrop/get-iterable
Last synced: 22 days ago
JSON representation
Get a iterable as a array of items
- Host: GitHub
- URL: https://github.com/floatdrop/get-iterable
- Owner: floatdrop
- License: mit
- Created: 2015-10-29T08:53:56.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-04T15:48:17.000Z (almost 9 years ago)
- Last Synced: 2024-10-26T21:11:35.445Z (2 months ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# get-iterable [![Build Status](https://travis-ci.org/floatdrop/get-iterable.svg?branch=master)](https://travis-ci.org/floatdrop/get-iterable)
> Get a iterable as a array
See [`Array.from`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/from) for more.
## Install
```
$ npm install --save get-iterable
```## Usage
```js
const getStream = require('get-iterable');function * generator() {
yield 1;
yield 2;
yield 3;
}const arr = getIterable(generator());
console.log(arr);
/*
[1,2,3]
*/
});
```## API
### getIterable(iterable)
Get the iterable as a array.
## Related
- [get-stream](https://github.com/sindresorhus/get-stream) - Get stream as a string or buffer
- [get-stdin](https://github.com/sindresorhus/get-stdin) - Get stdin as a string or buffer## License
MIT © [Vsevolod Strukchisnky](http://github.com/floatdrop/get-iterable)