CNode

如何实现node.exe执行完后按回车才退出

Hhaokeyy发布于14 年前最后回复14 年前1 回复5146 浏览0 收藏

就是暂停一下,按下回车键才退出

查看回复

回复 (1)

L
leizongmin#1·14 年前

目前只知道这种方法:

require('readline').createInterface({
  input: process.stdin,
  output: process.stdout
}).question('Press enter to exit...', function () {
  process.exit();
});

参考:http://nodejs.org/api/readline.html#readline_readline_createinterface_options

参与回复
登录后即可参与回复。登录