2.0.1 • Published 8 years ago

hapi-devine-autoload v2.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
8 years ago

hapi-devine-autoload

Description

šŸ”§ This Hapi loads plugins from a folder and/or a given array and configures them

files or folders starting with a _ are ignored

Install hapi-devine-autoload

yarn add hapi-devine-autoload

Usage

register this module as a plugin in Hapi

server.register({

  register: require(`hapi-devine-autoload`),

  options: {

    path: path.join(__dirname, `plugins`) // plugins directory

    plugins: [
      require(`inert`)
    ] // array with 3rd party plugins to be loaded

    log: true, // provide logs (optional, default: true)

    pluginOptions: {
      inert: {
        // inert options
      }
    }

  }

}, pluginHandler);

hapi-devine-autoload loads all plugins in the given folder and/or array and loads the options from pluginOptions

in this example module1 (index.js) and module2 are loaded

/module1
  /index.js
module2.js
_module3.js

License

MIT

2.0.1

8 years ago

2.0.0

8 years ago

1.1.0

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago