hapi-plugin-loader

0.9.0 • Public • Published

hapi-plugin-loader

Automatically loads plugins from a directory.

Installation

npm install hapi-plugin-loader

Usage

server.register({
  register: require('hapi-plugin-loader'),
  // options: {}
});

Options

  • path - Defaults to ${process.cwd()}/plugins

Methods

Each plugin should be a file in the plugins directory.

Each plugin should export either a plugin or a plugin-load object.

Example:

module.exports = {
	register: require("my-plugin"),
	options: {
		cache: {
			expiresIn: 60 * 60 * 1000
		}
	}
}

Readme

Keywords

Package Sidebar

Install

npm i hapi-plugin-loader

Weekly Downloads

3

Version

0.9.0

License

MIT

Last publish

Collaborators

  • rektide