Class: Midgar

Midgar

Midgar Class Manage Config, plugin manager, logeer and events

new Midgar()

Members


cli :Commander

Commander instance
Type:
  • Commander
See:

config :Config

Config instance
Type:
  • Config

logger :Logger

Logger instance
Type:

pm :PluginManager

Plugin manager instance
Type:

Methods


<protected> _createPmInstance()

Create Plugin manager instance
Returns:
Type
PluginManager

addPlugin(name)

Add a plugin in the plugins.json config file Return true if the plugin was added or false
Parameters:
Name Type Description
name string Plugin name
Returns:
Type
Promise.<boolean>

debug(args)

Log a debug message
Parameters:
Name Type Argument Description
args any <repeatable>

<async> disablePlugin(name)

Disable a plugin in the plugins.json config file Return true if the plugin was enabled or false
Parameters:
Name Type Description
name string Plugin name
Returns:
Type
Promise.<boolean>

<async> enablePlugin(name)

Enable a plugin in the plugins.json config file Return true if the plugin was enabled or false
Parameters:
Name Type Description
name string Plugin name
Returns:
Type
Promise.<boolean>

error(args)

Log an error message
Parameters:
Name Type Argument Description
args any <repeatable>

<async> exit()

Exit Wait for the logger gracefull exit the process
Returns:
Type
Promise.<void>

getNodeEnv()

Return the node env code
Returns:
Type
string

info(args)

Log an info message
Parameters:
Name Type Argument Description
args any <repeatable>

<async> initLogger()

Create logger instace and init
Returns:
Type
Promise.<void>

<async> initPluginManager()

Init plugin manager
Returns:
Type
Promise.<void>

<async> loadConfig()

load the config
Returns:
Type
Promise.<void>

<async> removePlugin(name)

Remove a plugin from the plugins.json config file Return true if the plugin was removed or false
Parameters:
Name Type Description
name string Plugin name
Returns:
Type
Promise.<boolean>

silly(args)

Log a silly message
Parameters:
Name Type Argument Description
args any <repeatable>

<async> start(configPath)

Start Midgar Load the config, init logger and plugin manager
Parameters:
Name Type Description
configPath Sting config dir path
Returns:
Type
Promise.<void>

<async> stop()

Stop Midgar
Returns:
Type
Promise.<void>

verbose(args)

Log a verbose message
Parameters:
Name Type Argument Description
args any <repeatable>

warn(args)

Log a warning message
Parameters:
Name Type Argument Description
args any <repeatable>