@altipla/express-async-handler
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

express-async-handler

Transform async handlers to use them in Express v4.

Install

npm install @altipla/express-async-handler

Usage

import express from 'express'
import type { Request, Response } from 'express'
import { asyncHandler } from '@altipla/express-async-handler'

async function exampleHandler(req: Request, res: Response) {
  await (...)
  return 'ok'
}

let app = express()
app.use('/example', asyncHandler(exampleHandler))

Dependencies (0)

    Dev Dependencies (3)

    Package Sidebar

    Install

    npm i @altipla/express-async-handler

    Weekly Downloads

    1

    Version

    0.1.0

    License

    MIT

    Unpacked Size

    3.02 kB

    Total Files

    5

    Last publish

    Collaborators

    • ernestoalejo