Base

This is the class your own plugin suppose to extend. Don't use Plugin directly unless you know what you're doing.

Constructor

new Base(pkgName, app)

Constructor.

Parameters:
NameTypeDescription
pkgNamestring

Package name (the one in package.json)

appObject

App instance reference. Useful to call app method inside a plugin

Members

dependencies :Array.<string>

Dependencies to other plugins. Enter all plugin's package name your plugin dependent from.

Semver is also supported.

Type:
  • Array.<string>

Methods

(async) dispose() → {Promise.<void>}

Dispose internal references.

Returns:
Type: 
Promise.<void>

(async) exit() → {void}

Upon app termination, this method will be called first. Mostly useful for system cleanup, delete temporary files, freeing resources etc.

Returns:
Type: 
void

(async) init() → {void}

After config is read, plugin will be initialized.

Returns:
Type: 
void

(async) loadConfig() → {void}

Load config from file in data directory, program arguments and environment variables. Level of importance: Env Variables > Program Arguments > Config File

Returns:
Type: 
void

(async) start() → {void}

This method will be called after plugin's init. You can still change your config here, because after plugin is started, config will be deep frozen

Returns:
Type: 
void

(async) stop() → {void}

Reserved for future use. This method will be called before plugin is stopped.

Returns:
Type: 
void