module for building chat server and client

npm install chatter
2 downloads in the last week
6 downloads in the last month


An npm module for creating chat servers and clients.

Check out the examples directory for CLI server and client apps.

Install with npm

npm install chatter

Node Server

var chatter = require('chatter');
var options = {
  port: process.env.PORT || 8000
var chatter_server = new chatter.server(options);

Node Client

var chatter = require('chatter');
var chatter_client = new chatter.client("");

// get last 10 messages in transcript

// start listening for new messages
chatter_client.on('message', function(message) {

// send new message with body and user
chatter_client.send('Hello World', 'Jim');

Front-End Client

requires "JQuery-like" library for ajax calls. Primary testing done using zepto.js

<script src=""></script>
// first argument is host server, second is callback for new messages
// last argument is optional for polling interval
chatter.connect('', function(data) {
  console.log("handling new message: ", data);
}, 500);

// method to get last 10 messages in room

chatter.send("Hello World!", "Client");
npm loves you