1.0.1 • Published 10 months ago

@kermanx/lazy-iterator v1.0.1

Weekly downloads
-
License
Apache-2.0
Repository
-
Last release
10 months ago

lazy-iterator

Yet another package for lazy iteration in JavaScript.

  • Full TypeScript support
  • No dependencies

Installation

npm install @kermanx/lazy-iterator

Usage

import { lazyIteratorFactory } from "@kermanx/lazy-iterator";

const iterator = lazyIteratorFactory.from([1, 2, 3]).map((x) => x * 2);

for (const x of iterator) {
  console.log(x);
}

You can extend the LazyIterator and LazyIteratorFactory class to create your own lazy iterators. See src/iterator.ts for details.

1.0.1

10 months ago

1.0.0

10 months ago