1.0.4 • Published 1 year ago

@paukuman/autoloader v1.0.4

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year 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

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago