{"id":26825200,"url":"https://github.com/chancehudson/async-express","last_synced_at":"2025-03-30T10:19:29.885Z","repository":{"id":77470133,"uuid":"177473336","full_name":"chancehudson/async-express","owner":"chancehudson","description":"Allow async/await syntax in Express routes and middleware","archived":false,"fork":false,"pushed_at":"2019-06-26T16:35:59.000Z","size":12,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-07-21T00:41:09.704Z","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/chancehudson.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2019-03-24T21:48:47.000Z","updated_at":"2024-07-21T00:41:17.551Z","dependencies_parsed_at":"2023-05-16T21:16:29.054Z","dependency_job_id":null,"html_url":"https://github.com/chancehudson/async-express","commit_stats":null,"previous_names":["chancehudson/async-express"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fasync-express","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fasync-express/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fasync-express/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chancehudson%2Fasync-express/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chancehudson","download_url":"https://codeload.github.com/chancehudson/async-express/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246302388,"owners_count":20755578,"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":[],"created_at":"2025-03-30T10:19:29.327Z","updated_at":"2025-03-30T10:19:29.871Z","avatar_url":"https://github.com/chancehudson.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# async-express\n\nSimple middleware wrapper to make Express handlers async compatible.\n\n## This package is likely unnecessary\n\nYou can pass an async function as an express route handler without a problem, just make sure to use `res` and `next` appropriately.\n\n## Usage\n\n`npm install --save async-express`\n\nIn a route\n\n```js\nconst express = require('express');\nconst asyncExpress = require('async-express');\n\nconst app = express();\n\n// As a route\napp.get('/', asyncExpress(async (req, res, next) =\u003e {\n  // Wait 5 seconds\n  await new Promise(r =\u003e setTimeout(r, 5000));\n  // Send a response\n  res.send('Waited 5 seconds successfully');\n}));\n```\n\nThe sample above can be refactored as the following\n\n```js\nconst express = require('express');\nconst asyncExpress = require('async-express');\n\nconst app = express();\n\nconst waitForABit = asyncExpress(async (req, res, next) =\u003e {\n  // Wait 5 seconds\n  await new Promise(r =\u003e setTimeout(r, 5000));\n  // Send a response\n  res.send('Waited 5 seconds successfully');\n});\n\napp.get('/', waitForABit);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchancehudson%2Fasync-express","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchancehudson%2Fasync-express","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchancehudson%2Fasync-express/lists"}