mcpField
W
wooksjs

wooksjs

github.com/wooksjsDevelopment043 installsUpdated 1w ago
Repository

About wooksjs

wooksjs is a typed, composable framework for building Node.js applications across HTTP, CLI, WebSocket, and workflow adapters. It propagates event context through AsyncLocalStorage, so composables can access request and event data without `req`/`res` parameters or middleware chains.

Key features

  1. 01Typed composable API
  2. 02Propagates event context with AsyncLocalStorage
  3. 03Adapters for HTTP, CLI, WebSocket, and workflows
  4. 04Standalone WebSocket client
  5. 05HTTP body, static-file, and proxy utilities

Use cases

  1. 01Build Node.js HTTP routes and services
  2. 02Develop command-line applications
  3. 03Implement WebSocket servers or clients
  4. 04Orchestrate workflows with HTTP outlets

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/wooksjs/wooksjs --skill wooksjs

After installing, type/wooksjsin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

references/
event-cli.md
event-core.md
event-http.md
event-wf.md
event-ws.md
http-body.md
http-proxy.md
http-request.md
http-response.md
http-static.md
router.md
wf-advanced.md
wf-outlets.md
ws-client.md

Details

From the project README

wooksjs

Typed composable framework for Node.js. Every piece of request/event data is accessed through composable functions — no req/res parameters, no middleware chains. Adapters: HTTP, CLI, WebSocket, Workflows. Plus a standalone WebSocket client.

Install

PackageInstallPeer notes
@wooksjs/event-httpnpm i wooks @wooksjs/event-http—
@wooksjs/event-clinpm i wooks @wooksjs/event-cli—
@wooksjs/event-wsnpm i wooks @wooksjs/event-ws wsws ^8.0.0 required
@wooksjs/event-wfnpm i wooks @wooksjs/event-wfoptional peers @wooksjs/event-http + @wooksjs/http-body (HTTP outlets)
@wooksjs/http-bodynpm i @wooksjs/http-bodypeers @wooksjs/event-core, @wooksjs/event-http
@wooksjs/http-staticnpm i @wooksjs/http-staticpeer @wooksjs/event-http
@wooksjs/http-proxynpm i @wooksjs/http-proxypeer @wooksjs/event-http
@wooksjs/ws-clientnpm i @wooksjs/ws-clientws optional — Node only; browsers use native WebSocket
Dependency map
event-core  <-  wooks  <-  adapters: event-http, event-cli, event-ws, event-wf
                           event-http  <-  utilities: http-body, http-static, http-proxy

ws-client: standalone (no event-core dependency)
  • Utilities peer-depend on event-http specifically (http-body also on event-core).
  • event-wf has optional peers @wooksjs/event-http + @wooksjs/http-body — install both when using HTTP outlets.

Architecture

All public API is composables created with defineWook, cached per EventContext — a typed slot container (key/cached/cachedBy/slot) propagated via AsyncLocalStorage; call current() to get it anywhere without parameter passing. Parent context chains let nested events (HTTP → workflow, HTTP → WS upgrade) read parent slots. Details: event-core.md.

Quick start

import { createHttpApp, useRouteParams } from '@wooksjs/event-http'

const app = createHttpApp()
app.get('/hello/:name', () => `Hello, ${useRouteParams().get('name')}!`)
app.listen(3000)

Most reference files end with a Rules & Gotchas table — read it before writing code.

Key imports

// event-core — context engine, custom adapters
import { key, cached, cachedBy, slot, defineEventKind, defineWook,
  EventContext, run, current, tryGetCurrent, createEventContext,
  useRouteParams, useEventId, useLogger, routeParamsKey, eventTypeKey,
  ContextInjector, getContextInjector, replaceContextInjector, resetContextInjector } from '@wooksjs/event-core'

// event-http — HTTP server + request/response composables
import { createHttpApp, useRequest, useResponse, useHeaders, useCookies,
  useUrlParams, useAuthorization, useAccept, HttpError,
  prepareTestHttpContext, DEFAULT_FORWARD_HEADERS } from '@wooksjs/event-http'

// http-body — parsed request bodies (JSON, form-data, urlencoded)
import { useBody } from '@wooksjs/http-body'

// http-static — file serving
import { serveFile } from '@wooksjs/http-static'

// http-proxy — reverse proxy
import { useProxy } from '@wooksjs/http-proxy'

// event-cli — command-line apps
import { createCliApp, useCliOptions, useCliOption,
  useCliHelp, useAutoHelp, useCommandLookupHelp } from '@wooksjs/event-cli'

// event-ws — WebSocket server
import { createWsApp, useWsConnection, useWsMessage, useWsRooms, useWsServer,
  currentConnection, prepareTestWsConnectionContext, prepareTestWsMessageContext } from '@wooksjs/event-ws'

// event-wf — workflows
import { createWfApp, useWfState, StepRetriableError } from '@wooksjs/event-wf'

// ws-client — standalone WS client (browser + Node)
import { createWsClient } from '@wooksjs/ws-client'

References

Read the reference file that matches the task. Do not load all files — only what is needed.

DomainFileLoad when...
Routingrouter.mdRoute patterns, params, wildcards, regex, path builders, config
Context engineevent-core.mdWorking with slots, composables, EventContext, custom adapters
HTTP core/routingevent-http.mdCreating HTTP apps, routing, server lifecycle, security headers
HTTP requesthttp-request.mdReading headers, cookies, query params, raw body, authorization
HTTP responsehttp-response.mdStatus, headers, cookies, cache, errors, streaming, testing
Body parsinghttp-body.mdParsing request bodies (useBody): JSON, form-data, urlencoded types
Static fileshttp-static.mdServing files/directories (serveFile), ranges, cache headers
HTTP proxyhttp-proxy.mdProxying/forwarding requests, header/cookie filtering, allowedHosts
CLI appsevent-cli.mdBuilding CLI tools, command routing, options, help system
WebSocket serverevent-ws.mdWS server, rooms, broadcasting, message routing, wire protocol
Workflow coreevent-wf.mdSteps, flows, schema syntax, pause/resume, useWfState
Workflow outletswf-outlets.mdHTTP/email delivery, state strategies, tokens, trigger handler
Workflow advancedwf-advanced.mdParent context, spies, error handling, testing
WS clientws-client.mdBrowser/Node WS client, RPC, subscriptions, reconnection

Cross-cutting pointers

See also

Comments

Markdown supported