# crossws

> Cross-platform WebSocket Servers for Node.js, Deno, Bun and Cloudflare Workers

Latest version **0.4.12** (published 2026-08-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install crossws
pnpm add crossws
yarn add crossws
bun add crossws
```

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.4.12 |
| Published | 2026-08-20 |
| First published | 2023-12-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 212.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 731 |
| Maintainers | pi0 |

## Links

- npm: https://www.npmjs.com/package/crossws
- Repository: https://github.com/h3js/crossws
- Homepage: https://crossws.h3.dev
- Issues: https://github.com/h3js/crossws/issues
- npm.io page: https://npm.io/package/crossws

## Recent versions

- 0.4.12 (latest) — 2026-08-20
- 0.4.11 — 2026-08-20
- 0.4.10 — 2026-07-11
- 0.4.9 — 2026-07-03
- 0.4.8 — 2026-07-02
- 0.4.7 — 2026-06-30
- 0.4.6 — 2026-06-09
- 0.4.5 — 2026-04-10
- 0.4.4 — 2026-01-27
- 0.4.3 — 2026-01-19
- 0.4.2 — 2026-01-19
- 0.4.1 — 2025-05-23
- 0.4.0 — 2025-05-23
- 0.3.5 — 2025-05-07
- 0.3.4 — 2025-02-10
- … 15 more at https://npm.io/package/crossws/versions

## README

# crossws

<!-- automd:badges -->

[![npm version](https://flat.badgen.net/npm/v/crossws)](https://npmjs.com/package/crossws)
[![npm downloads](https://flat.badgen.net/npm/dm/crossws)](https://npmjs.com/package/crossws)

<!-- /automd -->

Elegant, typed, and simple toolkit to implement cross-platform WebSocket servers.

👉 [📖 documentation](https://crossws.h3.dev)

## Features

🧩 Seamlessly integrates with [Bun](https://crossws.h3.dev/adapters/bun), [Cloudflare Workers](https://crossws.h3.dev/adapters/cloudflare), [Deno](https://crossws.h3.dev/adapters/deno) and [Node.js](https://crossws.h3.dev/adapters/node) and any compatible web framework.

✅ Prebundled with [ws](https://github.com/websockets/ws) for Node.js support with alternative/much faster [uWebSockets](https://crossws.h3.dev/adapters/node#uwebsockets) adapter.

📦 Extremely lightweight and tree-shakable conditional ESM exports.

🚀 High-performance and simple hooks API, without per-connection callback creation.

🌟 Typed hooks API and developer-friendly object inspection.

[^1]: crossws supports Node.js via [npm:ws](https://github.com/websockets/ws) (prebundled) or [uWebSockets.js](https://github.com/uNetworking/uWebSockets.js).

## Contribution

<details>
  <summary>Local development</summary>

- Clone this repository
- Install the latest LTS version of [Node.js](https://nodejs.org/en/)
- Enable [Corepack](https://github.com/nodejs/corepack) using `corepack enable`
- Install dependencies using `pnpm install`
- Run examples using `pnpm play:` scripts

</details>

<!-- /automd -->

## License

<!-- automd:contributors license=MIT author="pi0" -->

Published under the [MIT](https://github.com/h3js/crossws/blob/main/LICENSE) license.
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/h3js/crossws/graphs/contributors) 💛
<br><br>
<a href="https://github.com/h3js/crossws/graphs/contributors">
<img src="https://contrib.rocks/image?repo=h3js/crossws" />
</a>

<!-- /automd -->

<!-- automd:with-automd -->

---

_🤖 auto updated with [automd](https://automd.unjs.io)_

<!-- /automd -->

---
_Source: https://npm.io/package/crossws · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
