@lou.codes/iterables
TypeScript icon, indicating that this package has built-in type declarations

3.2.2Β β€’Β PublicΒ β€’Β Published

Coverage License NPM Version Open Issues Size

πŸ” Iterable and AsyncIterable utils.

Usage

By default, all utils are meant to be used with Iterable values, to use AsyncIterable values the functions have to be imported from @lou.codes/iterables/asynchronous.

πŸ“¦ Node

Install @lou.codes/iterables as a dependency:

pnpm add @lou.codes/iterables
# or
npm install @lou.codes/iterables
# or
yarn add @lou.codes/iterables

Import it and use it:

import { iterableToArray, map } from "@lou.codes/iterables";

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

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

πŸ¦• Deno

Import @lou.codes/iterables using the npm: prefix, and use it directly:

import { iterableToArray, map } from "npm:@lou.codes/iterables";

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

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

🌎 Browser

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

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

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

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

Useful links

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 3.2.2
    9
    • latest

Version History

Package Sidebar

Install

npm i @lou.codes/iterables

Weekly Downloads

241

Version

3.2.2

License

MIT

Unpacked Size

98.2 kB

Total Files

137

Last publish

Collaborators

  • loucyx