# pull-queue

> Pull stream with queue

Latest version **0.1.4** (published 2017-09-10) · MIT license · 0 weekly downloads

## Install

```sh
npm install pull-queue
pnpm add pull-queue
yarn add pull-queue
bun add pull-queue
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.4 |
| Published | 2017-09-10 |
| First published | 2017-07-26 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | Maciej Krüger |
| Maintainers | mkg20001 |
| Keywords | pull-stream, queue, async |

## Links

- npm: https://www.npmjs.com/package/pull-queue
- Repository: https://github.com/mkg20001/pull-queue
- Homepage: https://github.com/mkg20001/pull-queue#readme
- Issues: https://github.com/mkg20001/pull-queue/issues
- npm.io page: https://npm.io/package/pull-queue

## Dependencies (1)

- [data-queue](https://npm.io/package/data-queue.md) 0.0.2

## Alternatives

- [cron](https://npm.io/package/cron.md) — 4.9M weekly downloads
- [@vercel/queue](https://npm.io/package/@vercel/queue.md) — 731.6K weekly downloads
- [create-sonicjs](https://npm.io/package/create-sonicjs.md) — 1.6K weekly downloads
- [@exellix/jobs-api](https://npm.io/package/@exellix/jobs-api.md) — 941 weekly downloads
- [@forwardimpact/libskill](https://npm.io/package/@forwardimpact/libskill.md) — 575 weekly downloads

## Recent versions

- 0.1.4 (latest) — 2017-09-10
- 0.1.3 — 2017-07-28
- 0.1.2 — 2017-07-27
- 0.1.1 — 2017-07-26
- 0.1.0 — 2017-07-26
- 0.0.1-alphapre — 2017-07-26

## README

# pull-queue
Pull stream with queue

## API
`queue(through, options)` - Returns a duplex stream with built-in-queue

### Options
`sendMany`: If true will treat arrays as multiple items

## Examples

### Validate Data

```js
queue(function(end, data, cb) { //this will only allow valid data to pass through
  if (end) return cb(end)
  if (validateData(data)) cb(null, data) //will send that data
  else cb() //will not send anything
})
```

### Split words

```js
queue(function(end, data, cb) { //this will transfer a stream of comma seperated items into single words
  if (end) return cb(end)
  cb(null, data.split(","))
}, { sendMany: true })
```

### msgpack unpack
[» See here](https://github.com/ZeroNetJS/zeronet-js/blob/46b8742f37553b9e70718a66bc6c3f8e14fdc530/zeronet-protocol/lib/stream/msgpack.js#L40)

## FAQ
Q: Why a duplex?

A: Because otherwise we would have to return null for some reads which causes trouble

Q: Why not pull-through?

A: See Q#1

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