@dvpnt/express-async-patch
v1.0.0
Published
simple express monkey patch for async handlers support
Downloads
1
Readme
@dvpnt/express-async-patch
Simple express monkey patch for async handlers support.
Installation
$ npm install @dvpnt/express-async-patch
Usage
require('@dvpnt/express-async-patch');
const express = require('express');
const app = express();
app.get('/', async () => {
await Promise.reject(new Error('async error'));
});
app.use((err, req, res, next) => {
console.log(err.message); // async error
res.json({error: err.message});
});