express-api-responses
v1.0.0
Published
A clean, consistent, and developer-friendly response helper for Express.js applications.
Maintainers
Readme
express-api-responses
A professional and lightweight utility for sending standardized JSON responses in Express.js applications.
🚀 Installation
npm install express-api-responses
yarn add express-api-responses
| Function | HTTP Code | Description |
| ----------------------------- | --------- | -------------------------- |
| `successResponse` | 200 | Success response |
| `createdResponse` | 201 | Resource created |
| `noContentResponse` | 204 | No content |
| `badRequestResponse` | 400 | Validation or client error |
| `unauthorizedResponse` | 401 | Unauthorized request |
| `forbiddenResponse` | 403 | Forbidden resource |
| `notFoundResponse` | 404 | Resource not found |
| `conflictResponse` | 409 | Conflict error |
| `unprocessableEntityResponse` | 422 | Validation errors |
| `serverErrorResponse` | 500 | Server error |
| `customResponse` | any | Custom response |