ZingJS is a fast, file-based, middleware-friendly Node.js framework designed for simplicity, performance, and flexibility. It combines the best features of Express, Fastify, and Hono while keeping things minimal and dependency-free. Yes, you heard it rightβzero dependencies!
β
Zero Dependencies β No unnecessary bloat, just pure performance.
β
File-Based Routing β Organize routes effortlessly with a folder structure.
β
Middleware Support β Use custom middleware, just like Express.
β
Event-Driven Architecture β Efficient and modular event-based system.
β
Auto API Documentation β Extracts route information directly from comments.
β
Static File Serving β Easily serve assets like HTML, CSS, and images.
β
Customizable Logging & Rate Limiting β Full control over request logs & throttling.
npm install zingjs
Since ZingJS has zero dependencies, installation is blazing fast.
mkdir my-zing-app && cd my-zing-app
npm init -y
npm install zingjs
import ZingJS from "zingjs";
const app = new ZingJS({ enableDocs: true });
app.listen(3000, () => {
console.log("Server running on http://localhost:3000");
});
π Folder Structure
/routes
βββ index.js β GET /
βββ user.js β GET /user
βββ users/[id].js β GET /users/:id
π routes/users/[id].js
/**
* @route GET /users/:id
* @desc Fetch user details
* @params id - User ID
* @return { userId, name }
**/
export default {
GET: async (req) => {
return { userId: req.params.id, name: "John Doe" };
}
};
node index.js
Your API is now live at http://localhost:3000
!
ZingJS automatically generates API documentation from inline comments.
View API Docs at: http://localhost:3000/docs
Example:
{
"/users/:id": {
"get": {
"description": "Fetch user details",
"params": ["id - User ID"],
"return": "{ userId, name }",
"responses": {
"200": { "description": "Successful response" }
}
}
}
}
app.use((req, res, next) => {
console.log(`Incoming request: ${req.method} ${req.url}`);
next();
});
const app = new ZingJS({ serveStatic: true });
Place your static files inside public/
, and access them at /
.
app.on("userCreated", (data) => {
console.log("New user added:", data);
});
We welcome contributions! Feel free to fork the repository and submit a pull request.
ZingJS is released under the MIT License.
π Fast & Lightweight β Zero dependencies ensure minimal footprint.
π Easy to Use β Simple API design with file-based routing.
π§ Flexible & Extensible β Customize everything as per your needs.
π― Designed for Performance β Event-driven, optimized for speed.
Start building amazing APIs with ZingJS today! π