事件:'SIGTSTP'
添加于:v0.7.5
 'SIGTSTP'当input流接收一个Ctrl+Z输入,通常称为SIGTSTP.如果没有'SIGTSTP'事件监听器注册时input流接收一个SIGTSTP,Node.js进程将被发送到后台。
当使用   恢复程序时,将发出 fg(1p) 'pause' 和 'SIGCONT' 事件。这些可用于恢复input 流。
如果 input 在进程发送到后台之前暂停,则不会发出 'pause' 和 'SIGCONT' 事件。
在不传递任何参数的情况下调用侦听器函数。
rl.on('SIGTSTP', () => {
  // This will override SIGTSTP and prevent the program from going to the
  // background.
  console.log('Caught SIGTSTP.');
});
Windows 不支持 'SIGTSTP' 事件。
相关用法
- Node.js InterfaceConstructor 'SIGCONT'事件用法及代码示例
 - Node.js InterfaceConstructor 'SIGINT'事件用法及代码示例
 - Node.js tls.Server 'keylog'事件用法及代码示例
 - Node.js http.Server 'clientError'事件用法及代码示例
 - Node.js cluste 'disconnect'事件用法及代码示例
 - Node.js proces 'exit'事件用法及代码示例
 - Node.js stream.Writable 'pipe'事件用法及代码示例
 - Node.js stream.Readable 'end'事件用法及代码示例
 - Node.js cluste 'fork'事件用法及代码示例
 - Node.js stream.Writable 'unpipe'事件用法及代码示例
 - Node.js Http2Session 'remoteSettings'事件用法及代码示例
 - Node.js Worker 'listening'事件用法及代码示例
 - Node.js tls.Server 'resumeSession'事件用法及代码示例
 - Node.js InterfaceConstructor 'pause'事件用法及代码示例
 - Node.js fs.FSWatcher 'change'事件用法及代码示例
 - Node.js stream.Readable 'data'事件用法及代码示例
 - Node.js http.ClientRequest 'connect'事件用法及代码示例
 - Node.js proces 'uncaughtException'事件用法及代码示例
 - Node.js Http2Session 'localSettings'事件用法及代码示例
 - Node.js REPLServer 'exit'事件用法及代码示例
 - Node.js cluste 'online'事件用法及代码示例
 - Node.js tls.TLSSocket 'session'事件用法及代码示例
 - Node.js Worker 'exit'事件用法及代码示例
 - Node.js cluste 'exit'事件用法及代码示例
 - Node.js Http2Stream 'trailers'事件用法及代码示例
 
注:本文由纯净天空筛选整理自nodejs.org大神的英文原创作品 'SIGTSTP'事件。非经特殊声明,原始代码版权归原作者所有,本译文未经允许或授权,请勿转载或复制。
