{"id":15296004,"url":"https://github.com/chrisvilches/parallel-express-middleware","last_synced_at":"2026-04-09T16:36:50.506Z","repository":{"id":57318818,"uuid":"380778169","full_name":"ChrisVilches/parallel-express-middleware","owner":"ChrisVilches","description":"Utility that assembles multiple Express middlewares into a new middleware, and executes them in parallel.","archived":false,"fork":false,"pushed_at":"2021-06-27T17:06:34.000Z","size":35,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-18T11:11:28.198Z","etag":null,"topics":["async-await","express","expressjs","middleware","node","nodejs","npm","npm-package","parallel"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/parallel-express-middleware","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/ChrisVilches.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}},"created_at":"2021-06-27T15:44:56.000Z","updated_at":"2021-09-06T18:16:02.000Z","dependencies_parsed_at":"2022-08-25T20:41:23.260Z","dependency_job_id":null,"html_url":"https://github.com/ChrisVilches/parallel-express-middleware","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisVilches%2Fparallel-express-middleware","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisVilches%2Fparallel-express-middleware/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisVilches%2Fparallel-express-middleware/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ChrisVilches%2Fparallel-express-middleware/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ChrisVilches","download_url":"https://codeload.github.com/ChrisVilches/parallel-express-middleware/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245407755,"owners_count":20610232,"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","expressjs","middleware","node","nodejs","npm","npm-package","parallel"],"created_at":"2024-09-30T18:08:56.276Z","updated_at":"2026-04-09T16:36:50.411Z","avatar_url":"https://github.com/ChrisVilches.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Parallel Express Middleware\n\nUtility that assembles multiple Express middlewares into a new middleware, and executes them in parallel.\n\n## Install\n\n```bash\nnpm install parallel-express-middleware --save\n```\n\n## Usage\n\n```javascript\nconst parallel = require('parallel-express-middleware');\n\nconst getUsers = async (req, res, next) =\u003e {\n  res.locals.users = await User.all();\n  next();\n}\n\nconst getArticles = async (req, res, next) =\u003e {\n  res.locals.articles = await Article.all();\n  next();\n}\n\nrouter.get('/', parallel(getUsers, getArticles), (req, res) =\u003e {\n  // Success\n  res.render('index');\n}, (err, req, res, next) =\u003e {\n  // Error happened\n  res.send('Error!');\n});\n```\n\n## Warnings\n\nA few things must be kept in mind when using this utility.\n\n1. Rendering functions like `render`, or `json` will be disabled and will throw an error when attempted to be used inside middlewares created using `parallel`.\n2. Any exception (runtime error) that occurs inside the middlewares will execute the `next()` using the exception raised as its argument.\n3. The resulting middleware generated by `parallel` will execute `next()` with an error argument as soon as any middleware calls `next()` with an error argument.\n4. Order of execution is unknown. Only middlewares that don't depend on each other should be used. Don't use middlewares that modify the same data in `res.locals`, or a middleware that needs data created by another middleware being executed in parallel.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisvilches%2Fparallel-express-middleware","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchrisvilches%2Fparallel-express-middleware","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchrisvilches%2Fparallel-express-middleware/lists"}