Skip to content

Instantly share code, notes, and snippets.

@laduke
Created March 9, 2011 02:35
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/861585 to your computer and use it in GitHub Desktop.
Save laduke/861585 to your computer and use it in GitHub Desktop.
var util = require('util'),
MyModule = require("./MyMod"),
sys = require('sys');
var my = new MyModule();
console.log(util.inspect(my));
my.states["f o"] = "bar";
console.log(util.inspect(my));
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"};
}
sys.inherits(MyModule, events.EventEmitter);
MyModule.states["fo o"] = "Bar"; //nope
module.exports = MyModule;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment