Skip to content
This repository has been archived by the owner on Jan 6, 2021. It is now read-only.

fullstackers/bus.io-client

Repository files navigation

Build Status NPM version David DM

Bus.IO

The client interface for bus.io. Built on top of socket.io-client.

npm install bus.io-client

var sock = require('bus.io-client')('ws://localhost:3000');
sock.on('connect', function () {
  sock.deliver({
    action:'say',
    content:'Hello'
  });
  sock.msg({
    action:'say',
    content:'Hello'
  }).deliver();
  sock.emit('say', 'Hello');
});
sock.on('say', function (msg) {
  console.log(msg.content());
});

Features

  • Exposes underlying socket.io-client interface.
  • Sends and Receives Message objects.
  • Runs in the browser too.

Installation and Environment Setup

Install node.js (See download and install instructions here: http://nodejs.org/).

Clone this repository

> git clone git@github.com:turbonetix/bus.io-client.git

cd into the directory and install the dependencies

> cd bus.io-client
> npm install && npm shrinkwrap --dev

Running Tests

Install coffee-script

> npm install coffee-script -g

Tests are run using grunt. You must first globally install the grunt-cli with npm.

> sudo npm install -g grunt-cli

Unit Tests

To run the tests, just run grunt

> grunt spec