1.0.8 • Published 6 years ago

ws-client.io v1.0.8

Weekly downloads
4
License
ISC
Repository
github
Last release
6 years ago

Install

npm i ws-client.io

ws-client.io

const Socket = require('ws-client.io');

let ws = new Socket;
//or
let ws = new Socket(url);

handler

ws.on('update', v => {
  //event handler
});

ws.once('update2', (...arg) => {
  //event handler
});

ws.on('updateAndCallback', (v, cb) => {
  console.log(v);
  cb('ok');
});

call the server function (emit)

//with callback
ws.getUsers((err, res) => {
  console.log(err, res);
});

//without callback
ws['any function name']('any count arg');

or

//with callback
ws.emit('getUsers', (err, res) => {
  console.log(err, res);
});

//without callback
ws.emit('any function name', 'any count arg');
1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago