Skip to content

Commit 65cc03b

Browse files
committed
changelog and readme updated
1 parent e42887a commit 65cc03b

File tree

3 files changed

+62
-5
lines changed

3 files changed

+62
-5
lines changed

CHANGELOG.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,30 @@ This project adheres to [Semantic Versioning](https://semver.org) and follows [C
55

66
---
77

8+
## [1.0.0](https://github.com/Rashedin-063/express-error-toolkit/releases/tag/1.0.0) – 2025-07-07
9+
10+
### ✨ Features
11+
12+
- ✅ Production-ready global error handler with optional stack trace
13+
- ✅ Ready-to-use `asyncHandler` for wrapping async route handlers
14+
- ✅ Built-in `notFoundHandler` middleware
15+
- ✅ Custom error classes:
16+
- `BadRequestError`
17+
- `NotFoundError`
18+
- `ForbiddenError`
19+
- `UnauthenticatedError`
20+
- `ConflictError`
21+
- `ValidationError`
22+
- `TooManyRequestsError`
23+
-`httpError()` factory for creating custom errors dynamically
24+
-`isCustomAPIError()` type guard
25+
- ✅ Optional `errorDetails` support (string or object) across all error types
26+
- ✅ Full TypeScript support
27+
- ✅ Supports both CommonJS and ESM
28+
- ✅ Includes re-exports from `http-status-toolkit`
29+
30+
---
31+
832
## [0.1.0-beta.1](https://github.com/Rashedin-063/express-error-toolkit/releases/tag/0.1.0-beta.1) – 2025-07-05
933

10-
- Initial Publish
34+
- Initial beta release

README.md

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
[![npm version](https://img.shields.io/npm/v/express-error-toolkit)](https://www.npmjs.com/package/express-error-toolkit)
44
![typescript](https://badgen.net/badge/icon/typescript?icon=typescript&label)
55
[![license](https://img.shields.io/npm/l/express-error-toolkit)](https://github.com/dev-rashedin/express-error-toolkit/blob/main/LICENSE)
6-
[![downloads](https://img.shields.io/npm/dw/express-error-toolkit)](https://www.npmjs.com/package/express-error-toolkit)
76
[![GitHub stars](https://img.shields.io/github/stars/dev-rashedin/express-error-toolkit?style=social)](https://github.com/dev-rashedin/express-error-toolkit/stargazers)
87
![minified](https://badgen.net/bundlephobia/min/express-error-toolkit)
98
![minified gzip](https://badgen.net/bundlephobia/minzip/express-error-toolkit)
@@ -36,12 +35,30 @@ It provides:
3635

3736
---
3837

39-
## 📦 Installation
38+
# 🚀 Installation Guide
39+
40+
You can install **express-error-toolkit** using your favorite package manager.
41+
42+
## Using npm
4043

4144
```bash
4245
npm install express-error-toolkit
4346
```
4447

48+
## Using yarn
49+
50+
```bash
51+
yarn add express-error-toolkit
52+
```
53+
54+
## Using pnpm
55+
56+
```bash
57+
pnpm add express-error-toolkit
58+
```
59+
60+
> ℹ️ Make sure you have `express` installed in your project, as this toolkit is built specifically to enhance Express.js error handling.
61+
4562
---
4663

4764
## 📁 Usage
@@ -75,7 +92,15 @@ app.get('/test', (req, res) => {
7592
});
7693
```
7794

78-
Each custom error sets the correct `statusCode` and `name` automatically.
95+
Each custom error automatically sets the correct `statusCode` and `name`.
96+
97+
You can also pass optional `errorDetails` as a string, object, or leave it out:
98+
99+
```ts
100+
throw new BadRequestError('Invalid data', { field: 'email' });
101+
throw new BadRequestError('Invalid input', 'Missing required field');
102+
throw new BadRequestError('Generic client error');
103+
```
79104

80105
---
81106

@@ -111,6 +136,14 @@ import { httpError } from 'express-error-toolkit';
111136
throw httpError('Something custom', 418);
112137
```
113138

139+
You can also pass optional `errorDetails` as a string, object, or leave it out:
140+
141+
```ts
142+
throw new BadRequestError('Invalid data', { field: 'email' });
143+
throw new BadRequestError('Invalid input', 'Missing required field');
144+
throw new BadRequestError('Generic client error');
145+
```
146+
114147
---
115148

116149
### 6. **isCustomAPIError()**: Type guard for checking error type

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "express-error-toolkit",
3-
"version": "0.1.0-beta.1",
3+
"version": "1.0.0",
44
"description": "A lightweight and developer-friendly toolkit for robust error handling in Express.js applications.\nIncludes ready-to-use custom error classes, an async route error handler wrapper, a global error handler middleware, and a convenient 'not found' route handler.\nDesigned to simplify error management, reduce boilerplate, and improve app reliability — all with TypeScript support and easy integration.",
55
"author": "Rashedin Islam <[email protected]>",
66
"license": "MIT",

0 commit comments

Comments
 (0)