Skip to content

Jdender/importful

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published