const speeech = require("../src/index");
const get = require("lodash.get");
const say = require("say");

const serviceConfig = require("../witkeyfile.json");

const process = result => {
  const intent = get(result, "entities.intent[0].value");
  if (intent === "weather") {
    const location = get(result, "entities.location[0].value");
    say.speak("You want weather of " + location);
  }
  console.log(result.entities);
};

speeech.emit("start", speeech.witService(serviceConfig));
speeech.on("result", result => process(result));

@@ -72,36 +72,8 @@
 t%22);
-%0Aconst say = require(%22say%22);
 %0A%0Aco
@@ -216,183 +216,46 @@
 ;%0A  
-if (intent === %22weather%22) %7B%0A    const location = get(result, %22entities.location%5B0%5D.value%22);%0A    say.speak(%22You want weather of %22 + location);%0A  %7D%0A  console.log(result.entities
+console.log(%60The  intent is $%7Bintent%7D%60
 );%0A%7D

Update first Wit example to do it more simple