node.js でプロパティを増やしたい場合はこうする。node.js っていうかjavascriptかな。
var Hoge = function(bool) { this.hoge = bool ? true : false; }; Hoge.prototype.__defineGetter__('isHoge', function() { return this.hoge ? true : false; }); var hoge = new Hoge(true); console.log(hoge.isHoge); var hoge2 = new Hoge(false); console.log(hoge2.isHoge); // TypeError: Property 'isHoge' of object [object Object] is not a function hoge.isHoge();