我正在按照指南here(监听SIGINT
个事件)优雅地关闭我的Windows-8托管 node .js应用程序响应Ctrl+C或服务器关闭.
但Windows没有SIGINT
个.我也try 了process.on('exit')
,但似乎做任何有成效的事情都为时已晚.
在Windows上,这个代码给我:Error: No such module
process.on( 'SIGINT', function() {
console.log( "\ngracefully shutting down from SIGINT (Crtl-C)" )
// wish this worked on Windows
process.exit( )
})
在Windows上,此代码运行,但为too late to do anything graceful:
process.on( 'exit', function() {
console.log( "never see this log message" )
})
Windows上是否有SIGINT
个相同的事件?