1.0.1 • Published 10 years ago

webeng14-03-chat v1.0.1

Weekly downloads
1
License
MIT
Repository
-
Last release
10 years ago

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-chat

Usage

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!');
1.0.1

10 years ago

1.0.0

10 years ago