0.9.0 • Published 7 years ago

hapi-plugin-loader v0.9.0

Weekly downloads
-
License
MIT
Repository
-
Last release
7 years ago

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
		}
	}
}