You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
> The next-generation HTTP error system for JavaScript & TypeScript — designed for modern DX, structured observability, and future-proof error handling.
4
+
5
+
---
6
+
7
+
## ⚡ Why http-errors-plus?
8
+
9
+
`http-errors` served us well — but it’s stuck in a CommonJS world with stringly-typed messages and zero structure and inspired me to do this.
10
+
11
+
**http-errors-plus** gives you:
12
+
13
+
✅ Fully ESM-ready and works in both JS and TS
14
+
✅ Named constants like `NOT_FOUND`, `BAD_REQUEST`, etc.
15
+
✅ Overrideable metadata: `detail`, `path`, `traceId`, `requestId`, etc.
16
+
✅ Drop-in `generateError()` utility
17
+
✅ Strong IntelliSense via JSDoc
18
+
✅ `HttpError` class with `.toJSON()` and APM-ready structure
19
+
20
+
---
21
+
22
+
## 🚀 Installation
23
+
24
+
```bash
25
+
yarn add http-errors-plus
26
+
```
27
+
28
+
---
29
+
30
+
## 🧑💻 Usage
31
+
32
+
### Import and Use Named Constants
33
+
```js
34
+
import { BASE_HTTP_ERRORS, generateError } from 'http-errors-plus';
0 commit comments