|
1 | | -# it |
2 | | - |
3 | | -Utility modules to make dealing with async iterators easier, some trivial, some not. |
4 | | - |
5 | | -* [blob-to-it](./packages/blob-to-it) Turn a Blob into an iterable |
6 | | -* [browser-readablestream-to-it](./packages/browser-readablestream-to-it) Turn a browser ReadableStream into an iterable |
7 | | -* [it-all](./packages/it-all) Collect the contents of an iterable into an array |
8 | | -* [it-batch](./packages/it-batch) Batch up the contents of an iterable into arrays |
9 | | -* [it-buffer-stream](./packages/it-buffer-stream) Creates an iterable of buffers |
10 | | -* [it-drain](./packages/it-drain) Consume an iterable and ignore any output |
11 | | -* [it-filter](./packages/it-filter) Skip some items in an iterable based on a filter function |
12 | | -* [it-first](./packages/it-first) Return the first item in an iterable |
13 | | -* [it-flat-batch](./packages/it-flat-batch) Take an iterable of variable length arrays and make them all the same length |
14 | | -* [it-foreach](./packages/it-foreach) Invoke a function for every member of an iterable |
15 | | -* [it-glob](./packages/it-glob) Glob matcher for file systems |
16 | | -* [it-last](./packages/it-last) Return the last item in an iterable |
17 | | -* [it-length](./packages/it-length) Consume an iterable and return its length |
18 | | -* [it-map](./packages/it-map) Map the output of an iterable |
19 | | -* [it-merge](./packages/it-merge) Treat multiple iterables as one |
20 | | -* [it-multipart](./packages/it-multipart) Parse multipart message bodies as an iterable |
21 | | -* [it-ndjson](./packages/it-ndjson) Parse multipart message bodies as an iterable |
22 | | -* [it-parallel](./packages/it-parallel) Take an iterable of functions that return promises and run them in parallel up to a concurrency limit |
23 | | -* [it-parallel-batch](./packages/it-parallel-batch) Take an iterable of functions that return promises and run them in parallel in batches |
24 | | -* [it-peekable](./packages/it-peekable) Peek/push an iterable |
25 | | -* [it-reduce](./packages/it-reduce) Reduce the output of an iterable |
26 | | -* [it-skip](./packages/it-skip) Skip items at the start of an iterable |
27 | | -* [it-sort](./packages/it-sort) Sort an iterable using a passed sort function |
28 | | -* [it-split](./packages/it-split) Split an iterable of buffers by linebreaks |
29 | | -* [it-take](./packages/it-take) Limit the number of items you want from an iterable |
30 | | -* [it-to-browser-readablestream](./packages/it-to-browser-readablestream) Turns an iterable into a WhatWG [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) |
31 | | -* [it-to-buffer](./packages/it-to-buffer) Takes an iterable of Buffers and concatenates them |
| 1 | +# it <!-- omit in toc --> |
| 2 | + |
| 3 | +[](https://codecov.io/gh/achingbrain/it) |
| 4 | +[](https://github.com/achingbrain/it/actions/workflows/js-test-and-release.yml) |
| 5 | + |
| 6 | +> A collection of utilities for making working with iterables more bearable |
| 7 | +
|
| 8 | +## Table of contents <!-- omit in toc --> |
| 9 | + |
| 10 | +- [Structure](#structure) |
| 11 | +- [License](#license) |
| 12 | +- [Contribute](#contribute) |
| 13 | + |
| 14 | +## Structure |
| 15 | + |
| 16 | +- [`/packages/blob-to-it`](./packages/blob-to-it) Turns a blob into an async iterator |
| 17 | +- [`/packages/browser-readablestream-to-it`](./packages/browser-readablestream-to-it) Turns a browser readble stream into an async iterator |
| 18 | +- [`/packages/it-all`](./packages/it-all) Collects all values from an (async) iterable and returns them as an array |
| 19 | +- [`/packages/it-batch`](./packages/it-batch) Takes an async iterator that emits things and emits them as fixed size batches |
| 20 | +- [`/packages/it-buffer-stream`](./packages/it-buffer-stream) An async iterator that emits buffers containing bytes up to a certain length |
| 21 | +- [`/packages/it-drain`](./packages/it-drain) Empties an async iterator |
| 22 | +- [`/packages/it-filter`](./packages/it-filter) Filters the passed iterable by using the filter function |
| 23 | +- [`/packages/it-first`](./packages/it-first) Returns the first result from an async iterator |
| 24 | +- [`/packages/it-flat-batch`](./packages/it-flat-batch) Takes an async iterator that emits variable length arrays and emits them as fixed size batches |
| 25 | +- [`/packages/it-foreach`](./packages/it-foreach) Invokes the passed function for each item in an iterable |
| 26 | +- [`/packages/it-glob`](./packages/it-glob) Async iterable filename pattern matcher |
| 27 | +- [`/packages/it-last`](./packages/it-last) Returns the last result from an async iterator |
| 28 | +- [`/packages/it-length`](./packages/it-length) Counts the number of items in an async iterable |
| 29 | +- [`/packages/it-map`](./packages/it-map) Maps the values yielded by an async iterator |
| 30 | +- [`/packages/it-merge`](./packages/it-merge) Treat one or more iterables as a single iterable |
| 31 | +- [`/packages/it-multipart`](./packages/it-multipart) Async iterable http multipart message parser |
| 32 | +- [`/packages/it-ndjson`](./packages/it-ndjson) Parse iterators as ndjson and transform iterators to ndjson |
| 33 | +- [`/packages/it-parallel`](./packages/it-parallel) Takes an (async) iterable that emits promise-returning functions, invokes them in parallel up to the concurrency limit and emits the results as they become available, optionally in the same order as the input |
| 34 | +- [`/packages/it-parallel-batch`](./packages/it-parallel-batch) Takes an async iterator that emits promise-returning functions, invokes them in parallel and emits the results in the same order as the input |
| 35 | +- [`/packages/it-peekable`](./packages/it-peekable) Allows peeking/pushing an iterable |
| 36 | +- [`/packages/it-reduce`](./packages/it-reduce) Reduces the values yielded from an async iterator |
| 37 | +- [`/packages/it-skip`](./packages/it-skip) Skip items from an iterable |
| 38 | +- [`/packages/it-sort`](./packages/it-sort) Collects all values from an async iterator, sorts them using the passed function and yields them |
| 39 | +- [`/packages/it-split`](./packages/it-split) Splits Uint8Arrays emitted by an (async) iterable by a delimiter |
| 40 | +- [`/packages/it-take`](./packages/it-take) Stop iteration after n items have been received |
| 41 | +- [`/packages/it-to-browser-readablestream`](./packages/it-to-browser-readablestream) Takes an async iterator and turns it into a browser readable stream |
| 42 | +- [`/packages/it-to-buffer`](./packages/it-to-buffer) Takes an async iterator that yields buffers and concatenates them all together |
| 43 | + |
| 44 | +<!----> |
| 45 | + |
| 46 | +- [blob-to-it](./packages/blob-to-it) Turn a Blob into an iterable |
| 47 | +- [browser-readablestream-to-it](./packages/browser-readablestream-to-it) Turn a browser ReadableStream into an iterable |
| 48 | +- [it-all](./packages/it-all) Collect the contents of an iterable into an array |
| 49 | +- [it-batch](./packages/it-batch) Batch up the contents of an iterable into arrays |
| 50 | +- [it-buffer-stream](./packages/it-buffer-stream) Creates an iterable of buffers |
| 51 | +- [it-drain](./packages/it-drain) Consume an iterable and ignore any output |
| 52 | +- [it-filter](./packages/it-filter) Skip some items in an iterable based on a filter function |
| 53 | +- [it-first](./packages/it-first) Return the first item in an iterable |
| 54 | +- [it-flat-batch](./packages/it-flat-batch) Take an iterable of variable length arrays and make them all the same length |
| 55 | +- [it-foreach](./packages/it-foreach) Invoke a function for every member of an iterable |
| 56 | +- [it-glob](./packages/it-glob) Glob matcher for file systems |
| 57 | +- [it-last](./packages/it-last) Return the last item in an iterable |
| 58 | +- [it-length](./packages/it-length) Consume an iterable and return its length |
| 59 | +- [it-map](./packages/it-map) Map the output of an iterable |
| 60 | +- [it-merge](./packages/it-merge) Treat multiple iterables as one |
| 61 | +- [it-multipart](./packages/it-multipart) Parse multipart message bodies as an iterable |
| 62 | +- [it-ndjson](./packages/it-ndjson) Parse multipart message bodies as an iterable |
| 63 | +- [it-parallel](./packages/it-parallel) Take an iterable of functions that return promises and run them in parallel up to a concurrency limit |
| 64 | +- [it-parallel-batch](./packages/it-parallel-batch) Take an iterable of functions that return promises and run them in parallel in batches |
| 65 | +- [it-peekable](./packages/it-peekable) Peek/push an iterable |
| 66 | +- [it-reduce](./packages/it-reduce) Reduce the output of an iterable |
| 67 | +- [it-skip](./packages/it-skip) Skip items at the start of an iterable |
| 68 | +- [it-sort](./packages/it-sort) Sort an iterable using a passed sort function |
| 69 | +- [it-split](./packages/it-split) Split an iterable of buffers by linebreaks |
| 70 | +- [it-take](./packages/it-take) Limit the number of items you want from an iterable |
| 71 | +- [it-to-browser-readablestream](./packages/it-to-browser-readablestream) Turns an iterable into a WhatWG [ReadableStream](https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream) |
| 72 | +- [it-to-buffer](./packages/it-to-buffer) Takes an iterable of Buffers and concatenates them |
| 73 | + |
| 74 | +## License |
| 75 | + |
| 76 | +Licensed under either of |
| 77 | + |
| 78 | +- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>) |
| 79 | +- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>) |
| 80 | + |
| 81 | +## Contribute |
| 82 | + |
| 83 | +Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions. |
0 commit comments