Express Async Methods
Allow async functions on Express.IO. Only write the word Async
after of your methods.
Methods allowed
getAsync
postAsync
headAsync
deleteAsync
putAsync
useAsync
How to use
import '@jondotsoy/express-async-methods'
import express from 'express'
const app = express()
app.getAsync(async (req, res) => {
throw new Error('Fail 🍫!!!')
})
Why use it
@jondotsoy/express-async-methods
Whitout app.get(async (req, res, next) => {
try {
throw new Error('Fail 🍫!!!')
} catch (ex) {
next(ex)
}
})
@jondotsoy/express-async-methods
Whit app.getAsync(async (req, res) => {
throw new Error('Fail 🍫!!!')
})