importful

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

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
importful
102.0.16 years ago6 years agoMinified + gzip package size for importful in KB

Readme

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.