importful
TypeScript icon, indicating that this package has built-in type declarations

2.0.1 • Public • Published

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.

Readme

Keywords

none

Package Sidebar

Install

npm i importful

Weekly Downloads

0

Version

2.0.1

License

AGPL-3.0

Unpacked Size

38 kB

Total Files

9

Last publish

Collaborators

  • jdenderplays