Say I create a library in ./libname which contains one main file: main.js and multiple optional library files which are occasionally used with the main
./libname
main.js
Looks like the only way is to use getters. In short, like this:
exports = { MainClass : require('main.js').MainClass, get a(){ return require('./a.js'); }, get b(){ return require('./a.js'); } }