Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Emitting SIGINT event from inside node

I'm currently working with a library in node.js that happens to capture Ctrl-C and throw an error instead of allowing the normal behaviour (emitting a SIGINT event) to occur.

Wondering if it is possible to catch this error and emit a SIGINT event?

like image 222
Rohan Orton Avatar asked Sep 03 '25 04:09

Rohan Orton


1 Answers

It is possible to do this within a Node process.

You can emit the 'SIGINT' event from the process object.

process.emit('SIGINT');
like image 105
gnerkus Avatar answered Sep 04 '25 23:09

gnerkus