autodiscover-modules
Autodiscover modules in a directory with a required export signature
Usage
import path from 'path';
import autodiscover 'autodiscover-modules';
const folder = path.join(__dirname, 'modules');
autodiscover(
folder,
{ handler: 'function', name: 'string' }
).then((modules) => {
// do something
});
The library will give you all the modules in the modules/
directory that
matches the following export signature:
{
name: string,
handler: function
}