23 lines
479 B
JavaScript
23 lines
479 B
JavaScript
const readlineSync = require('readline-sync');
|
|
|
|
let key = readlineSync.keyIn('? ')
|
|
console.log(key);
|
|
|
|
/* This works without external dependencies,
|
|
* but it's for a full line at a time
|
|
const readline = require('readline/promises');
|
|
|
|
const rl = readline.createInterface({
|
|
input: process.stdin,
|
|
output: process.stdout
|
|
});
|
|
|
|
async function getInput(prompt) {
|
|
let input = await rl.question(prompt)
|
|
console.log(input);
|
|
console.log("Later");
|
|
rl.close();
|
|
}
|
|
|
|
getInput('?');
|
|
*/ |