webeng14-03-chat

1.0.1 • Public • Published

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

Readme

Keywords

Package Sidebar

Install

npm i webeng14-03-chat

Weekly Downloads

1

Version

1.0.1

License

MIT

Last publish

Collaborators

  • fnogatz