plugins - Plugins
10/22/22Less than 1 minute
Table of contents
Functions
Functions
load
load(packageName: string): Promise<any>
Loads a plugin and resolves to the value exported from that plugin’s module.exports.
Throws PluginLoadException if the plugin is not installed or cannot be loaded.
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
packageName: Android package name of the plugin.
Returns
Promise<any>
The plugin’s exported object.
unload
unload(packageName: string): Promise<boolean>
Unloads the plugin. Using objects previously exported by that plugin after unload is undefined behavior.
Parameters
packageName: Android package name of the plugin.
Returns
Promise<boolean>
true if the plugin was unloaded successfully.
unloadAll
unloadAll(): Promise<void>
Unloads every loaded plugin. Using objects from plugins after this is undefined behavior.
Returns
Promise<void>
