2025-06-21 23:30:33 +03:00

63 lines
2.1 KiB
Markdown

# 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.unjs.io)
## Features
๐Ÿงฉ Seamlessly integrates with [Bun](https://crossws.unjs.io/adapters/bun), [Cloudflare Workers](https://crossws.unjs.io/adapters/cloudflare), [Deno](https://crossws.unjs.io/adapters/deno) and [Node.js](https://crossws.unjs.io/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.unjs.io/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/unjs/crossws/blob/main/LICENSE) license.
Made by [@pi0](https://github.com/pi0) and [community](https://github.com/unjs/crossws/graphs/contributors) ๐Ÿ’›
<br><br>
<a href="https://github.com/unjs/crossws/graphs/contributors">
<img src="https://contrib.rocks/image?repo=unjs/crossws" />
</a>
<!-- /automd -->
<!-- automd:with-automd -->
---
_๐Ÿค– auto updated with [automd](https://automd.unjs.io)_
<!-- /automd -->