Overview & Philosophy
NodeFrame is a lightweight, zero-dependency Node.js backend framework built on top of native Node.js core HTTP APIs (http.createServer, IncomingMessage, ServerResponse).
npm install @harshitclub/nodeframeWhy NodeFrame?
When building modern backend applications in JavaScript, developers frequently use frameworks like Express or Fastify without understanding the low-level machinery underneath.
NodeFrame was created with a clear objective: to build a clean, production-grade request/response lifecycle from first principles using Node.js core modules, without bloated abstractions or heavy dependency graphs.
Core Principles
Zero External Runtime Dependencies: Everything in NodeFrame runs on pure Node.js core APIs (
http,buffer,url). When you install@harshitclub/nodeframe, yournode_modulesstays virtually weightless.Non-destructive Object Enhancement: Instead of wrapping Node.js request and response objects in bulky wrapper classes, NodeFrame directly enhances native
IncomingMessageandServerResponseinstances with chainable, convenient helper methods (res.json(),res.status(),req.query, etc.).Explicit Execution Pipelines: Middlewares and error handlers execute sequentially through a deterministic
next()pipeline with separated normal and error handling stages.Predictable Performance: Because there are no heavy internal abstractions, overhead is minimal and predictable.
Feature Comparison
| Capability | NodeFrame | Raw http Module | Heavy Frameworks |
|---|---|---|---|
| Routing | HTTP method & dynamic segment matching | Manual URL parsing & if/else | Full regex / radix tree |
| Route Params | :id extracted into req.params | Manual substring splitting | Param extraction |
| Query Params | Parsed req.query via WHATWG URL | Manual URLSearchParams | Parsed query string |
| JSON Parser | Built-in streaming parseJsonBody | Manual req.on('data') buffers | External dependency (body-parser) |
| Cookie Setting | res.cookie() with secure defaults | Manual Set-Cookie header syntax | External dependency (cookie-parser) |
| Error Handling | Isolated 4-arg error middleware | Uncaught exception crashes | Complex error layers |
| Rate Limiter | Built-in in-memory fixed window | Must implement yourself | External dependency (express-rate-limit) |
| Request Logger | Built-in logger() with duration | Must implement yourself | External dependency (morgan) |
| Dependencies | 0 external dependencies | 0 | Dozens / Hundreds |
What's Next?
Ready to build your first server? Jump to the Quick Start guide.