Sunday, 8 September 2013

Module.export-ing a New Instance

Module.export-ing a New Instance

If I attach an object to the module.exports object in node like so:
module.exports = new Object()
will each object = require('./Object') throughout my application create a
new instance of that object, or will it create a reference to the one
instance?

No comments:

Post a Comment