socket.io-wildcard

0.1.1 • Public • Published

socket.io-wildcard build status

Extends socket.io with a wildcard event.

Examples

var socketio = require( 'socket.io' ),
    socketioWildcard = require( 'socket.io-wildcard' ),
    io = socketioWildcard( socketio ).listen( 8000 );
 
io.sockets.on( 'connection', function onConnection ( socket ) {
  socket.on( '*', function onWildcard ( event ) {
    // > { name: 'cake', args: [ { 'is a lie': true }, 'another argument' ] }
    console.log( event );
  } );
 
  socket.emit( 'cake', { 'is a lie': true }, 'another argument' );
} );

Readme

Keywords

none

Package Sidebar

Install

npm i socket.io-wildcard

Weekly Downloads

13

Version

0.1.1

License

MIT

Last publish

Collaborators

  • lmjabreu