# genpipe

> Tiny data processing library for TypeScript based on composable async generators.

Latest version **0.0.5** (published 2023-11-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install genpipe
pnpm add genpipe
yarn add genpipe
bun add genpipe
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities.

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2023-11-16 |
| First published | 2023-11-16 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 45.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Nishant George Agrwal |
| Maintainers | nishantartenos |

## Links

- npm: https://www.npmjs.com/package/genpipe
- npm.io page: https://npm.io/package/genpipe

## Recent versions

- 0.0.5 (latest) — 2023-11-16
- 0.0.4 — 2023-11-16
- 0.0.3 — 2023-11-16
- 0.0.2 — 2023-11-16
- 0.0.1 — 2023-11-16

## README

# genpipe

Tiny data processing library for TypeScript based on composable async generators.

## Installation

### Copy the file

The library is just one file - [genpipe.ts](genpipe.ts). Copy it to your project and use it.

### Install with npm

```sh
npm install genpipe
```

## Usage

### Basic example

```typescript
import { Pipeline, toGen, F, delay } from 'genpipe'

const x = new Pipeline(toGen([20, 5, 2, 1]))
    .tf(F.map((i) => i * 2))
    .toAsync()
    .tf(F.mapConcurrent(10, async (i) => {
        const timeout = 1000 * Math.max(0.5, Math.random())
        console.log(`starting timeout async function ${i}`)
        await delay(timeout)
        console.log(`finished timeout async function ${i}`)
        return i
    }))
    .eval()

console.log(await x)
```

---
_Source: https://npm.io/package/genpipe · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
