Giter Club home page Giter Club logo

socketash's Introduction

#Socketash

Currently In Development. Don't cry if it breaks. Fixes are great, though! Contributors welcome!

Socketash is simply an organizer for socket.io events. It wraps up all of your events into a not-so-fancy object so that you can better organize things.

###Getting Started

Holding off on putting anything on npm until stable.

Clone from Github at https://github.com/Aetiranos/socketash

var Socketash = require('./socketash'),
    express = require('express'),
    app = express(),
    server = require('http').Server(app),
    io = require('socket.io')(server);
    
var sash = new Socketash(io);

###Registering Events

To add events to the Socketash registry, simply call:

registerEvent(type,event[,data,callback,force])

sash.registerEvent('emit','connection',{message: 'Connected!'});

The first parameter can be either 'emit' or 'on' (sender or receiver). The second is the event name/identifier. Any data that you wish to pass along follows with an optional callback and force parameter (if you wish to override an existing registered event).

Events can also be deregistered by calling: deregisterEvent(type,event)

Here, you only have to specify the event's type ('emit' or 'on') and identifier to remove it.

###Calling Events

When you want to use your registered events, simply call the 'send' event (to emit an event) or 'receive' event (to open a listener).

###Broadcasts

Coming soon...

###Contributing

Anyone who is interested in contributing and building this project up, feel free to jump in! The more, the merrier!

If you find any bugs or issues with the source code, be sure to submit an issue or submit a pull request with a fix.

If you have a feature request, submit an issue ticket (particularly if this is a major request). For smaller requests, feel free to submit a pull request with the requested feature code.

socketash's People

Contributors

dizdain avatar

Stargazers

Max Kotliar avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.