Decision record · server stack

swm-core or swm-uws for Node.js?

Short answer

Use swm-core for an application HTTP/WebSocket service: it adds routing, request contexts, body limits, timeouts, backpressure, and graceful shutdown. Use swm-uws only when you need a compatible low-level uWebSockets.js API and the team is prepared to own the entire server lifecycle.

4.1.1
swm-core
0.5.7
swm-uws
22 / 24
Node.js

Scope

This comparison fixes @swarmmachina/swm-core at 4.1.1 and @swarmmachina/swm-uws at 0.5.7 for Node.js 22/24. Both packages use MPL-2.0.

Server stack layer comparison

Criterionswm-coreswm-uws
LayerA ready HTTP/WebSocket server layer.A native V8 binding for the compatible non-TLS uWebSockets.js surface.
HTTPRoutes, before hooks, contexts, body parsing, CORS, and static helpers.App.get/post/any with direct request and response callback ownership.
WebSocketUpgrade contract, context, pub/sub, connectionKey, and managed termination.App.ws behavior and low-level WebSocket callbacks.
ResourcesBody budgets, async timeout, backpressure helpers, and context pools.Resource limits and policy belong to the application.
Shutdownshutdown(timeout) drains active work; close() terminates immediately.The team coordinates the listen socket, requests, and connections.
Ownership costMore ready contracts and less application infrastructure.Fewer abstractions but more lifecycle code and tests to own.

Choose from the task

  1. 01

    A normal production API or WebSocket gateway

    Start with swm-core

    Server limits and termination are already part of its contract.

  2. 02

    Porting an existing uWebSockets.js application

    Consider swm-uws

    It offers a compatible non-TLS API and an npm alias for uwebsockets.js.

  3. 03

    Building a custom framework layer

    Build on swm-uws

    Only when the team explicitly owns routing, safety, shutdown, and regression tests.

Checks before choosing

  • Both packages support only their documented Node.js and prebuilt platform matrix.
  • TLS terminates before the application; Alpine/musl is outside the current build matrix.
  • A lower-level API does not automatically reduce total system cost.

Primary sources

Contracts were checked against the README and package metadata for fixed releases.