An ES6 iterator generator
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.eslintrc
.gitignore
.travis.yml
README.md
iterator.js
package.json
test.js

README.md

Iterator Generator

An iterable interface to collections using ES2015 generators

Installation

npm install iterator-generator --save

Usage Example

'use strict';
import iterable from 'iterator-generator';

var list = ['a', 'b', 'c', 'd'];
var iterator = iterable(list);

var item;
while (!(item = iterator.next()).done) {
  console.log(item.value);
}

Outputs:

a
b
c
d