hatchet.io

Hosted socket.io service with a simple API for sending and receiving messages.

hatchet.io

Hosted (or self-hosted) socket.io service with a simple API for sending and receiving messages. It can be used for logging, analytics or any simple message broadcasting for your app.

Install the module with: npm install hatchet.io

(Coming soon)

var hatchet = require('hatchet.io');
 
hatchet.authenticate('http://douglas.hatchet.io:1337', 'demo', 'iYkrswPZVIrUMv');
 
// Watch for 'log' events and run the defined function when it occurs 
hatchet.watch('log', function(data) {
    console.log('log', data);
});
 
// Watch another 
hatchet.watch('signup', function(data) {
    console.log('signup', data);
});
 
// You can also stop listening to an event 
setTimeout(function() {
    hatchet.unwatch('log');
}, 20000);
var hatchet = require('hatchet.io');
 
hatchet.authenticate('http://douglas.hatchet.io:1338', 'demo', 'iYkrswPZVIrUMv');
 
// Warmup begins connection + auth process to server, otherwise it happens on first "send" 
// which will likely cause that message to be lost. This will be resolved using a buffer 
// in a later release. But for the moment all messages are volatile - hatchet isn't for mission critical 
// messages. 
hatchet.warmup();
 
// Send 'log' event with data every 2 seconds 
setInterval(function() {
    var data = {
        line: 100,
        file: 'ben.txt'
    };
    hatchet.send('log', data);
}, 2000);
 
// Send 'signup' event with data every second 
setInterval(function() {
    var data = {
        firstName: 'Frederick',
        lastName: 'Gustaveerson',
        created: new Date()
    };
    hatchet.send('signup', data);
}, 1000);
var hatchet = require('hatchet.io');
 
// Enable logging 
hatch.options.log = true;

Please feel free to contribute. If you see any areas for improvement, particularly in regards to performance / reliability it'd be great to receive your pull requests / comments because it's really the main crux of the application.

  • ADDED: Client library code that allows you to send and receive messages

Copyright (c) 2013 Ben Pearson Licensed under the MIT license.