Monkeydo uses the portable data format JSON to read tasks, making it easy to read by primates and machines alike.
{
"tasks": [
[0,"myJavaSriptMethod","someArgument","anotherArgument"]
]
}
|
|
Monkeydo comes as an importable ECMAScript 6 module. In this guide we'll import this directly from a ./modules/ folder, but any web-accesible location will work.
Monkeydo
from your repo clone or download
import { default } from "./modules/Monkeydo/Monkeydo.mjs";
const methods = {
myJavaScriptMethod: (foo,bar) => {
console.log(foo,bar);
}
}
{
"tasks": [
[0,"myJavaSriptMethod","I see skies of","blue"],
[300,"myJavaSriptMethod","red","roses too"],
[160,"myJavaSriptMethod","I see them","bloom"],
[1200,"myJavaSriptMethod","for","me and you"]
]
}
Monkeydo
with your methods and manifest
const monkey = new Monkeydo(methods,manifest);
monkey.do();
The example above would be the same as running:
console.log("I see skies","of blue"); // Right away
console.log("red","roses too"); // 300 milliseconds after the first
console.log("I see them","bloom"); // 160 milliseconds after that one
console.log("for","me and you"); // and lastly, 1200 after that