Home Manual Reference Source Test Repository
import Plugin from 'reptar/lib/plugin/index.js'
public class | source

Plugin

Static Method Summary

Static Public Methods
public static

Load all .js files from a directory and load them as a plugin.

public static

loadFromPackageJson(directory: string, pluginConfigs: *)

public static

loadPlugin(pluginPath: string, options: object)

Using node's require function, load a plugin and invoke it, passing it the API object and any other additional objects defined from the _config.yml file.

Static Public Methods

public static loadFromDirectory(directory: string) source

Load all .js files from a directory and load them as a plugin.

Params:

NameTypeAttributeDescription
directory string

Path to directory where plugin files exist.

public static loadFromPackageJson(directory: string, pluginConfigs: *) source

Params:

NameTypeAttributeDescription
directory string
  • optional
  • default:
pluginConfigs *

public static loadPlugin(pluginPath: string, options: object) source

Using node's require function, load a plugin and invoke it, passing it the API object and any other additional objects defined from the _config.yml file.

Params:

NameTypeAttributeDescription
pluginPath string

Path to the plugin module.

options object

Plugin options.