From cef00c054bc6120c45273f5aaa48e0413500b5b3 Mon Sep 17 00:00:00 2001 From: Sebastian Kocks Date: Sun, 7 Jan 2018 21:29:13 +0100 Subject: [PATCH] Add SIGINT callback on process to enable termination with ctrl-c from the starting command line. --- index.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/index.js b/index.js index fbda0fa..17d4cd7 100644 --- a/index.js +++ b/index.js @@ -6,6 +6,10 @@ const cluster = require('cluster'); main(); async function main() { + process.on('SIGINT', function () { + process.exit(0); + }); + if (config.help) { console.log('Todo, just see this for now:', require('fs').readFileSync(__filename, 'utf8')); process.exit(0);