EventEmitter over a network
Want to see pretty graphs? Log in now!
npm install sockemitter
|3||downloads in the last week|
|12||downloads in the last month|
|Last Published By|
|Version||0.3.0 last updated 9 months ago|
|Keywords||eventemitter, sockets, network, json|
I wanted an EventEmitter over a network. Now I have one.
Caveat: events only go over the wire, not locally. So the following won't trigger a console.log. It's possible I'll change this in the future.
var io = new SockEmitter(socket) io.on('foo', console.log) io.emit('foo', 42)
Handlers are called when an event of the specified type comes over the wire.
off(event, handler) -> bool
Returns false if the handler wasn't found.
Sends the event over the wire with associated arguments. All are JSONified.