No Edge Software
  • Search results
No Edge Software

Javascript Prompt

Description

Sometimes you just need a small super simple interactive console app. Here’s a simple way to do it in javascript.

Javascript

const readline = require("readline");

const rl = readline.createInterface(process.stdin, process.stdout);

rl.on("line", line => {
    console.log(`You typed ${line}`);
    rl.prompt();
});

rl.setPrompt("Action> ");
rl.prompt();

Author

Joe Enos