API Docs for:
Show:

PluginLoader Class

The Plugin Loader class

Constructor

PluginLoader

()

Item Index

Properties

Methods

constructor

(
  • opts
)

Constructor method

Parameters:

  • opts Object
    • docpad Object

      The docpad instance that we are loading plugins for

    • dirPath String

      The directory path of the plugin

    • BasePlugin Object

      The base plugin class

create

(
  • config
  • next
)

Create an instance of a plugin defined by the passed config. The plugin instance is returned in the passed callback. next(err,pluginInstance)

Parameters:

  • config Object
  • next Function

exists

(
  • next
)

Loads the package.json file and extracts the main path next(err,exists)

Parameters:

  • next Function

install

(
  • next
)
private

Installs the plugins node modules. next(err)

Parameters:

  • next Function

load

(
  • next
)

Load in the pluginClass from the plugin file. The plugin class that has been loaded is returned in the passed callback next(err,pluginClass)

Parameters:

  • next Function

unsupported

(
  • next
)

Check if this plugin is unsupported Boolean value returned as a parameter in the passed callback next(err,supported)

Parameters:

  • next Function

Properties

docpad

Object private

The DocPad Instance

Object private

The BasePlugin Class

String private

The full path of the plugin's directory

String private

The full path of the plugin's package.json file

Object private

The parsed contents of the plugin's package.json file

String private

The full path of the plugin's main file

Object private

The parsed content of the plugin's main file

String private

The plugin name

String private

The plugin version

String private

Node modules path