Skip to content
This repository was archived by the owner on Feb 2, 2024. It is now read-only.

Latest commit

 

History

History
81 lines (55 loc) · 2.4 KB

README.md

File metadata and controls

81 lines (55 loc) · 2.4 KB

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