{"id":20994516,"url":"https://github.com/loulafripouille/asyncable","last_synced_at":"2026-04-04T16:35:15.015Z","repository":{"id":42205986,"uuid":"126194727","full_name":"loulafripouille/asyncable","owner":"loulafripouille","description":"Wrap async/await middleware function for Express. Catches error and passes it to next.","archived":false,"fork":false,"pushed_at":"2023-01-06T01:52:51.000Z","size":792,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-20T08:49:49.568Z","etag":null,"topics":["async-await","express","middleware","nodejs"],"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/loulafripouille.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":"2018-03-21T14:51:05.000Z","updated_at":"2021-04-12T10:32:31.000Z","dependencies_parsed_at":"2023-02-05T02:02:10.715Z","dependency_job_id":null,"html_url":"https://github.com/loulafripouille/asyncable","commit_stats":null,"previous_names":["laudeon/asyncable"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loulafripouille%2Fasyncable","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loulafripouille%2Fasyncable/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loulafripouille%2Fasyncable/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/loulafripouille%2Fasyncable/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/loulafripouille","download_url":"https://codeload.github.com/loulafripouille/asyncable/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243410230,"owners_count":20286387,"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-await","express","middleware","nodejs"],"created_at":"2024-11-19T07:18:39.953Z","updated_at":"2025-12-29T16:10:18.852Z","avatar_url":"https://github.com/loulafripouille.png","language":"JavaScript","readme":"# express-asyncable\nWraps async/await Express middlewares. Catches error and passes it to next.  \nAvoid wrinting try/catch in your middlewares.\n\n[![Build Status](https://travis-ci.org/laudeon/asyncable.svg?branch=master)](https://travis-ci.org/laudeon/asyncable)\n[![npm version](https://badge.fury.io/js/express-asyncable.svg)](https://badge.fury.io/js/express-asyncable)\n\n## Why?\nDRY when catching errors from asyn/await Express middlewares. \n  \nThis module exposes a wrapper for param middleware as well, which is using a different signature `(req, res, next, value)`.\n\n## API\n\n### .middleware(function)\n\nWhere `function` returns a promise and accepts `req`, `res`, `next` arguments.\n\n### .paramMiddleware(function)\n\nWhere `function` returns a promise and accepts `req`, `res`, `next` and `value` arguments.\n\n## Usage example\n\n```js\nimport { middleware, paramMiddleware } from \"asyncable\"\n// const { middleware, paramMiddleware } = require('asyncable')\n// ...\n\nrouter.param('userId', paramMiddleware(model.findObject.bind(model)))\n\nrouter.route('/')\n  .get(\n    // ACL middleware or whatever before for instance...\n    middleware(userController.list.bind(userController))\n  )\n  .post(\n    // ACL middleware or whatever before for instance...\n    middleware(userController.add.bind(userController))\n  )\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floulafripouille%2Fasyncable","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Floulafripouille%2Fasyncable","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Floulafripouille%2Fasyncable/lists"}