3h-iter
TypeScript icon, indicating that this package has built-in type declarations

0.9.1 • Public • Published

3h-iter

An iterator lib.

Introduction

3h-iter is an iterator library that provides useful iterator-related helpers, such as map, range, chain, zip and so on. It is recommanded to use 3h-iter with ES2015+ syntax.

Example Usage

import { range, zip } from '3h-iter';

for (const i of range(5)) {
    console.log(i);
}
// Prints 0 through 4 in console.

const numbers = [0, 1, 2];
const strings = ['a', 'b', 'c'];
for (const tuple of zip(numbers, strings)) {
    console.log(tuple);
}
// Prints the following tuples:
// [ 0, 'a' ]
// [ 1, 'b' ]
// [ 2, 'c' ]

Links

Package Sidebar

Install

npm i 3h-iter

Weekly Downloads

2

Version

0.9.1

License

MIT

Unpacked Size

68.2 kB

Total Files

25

Last publish

Collaborators

  • 3h