{"id":17784779,"url":"https://github.com/chunkai1312/express-error-slack","last_synced_at":"2025-03-16T04:30:42.005Z","repository":{"id":40790251,"uuid":"79490481","full_name":"chunkai1312/express-error-slack","owner":"chunkai1312","description":"Express error handling middleware for reporting error to Slack","archived":false,"fork":false,"pushed_at":"2023-01-04T21:49:57.000Z","size":1038,"stargazers_count":14,"open_issues_count":13,"forks_count":3,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-20T17:44:18.627Z","etag":null,"topics":["error-handling","express","express-middleware","notifications","slack"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chunkai1312.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-01-19T20:08:33.000Z","updated_at":"2024-04-09T09:12:46.000Z","dependencies_parsed_at":"2023-02-02T21:15:27.322Z","dependency_job_id":null,"html_url":"https://github.com/chunkai1312/express-error-slack","commit_stats":null,"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chunkai1312%2Fexpress-error-slack","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chunkai1312%2Fexpress-error-slack/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chunkai1312%2Fexpress-error-slack/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chunkai1312%2Fexpress-error-slack/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chunkai1312","download_url":"https://codeload.github.com/chunkai1312/express-error-slack/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243802941,"owners_count":20350316,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["error-handling","express","express-middleware","notifications","slack"],"created_at":"2024-10-27T08:06:23.044Z","updated_at":"2025-03-16T04:30:41.477Z","avatar_url":"https://github.com/chunkai1312.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# express-error-slack\n\n[![NPM version][npm-image]][npm-url]\n[![Build Status][travis-image]][travis-url]\n[![Coverage Status][codecov-image]][codecov-url]\n\n\u003e Express error handling middleware for reporting error to Slack\n\n## Install\n\n```\n$ npm install --save express-error-slack\n```\n\n## Usage\n\n```js\nconst express = require('express')\nconst errorToSlack = require('express-error-slack')\n\nconst app = express()\n\n// Route that triggers a error\napp.get('/error', function (req, res, next) {\n  const err = new Error('Internal Server Error')\n  err.status = 500\n  next(err)\n})\n\n// Send error reporting to Slack\napp.use(errorToSlack({ webhookUri: 'https://hooks.slack.com/services/TOKEN' }))\napp.listen(3000)\n```\n\n## API\n\n```js\nconst errorToSlack = require('express-error-slack')\n```\n\n### errorToSlack(options)\n\nCreate a error handling middleware to send error reporting to Slack channel.\n\n#### Options\n\n```js\n{\n  webhookUri: String,\n  skip: function (err, req, res) { return false },\n  debug: Boolean\n}\n```\n\n- `webhookUri`: Required. Your Slack webhook uri that the channel will receive error reporting.\n- `skip`: Optional. A function to determine if handler is skipped. Defaults to always returning `false`.\n- `debug`: Optional. Show logging of response from Slack if set true. Defaults to `false`.\n\n## Result Example\n\n### 4xx\n\n![Slack Message](https://github.com/chunkai1312/express-error-slack/raw/master/screenshots/4xx.png)\n\n### 5xx\n\n![Slack Message](https://github.com/chunkai1312/express-error-slack/raw/master/screenshots/5xx.png)\n\n## License\n\nMIT © [Chun-Kai Wang](https://github.com/chunkai1312)\n\n[npm-image]: https://img.shields.io/npm/v/express-error-slack.svg\n[npm-url]: https://npmjs.org/package/express-error-slack\n[travis-image]: https://img.shields.io/travis/chunkai1312/express-error-slack.svg\n[travis-url]: https://travis-ci.org/chunkai1312/express-error-slack\n[codecov-image]: https://img.shields.io/codecov/c/github/chunkai1312/express-error-slack.svg\n[codecov-url]: https://codecov.io/gh/chunkai1312/express-error-slack\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchunkai1312%2Fexpress-error-slack","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchunkai1312%2Fexpress-error-slack","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchunkai1312%2Fexpress-error-slack/lists"}