# passerror

> Simple helper for handling error and success with two different callbacks

Latest version **1.1.1** (published 2015-10-30) · BSD-3-Clause license · 0 weekly downloads

## Install

```sh
npm install passerror
pnpm add passerror
yarn add passerror
bun add passerror
```

## 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.1 |
| Published | 2015-10-30 |
| First published | 2012-06-28 |
| Weekly downloads | 0 |
| License | BSD-3-Clause |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Andreas Lind |
| Maintainers | papandreou |

## Links

- npm: https://www.npmjs.com/package/passerror
- Repository: https://github.com/papandreou/passerror
- Homepage: https://github.com/papandreou/passerror#readme
- Issues: https://github.com/papandreou/passerror/issues
- npm.io page: https://npm.io/package/passerror

## Recent versions

- 1.1.1 (latest) — 2015-10-30
- 1.1.0 — 2014-10-02
- 1.0.1 — 2014-02-18
- 1.0.0 — 2013-10-30
- 0.0.2 — 2013-03-07
- 0.0.1 — 2012-06-28

## README

passError
=========

Handle success and failure with two different callbacks. Lets you get
rid of most `if (err) return cb(err);` constructs.


Example
-------

Send errors reported by `fs.readFile` straight to `cb`:

```javascript
var passError = require('passerror'),
    fs = require('fs');

function getLines(fileName, cb) {
    fs.readFile(fileName, 'utf-8', passError(cb, function (contents) {
        cb(null, contents.split(/\r?\n|\n?\r/));
    }));
}
```


License
-------

Licensed under a standard 3-clause BSD license -- see the
`LICENSE`-file for details.

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