A modern Node.js framework that makes backend development simple and fast
- Why Vegaa?
- Installation
- Quick Start
- Core Concepts
- Express Middleware Compatibility
- Middleware System
- Built-in Plugins
- Features
- Performance
- CLI & Templates
- Documentation
- Links & Resources
Vegaa makes Node.js backend development simpler without sacrificing performance.
In Express, you constantly repeat yourself:
app.get('/user/:id', (req, res) => {
const user = req.user // Extract from req
const id = req.params.id // Extract from params
res.json({ user, id }) // Manually send response
})Just declare what you need โ Vegaa handles the rest:
route('/user/:id').get((user, id) => ({ user, id }))No manual extraction. No req/res juggling. Just clean, readable code.
Need Express middleware? Use it seamlessly:
enableExpressCompat(vegaa)
vegaa.useExpressMiddleware(helmet())
route('/users/:id').get((id) => ({ userId: id })) // Still clean!Vegaa's DNA stays intact โ minimalism and context integration, with Express middleware support when you need it.
Get started instantly with pre-configured templates:
npx vegaa-cli create my-app
# or
npx vegaa create my-appChoose from 5 production-ready templates! See CLI section for details.
npm install vegaaRequirements: Node.js 18 or higher
๐ Full Getting Started Guide โ
Create your first API in under 30 seconds:
import { vegaa, route } from 'vegaa'
// Define a simple route
route('/ping').get(() => ({ message: 'pong' }))
// Start the server
await vegaa.startVegaaServer()Visit http://localhost:4000/ping and you'll see:
{
"message": "pong"
}That's it! You just built your first API endpoint.
๐ Learn more about Core Concepts โ
Vegaa automatically provides values based on parameter names:
// Route parameters are automatically available
route('/users/:id').get((id) => {
return { userId: id }
})
// Multiple parameters work too
route('/users/:userId/posts/:postId').get((userId, postId) => {
return { userId, postId }
})How it works: Vegaa reads your function parameters and injects the matching values automatically.
For routes with request bodies (POST, PUT, PATCH), Vegaa groups data to avoid naming conflicts:
route('/users/:id').post((params, body) => {
return {
userId: params.id, // Route parameter
userData: body // Request body
}
})paramsโ Route parameters (:id,:postId, etc.)bodyโ Request body dataqueryโ Query string parameters- Any middleware values you define
๐ Learn more about Middleware โ
Middleware is the heart of Vegaa โ it creates reusable logic that flows through your app.
Runs for all routes in your application:
// Authentication middleware
vegaa.middleware(async () => {
return { user: { id: 1, name: 'John' } }
})
// Logging middleware
vegaa.middleware((pathname) => {
console.log('Request:', pathname)
})
// Now ALL routes have access to 'user'
route('/profile').get((user) => {
return { message: `Welcome ${user.name}!` }
})Runs only for specific routes:
route('/admin/:id')
.middleware((params) => {
// Only runs for /admin/:id
if (params.id !== '1') {
throw new Error('Unauthorized')
}
return { access: 'granted' }
})
.get((params, access) => {
return { adminId: params.id, access }
})Middleware can build on each other โ values flow automatically:
vegaa.middleware([
async () => ({ user: { id: 1, name: 'Bob' } }),
async (user) => ({ greeting: `Hello ${user.name}` }),
async (user, greeting) => ({ log: `${greeting} [User ${user.id}]` })
])
route('/welcome')
.middleware(async (user, greeting) => ({ log: `${greeting} [User ${user.id}]` }))
.middleware(async (log) => ({ timestamp: new Date().toISOString() }))
.get((greeting, log, timestamp) => ({ greeting, log, timestamp }))Key Concept: Each middleware receives values from previous middleware automatically. Think of it as a pipeline where data flows downstream.
๐ Learn more about Plugins โ
Vegaa comes with powerful plugins that are loaded by default:
// These are automatically available:
// โ
jsonPlugin - JSON response helpers
// โ
bodyParserPlugin - Request body parsing
// โ
httpClientPlugin - makeRequest() for external APIsEnable cross-origin requests:
import { vegaa, corsPlugin } from 'vegaa'
await vegaa.plugin(corsPlugin)Serve HTML, CSS, JavaScript, images:
import { vegaa, staticPlugin } from 'vegaa'
await vegaa.plugin(staticPlugin, {
root: './public', // Folder with your files
prefix: '/assets', // URL prefix (optional)
cacheControl: 'public, max-age=3600'
})
// Files in ./public/ โ http://localhost:4000/assets/*const loggerPlugin = {
name: 'logger',
version: '1.0.0',
async register(app) {
app.middleware((pathname) => {
console.log('โ', pathname)
})
}
}
await vegaa.plugin(loggerPlugin)๐ Learn more about Express Compatibility โ
Use any Express middleware with Vegaa's minimal API โ no compromises:
import { vegaa, route, enableExpressCompat } from 'vegaa'
import helmet from 'helmet'
import cors from 'cors'
// Enable Express compatibility
enableExpressCompat(vegaa)
// Use Express middleware seamlessly
vegaa.useExpressMiddleware(helmet())
vegaa.useExpressMiddleware(cors())
vegaa.useExpressMiddleware('/api', someMiddleware)
// Your Vegaa routes work exactly as before
route('/users/:id').get((id) => ({ userId: id }))Key Benefits:
- โ Use existing Express middleware (helmet, cors, morgan, etc.)
- โ
Maintains Vegaa's minimal API โ no
req/resjuggling - โ Express middleware values flow into Vegaa context automatically
- โ Path-specific middleware support
- โ Error middleware automatically handled
Example with Real Express Middleware:
import { vegaa, route, enableExpressCompat } from 'vegaa'
import helmet from 'helmet'
import cors from 'cors'
import morgan from 'morgan'
enableExpressCompat(vegaa)
// Security headers
vegaa.useExpressMiddleware(helmet())
// CORS
vegaa.useExpressMiddleware(cors({ origin: 'https://example.com' }))
// Logging
vegaa.useExpressMiddleware(morgan('combined'))
// Your routes remain clean and minimal
route('/api/users').get(() => ({ users: [] }))Perfect for: Migrating from Express, using popular Express middleware, maintaining existing middleware investments.
route('/data').get(() => ({ status: 'success', data: [1, 2, 3] }))import { route, html } from 'vegaa'
route('/').get(() => html('<h1>Welcome!</h1>'))import { route, text } from 'vegaa'
route('/health').get(() => text('OK'))Built-in HTTP client powered by Undici:
route('/posts').get(async (makeRequest) => {
const data = await makeRequest()
.url('https://api.example.com/posts/1')
.get()
.json()
return data
})
// POST request
route('/create').post(async (makeRequest, body) => {
return await makeRequest()
.url('https://api.example.com/posts')
.post()
.headers({ 'Content-Type': 'application/json' })
.body(body)
.json()
})Available Methods: .get(), .post(), .put(), .delete(), .headers(), .body(), .json(), .text(), .buffer()
Add custom values available everywhere:
vegaa.decorate('version', '1.0.0')
vegaa.decorate('db', myDatabaseConnection)
route('/info').get((version) => ({ version }))Use all CPU cores automatically:
await vegaa.startVegaaServer({
port: 4000,
cluster: true // Enable multi-core mode
})Here's everything working together with route chaining:
import { vegaa, route, html } from 'vegaa'
// Global auth middleware
vegaa.middleware(async () => ({
user: { id: 1, name: 'Alice' }
}))
// Multiple routes with method chaining
route('/users/:id')
.get((id, user) => ({ viewerId: user.id, profileId: id }))
.post((params, body, user) => ({
created: true,
data: body,
authorId: user.id
}))
.delete((id) => ({ deleted: true, userId: id }))
// External API call
route('/external').get(async (makeRequest) => {
return await makeRequest()
.url('https://api.example.com/data')
.get()
.json()
})
// HTML page
route('/').get(() => html('<h1>Welcome to Vegaa!</h1>'))
await vegaa.startVegaaServer({ port: 4000 })Vegaa is built for speed while maintaining clean code.
Test Environment: MacBook M3, macOS 26, Node v24.3
Tool: autocannon -c 100 -d 300 http://localhost:4000/ping
| Framework | Requests/sec | Latency | Notes |
|---|---|---|---|
| Vegaa (Cluster) | 112,774 | 0.09ms | Multi-core |
| Vegaa (Single) | 91,488 | 0.97ms | Single-core |
| Fastify | 79,852 | 1.01ms | Industry standard |
| Express | 54,339 | 1.06ms | Most popular |
Express โโโโโโโโโโโโโโโโ 54k req/s
Fastify โโโโโโโโโโโโโโโโโโโโ 79k req/s
Vegaa โโโโโโโโโโโโโโโโโโโโโโโโ 91k req/s
Vegaa Cluster โโโโโโโโโโโโโโโโโโโโโโโโโโโโ 112k req/s
Result: Vegaa is 25-30% faster than Fastify and 2x faster than Express.
| Component | Technology | Purpose |
|---|---|---|
| HTTP Server | Node.js http |
Native, low-overhead |
| Routing | find-my-way |
Fast path matching |
| JSON | fast-json-stringify |
Optimized serialization |
| HTTP Client | undici |
High-performance requests |
| Scaling | Node.js cluster |
Multi-core support |
Vegaa CLI provides 5 production-ready templates to kickstart your project:
# Install globally
npm install -g vegaa-cli
# Create new project
vegaa create my-app
# or
npx vegaa-cli create my-app| Template | Description | Live Demos |
|---|---|---|
| ๐ฑ Minimal | Basic /ping server | StackBlitz โข CodeSandbox |
| ๐ง Middleware | Middleware + Dashboard demo | StackBlitz โข CodeSandbox |
| ๐ CRUD | JWT Auth + Swagger Docs | StackBlitz โข CodeSandbox |
| ๐๏ธ Full-Fledge | Production setup (monitoring, admin, etc.) | StackBlitz โข CodeSandbox |
| ๐ณ Docker | Containerized setup | StackBlitz โข CodeSandbox |
Try instantly: Launch on your preferred platform โ StackBlitz or CodeSandbox โ right in the browser, no installation needed!
cd my-app
npm install
npm start # Start development server
npm run build # Build for productionroute('/path')
.get(handler)
.post(handler)
.put(handler)
.delete(handler)vegaa.middleware(middlewareFn) // Global
route('/path').middleware(middlewareFn) // Route-specificimport { enableExpressCompat } from 'vegaa'
enableExpressCompat(vegaa)
vegaa.useExpressMiddleware(middleware) // Global
vegaa.useExpressMiddleware('/path', middleware) // Path-specificawait vegaa.startVegaaServer({
port: 4000,
cluster: false
})| Phase | Features | Status |
|---|---|---|
| Core Engine | Context, cluster, plugins | โ Complete |
| Dev Tools | CLI, validation, caching | ๐ง In Progress |
| Advanced | WebSockets, Redis, Streaming | ๐ง Planned |
Contributions welcome! Fork the repo, make changes, and submit a PR.
Need help with: Documentation, bug fixes, performance improvements, new plugins
Open an Issue | View Contributing Guide
Sunny Ghodeswar Senior Full-Stack Developer โข Pune, India ๐ฎ๐ณ
MIT License โ Free for personal and commercial use
๐ Visit the Full Documentation Website โ
The documentation includes:
- ๐ Getting Started Guide
- ๐ก Core Concepts & Examples
- ๐ง Complete API Reference
- ๐ฏ Interactive Examples with Stackblitz
- ๐ Advanced Features & Best Practices
- โญ GitHub Repository - Star us!
- ๐ฆ npm Package - Install Vegaa
- ๐ Documentation Website - Full documentation with examples
- ๐งฐ CLI Tool - Project templates
- ๐ Report Issues - Bug reports & features
โก Vegaa โ Named for velocity. Engineered for developers.
Built with โค๏ธ by developers, for developers.
Get Started | Documentation | View Templates | Star on GitHub โญ
