
Composables for Node.js
No req/res. No middleware. Just functions.

Composables for Node.js
No req/res. No middleware. Just functions.
Access request data through composables — lazy, cached, and available anywhere in the call stack.
HTTP, WebSocket, CLI, Workflows — the same composable pattern works everywhere. Learn once, use anywhere.
Body parsing, cookie reading, auth extraction — nothing runs until you call it. Zero cost for unused data.
Fully typed context slots, route params, and composable return values. Type safety through compile-time branding.
Regex constraints on params, multi-segment wildcards, indexed lookups. Faster than Express and Fastify.
defineWook() lets you create reusable, cached, typed composables — like building your own useAuth().
// Middleware chain + req/res threading
app.post('/users',
bodyParser.json(),
authenticate,
async (req, res) => {
res.status(201).json({ name: req.body.name })
}
)// Just call what you need
app.post('/users', async () => {
await useAuthorization()
const user = await useBody().parseBody<User>()
return { name: user.name } // status 201 is default for POST
})HTTP, WebSocket, CLI, Workflows — the same composable API everywhere. Learn once, use anywhere.
import { createHttpApp, useRouteParams } from '@wooksjs/event-http'
import { useBody } from '@wooksjs/http-body'
const app = createHttpApp()
app.post('/users/:org', async () => {
const { parseBody } = useBody()
const { get } = useRouteParams<{ org: string }>()
const user = await parseBody<{ name: string }>()
return { org: get('org'), created: user.name }
})
app.listen(3000)