Skip to content

Latest commit

 

History

History
23 lines (19 loc) · 470 Bytes

Readme.md

File metadata and controls

23 lines (19 loc) · 470 Bytes

Iterator library

Library to work with javascript generators

npm install @reeywhaar/iterator
Iterator
.fromArray([0,1,2,3,4,5,6,7,8])
.take(5) // [0,1,2,3,4]
.map(x => x * 2) // [0,2,4,6,8]
.skip(2) // [4,6,8]
.subSplit(function*(item){
	yield item;
	yield "a";
}) // [4,"a",6,"a",8,"a"]
.odd() // ["a","a","a"]
// ...and so on. Check out Documentation

API