airdcpp-runscript-extension

1.2.13 • Public • Published

airdcpp-runscript-extension Travis npm package

Extension to execute scripts (JavaScript) on certain events/hooks provided by the AirDC++ Web Client or controlled by cron statement.

Configuration

The configuration consists of 3 sections for events, hooks and schedules. Executions for the same event/hook are executed asynchronously, so the scripts should never build on one another.

Settings

Script execution

Scripts are currently executed by wrapping them in a AsyncFunction object.

Parameter

The following parameters are defined:

Name Type Description
socket object The Api socket
require function Module.require(id) function to load additional modules in the script
extension object The Extension entry structure
message object (Hook and event only) Received message
accept function (Hook only) Function to accept the validation (documentation)
reject function (Hook only) Function to reject the validation (documentation)

Resulting method signatures for each execution type:

async cron(socket, require, extension){
    // your script code
}

async event(socket, require, extension, message){
    // your script code
}

async hook(socket, require, extension, message, accept, reject){
    // your script code
}

Resources

Package Sidebar

Install

npm i airdcpp-runscript-extension

Weekly Downloads

27

Version

1.2.13

License

MIT

Unpacked Size

6.95 MB

Total Files

1097

Last publish

Collaborators

  • zersetz-end