I\'m trying to create a module that exports multiple ES6 classes. Let\'s say I have the following directory structure:
my/
└── module/
├── Foo.js
├──
For exporting the instances of the classes you can use this syntax:
// export index.js
const Foo = require('./my/module/foo');
const Bar = require('./my/module/bar');
module.exports = {
Foo : new Foo(),
Bar : new Bar()
};
// import and run method
const {Foo,Bar} = require('module_name');
Foo.test();