bin/cli.js
function initTerminateHandlers() {
  var readLine;

  if (process.platform === "win32"){
    readLine = require("readline");

    readLine.createInterface ({
      input: process.stdin,
      output: process.stdout
    }).on("SIGINT", function () {
      process.emit("SIGINT");
    });
  }

  // handle INTERRUPT (CTRL+C) and TERM/KILL signals
  process.on('exit', function () {
    if (server) {
      console.log(chalk.blue('*'), 'Shutting down server');
      server.stop();
    }
    console.log();  // extra blank line
  });
  process.on('SIGINT', function () {
    console.log(chalk.blue.bold('!'), chalk.yellow.bold('SIGINT'), 'detected');
    process.exit();
  });
  process.on('SIGTERM', function () {
    console.log(chalk.blue.bold('!'), chalk.yellow.bold('SIGTERM'), 'detected');
    process.exit(0);
  });
}
function initTerminateHandlers() {
  var readLine;

  if (process.platform === "win32"){
    readLine = require("readline");

    readLine.createInterface ({
      input: process.stdin,
      output: process.stdout
    }).on("SIGINT", function () {
      process.emit("SIGINT");
    });
  }

  // handle INTERRUPT (CTRL+C) and TERM/KILL signals
  process.on('exit', function () {
    if (server) {
      console.log(chalk.blue('*'), 'Shutting down server');
      server.stop();
    }
    console.log();  // extra blank line
  });
  process.on('SIGINT', function () {
    console.log(chalk.blue.bold('!'), chalk.yellow.bold('SIGINT'), 'detected');
    process.exit();
  });
  process.on('SIGTERM', function () {
    console.log(chalk.blue.bold('!'), chalk.yellow.bold('SIGTERM'), 'detected');
    process.exit(0);
  });
}
function initTerminateHandlers ( ) { var readLine ; if ( process . platform === "win32" ) { readLine = require ( "readline" ) ; readLine . createInterface ( { input : process . stdin , output : process . stdout } ) . on ( "SIGINT" , function ( ) { process . emit ( "SIGINT" ) ; } ) ; } // handle INTERRUPT (CTRL+C) and TERM/KILL signals process . on ( 'exit' , function ( ) { if ( server ) { console . log ( chalk . blue ( '*' ) , 'Shutting down server' ) ; server . stop ( ) ; } console . log ( ) ; // extra blank line } ) ; process . on ( 'SIGINT' , function ( ) { console . log ( chalk . blue . bold ( '!' ) , chalk . yellow . bold ( 'SIGINT' ) , 'detected' ) ; process . exit ( ) ; } ) ; process . on ( 'SIGTERM' , function ( ) { console . log ( chalk . blue . bold ( '!' ) , chalk . yellow . bold ( 'SIGTERM' ) , 'detected' ) ; process . exit ( 0 ) ; } ) ; }
Prepare the 'exit' handler for the program termination
Prepare the exit handler for the program termination