@jondotsoy/express-async-methods
v1.0.0
Published
Allow async functions on Express.IO. Only write the word `Async` after of your methods.
Downloads
2
Readme
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
Whitout @jondotsoy/express-async-methods
app.get(async (req, res, next) => {
try {
throw new Error('Fail 🍫!!!')
} catch (ex) {
next(ex)
}
})
Whit @jondotsoy/express-async-methods
app.getAsync(async (req, res) => {
throw new Error('Fail 🍫!!!')
})