diff --git a/README.md b/README.md index 47f470a..405499a 100644 --- a/README.md +++ b/README.md @@ -38,12 +38,12 @@

Use Monkeydo

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.

    -
  1. Import Monkeydo from your repo clone or download +
  2. Import Monkeydo as an ES6 module
    -import { default } from "./modules/Monkeydo/Monkeydo.mjs";
    +import { default as Monkeydo } from "./modules/Monkeydo/Monkeydo.mjs";
     
  3. -
  4. Define your JS methods +
  5. Define your JS methods in an object
     const methods = {
       myJavaScriptMethod: (foo,bar) => {
    @@ -52,29 +52,27 @@ const methods = {
     }
     
  6. -
  7. Define your tasks in a JSON file (or directly in JavaScript) +
  8. Define your tasks in a JSON manifest (file or JSON-compatible JavaScript)
     {
       "tasks": [
    -    [0,"myJavaSriptMethod","I see trees of","green"],
    -    [300,"myJavaSriptMethod","red","roses too"],
    -    [160,"myJavaSriptMethod","I see them","bloom"],
    -    [1200,"myJavaSriptMethod","for","me and you"]
    +    [0,"myJavaSriptMethod","Just like a","monkey"],
    +    [1200,"myJavaSriptMethod","I've been","dancing"],
    +    [160,"myJavaSriptMethod","my whole","life"]
       ]
     }
     
  9. -
  10. Initialize and run Monkeydo with your methods and manifest +
  11. Initialize and run Monkeydo with your methods and manifest
    -const monkey = new Monkeydo(methods,manifest);
    -monkey.do();
    +const monkey = new Monkeydo(methods);
    +monkey.play(manifest);
     

The example above would be the same as running:

-console.log("I see trees of","green"); // 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
+console.log("Just like a","monkey"); // Right away
+console.log("I've been","dancing"); // 1.2 seconds after the first
+console.log("my whole","life"); // and then 160 milliseconds after the second