Skip to content

sairash/chitosocket-js

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 

Repository files navigation

Chitosocket Js

This is a js wrapper for Chitosocket Server

npm i @sairash/chitosocket
Start A new Websocket connection
cs = new chitosocket(`ws://localhost:6969/ws/`);
Get event on message
cs.on("message", (data) => {
    console.log(data);
});
Send message on event
cs.emit("message", { user_id: 1, message: "This is a message." });
Get all the events client is listening to
console.log(cs.get_events());
Get raw websocket
const ws = cs.ws();
Run function on any message from server
ws.all_messages( (data) => {
    console.log(data);
})

About

ChitoSocket-js Wrapper for chitosocket server

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published