Gathering detailed insights and metrics for express-async-errors
Gathering detailed insights and metrics for express-async-errors
Gathering detailed insights and metrics for express-async-errors
Gathering detailed insights and metrics for express-async-errors
maestro-express-async-errors
A simple an secure layer of code for async middlewares.
express-async-await-errors
Add error handling for async routes on express
az-express-errors
Better way to deal with express error handling. The right way to deal with async errors
express-async-catch
Simple wrapper for Express route handlers, which propagates errors to the centralized error handler.
npm install express-async-errors
Typescript
Module System
Node Version
NPM Version
95.2
Supply Chain
84.9
Quality
73.1
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
NOASSERTION License
907 Stars
40 Commits
43 Forks
8 Watchers
5 Branches
5 Contributors
Updated on Jul 15, 2025
Latest Version
3.1.1
Package Id
express-async-errors@3.1.1
Size
17.59 kB
NPM Version
6.4.1
Node Version
10.10.0
Published on
Oct 12, 2018
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
1
A dead simple ES6 async/await support hack for ExpressJS
Shamelessly copied from express-yields
This has been lightly reworked to handle async rather than generators.
npm install express-async-errors --save
Then require this script somewhere before you start using it:
Async functions already work fine in Express.
1const express = require('express'); 2require('express-async-errors'); 3const User = require('./models/user'); 4const app = express(); 5 6app.get('/users', async (req, res) => { 7 const users = await User.findAll(); 8 res.send(users); 9});
This library is about what happens when you hit an error.
next
As we all know express sends a function called next
into the middleware, which
then needs to be called with or without error to make it move the request handling
to the next middleware. It still works, but in case of an async function, you
don't need to do that. If you want to pass an error, just throw a normal exception:
1app.use(async (req, res) => { 2 const user = await User.findByToken(req.get('authorization')); 3 4 if (!user) throw Error("access denied"); 5}); 6 7app.use((err, req, res, next) => { 8 if (err.message === 'access denied') { 9 res.status(403); 10 res.json({ error: err.message }); 11 } 12 13 next(err); 14});
This is a very minimalistic and unintrusive hack. Instead of patching all methods
on an express Router
, it wraps the Layer#handle
property in one place, leaving
all the rest of the express guts intact.
The idea is that you require the patch once and then use the 'express'
lib the
usual way in the rest of your application.
All code in this repository is released under the terms of the ISC license.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 4/22 approved changesets -- score normalized to 1
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
45 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-07-14
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More