更新时间:2023-02-14 13:09:06
Call the global process
object's exit
method:
process.exit()
process.exit([code])
以指定的
code
结束进程.如果省略,则退出使用成功"代码0
.
process.exit([code])
Ends the process with the specified
code
. If omitted, exit uses the 'success' code0
.
要以失败"代码退出:
process.exit(1);
执行节点的外壳应该将退出代码显示为1
.
The shell that executed node should see the exit code as 1
.