# @delight-rpc/native-websocket

> ```sh npm install --save @delight-rpc/native-websocket # or yarn add @delight-rpc/native-websocket ```

Latest version **0.7.1** (published 2026-02-26) · MIT license · 0 weekly downloads

## Install

```sh
npm install @delight-rpc/native-websocket
pnpm add @delight-rpc/native-websocket
yarn add @delight-rpc/native-websocket
bun add @delight-rpc/native-websocket
```

## Health

**Score 60/100 (C)** — status: stable.

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

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.7.1 |
| Published | 2026-02-26 |
| First published | 2022-06-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=22 |
| Dependencies | 8 |
| Unpacked size | 26 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | BlackGlory |
| Maintainers | black_glory |

## Links

- npm: https://www.npmjs.com/package/@delight-rpc/native-websocket
- Repository: https://github.com/delight-rpc/native-websocket
- Homepage: https://github.com/delight-rpc/native-websocket#readme
- Issues: https://github.com/delight-rpc/native-websocket/issues
- npm.io page: https://npm.io/package/@delight-rpc/native-websocket

## Dependencies (8)

- [extra-abort](https://npm.io/package/extra-abort.md) ^0.4.1
- [extra-defer](https://npm.io/package/extra-defer.md) ^0.3.1
- [return-style](https://npm.io/package/return-style.md) ^4.0.0
- [extra-promise](https://npm.io/package/extra-promise.md) ^7.1.1
- [@blackglory/errors](https://npm.io/package/@blackglory/errors.md) ^3.1.0
- [@blackglory/prelude](https://npm.io/package/@blackglory/prelude.md) ^0.4.0
- [@delight-rpc/protocol](https://npm.io/package/@delight-rpc/protocol.md) ^4.1.1
- [@blackglory/structures](https://npm.io/package/@blackglory/structures.md) ^0.14.13

## Recent versions

- 0.7.1 (latest) — 2026-02-26
- 0.7.0 — 2026-02-25
- 0.6.5 — 2026-02-25
- 0.6.4 — 2026-02-12
- 0.6.3 — 2025-11-03
- 0.6.2 — 2023-06-11
- 0.6.1 — 2023-03-19
- 0.6.0 — 2023-03-19
- 0.5.1 — 2023-02-05
- 0.5.0 — 2022-12-16
- 0.4.5 — 2022-08-01
- 0.4.4 — 2022-06-22

## README

# @delight-rpc/native-websocket
## Install
```sh
npm install --save @delight-rpc/native-websocket
# or
yarn add @delight-rpc/native-websocket
```

## API
### createClient
```ts
function createClient<IAPI extends object>(
  socket: WebSocket
, options?: {
    parameterValidators?: DelightRPC.ParameterValidators<IAPI>
    expectedVersion?: string
    channel?: string
    timeout?: number
  }
): [client: DelightRPC.ClientProxy<IAPI>, close: () => void]
```

### createBatchClient
```ts
function createBatchClient(
  socket: WebSocket
, options?: {
    expectedVersion?: string
    channel?: string
    timeout?: number
  }
): [client: DelightRPC.BatchClient, close: () => void]
```

### createServer
```ts
function createServer<IAPI extends object>(
  api: DelightRPC.ImplementationOf<IAPI>
, socket: WebSocket
, options?: {
    parameterValidators?: DelightRPC.ParameterValidators<IAPI>
    version?: `${number}.${number}.${number}`
    channel?: string | RegExp | AnyChannel
    ownPropsOnly?: boolean
  }
): () => void
```

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