Export multiple files as single module in node js
it works this way:
stuff.js
module.exports = Object.assign(
{},
require('./foo'),
require('./bar'),
);
or if Object Spread Operator is supported:
module.exports = {
...require('./foo'),
...require('./bar'),
};
OtherFiles.js
var stuff = require('./stuff');
stuff.one();
stuff.two();