var readLine = require("readline").createInterface({input: prosess.stdin}) readLine.on("line", function(line){ if(line === "exit") throw "exit" console.log("you have printed " + line) })