Skip to content
This repository has been archived by the owner on Feb 2, 2024. It is now read-only.
/ iterables Public archive

πŸ” Iterable and AsyncIterable utils

License

Notifications You must be signed in to change notification settings

vangware/iterables

Repository files navigation

This repository's code was moved to lou.codes.


Coverage License NPM Version Open Issues

πŸ” Iterable and AsyncIterable utils.

Usage

πŸ“¦ Node

Install @vangware/iterables as a dependency:

pnpm add @vangware/iterables
# or
npm install @vangware/iterables
# or
yarn add @vangware/iterables

Import it and use it:

import { iterableToArray, map } from "@vangware/iterables";

const mapDouble = map((value: number) => value * 2);

iterableToArray(mapDouble([1, 2, 3])); // [2, 4, 6]

πŸ¦• Deno

Import @vangware/iterables using the npm: prefix, and use it directly:

import { iterableToArray, map } from "npm:@vangware/iterables";

const mapDouble = map((value: number) => value * 2);

iterableToArray(mapDouble([1, 2, 3])); // [2, 4, 6]

🌎 Browser

Import @vangware/iterables using esm.sh, and use it directly:

<script type="module">
	import { iterableToArray, map } from "https://esm.sh/@vangware/iterables";

	const mapDouble = map(value => value * 2);

	iterableToArray(mapDouble([1, 2, 3])); // [2, 4, 6]
</script>

Useful links