formacao
This commit is contained in:
+2
-5
@@ -14,11 +14,8 @@ class StdinDiscarder {
|
||||
|
||||
const code = typeof chunk === 'string' ? chunk.codePointAt(0) : chunk[0];
|
||||
if (code === ASCII_ETX_CODE) {
|
||||
if (process.listenerCount('SIGINT') > 0) {
|
||||
process.emit('SIGINT');
|
||||
} else {
|
||||
process.kill(process.pid, 'SIGINT');
|
||||
}
|
||||
// Always re-signal the process. Emitting `SIGINT` directly breaks normal Ctrl+C termination when libraries install listeners for cleanup.
|
||||
process.kill(process.pid, 'SIGINT');
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "stdin-discarder",
|
||||
"version": "0.3.1",
|
||||
"version": "0.3.2",
|
||||
"description": "Discard stdin input except for Ctrl+C",
|
||||
"license": "MIT",
|
||||
"repository": "sindresorhus/stdin-discarder",
|
||||
|
||||
Reference in New Issue
Block a user