simple.io

Minimalistic wrapper around engine.io and engine.io-client.

npm install simple.io
6 downloads in the last day
8 downloads in the last week
42 downloads in the last month

simple.io

Minimalistic wrapper around engine.io and engine.io-client.

Install

$ npm install simple.io

Usage

Server-side:

server = require('http').createServer().listen(3000)
io = require('simple.io')(server)

io.sub(function(msg){

  msg.from
  // => 'william'

  msg.text
  // => 'Morning, Paul'
})

io.pub({ from: 'paul', text: 'Oh, morning, William, how are you?' })

Client-side:

io = require('simple.io')() // or: require('simple.io')('localhost:1234')

io.pub({ from: 'william', text: 'Morning, Paul.' })

io.sub(function(msg){

  msg.from
  // => 'paul'

  msg.text
  // => 'Oh, morning, William, how are you?'

})

Testing

$ npm install -g indev
$ indev test

npm loves you