# unws

> Unified WebSocket API for Node.js, Bun and modern browsers.

Latest version **0.3.2** (published 2025-05-10) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

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

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.3.2 |
| Published | 2025-05-10 |
| First published | 2023-04-19 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 3.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 32 |
| Author | 三咲智子 Kevin Deng |
| Maintainers | sxzz |

## Links

- npm: https://www.npmjs.com/package/unws
- Repository: https://github.com/sxzz/unws
- Homepage: https://github.com/sxzz/unws#readme
- Issues: https://github.com/sxzz/unws/issues
- Funding: https://github.com/sponsors/sxzz
- npm.io page: https://npm.io/package/unws

## Recent versions

- 0.3.2 (latest) — 2025-05-10
- 0.3.1 — 2025-03-09
- 0.3.0 — 2025-02-06
- 0.2.4 — 2023-08-01
- 0.2.3 — 2023-05-19
- 0.2.2 — 2023-04-19
- 0.2.1 — 2023-04-19
- 0.2.0 — 2023-04-19
- 0.1.1 — 2023-04-19
- 0.1.0 — 2023-04-19
- 0.0.0 — 2023-04-19

## README

# unws [![npm](https://img.shields.io/npm/v/unws.svg)](https://npmjs.com/package/unws)

[![Unit Test](https://github.com/sxzz/unws/actions/workflows/unit-test.yml/badge.svg)](https://github.com/sxzz/unws/actions/workflows/unit-test.yml)

Unified WebSocket API for Node.js, Bun and [modern browsers](https://caniuse.com/websockets).

## Install

```bash
npm i unws
```

## Usage

```ts
import { WebSocket } from 'unws'

const ws = new WebSocket('ws://localhost:8080')
```

> [!TIP]
> For Node.js v20.10.0 and above, the `WebSocket` global object is directly accessible without this package.
> See [here](https://nodejs.org/api/globals.html#websocket).

## Sponsors

<p align="center">
  <a href="https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg">
    <img src='https://cdn.jsdelivr.net/gh/sxzz/sponsors/sponsors.svg'/>
  </a>
</p>

## License

[MIT](./LICENSE) License © 2023-PRESENT [三咲智子](https://github.com/sxzz)

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