Plugin

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

Constructor

new Plugin(pkgName, app)

Parameters:
NameTypeDescription
pkgNamestring

Package name (the one you use in package.json)

appObject

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

Members

(static, constant) 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) exit()

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

(async) init()

After config is read, plugin will be initialized. You can still change your config here, because after plugin is initialized, config will be deep frozen.

(async) loadConfig()

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

(async) start()

This method will be called after plugin's init