Show:
Module: PluginRegistry

A fluent interface for interacting with a plugin registry

Methods

addPluginImpl
(
  • pluginDefinition
)
private

Defined in index.js:258

Parameters:

  • pluginDefinition String | PluginDefinition
addPlugins
(
  • plugins
)
chainable

Defined in index.js:240

Add one or more plugins to this registry

Parameters:

  • plugins String | PluginDefinition multiple
getAllPluginsOfCategory
(
  • category
)
chainable

Defined in index.js:277

Returns all plugins of a particular category, or an empty array for a non-existent category.

Parameters:

  • category String
getContext ()

Defined in index.js:300

Gets the context used by this plugin registry.

getFullPluginRegistry ()

Defined in index.js:290

Gets the entire plugin registry

setContext
(
  • newContext
)
chainable

Defined in index.js:206

Sets the context used by this plugin registry. May only be called once.

When the tool asks plugin registry to find its plugins by name - and not specify an explicit requirePath, it attempts to infer the location of the plugin from a number of possible locations, based on the location of the tool, and the location of the project.

The default values for each of these work well in most cases, however, they can be explicitly specified too if this is desired.

Note that this method can only be called once - it does not make sense for the context to change once set.

Parameters:

  • newContext Object