# @zcong/batcher

> A simple batch wrapper for JS

Latest version **0.1.0** (published 2019-01-29) · MIT license · 0 weekly downloads

## Install

```sh
npm install @zcong/batcher
pnpm add @zcong/batcher
yarn add @zcong/batcher
bun add @zcong/batcher
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2019-01-29 |
| First published | 2019-01-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 7.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | zcong1993 |
| Maintainers | zcong |

## Links

- npm: https://www.npmjs.com/package/@zcong/batcher
- npm.io page: https://npm.io/package/@zcong/batcher

## Recent versions

- 0.1.0 (latest) — 2019-01-29

## README

# batcher

[![NPM version](https://img.shields.io/npm/v/@zcong/batcher.svg?style=flat)](https://npmjs.com/package/@zcong/batcher) [![NPM downloads](https://img.shields.io/npm/dm/@zcong/batcher.svg?style=flat)](https://npmjs.com/package/@zcong/batcher) [![CircleCI](https://circleci.com/gh/zcong1993/batcher/tree/master.svg?style=shield)](https://circleci.com/gh/zcong1993/batcher/tree/master) [![codecov](https://codecov.io/gh/zcong1993/batcher/branch/master/graph/badge.svg)](https://codecov.io/gh/zcong1993/batcher)

> A simple batch wrapper for JS

## Example

```ts
import { Batcher } from '@zcong/batcher'

const bs = new Batcher<string>(
  1000,
  10000,
  (batch: string[]) => {
    console.log(batch.length)
  },
  (str: string) => str.length
)

Array(100)
  .fill('nasjxkajsnxkjanskxnksanxkjsnakxs')
  .forEach(s => bs.dispatch(s))

setTimeout(() => bs.stop(), 9000)
// 31
// 31
// 31
// 7
```

## License

MIT &copy; zcong1993

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