Skip to content

v0.0.1

Latest
Compare
Choose a tag to compare
@pacifiquem pacifiquem released this 09 Jan 17:28

Introducing node-async-handler v1.0.0 by MURANGWA Pacifique.

  • AsyncHandler middleware for easy error handling in ExpressJS.
  • Supports both ESM and CommonJS.
  • Simplifies code with automatic error forwarding.
// ESM
import pkg from 'node-async-handler';
const { asyncHandler } = pkg;

// CommonJS
const { asyncHandler } = require('node-async-handler');

express.get('/', asyncHandler(async (req, res, next) => {
  const result = await someAsyncFunction();
  res.json(result);
}));

🚀 Released under the MIT License.

Explore node-async-handler and enjoy streamlined async error handling in your Express projects!