# nerio-io-client

> Web socket-io client

Latest version **1.1.4** (published 2022-07-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install nerio-io-client
pnpm add nerio-io-client
yarn add nerio-io-client
bun add nerio-io-client
```

## Health

**Score 25/100 (F)** — status: abandoned.

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.4 |
| Published | 2022-07-07 |
| First published | 2018-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 318.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | CaoJiayuan |
| Maintainers | cjy632258 |
| Keywords | socket-io, js |

## Links

- npm: https://www.npmjs.com/package/nerio-io-client
- npm.io page: https://npm.io/package/nerio-io-client

## Dependencies (1)

- [socket.io-client](https://npm.io/package/socket.io-client.md) 1.4

## Alternatives

- [@mapbox/jsonlint-lines-primitives](https://npm.io/package/@mapbox/jsonlint-lines-primitives.md) — 5.3M weekly downloads
- [reftools](https://npm.io/package/reftools.md) — 3.5M weekly downloads
- [@hey-api/openapi-ts](https://npm.io/package/@hey-api/openapi-ts.md) — 3.5M weekly downloads
- [@mapbox/geojson-rewind](https://npm.io/package/@mapbox/geojson-rewind.md) — 2.4M weekly downloads
- [turbo-stream](https://npm.io/package/turbo-stream.md) — 1.7M weekly downloads

## Recent versions

- 1.1.4 (latest) — 2022-07-07
- 1.1.3 — 2021-07-21
- 1.1.2 — 2021-07-21
- 1.1.1 — 2019-09-15
- 1.1.0 — 2019-07-19
- 1.0.8 — 2018-08-29
- 1.0.7 — 2018-08-28
- 1.0.6 — 2018-08-28
- 1.0.5 — 2018-08-28
- 1.0.4 — 2018-08-28
- 1.0.3 — 2018-08-28
- 1.0.2 — 2018-08-28
- 1.0.1 — 2018-08-27
- 1.0.0 — 2018-05-31

## README

# Io-client

![npm](https://img.shields.io/npm/v/nerio-io-client.svg) [![](https://data.jsdelivr.com/v1/package/npm/nerio-io-client/badge)](https://www.jsdelivr.com/package/npm/nerio-io-client)

A websocket client base on [socket.io-client](https://github.com/socketio/socket.io-client), working with [io-server](https://github.com/CaoJiayuan/io-server)

## install
```npm i nerio-io-client -S```
## CDN

```<script src="https://cdn.jsdelivr.net/npm/nerio-io-client/dist/messenger.js"></script>```

## Usage

### initialize instance

```ecmascript 6
import Client from 'nerio-io-client'

const client = new Client(url, [socketIoOptions, autoCreate])
// const client = new Messenger(url, [socketIoOptions, autoCreate]) // using cdn
```

### subscribe channel 

```ecmascript 6
client.subscribe('message')
client.subscribe(['message', 'client-1'])
```

### select channel and broadcast
```ecmascript 6
let channel = client.select('message')
// let channel = client.select(['message', 'client-1'])
channel.broadcast('event-1', {
    payload: 'foo'
})

channel.broadcast({ // default event is: message
    payload: 'foo'
})

```

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