2.0.1 • Published 6 years ago

importful v2.0.1

Weekly downloads
1
License
AGPL-3.0
Repository
github
Last release
6 years ago

importful

Simple automatic importer. You pass a string and get an array of modules back.

Install

yarn add importful

Usage

import importful from 'importful';
import { join } from 'path';

const routesPath = join(__dirname, './routes');

void async function() {

    const modules = await importful(routesPath);

    // Use modules
}();

Note: modules here is a Promise<any>[], to switch to a all or nothing approach use Promise.all() to get a Promise<any[]>.

Author

License

This project is licensed under the AGPL 3.0 License - see the license file for details.