{"id":20492902,"url":"https://github.com/segment-boneyard/last-error-middleware","last_synced_at":"2026-03-02T13:40:26.994Z","repository":{"id":11278150,"uuid":"13686100","full_name":"segment-boneyard/last-error-middleware","owner":"segment-boneyard","description":"Middleware for catching the last error in your express.js apps","archived":false,"fork":false,"pushed_at":"2013-12-05T23:24:00.000Z","size":248,"stargazers_count":6,"open_issues_count":2,"forks_count":0,"subscribers_count":38,"default_branch":"master","last_synced_at":"2025-09-03T06:20:49.838Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/segment-boneyard.png","metadata":{"files":{"readme":"Readme.md","changelog":"History.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-10-18T18:39:20.000Z","updated_at":"2019-02-06T21:51:08.000Z","dependencies_parsed_at":"2022-07-08T01:50:28.582Z","dependency_job_id":null,"html_url":"https://github.com/segment-boneyard/last-error-middleware","commit_stats":null,"previous_names":["segmentio/last-error-middleware"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/segment-boneyard/last-error-middleware","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-boneyard%2Flast-error-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-boneyard%2Flast-error-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-boneyard%2Flast-error-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-boneyard%2Flast-error-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/segment-boneyard","download_url":"https://codeload.github.com/segment-boneyard/last-error-middleware/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/segment-boneyard%2Flast-error-middleware/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30005033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-02T12:19:43.414Z","status":"ssl_error","status_checked_at":"2026-03-02T12:19:02.215Z","response_time":60,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-11-15T17:31:51.524Z","updated_at":"2026-03-02T13:40:26.980Z","avatar_url":"https://github.com/segment-boneyard.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n# last-error-middleware\n\n  Middleware for catching the last `express.js` error and rendering it as json or an error page.\n\n## Installation\n\n    $ npm install last-error-middleware\n\n## Example\n\n```js\nvar lastError = require('last-error-middleware');\n\napp.use(lastError({ pages: {\n  '401': 'path/to/401.html',\n  '404': 'path/to/404.html',\n  '500': 'path/to/500.html',\n  '503': 'path/to/503.html',\n  '*'  : 'path/to/omg.html',\n}));\n```\n\n## API\n\n### .LastError(options)\n  \n  Construct a `last-error` middleware generator with custom `options`. The defaults are:\n\n```js\n{\n  \"pages\": {},     // status code to html template path\n  \"stack\": false   // return the error stack with json responses\n}\n```\n\n### on('err', ..)\n\n  Emitted on every error.\n\n```js\nvar lastError = require('last-error-middleware');\n\nvar errors = lastError({ pages: {\n  '401': 'path/to/401.html',\n  '404': 'path/to/404.html',\n  '500': 'path/to/500.html',\n  '503': 'path/to/503.html'\n});\n\napp.use(errors);\n\nerrors.on('err', function (err) {\n  console.log(err.stack);\n});\n```\n\n## License\n\n```\nWWWWWW||WWWWWW\n W W W||W W W\n      ||\n    ( OO )__________\n     /  |           \\\n    /o o|    MIT     \\\n    \\___/||_||__||_|| *\n         || ||  || ||\n        _||_|| _||_||\n       (__|__|(__|__|\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegment-boneyard%2Flast-error-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsegment-boneyard%2Flast-error-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsegment-boneyard%2Flast-error-middleware/lists"}