Re: [nodejs] exports and new function

2014-03-17 Thread Jose Luis Rivas
That's returning a new Object already initialized when you do the "require('moduleName')"; So instead of doing: ```js var moduleHolder = require('moduleName'); var moduleObject = new moduleHolder(); ``` You just need: ```js var moduleObject = require('moduleName'); ``` I wouldn't suggest doing

[nodejs] exports and new function

2014-03-17 Thread Reza Razavipour
I am looking at a node code snippet and I see: module.exports = new MyClass(); What does that mean and how is it used? -- -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are su