if
it-first
npm i it-first
if

it-first

A collection of utilities for making working with iterables more bearable

by Alex Potsides

1.0.7 (see all)License:ISCTypeScript:Built-In
npm i it-first
Readme

it

Utility modules to make dealing with async iterators easier, some trivial, some not.

  • blob-to-it Turn a Blob into an iterable
  • browser-readablestream-to-it Turn a browser ReadableStream into an iterable
  • it-all Collect the contents of an iterable into an array
  • it-batch Batch up the contents of an iterable into arrays
  • it-buffer-stream Creates an iterable of buffers
  • it-drain Consume an iterable and ignore any output
  • it-filter Skip some items in an iterable based on a filter function
  • it-first Return the first item in an iterable
  • it-flat-batch Take an iterable of variable length arrays and make them all the same length
  • it-foreach Invoke a function for every member of an iterable
  • it-glob Glob matcher for file systems
  • it-last Return the last item in an iterable
  • it-length Consume an iterable and return its length
  • it-map Map the output of an iterable
  • it-merge Treat multiple iterables as one
  • it-multipart Parse multipart message bodies as an iterable
  • it-ndjson Parse multipart message bodies as an iterable
  • it-parallel Take an iterable of functions that return promises and run them in parallel up to a concurrency limit
  • it-parallel-batch Take an iterable of functions that return promises and run them in parallel in batches
  • it-peekable Peek/push an iterable
  • it-reduce Reduce the output of an iterable
  • it-skip Skip items at the start of an iterable
  • it-sort Sort an iterable using a passed sort function
  • it-split Split an iterable of buffers by linebreaks
  • it-take Limit the number of items you want from an iterable
  • it-to-browser-readablestream Turns an iterable into a WhatWG ReadableStream
  • it-to-buffer Takes an iterable of Buffers and concatenates them

Downloads/wk

45.4K

GitHub Stars

195

LAST COMMIT

4mos ago

MAINTAINERS

1

CONTRIBUTORS

6

OPEN ISSUES

3

OPEN PRs

0
VersionTagPublished
1.0.7
latest
7mos ago
No alternatives found
No tutorials found
Add a tutorial