express-error-toolkit — the One NPM Package to Handle All Express Errors
Rashedin | FullStack Developer

Rashedin | FullStack Developer @dev-rashedin

About: Full-stack JavaScript dev ⚡ Skilled in React, Node.js, TypeScript, Docker | Focused on clean code, performance & UX 🚀 Love building, breaking, debugging, optimizing and deploying real world apps

Location:
Rangpur, Bangladesh
Joined:
Feb 19, 2024

express-error-toolkit — the One NPM Package to Handle All Express Errors

Publish Date: Sep 30 '25
20 2

Error handling in Express has always been repetitive:

writing the same notFoundHandler, globalErrorHandler, asyncHandler, and custom error classes across every project.

Even with libraries like express-async-errors, you still end up wiring things manually — and none of them improve the DX in the terminal.

That’s why I built — 🔗 express-error-toolkit


✨ Core Features

  • ✅ Pre-built middleware: globalErrorHandler, notFoundHandler
  • ✅ Type-safe custom error classes (e.g. NotFoundError, BadRequestError)
  • ✅ Simple asyncHandler utility to avoid try-catch blocks
  • httpError() helper for one-liner errors
  • ✅ Colorful, readable console logs (no chalk needed)
  • ✅ Works with both CommonJS & ESM
  • ✅ Fully configurable (via .env or code)
  • ✅ Built with DX in mind

📖 Detailed guide, usage examples & console previews here:

➡️ Read the full article


If you find it useful, please consider giving it a ⭐ on GitHub 💙

🔗 GitHub Repo

Comments 2 total

  • dr
    drOct 1, 2025

    Just used this in one of my recent project. The colored logs is game changer. Great work due.

Add comment