Skip to main content

Built and signed on GitHub Actions

♻️ Iterable and AsyncIterable utilities.

This package works with Cloudflare Workers, Node.js, Deno, Bun, Browsers
This package works with Cloudflare Workers
This package works with Node.js
This package works with Deno
This package works with Bun
This package works with Browsers
JSR Score
100%
Published
2 weeks ago (0.3.2)
f
append

Appends one iterable to another.

f
count

Counts the number of items that satisfy a predicate in the given iterable.

f
drop

Drop the specified amount of items from the given iterable.

f
entriesToObject

Takes an entries iterable and returns an object.

v
every

Evaluates items in an iterable against a predicate and returns true if allitems evaluates to true.

v
filter

Filters items in an iterable against a predicate and returns items thatevaluated to true.

f
find

Returns the value of the first item in the iterable where predicate istrue, undefined otherwise.

f
flat

Flattens one level of the given iterable.

f
forEach

For each function for iterables.

f
getIterator

Get a Symbol.iterator from an iterable.

f
groupBy

Groups values of an iterable in an object based on the output of thegrouper function.

f
head

Get first element of an iterable (undefined if it is empty).

f
includes

Tries to find the given searchItem in iterable.

f
initial

Get all elements except the last one of an iterable.

f
intersperse

Add the given separator between each element of the given iterable.

f
iterableToArray

Turns given iterable into an array.

f
iteratorFunctionToIterableIterator

Takes a generator function and returns an iterable iterator object.

f
join

Takes a separator string and a iterable and returns a string with theconcatenation of all the elements separated by the separator.

f
length

Get the length of an iterable.

f
map

Map for iterables.

f
objectToEntries

Yields all entries of an object (including symbols).

f
prepend

Prepends one iterable to another.

f
range

Range iterable generator (from from to to).

f
reduce

Reducer function for iterables.

f
repeat

Repeat given item the specified amount of times (can be BigInt orInfinity times) as an iterable.

v
some

Evaluates items in an iterable against a predicate and returns true if anyitem evaluates to true.

f
take

Take the given amount of items from the iterable.

f
toIterable

Takes a value, iterable and yields it.

f
unique

Returns a single instance of each item in the iterable.

f
zip

Takes two iterables and returns a new iterable with the length of theshortest iterable with tuples containing the items from both.

f
zipIndex

Yields a tuple for each item in the iterable with the index of said item.

async

♻️ Asynchronous iterable utilities.

f
append

Appends one iterable or asynchronous iterable to another.

f
count

Counts the number of items that satisfy a predicate in the given iterable orasynchronous iterable.

f
drop

Drop the specified amount of items from the given iterable or asynchronousiterable.

f
entriesToObject

Takes an entries iterable or asynchronous iterable and returns an object.

v
every

Evaluates items in an iterable or asynchronous iterable against a predicateand returns true if all items evaluates to true.

v
filter

Filters items in an iterable or asynchronous iterable against a predicate andreturns items that evaluated to true.

v
find

Returns the value of the first item in the iterable or asynchronous iterablewhere predicate is true, undefined otherwise.

f
flat

Flattens one level of the given iterable or asynchronous iterable.

f
forEach

For each function for iterables and asynchronous iterables.

f
getIterator

Get a Symbol.iterator from an iterable or a Symbol.asyncIterator from anasynchronous iterable.

f
groupBy

Groups values of an iterable or asynchronous iterable in an object based onthe output of the grouper function.

f
head

Get first element of an iterable or asynchronous iterable (undefined ifit is empty).

f
includes

Tries to find the given searchItem in iterable or asynchronous iterable.

f
initial

Get all elements except the last one of an iterable or asynchronous iterable.

f
intersperse

Add the given separator between each element of the given iterable orasynchronous iterable.

f
iterableToArray

Turns given iterable or asynchronous iterable into an array.

f
iteratorFunctionToAsyncIterableIterator

Takes a generator function and returns an iterable iterator or asynchronousiterable iterator object.

f
join

Takes a separator string and a iterable or asynchronous iterable andreturns a string with the concatenation of all the elements separated by theseparator.

f
length

Get the length of an iterable or asynchronous iterable.

f
map

Map for iterables and asynchronous iterables.

f
prepend

Prepends one iterable or asynchronous iterable to another.

f
random

Deterministic pseudo-random number generator.

f
reduce

Reducer function for iterables and asynchronous iterables.

v
some

Evaluates items in an iterable or asynchronous iterable against a predicateand returns true if any item evaluates to true.

f
take

Take the given amount of items from the iterable or asynchronous iterable.

f
toIterable

Takes a value, iterable or asynchronous iterable and yields it.

f
unique

Returns a single instance of each item in the iterable or asynchronousiterable.

f
zip

Takes two iterables or asynchronous iterable and returns a new iterable orasynchronous iterable with the length of the shortest iterable with tuplescontaining the items from both.

f
zipIndex

Yields a tuple for each item in the iterable with the index of said item.