cable.io

socket.io+jquery socket.on library

npm install cable.io
26 downloads in the last week
104 downloads in the last month

cable.io

socket.io & jquery short coding library

Install

$ npm install cable.io

Override

var socket=require('socket.io').listen(3000);
//‚Čí
var socket=require('cable.io').listen(3000);

Hello World

$ node hw

hw.js

require('cable.io').clientOn('load',function(){
  $(document.body).text('hello world');
}).listen(59798);

Referrence

cable.prototype methods "*On" is single listener only

clientOn('load',function) return this

Execute function after jquery & io.connect

clientOn(name,listener) return this

Setting client-side socket.on

eventOn(selector,type,listener) return this

Setting jquery to $(document).on(type,selector,listener)

serverOn(name,listener) return this

Setting server-side socket.on

serverException(function) return undefined

Throw catching in the serverOn (Can not be processed correctly syntax error occurs in the function)

listen(port,request-handler) return socket.io.Manager

Settings activation

License

MIT @59naga

npm loves you