Skip to content

Instantly share code, notes, and snippets.

@laduke
Created March 9, 2011 03:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save laduke/861633 to your computer and use it in GitHub Desktop.
Save laduke/861633 to your computer and use it in GitHub Desktop.
var util = require('util'),
events = require('events'),
sys = require('sys');
function MyModule() {
if(false === (this instanceof MyModule)) {
return new MyModule();
}
events.EventEmitter.call(this);
this.states = {"hello":"world"};
this.parse("bar");
}
sys.inherits(MyModule, events.EventEmitter);
MyModule.prototype.parse = function(data){
//parse data
this.states[data] = "result";
}
module.exports = MyModule;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment