{"id":16869515,"url":"https://github.com/diegorbaquero/express-debug-async-wrap","last_synced_at":"2026-05-07T20:03:49.415Z","repository":{"id":66180518,"uuid":"115876648","full_name":"DiegoRBaquero/express-debug-async-wrap","owner":"DiegoRBaquero","description":"express async wrapper that passes custom debug instance","archived":false,"fork":false,"pushed_at":"2020-10-29T00:57:47.000Z","size":29,"stargazers_count":2,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-16T20:40:20.829Z","etag":null,"topics":["async","debug","express","express-async-wrapper","expressjs","wrap","wrapper"],"latest_commit_sha":null,"homepage":"","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/DiegoRBaquero.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-12-31T17:27:30.000Z","updated_at":"2023-03-04T06:06:07.000Z","dependencies_parsed_at":"2023-02-20T17:15:58.135Z","dependency_job_id":null,"html_url":"https://github.com/DiegoRBaquero/express-debug-async-wrap","commit_stats":{"total_commits":15,"total_committers":1,"mean_commits":15.0,"dds":0.0,"last_synced_commit":"9919410cdf3e41dbd5eff87ef05bda59c429821f"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoRBaquero%2Fexpress-debug-async-wrap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoRBaquero%2Fexpress-debug-async-wrap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoRBaquero%2Fexpress-debug-async-wrap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DiegoRBaquero%2Fexpress-debug-async-wrap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DiegoRBaquero","download_url":"https://codeload.github.com/DiegoRBaquero/express-debug-async-wrap/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244289524,"owners_count":20429207,"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":["async","debug","express","express-async-wrapper","expressjs","wrap","wrapper"],"created_at":"2024-10-13T15:01:03.125Z","updated_at":"2026-05-07T20:03:44.395Z","avatar_url":"https://github.com/DiegoRBaquero.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# express-debug-async-wrap [![npm](https://img.shields.io/npm/v/express-debug-async-wrap.svg?style=flat-square)]() [![npm](https://img.shields.io/npm/dm/express-debug-async-wrap.svg?style=flat-square)]() [![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg?style=flat-square)](https://standardjs.com) [![npm](https://img.shields.io/npm/l/express-debug-async-wrap.svg?style=flat-square)](LICENSE)\nexpress async wrapper that passes custom `debug` instance or logging function\n\n## Install\n\n```\nnpm i -S express-debug-async-wrap\nor\nnpm install --save express-debug-async-wrap\n```\n\n## Use\n\nIn your route: Require and initialize with `debug` instance:\n\n```js\nconst debug = require('debug')('myNamespace:myRouteName')\nconst wrapper = require(`express-debug-async-wrap`)(debug)\nconst express = require('express')\n\nconst router = express.Router()\n\nrouter.get('/', wrapper(async (req, res) =\u003e {\n  await ...\n  await ...\n  res.send('OK')\n}))\n\nmodule.exports = router\n```\n\nIn your main app:\n\n```js\nconst debug = require('debug')('myNamespace')\nconst express = require('express')\nconst app = express()\n// error handler\napp.use((err, req, res, next) =\u003e {\n  err.status = err.status || 500\n  let customDebug = debug\n  if (err.debug) {\n    customDebug = err.debug\n    delete err.debug\n  }\n  if (err.status === 404) delete err.stack // Do not show error stack for 404's\n  customDebug(err)\n\n  res.status(err.status)\n  res.json(err) // For JSON APIs\n  // res.send(err) // Or send as text\n})\n```\n\n## Related\n\n- [express-route-autoloader](https://github.com/DiegoRBaquero/express-route-autoloader)\n- [express-sequelize-crud-router](https://github.com/DiegoRBaquero/express-sequelize-crud-router)\n- [sequelize-express-findbyid](https://github.com/DiegoRBaquero/sequelize-express-findbyid)\n\n## License\n\nMIT Copyright © [Diego Rodríguez Baquero](https://diegorbaquero.com)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegorbaquero%2Fexpress-debug-async-wrap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdiegorbaquero%2Fexpress-debug-async-wrap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdiegorbaquero%2Fexpress-debug-async-wrap/lists"}