# primus/primus

:zap: Primus, the creator god of the transformers & an abstraction layer for real-time to prevent module lock-in.

Repository: https://github.com/primus/primus
Canonical: https://ross.abutalabs.com/products/primus
Language: JavaScript
License: MIT
License Family: permissive
Topics: javascript, real-time, websocket, framework, sockjs, browserchannel, polling, http, nodejs, node
Last push: 2023-11-06T18:13:11+00:00

## Health v2 (maintenance only)
Score: 23/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 0, release rhythm 8, longevity 100
- inputs: {"age_days": 4817, "days_push": 1031, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 4469, forks 270 (observed 2026-08-28T04:08:50.927582+00:00)

## What it is
Primus is a Node.js abstraction layer over multiple real-time frameworks (WebSocket, SockJS, Engine.IO, BrowserChannel, polling) that exposes a single unified client/server API. It adds built-in reconnect with exponential back-off, offline detection, pluggable message encoders, and a stream-compatible interface so frameworks can be swapped by changing one line of code.

## Use cases
- add real-time messaging to a node.js app without locking into socket.io
- switch websocket frameworks without rewriting client and server code
- implement automatic reconnection with exponential back-off for live connections
- broadcast messages to connected clients over websockets
- use the same realtime client code in the browser and node.js
- encode realtime messages with a custom parser or binary format

## When to choose
- you want framework-agnostic real-time communication on Node.js with easy transformer swapping
- you need built-in reconnect, offline detection, and stability patches across transports
- you want a stream-compatible realtime interface and plugin system

## When to avoid
- you are happy with a single framework like socket.io and don't need abstraction
- you need a non-JavaScript backend language
- you require a project with frequent recent releases and active development

## Facets
- artifact type: library
- maturity: maintenance
- function: websocket, middleware, serialization, plugin-system
- domain: web-development, backend, developer-tools
- platform: browser, cross-platform
- tags: real-time, abstraction-layer, sockjs, engine-dot-io, browserchannel, polling, pubsub, reconnect, transformers, nodejs

## Member repositories
- primus/primus (main) score 23

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:08:50.927582+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T18:20:37.165088+00:00, confidence not recorded.
  - readme: https://github.com/primus/primus (fetched 2026-08-28T04:08:50.927582+00:00, sha 8d9e95bd34d3)
  - registry_npm: https://registry.npmjs.org/primus (fetched 2026-08-29T09:07:29.412419+00:00, sha 34bc888bb8e2)
- Data as of 2026-08-30T08:39:29.467469+00:00.
