# psp-collect

> A modern version of the [pull-stream collect sink](https://pull-stream.github.io/#collect) which returns a promise rather than calling a callback.

Latest version **1.0.1** (published 2020-03-26) · 0 weekly downloads

## Install

```sh
npm install psp-collect
pnpm add psp-collect
yarn add psp-collect
bun add psp-collect
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2020-03-26 |
| First published | 2019-08-12 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 3.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | thomas-jensen |

## Links

- npm: https://www.npmjs.com/package/psp-collect
- Repository: https://github.com/srcagency/psp-collect
- Homepage: https://github.com/srcagency/psp-collect#readme
- Issues: https://github.com/srcagency/psp-collect/issues
- npm.io page: https://npm.io/package/psp-collect

## Dependencies (1)

- [psp-drain](https://npm.io/package/psp-drain.md) ^1.0.1

## Recent versions

- 1.0.1 (latest) — 2020-03-26
- 1.0.0 — 2019-08-12

## README

# Pull stream collect

A modern version of the
[pull-stream collect sink](https://pull-stream.github.io/#collect) which returns
a promise rather than calling a callback.

```
collect()
```

```js
const {pull, values, map} = require('pull-stream')
const collect = require('psp-collect')

pull(values([1, 2, 3]), map(x => x * 2), collect()).then(console.log)
// [ 2, 4, 6 ]
```

## Abort

Aborting without an error will end the stream and return the value so far.

```
abort([err])
```

```js
const {pull, values} = require('pull-stream')
const collect = require('psp-collect')

const sink = collect()
sink.abort()
pull(values([1, 2, 3]), sink).then(console.log)
// []
```

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