In my ES6 Node.js application, I have a file of classes that I'm exporting:
class Class1 {...}
class Class2 {...}
module.exports = {
Class1, Class2
}
If one day I make Class3, I don't want to have to remember to add it to the exports list. What I'd like is something like:
module.exports = {
class Class1 {...},
class Class2 {...}
}
Is there any syntax that accomplishes this?
module.exports = { Class1: class {…}, Class2: class {…}};, but why not just use ES6 modules?