Quick start
Install the core package, write a handler, and run a server. Ingenium targets Node 20+ and Bun 1.1+.
Install
npm install ingenium
Optional packages by use case:
# Bun.serve adapter
npm install ingenium ingenium-bun
# Express middleware compatibility (cors, helmet, etc.)
npm install ingenium ingenium-compat
# Project scaffolder
npm install -g ingenium-cli
ingenium new my-api
Requirements: Node 20+. Bun 1.1+ for the Bun adapter. WebSocket support requires installing
wsas a peer dep.
Your first server
import { ingenium } from 'ingenium'
const app = ingenium()
app.use(async (ctx, next) => {
const start = Date.now()
await next()
console.log(`${ctx.method} ${ctx.path} -> ${ctx._statusCode} ${Date.now() - start}ms`)
})
app.get('/', () => 'hello')
app.get('/users/:id', (ctx) => ({ id: ctx.params.id }))
app.post('/echo', async (ctx) => ctx.body.json())
const server = await app.listen(3000)
console.log(`listening on http://localhost:${server.port}`)
That's a full server. No res.send. No body-parser. No app.set('case sensitive routing', true). Return a value and Ingenium reflects it to the wire - object → JSON, string → text/html, Buffer → octet-stream, Readable → stream, undefined → 204. Call ctx.json(...) when you want explicit control over status or headers.
Scaffolding a new project
npm install -g ingenium-cli
ingenium new my-api # default template
ingenium new my-bun-api --bun # uses BunAdapter
ingenium new tiny --minimal # 10-line hello world
See the CLI reference for all flags.
Where to next?
- Migration from Express - port an existing Express app.
- Core concepts - App, Router, path syntax, composition timing.
- IngeniumContext - the typed
ctxsurface. - Middleware - the dispatch model and built-ins.