webeng14-03-chat
v1.0.1
Published
Simple Chat EventEmitter used for Exercise 03.1 of the Web Engineering lecture at the University of Ulm, November 2014.
Readme
Chat Event Emitter
Simple Chat EventEmitter used for Exercise 03.1 of the Web Engineering lecture at the University of Ulm, November 2014.
Installation
npm install webeng14-03-chatUsage
var Chat = require('./index');
var chat = new Chat();
// listen on 'message' events
chat.on('message', function(message) {
console.log(message);
});
// enter chat room
// this will emit a message of the form
// [Chat] Falco has entered, 3 users at all.
chat.enter('Falco');
// quit chat room
// this will emit a message of the form
// [Chat] Falco has left, 2 users at all.
// write a message
chat.write('Falco', 'Hello World!');