open-index/open-npm huggingface dataset:
npm package: @ninepie/batch-outputer
Description: ## How to use
Author: xuerzong
Latest version: 0.0.2

# batch-outputer

## How to use

```
bun add @ninepie/batch-outputer
```

```typescript
import { BatchOutputer } from '@ninepie/batch-outputer'

const outputer = new BatchOutputer<number[]>({
  outputer: (data) {
    console.log(data)
  },
  batchSize: 5,
  maxWaitTime: 1_000 /* ms */
})

outputer.insert(1)
outputer.insert(2)
// console.log(1)
// console.log(2)
```