Files
crossws/docs/1.guide/1.index.md
Pooya Parsa 48f0caad64 docs: migrate to unjs-docs structure v2 (#13)
* docs: migrate to unjs-docs structure v2

* update to stable
2024-02-01 18:53:16 +01:00

1.1 KiB

Getting Started

CrossWS provides a cross-platform API to define well-typed WebSocket apps that can then be integrated into various WebSocket servers using built-in adapters.

Writing a realtime WebSocket server that can work in different javascript and WebSocket runtimes is challenging because there is no single standard for WebSocket servers. You often need to go into many details of diffrent API implementations and it also makes switching from one runtime costly. CrossWS is a solution to this!

Play Online

You can quickly try CrossWS online with unjs/h3 and unjs/listhen:

::callout{to="https://stackblitz.com/github/unjs/crossws/tree/main/examples/h3?file=app.ts"} Play online in Stackblitz ::

Installing Package

You can install crossws from npm:

::code-group

```sh [auto]
npx nypm i crossws
```

```sh [npm]
npm install crossws
```

```sh [Yarn]
yarn add crossws
```

```sh [pnpm]
pnpm add crossws
```

```sh [bun]
bun add crossws
```

::