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());
});
- Exposes underlying socket.io-client interface.
- Sends and Receives
Message
objects. - Runs in the browser too.
Install node.js (See download and install instructions here: http://nodejs.org/).
Clone this repository
> git clone [email protected]:turbonetix/bus.io-client.git
cd into the directory and install the dependencies
> cd bus.io-client
> npm install && npm shrinkwrap --dev
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
To run the tests, just run grunt
> grunt spec