Skip to content

Instantly share code, notes, and snippets.

@ben-bradley
ben-bradley / Guvna.js
Created September 26, 2013 16:00
A copy of the Guvna to stick into bradleyit.com
function Guvna(options) {
// error checking
if (!options.list || !options.callback || !options.done) {
console.log('ERROR: missing required option - { list: [], callback: fn(), done: fn() }');
return false;
}
// assign vars
this.list = options.list;
@ben-bradley
ben-bradley / EventsClass.js
Created September 26, 2013 15:54
A simple way to extend the EventEmitter to classes with the class.extend module in NodeJS
/*
* A simple way to extend the EventEmitter to classes with the class.extend module in NodeJS
*/
var Class = require('class.extend'),
events = require('events');
var Events = Class.extend({
init: function() { events.EventEmitter.call(this); }
});