1.0.35 • Published 7 years ago

chat-cli v1.0.35

Weekly downloads
-
License
ISC
Repository
-
Last release
7 years ago

chat-cli

Simple script to quickly start and manage a chat client to work with the chat-srv module.

code

var cli = require('chat-cli'); cli.conf('myUsername', '127.0.0.1', 9000); cli.joinChat();

//let's see what rooms are there. console.log(cli.roomList());

//let's join one console.log(cli.joinRoom('aGenericRoom');

cli.message('hi guys!');

//you can configure message and error callbacks from the chat-srv responses cli.onError( function(err){ console.log('ops something went wrong!', err); } );

cli.onMessage( function(msg){ console.log(msg); } );

//list of all commands cli.roomList()

cli.joinRoom(roomname)

cli.createRoom(roomname, psw)

cli.leaveRoom()

cli.message(msg)

cli.pm(userID, msg)

cli.disconnect()

cli.userList()

/code

Installation

this is a node.js module available through the npm registry.

Before installing, download and install Node.js. Node.js 0.10 or higher is required.

Installation is done using the npm install command: code npm install chat-cli /code

Features

-simple and efficent tcp messaging through an instance of chat-srv

1.0.35

7 years ago

1.0.34

7 years ago