# swerrs

> Easy extensible error types for Node.js

Latest version **0.0.11** (published 2017-01-12) · MIT license · 0 weekly downloads

## Install

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

## 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.0.11 |
| Published | 2017-01-12 |
| First published | 2016-10-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Austin Moran |
| Maintainers | austo |
| Keywords | error, type, extend, callback, value, aggregate, transport, log |

## Links

- npm: https://www.npmjs.com/package/swerrs
- Repository: https://github.com/austo/swerrs
- Issues: https://github.com/austo/swerrs/issues
- npm.io page: https://npm.io/package/swerrs

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 0.0.11 (latest) — 2017-01-12
- 0.0.10 — 2016-12-19
- 0.0.9 — 2016-11-08
- 0.0.8 — 2016-10-27
- 0.0.7 — 2016-10-27
- 0.0.6 — 2016-10-24
- 0.0.5 — 2016-10-21
- 0.0.4 — 2016-10-07
- 0.0.3 — 2016-10-07
- 0.0.2 — 2016-10-06
- 0.0.1 — 2016-10-01

## README

[![Build Status](https://travis-ci.org/austo/swerrs.svg?branch=master)](https://travis-ci.org/austo/swerrs)

Stop Sw'erring, use swerrs

```javascript

'use strict';

const SwError = require('swerrs');

const InvalidFileError = SwError.extend({
  name: 'InvalidFileError',
  onPush: function(v) {
    if (v.statusCode === 404) {
      this.fileMissing = true;
    }
  }
});

if (!process.env['XANAX']) {
  let err = new InvalidFileError('OMG!!!');

  // or supply it to the constructor... supports varargs and arrays
  err.push({ msg: `where's my file?!!`, statusCode: 404 });

  process.nextTick(() => {
    console.log(JSON.stringify(err, null, 2));
  });
}

```

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