plugins


CloudControl Pro 9 Docs / plugins

plugins

Table of contents

Functions

Functions

load

load(packageName): Promise<any>

Load a plugin and return the module.exports object exported by the plugin.

If the plugin is not installed or does not exist, throw a PluginLoadException.

Example

"nodejs";
async function main() {
    const plugins = require("plugins");
    const ffmpeg = await plugins.load("org.autojs.plugin.ffmpeg");
    console.log(ffmpeg.inProcess.exec('-i /path/to/mp4.mp4 /path/to/mp3.mp3'));
}
main().catch(console.error);

Parameters

Name Type Description
packageName string plugin package name

Returns

Promise<any>

plugin exported object


unload

unload(packageName): Promise<boolean>

Unload a plugin. Using the plugin exported object is an undefined behavior after unloading.

Parameters

Name Type
packageName string

Returns

Promise<boolean>


unloadAll

unloadAll(): Promise<void>

Unload all plugins. Using the plugin exported object is an undefined behavior after unloading.

Returns

Promise<void>