# callbag-safe-pipe

> 👜 Utility like callbag-pipe but wraps the operators calls in a tryCatch block, sending an eventual exception to the sink

Latest version **1.1.0** (published 2018-12-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install callbag-safe-pipe
pnpm add callbag-safe-pipe
yarn add callbag-safe-pipe
bun add callbag-safe-pipe
```

## 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.1.0 |
| Published | 2018-12-09 |
| First published | 2018-11-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 6.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Francisco Tavares de Lima Neto |
| Maintainers | francisco.tln |
| Keywords | callbag |

## Links

- npm: https://www.npmjs.com/package/callbag-safe-pipe
- Repository: https://github.com/franciscotln/callbag-safe-pipe
- Homepage: https://github.com/franciscotln/callbag-safe-pipe#readme
- Issues: https://github.com/franciscotln/callbag-safe-pipe/issues
- npm.io page: https://npm.io/package/callbag-safe-pipe

## Recent versions

- 1.1.0 (latest) — 2018-12-09
- 1.0.0 — 2018-11-18

## README

# callbag-safe-pipe

Callbag utility like callbag-pipe but wraps the operators calls in a tryCatch block, sending an eventual exception to the sink. Check out the tests for more details.

`npm install callbag-safe-pipe`

## Examples

### Catch error thrown in the map operator
```js
const map = require('callbag-map');
const fromIter = require('callbag-from-iter');
const subscribe = require('callbag-subscribe');
const safePipe = require('callbag-safe-pipe');

safePipe(
  fromIter([0, 1, 2]),
  map(x => x.thisIsUndefined.y),
  subscribe({
    next() {},
    error(err) {
      console.log(err.message) // Cannot read property 'b' of undefined
    }
  })
);
```

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