With ES6, I can import several exports from a file like this:
import {ThingA, ThingB, ThingC} from \'lib/things\';
However, I like the orga
You can use async import():
import fs = require('fs');
and then:
fs.readdir('./someDir', (err, files) => { files.forEach(file => { const module = import('./' + file).then(m => m.callSomeMethod(); ); // or const module = await import('file') }); });