Skip to content

Commit 029fa58

Browse files
committed
contribution.md added and readme updated
1 parent 0b4c564 commit 029fa58

File tree

2 files changed

+57
-6
lines changed

2 files changed

+57
-6
lines changed

CONTRIBUTION.md

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Contributing to express-error-toolkit
2+
3+
Thanks for taking the time to contribute! 🎉
4+
5+
## How to Contribute
6+
7+
- 💡 Found a bug? Please [open an issue](https://github.com/dev-rashedin/express-error-toolkit/issues).
8+
- 🛠️ Want to suggest a new utility, error class, or fix a bug? Pull requests are welcome!
9+
- 📚 Found a documentation improvement? Feel free to edit `README.md` or related docs.
10+
11+
## Getting Started
12+
13+
1. Fork the repository
14+
2. Clone your fork:
15+
`git clone https://github.com/dev-rashedin/express-error-toolkit.git`
16+
3. Install dependencies:
17+
`npm install`
18+
4. Run the dev environment:
19+
`npm run dev`
20+
5. Run tests before pushing:
21+
`npm test`
22+
23+
## Coding Guidelines
24+
25+
- Use **TypeScript**
26+
- Follow the existing code style
27+
- Run `npm run check` before pushing (it builds + tests)
28+
29+
## Commit Messages
30+
31+
Please use [Conventional Commits](https://www.conventionalcommits.org/) format, such as:
32+
33+
feat: add ForbiddenError class
34+
fix: improve asyncHandler error propagation
35+
docs: update README usage example
36+
37+
38+
## Code of Conduct
39+
40+
By contributing, you agree to follow our [Code of Conduct](./CODE_OF_CONDUCT.md).

README.md

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# express-error-toolkit
22

3+
[![npm version](https://img.shields.io/npm/v/express-error-toolkit)](https://www.npmjs.com/package/express-error-toolkit)
4+
![typescript](https://badgen.net/badge/icon/typescript?icon=typescript&label)
5+
[![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)
7+
[![GitHub stars](https://img.shields.io/github/stars/dev-rashedin/express-error-toolkit?style=social)](https://github.com/dev-rashedin/express-error-toolkit/stargazers)
8+
![minified](https://badgen.net/bundlephobia/min/express-error-toolkit)
9+
![minified gzip](https://badgen.net/bundlephobia/minzip/express-error-toolkit)
10+
11+
👉 [View on npm](https://www.npmjs.com/package/express-error-toolkit)
12+
313
A lightweight, production-ready error handling toolkit for Express.js applications — written in TypeScript with full support for both CommonJS and ESM.
414

515
It provides:
@@ -93,19 +103,20 @@ In development mode (`NODE_ENV=development`), the error stack trace will be incl
93103
import { StatusCodes, getStatusMessage } from 'express-error-toolkit';
94104

95105
res.status(StatusCodes.BAD_REQUEST).json({
96-
message: getStatusMessage(StatusCodes.BAD_REQUEST)
106+
message: getStatusMessage(StatusCodes.BAD_REQUEST),
97107
});
98108
```
99109

100110
---
101111

102112
## 🔧 Custom Error Classes Available
103113

104-
| Error Class | Default Message | Status Code |
105-
|--------------------|------------------|-------------|
106-
| `NotFoundError` | "Not Found" | `404` |
107-
| `BadRequestError` | "Bad Request" | `400` |
108-
*(More to be added in future updates)*
114+
| Error Class | Default Message | Status Code |
115+
| ----------------- | --------------- | ----------- |
116+
| `NotFoundError` | "Not Found" | `404` |
117+
| `BadRequestError` | "Bad Request" | `400` |
118+
119+
_(More to be added in future updates)_
109120

110121
---
111122

0 commit comments

Comments
 (0)