HooksManager

HooksManager

Source:

Manage Hooks registration/loading

Methods

(static) get_commands() → {Array.<Object>}

Source:

Return local hooks

Returns:
Type
Array.<Object>

(static) get_hooks(filter_by, group_by) → {Object|Array}

Source:

Return loaded hooks, filtering and/or grouping them if required

Parameters:
Name Type Description
filter_by String

Filter hooks by this field

group_by String

Group returned hook by this field

Returns:
Type
Object | Array

(static) get_hooks_dir() → {String}

Source:

Return hooks dir

Returns:
Type
String

(static) load() → {Promise}

Source:

Load hooks from directory or cache

Returns:
Type
Promise

(static) reload() → {Promise}

Source:

Load hooks from directory

Returns:
Type
Promise

(private, static) work_hook(hook_def, hook_path) → {Object|Boolean}

Source:

Validates and extends passed Hook

Parameters:
Name Type Description
hook_def Object

Hook reference

hook_path String

Hook path relative to hooks_dir

Returns:
Type
Object | Boolean