1.0.0 • Published 10 months ago

asyncfunctionhandler v1.0.0

Weekly downloads
-
License
ISC
Repository
-
Last release
10 months ago

What is this?

A package which handles the asynchronous function and acts as a middleware.

Installation

Run npm i asyncfunctionhandler

Use

import asyncHandler from "asyncfunctionhandler";

router.get("/", asyncHandler(async (req, res) => {
    const data = await Data.find();
    res.send(data);
}))

Parameters

This implementation of asyncHandler can be used as middleware in your Express routes to handle asynchronous functions and simplify error handling.

1.0.0

10 months ago