Skip to content

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/nodeframe

Why 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

  1. Zero External Runtime Dependencies: Everything in NodeFrame runs on pure Node.js core APIs (http, buffer, url). When you install @harshitclub/nodeframe, your node_modules stays virtually weightless.

  2. Non-destructive Object Enhancement: Instead of wrapping Node.js request and response objects in bulky wrapper classes, NodeFrame directly enhances native IncomingMessage and ServerResponse instances with chainable, convenient helper methods (res.json(), res.status(), req.query, etc.).

  3. Explicit Execution Pipelines: Middlewares and error handlers execute sequentially through a deterministic next() pipeline with separated normal and error handling stages.

  4. Predictable Performance: Because there are no heavy internal abstractions, overhead is minimal and predictable.


Feature Comparison

CapabilityNodeFrameRaw http ModuleHeavy Frameworks
RoutingHTTP method & dynamic segment matchingManual URL parsing & if/elseFull regex / radix tree
Route Params:id extracted into req.paramsManual substring splittingParam extraction
Query ParamsParsed req.query via WHATWG URLManual URLSearchParamsParsed query string
JSON ParserBuilt-in streaming parseJsonBodyManual req.on('data') buffersExternal dependency (body-parser)
Cookie Settingres.cookie() with secure defaultsManual Set-Cookie header syntaxExternal dependency (cookie-parser)
Error HandlingIsolated 4-arg error middlewareUncaught exception crashesComplex error layers
Rate LimiterBuilt-in in-memory fixed windowMust implement yourselfExternal dependency (express-rate-limit)
Request LoggerBuilt-in logger() with durationMust implement yourselfExternal dependency (morgan)
Dependencies0 external dependencies0Dozens / Hundreds

What's Next?

Ready to build your first server? Jump to the Quick Start guide.