本文共 633 字,大约阅读时间需要 2 分钟。
node.js退出命令
When fatal happened, we’d like to kill the program. How to exit the program in ?
当发生致命 ,我们想终止该程序。 如何退出的程序?
You can use:
您可以使用:
process.exit()
Here, “process” is a global process object. exit method ends the process.
在此,“过程”是全局过程对象。 exit方法结束该过程。
process.exit([code])
process.exit([code])
Ends the process with the specified code. If omitted, exit uses the
‘success’ code 0.用指定的代码结束进程。 如果省略,则退出使用
“成功”代码0。To exit with a ‘failure’ code:
要以“失败”代码退出:
process.exit(1);
process.exit(1);
The that executed Node.js should see the exit code as 1.
执行Node.js的应该将退出代码显示为1。
翻译自:
node.js退出命令
转载地址:http://xaowd.baihongyu.com/