0.1.3 • Published 5 years ago

@prisel/client v0.1.3

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

client

prisel client library

Client provides utilities to communicate with server. The goal of client is to be as simple as possible so that it's feasible to develop our game without it.

Usage

> npm i @prisel/client
import { Client, Messages, MessageType } from '@prisel/client';

const client = new Client('ws://localhost:3000');

(async function() {
    await client.connect();
    const { userId } = await client.login('my-username'));
    client.emit(...Messages.getCreateRoom('room-name'));
    await client.once(MessageType.SUCCESS);
    console.log('we are in a room');
})();

This project is still in early stage. We are working on the API.

Contributing guide

To develop client, we can use the demo page. To start the demo page, run

> npm run start:client

in the project root directory. client-demo-page