
Security News
CVE Volume Surges Past 48,000 in 2025 as WordPress Plugin Ecosystem Drives Growth
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.
express-async-handler
Advanced tools
Simple middleware for handling exceptions inside of async express routes and passing them to your express error handlers.
npm install --save express-async-handler
or
yarn add express-async-handler
const asyncHandler = require('express-async-handler')
express.get('/', asyncHandler(async (req, res, next) => {
const bar = await foo.findAll();
res.send(bar)
}))
Without express-async-handler
express.get('/',(req, res, next) => {
foo.findAll()
.then ( bar => {
res.send(bar)
} )
.catch(next); // error passed on to the error handling route
})
import asyncHandler from "express-async-handler"
async-express is another package that provides similar functionality by allowing you to use async/await in your Express route handlers. It automatically catches errors and passes them to the next middleware. Compared to express-async-handler, async-express offers a similar level of simplicity and ease of use.
express-promise-router is a drop-in replacement for Express's Router that allows you to use promises (including async/await) in your route handlers. It automatically handles rejected promises and passes errors to the next middleware. This package is more comprehensive as it replaces the entire Router, whereas express-async-handler is a middleware function.
FAQs
Express Error Handler for Async Functions
The npm package express-async-handler receives a total of 112,801 weekly downloads. As such, express-async-handler popularity was classified as popular.
We found that express-async-handler demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
CVE disclosures hit a record 48,185 in 2025, driven largely by vulnerabilities in third-party WordPress plugins.

Security News
Socket CEO Feross Aboukhadijeh joins Insecure Agents to discuss CVE remediation and why supply chain attacks require a different security approach.

Security News
Tailwind Labs laid off 75% of its engineering team after revenue dropped 80%, as LLMs redirect traffic away from documentation where developers discover paid products.