express-async-handler
Advanced tools
Comparing version 1.1.4 to 1.2.0
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 @@ |
{ | ||
"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" | ||
``` |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
101
41
4807
6