📜  节点终端 readline 控制台 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:07.005000             🧑  作者: Mango

代码示例1
before executing the command node in terminal you have to install
  :~$ npm install prompt-sync
if you havent already.
then inside node
  >const prompt = require('prompt-sync')();
  >name = prompt('What is your name? '); michael
  >console.log(`Hey there ${name}`);
Hey there michael