1.0.4 • Published 2 years ago

@paukuman/autoloader v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
2 years ago

Autoloader

This is a autoloader modules like PHP autoloader

Installation

Install autoloader with npm

  npm install fs fs.promises
  npm install @paukuman/autoloader

How to use it

    (async function() => {
        /* [ Autoloader Modules ] */
        const autoloader = require('@paukuman/autoloader');

        // modules installed
        const packages = `${__dirname}/package.json`;
        
        // local modules
        const locals = `${__dirname}/plugins`;
        
        /* [ Configuration ] */
        await autoloader(packages, locals);
    })();

so

    // example if you want to see all installed modules
    console.log(m);
    // example if you have installed express
    const app = m.express;
    app.get('/', (req, res) => {
        res.send('Hello World');
    })
    // example if you have installed fs.promises
    console.log(await m['fs.promises'].readdir(args[1]));
1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago