3.1.6 • Published 3 years ago

async-wrapper-express-ts v3.1.6

Weekly downloads
17
License
MIT
Repository
github
Last release
3 years ago

Build Status Coverage Status

async-wrapper-express-ts

A simple function for Typescript sources to wrap async Express route

Wraps the express route in a function that passes the next method from the route to the promise's catch statement which allows the middleware to catch the exception.

This code was borrowed from the StrongLoop blog post on handling async/await routes in express. This npm module allows you to use this solution in the typescript sources.

Install

# With npm
npm install --save async-wrapper-express-ts

# With yarn
yarn add async-wrapper-express-ts

Usage

import asyncWrapper from 'asyncWrapper'
...
app.get('/foo', asyncWrapper(someAsyncRouteFunction))
3.1.3

3 years ago

3.1.6

3 years ago

3.1.5

3 years ago

3.1.4

3 years ago

3.1.1

5 years ago

3.1.0

5 years ago

3.0.0

5 years ago

2.0.0

5 years ago