Introduction
SpaceNode is a revolutionary, zero-dependency Node.js framework for building microservices and web applications. It rethinks everything about how Node.js frameworks work.
Philosophy — Convention over configuration. Auto-discovery over manual wiring. Pure functions over middleware chains. Zero dependencies over bloated node_modules.
What Makes It Different?
Unlike Express or Fastify, SpaceNode doesn't require you to manually wire routes, middleware, or services. You follow a simple folder convention, and the framework discovers everything automatically.
- Auto-Discovery — Drop a folder in
modules/, the framework finds routes, controllers, services, DTOs. Supports recursive module discovery.
- Pipeline Middleware — No
next() function. Each pipe is a pure function that returns data or throws errors.
- DI Container — Full lifecycle management: singleton, transient, scoped. Services from all modules injected automatically as the second handler argument.
- Event Bus — Inter-module communication without imports. Fully decoupled.
- Module Lifecycle —
onInit / onDestroy hooks for setup and teardown. Module isolation with namespaced services.
- Per-App Configuration — Per-app auth verifier (
app.setAuth()), per-app guards (app.addGuard()), pluggable rate limit store, custom body parsers.
- Static Files — LRU cache, ETag, 304 Not Modified, streaming for large files.
- SSR Template Engine — Built-in AOT-compiled template engine with layouts, partials, blocks, pipe filters, and auto-escaping. Full server-side rendering without external dependencies or build steps.
- WebSocket — Built-in with fragment assembly, ping/pong heartbeat, backpressure control, DI integration.
- Structured Logging — Pluggable logger with levels, timestamps, and custom transports.
- Graceful Shutdown — Automatic process signal handling (SIGTERM/SIGINT) with module cleanup.
- Watch Mode — Built-in
watch: true option for auto-restart on file changes during development. No nodemon needed.
- Zero Dependencies — The entire framework has 0 production dependencies. Just Node.js.
3 Lines to Launch
import { createApp } from 'SpaceNode'
const app = await createApp()
app.listen(3000)
That's a full working server. It auto-discovers all modules from the ./modules/ directory relative to your script.
Performance
- On par with Fastify 5 — matching throughput, zero dependencies
- 2× faster than Express 5 — half the latency, double the throughput
Benchmarked over 3 rounds × 30s at concurrency 50 for stable steady-state results. Proportions are hardware-independent.