Looking at a random source file of the express framework for NodeJS, there are two lines of the code that I do not understand (these lines of code
Module's code is wrapped in module.exports (The module, maybe composed by other module). There are many ways to build a module, but this is one very common (and my personal favorite).
// Dependencies
// const module = require('module');
// Module object
var foo = {}
// Internal property
foo._a = 'a';
// "Public" property
foo.b = 'b';
// Method
foo.fu = function() { return 'fu' };
// Export
module.exports = foo;