open-index/open-npm huggingface dataset:
npm package: @orche/collect
Description: Collect async iterables into array
Author: Hoyeung Wong
Latest version: 0.0.1

# @orche/collect

[![npm version][badge-npm-version]][url-npm]
[![npm download monthly][badge-npm-download-monthly]][url-npm]
[![npm download total][badge-npm-download-total]][url-npm]
[![github commit last][badge-github-last-commit]][url-github]
[![github commit total][badge-github-commit-count]][url-github]
[![npm license][badge-npm-license]][url-npm]

[//]: <> (Shields)
[badge-npm-version]: https://flat.badgen.net/npm/v/@orche/collect
[badge-npm-download-monthly]: https://flat.badgen.net/npm/dm/@orche/collect
[badge-npm-download-total]: https://flat.badgen.net/npm/dt/@orche/collect
[badge-npm-license]: https://flat.badgen.net/npm/license/@orche/collect
[badge-github-last-commit]: https://flat.badgen.net/github/last-commit/hoyeungw/orche
[badge-github-commit-count]: https://flat.badgen.net/github/commits/hoyeungw/orche

[//]: <> (Links)
[url-npm]: https://npmjs.org/package/@orche/collect
[url-github]: https://github.com/hoyeungw/orche

## Overview

Efficient async collection utilities for handling async iterables with powerful filtering and mapping capabilities.

## Features

- Async-first design
- Flexible collection strategies
- Conditional filtering
- Mapping transformations
- Zero dependencies
- ESM support

## Installation

```bash
# npm
$ npm install @orche/collect

# yarn
$ yarn add @orche/collect

# pnpm
$ pnpm add @orche/collect
```

## Usage

```js
import { asyncCollectOf, asyncCollectBy, asyncCollectTo } from '@orche/collect'

// Basic collection
const asyncIterable = async function* () {
  yield 1
  yield 2
  yield 3
}

// Collect all values
const all = await asyncCollectOf(asyncIterable())
// => [1, 2, 3]

// Collect with filtering
const even = await asyncCollectBy(asyncIterable(), x => x % 2 === 0)
// => [2]

// Collect with transformation
const doubled = await asyncCollectTo(asyncIterable(), x => x * 2)
// => [2, 4, 6]
```

## License

[BSD-3-Clause](LICENSE)
npm package: @orche/distinct
Description: Distinct async iterables into array
Author: Hoyeung Wong
Latest version: 0.0.1

# @orche/distinct

[![npm version][badge-npm-version]][url-npm]
[![npm download monthly][badge-npm-download-monthly]][url-npm]
[![npm download total][badge-npm-download-total]][url-npm]
[![github commit last][badge-github-last-commit]][url-github]
[![github commit total][badge-github-commit-count]][url-github]
[![npm license][badge-npm-license]][url-npm]

[//]: <> (Shields)
[badge-npm-version]: https://flat.badgen.net/npm/v/@orche/distinct
[badge-npm-download-monthly]: https://flat.badgen.net/npm/dm/@orche/distinct
[badge-npm-download-total]: https://flat.badgen.net/npm/dt/@orche/distinct
[badge-npm-license]: https://flat.badgen.net/npm/license/@orche/distinct
[badge-github-last-commit]: https://flat.badgen.net/github/last-commit/hoyeungw/orche
[badge-github-commit-count]: https://flat.badgen.net/github/commits/hoyeungw/orche

[//]: <> (Links)
[url-npm]: https://npmjs.org/package/@orche/distinct
[url-github]: https://github.com/hoyeungw/orche

## Overview

A lightweight identity function that returns its input unchanged. Perfect for functional composition and default transformations.

## Features

- Zero dependencies
- Tiny footprint (<1KB)
- Pure function
- ESM support

## Installation

```bash
# npm
$ npm install @orche/distinct

# yarn
$ yarn add @orche/distinct

# pnpm
$ pnpm add @orche/distinct
```

## Usage

```js
import { oneself } from '@orche/distinct'

// Basic usage
oneself(42)           // => 42
oneself('hello')      // => 'hello'
oneself([1, 2, 3])    // => [1, 2, 3]

// Function composition
const pipeline = [oneself, String, parseInt]
const result = pipeline.reduce((x, f) => f(x), 42)  // => 42

// Default transformer
const transform = condition ? complexTransform : oneself
```

## License

[BSD-3-Clause](LICENSE)
npm package: @orche/reduce
Description: Reduce async iterables to accumulate to initial value
Author: Hoyeung Wong
Latest version: 0.0.1

# @orche/reduce

[![npm version][badge-npm-version]][url-npm]
[![npm download monthly][badge-npm-download-monthly]][url-npm]
[![npm download total][badge-npm-download-total]][url-npm]
[![github commit last][badge-github-last-commit]][url-github]
[![github commit total][badge-github-commit-count]][url-github]
[![npm license][badge-npm-license]][url-npm]

[//]: <> (Shields)
[badge-npm-version]: https://flat.badgen.net/npm/v/@orche/reduce
[badge-npm-download-monthly]: https://flat.badgen.net/npm/dm/@orche/reduce
[badge-npm-download-total]: https://flat.badgen.net/npm/dt/@orche/reduce
[badge-npm-license]: https://flat.badgen.net/npm/license/@orche/reduce
[badge-github-last-commit]: https://flat.badgen.net/github/last-commit/hoyeungw/orche
[badge-github-commit-count]: https://flat.badgen.net/github/commits/hoyeungw/orche

[//]: <> (Links)
[url-npm]: https://npmjs.org/package/@orche/reduce
[url-github]: https://github.com/hoyeungw/orche

## Overview

Async reduction utility for async iterables with support for index-aware accumulation.

## Features

- Async-first design
- Index-aware reduction
- Flexible accumulator patterns
- Promise-based accumulation
- Zero dependencies
- ESM support

## Installation

```bash
# npm
$ npm install @orche/reduce

# yarn
$ yarn add @orche/reduce

# pnpm
$ pnpm add @orche/reduce
```

## Usage

```js
import { asyncReduce } from '@orche/reduce'

// Basic sum reduction
const asyncIterable = async function* () {
  yield 1
  yield 2
  yield 3
}

const sum = await asyncReduce(asyncIterable(), (acc, x) => acc + x, 0)
// => 6

// Index-aware reduction
const indexedSum = await asyncReduce(
  asyncIterable(),
  (acc, x, i) => acc + x * i,
  0
)
// => 0*1 + 1*2 + 2*3 = 8

// Async accumulator
const asyncSum = await asyncReduce(
  asyncIterable(),
  async (acc, x) => (await acc) + x,
  Promise.resolve(0)
)
// => 6
```

## License

[BSD-3-Clause](LICENSE)