const BasRemoteClient = require('bas-remote-node');
//Set script name, and optionally auth details (login, password)
const options = {
scriptName: 'TestRemoteControl' /* or 'YourScriptName' */
};
//Create client
const scriptClient = new BasRemoteClient(options);
//Start application, this may take some time
await scriptClient.start();
//Set parameters for function
const scriptParams = {
Query: 'cats'
};
//Run function and wait for result
//Following function will return list of strings
const result = await scriptClient.runFunction(
'GoogleSearch', /* or 'YourFunctionName' */
scriptParams);
//Iterate and output results
result.forEach(link => {
console.log(link);
});
await scriptClient.close();
Following error will be thrown:
(node:18544) UnhandledPromiseRejectionWarning: Error: ENOENT: no such file or directory, rmdir '3afb1'
at Object.rmdirSync (fs.js:684:3)
at fs.readdirSync.map.filter.map.filter.forEach (d:\dev\BASRemoteControl\node\node_modules\bas-remote-node\lib\services\engine.js:104:20)
at Array.forEach (<anonymous>)
at EngineService._clearRunDirectory (d:\dev\BASRemoteControl\node\node_modules\bas-remote-node\lib\services\engine.js:103:14)
at EngineService.start (d:\dev\BASRemoteControl\node\node_modules\bas-remote-node\lib\services\engine.js:45:14)
Please do at least initial testing before releasing/doing commit.
Execute script provided as quick example
Following error will be thrown:
Please do at least initial testing before releasing/doing commit.