In "Node.js" the "module" pattern is implemented.
// ??? var fs = require('fs') // ???? var XXX = function(...) {...} module.exports.init = function( db ) { // Private member var YYY = function (...) {...} // Public member mod.ZZZ = function (...) {...} return mod } There was a problem in terminology, how to properly call the "scope" XXX , YYY , and ZZZ :
- XXX - this function is visible YYY , ZZZ and is available for DI from the outside (rewire).
- YYY - this function is visible only inside init . The narrowest area.
- ZZZ - public method / function (public method / function)
function scope,module scopepublic scope- not? - hellboy