0.1.3 • Published 5 years ago
@prisel/client v0.1.3
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.