# psp-drain

> A modern version of the [pull-stream drain sink](https://pull-stream.github.io/#drain) 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-drain
pnpm add psp-drain
yarn add psp-drain
bun add psp-drain
```

## 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-08 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | thomas-jensen |

## Links

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

## Recent versions

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

## README

# Pull stream drain

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

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

pull(values([1, 2, 3]), drain(console.log)).then(() => console.log('Done'))
```

```
drain([op])
```

## Abort

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

const sink = drain()
sink.abort()
pull(values([1, 2, 3]), sink).then(() => console.log('Done'))

const sink = drain()
sink.abort(new Error())
pull(values([1, 2, 3]), sink).catch(console.error)
```

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

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