# colyseus-client

> Wrapper to communicate with [colyseus](https://github.com/gamestdio/colyseus) game server.

Latest version **0.1.1** (published 2015-12-02) · 0 weekly downloads

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

## Install

```sh
npm install colyseus-client
pnpm add colyseus-client
yarn add colyseus-client
bun add colyseus-client
```

## Health

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

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.1.1 |
| Published | 2015-12-02 |
| First published | 2015-12-02 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >= 5.x |
| Dependencies | 5 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 7336 |
| Maintainers | endel |

## Links

- npm: https://www.npmjs.com/package/colyseus-client
- Repository: https://github.com/gamestdio/colyseus
- Homepage: https://github.com/gamestdio/colyseus#readme
- Issues: https://github.com/gamestdio/colyseus/issues
- npm.io page: https://npm.io/package/colyseus-client

## Dependencies (5)

- [babelify](https://npm.io/package/babelify.md) ^7.2.0
- [msgpack-lite](https://npm.io/package/msgpack-lite.md) ^0.1.13
- [websocket.js](https://npm.io/package/websocket.js.md) ^0.1.3
- [fast-json-patch](https://npm.io/package/fast-json-patch.md) ^0.5.4
- [babel-preset-es2015](https://npm.io/package/babel-preset-es2015.md) ^6.1.18

## Recent versions

- 0.1.1 (latest) — 2015-12-02

## README

# colyseus-client for the browser

Wrapper to communicate with [colyseus](https://github.com/gamestdio/colyseus) game server.

## Usage

```javascript
var client = new Colyseus('ws://localhost:2657');
var roomName = "room_name"
var room = client.join(roomName)

room.on('join', function() {
  console.log(client.id, "joined", roomName)
})

room.on('error', function() {
  console.log(client.id, "couldn't join", roomName)
})

room.on('leave', function() {
  console.log(client.id, "leaved", roomName)
})

room.on('data', function(data) {
  console.log(client.id, "received on", roomName, data)
})

room.on('setup', function(state) {
  console.log(roomName, "initial state:", state)
})

room.on('patch', function(patches) {
  console.log(roomName, "has these changes:", patches)
})

room.on('update', function(newState) {
  console.log(roomName, "has a new state:", newState)
})

```

## License

MIT

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