# send-error-slack

> The library helps the system to send errors to slack

Latest version **1.0.5** (published 2021-06-18) · ISC license · 0 weekly downloads

## Install

```sh
npm install send-error-slack
pnpm add send-error-slack
yarn add send-error-slack
bun add send-error-slack
```

## 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.5 |
| Published | 2021-06-18 |
| First published | 2021-06-18 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | anonystick |
| Maintainers | anonystick |
| Keywords | send-error-slack, error, express, nodejs, middleware, anonystick, slack |

## Links

- npm: https://www.npmjs.com/package/send-error-slack
- Repository: https://github.com/anonystick/send-error-slack
- Homepage: https://github.com/anonystick/send-error-slack#readme
- Issues: https://github.com/anonystick/send-error-slack/issues
- npm.io page: https://npm.io/package/send-error-slack

## Alternatives

- [@sentry/react-native](https://npm.io/package/@sentry/react-native.md) — 2.6M weekly downloads
- [@ardatan/aggregate-error](https://npm.io/package/@ardatan/aggregate-error.md) — 708.1K weekly downloads
- [custom-error-generator](https://npm.io/package/custom-error-generator.md) — 2.0K weekly downloads
- [@technik-sde/prosemirror-recreate-transform](https://npm.io/package/@technik-sde/prosemirror-recreate-transform.md) — 1.5K weekly downloads
- [@suchipi/error-utils](https://npm.io/package/@suchipi/error-utils.md) — 78 weekly downloads

## Recent versions

- 1.0.5 (latest) — 2021-06-18
- 1.0.4 — 2021-06-18
- 1.0.3 — 2021-06-18
- 1.0.1 — 2021-06-18
- 1.0.0 — 2021-06-18

## README

The library helps the system to send errors to slack

## Install

```js
$ npm install --save send-error-slack
```
## Usage express without route
```js
const express = require('express')
const sendErrorSlack = require('send-error-slack')

const app = express()

// Route that triggers a error
app.get('/error', function (req, res, next) {
  const err = new Error('Internal Server Error')
  err.status = 500
  next(err)
})

// Send error reporting to Slack
app.use(sendErrorSlack({ webhookUri: 'https://hooks.slack.com/services/TOKEN' }))
app.listen(3000)
```

## Usage express route
```js
/*
    File index.js
*/
var express = require('express'),
    app = express(),
    bodyParser = require('body-parser');

app.use(bodyParser.json()); // support json encoded bodies
app.use(bodyParser.urlencoded({ extended: true })); // support encoded bodies
require('./route')(app); //importing route

/*
    File Route.js
*/
const sendErrorSlack = require('send-error-slack')
const webhookUri = 'https://hooks.slack.com/services/TOKEN';

module.exports = function(app) {
    app.route('/api/checkError').get([TEST_CONTROLLER.checkError])

    // ERRORS
	app.use(sendErrorSlack({webhookUri}))
}
```
## API
```js
const sendErrorSlack = require('send-error-slack')
```

## Author
[Tips Javascript](https://anonystick.com)

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