Skip to content

Repository files navigation

Smart Processes Management

NPM versionDownloadscode style: prettier

Runnerty: Module Core

This module exposes the classes that Runnerty modules should extend from.

Trigger example:

constTrigger=require('@runnerty/module-core').Trigger;classintervalTriggerextendsTrigger{constructor(chain,params){super(chain,params);}start(){constcheckCalendar=true;constinputValues=[];constcustomValues={};setTimeout(()=>{// Run Chain 🚀:try{this.startChain(checkCalendar,inputValues,customValues);}catch(err){this.logger.error('startChain (intervalTrigger):',err);}},this.params.interval);}}module.exports=intervalTrigger;

Executor example:

constExecutor=require('@runnerty/module-core').Executor;classgreetingExecutorextendsExecutor{constructor(process){super(process);this.options={};this.endOptions={end: 'end'};}asyncexec(options){this.options=options;try{// Greeting 👋:this.endOptions.messageLog=this.options.greeting;this.end(this.endOptions);}catch(err){this.endOptions.end='error';this.endOptions.err_output=err.message;this.end(this.endOptions);}}}module.exports=greetingExecutor;

Notifier example:

constNotifier=require('@runnerty/module-core').Notifier;classconsoleNotifierextendsNotifier{constructor(notification){super(notification);}// Notification sender 📤:send(notification){notification.mode=notification.mode ? notification.mode.toString() : 'info';notification.message=notification.message ? notification.message.toString() : '';this.logger.log(notification.mode,notification.message);this.end();}}module.exports=consoleNotifier;

About

Runnerty: Module Core

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages