Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

express-async-handler

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

express-async-handler - npm Package Compare versions

Comparing version 1.1.4 to 1.2.0

10

index.d.ts
import express = require('express');
import core = require('express-serve-static-core');
declare function expressAsyncHandler(handler: express.RequestHandler): express.RequestHandler;
declare function expressAsyncHandler<
P = core.ParamsDictionary,
ResBody = any,
ReqBody = any,
ReqQuery = core.Query,
>(handler: (...args: Parameters<express.RequestHandler<P, ResBody, ReqBody, ReqQuery>>) => void | Promise<void>):
express.RequestHandler<P, ResBody, ReqBody, ReqQuery>;
declare namespace expressAsyncHandler {

@@ -5,0 +13,0 @@

10

package.json
{
"name": "express-async-handler",
"version": "1.1.4",
"version": "1.2.0",
"description": "Express Error Handler for Async Functions",

@@ -25,7 +25,7 @@ "main": "index.js",

"@types/express": "*",
"chai": "^4.1.2",
"mocha": "^5.0.0",
"sinon": "^4.2.1",
"sinon-chai": "^2.14.0"
"chai": "^4.3.4",
"mocha": "^9.1.3",
"sinon": "^11.1.2",
"sinon-chai": "^3.7.0"
}
}

@@ -24,6 +24,18 @@ Simple middleware for handling exceptions inside of async express routes and passing them to your express error handlers.

Without express-async-handler
```javascript
express.get('/',(req, res, next) => {
foo.findAll()
.then ( bar => {
res.send(bar)
} )
.catch(next); // error passed on to the error handling route
})
```
#### Import in Typescript:
```javascript
import * as asyncHandler from 'express-async-handler'
import asyncHandler from "express-async-handler"
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc