π§° Simplify Your API Responses in Node.js with api-response-utility


Hey devs π
I just released my first NPM package called api-response-utility
, and I wanted to share it with you all. Itβs a small utility to help format your API responses β success, error, and pagination β in a clean, consistent way.
π§ Why I built it
In every backend project, I found myself writing the same response boilerplate:
{ success: true, message: "...", data: ... }
{ success: false, message: "Error message" }
So I packaged it into a utility you can reuse across projects.
π Features
Clean success and error responses
Built-in pagination support
Super simple API
Fully customizable
Lightweight (no dependencies)
How to use
npm install api-response-utility
const {success, error} = require('api-response-utility');
res.status(200).json(success({ userId: 123 }, "User retrieved successfully"));
res.status(500).json(error("Something went wrong", 500));
π¦ Links
I'd love your thoughts! Try it out, share feedback, and feel free to contribute if you're into open source. π
#NodeJS #NPM #JavaScript #OpenSource #B[ackend #ExpressJS #DevTools #API #CleanCode #WebDev
Subscribe to my newsletter
Read articles from Groot directly inside your inbox. Subscribe to the newsletter, and don't miss out.
Written by
