Sha256: ef48185e70da4b68b2cc67b2f1215827be3ed71dbbea59c7ade33f7a1f21c274

Contents?: true

Size: 486 Bytes

Versions: 15

Compression:

Stored size: 486 Bytes

Contents

'use strict';

const signals = ['SIGINT', 'SIGTERM'];

function setupExitSignals(serverData) {
  signals.forEach((signal) => {
    process.on(signal, () => {
      if (serverData && serverData.server) {
        serverData.server.close(() => {
          // eslint-disable-next-line no-process-exit
          process.exit();
        });
      } else {
        // eslint-disable-next-line no-process-exit
        process.exit();
      }
    });
  });
}

module.exports = setupExitSignals;

Version data entries

15 entries across 14 versions & 4 rubygems

Version Path
disco_app-0.16.1 test/dummy/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
disco_app-0.15.2 test/dummy/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
disco_app-0.18.4 test/dummy/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
disco_app-0.18.1 test/dummy/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
disco_app-0.12.7.pre.puma.pre.3 test/dummy/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
disco_app-0.14.0 test/dummy/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
disco_app-0.13.6.pre.puma.pre.3 test/dummy/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
tang-0.2.1 spec/tang_app/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
tang-0.2.0 spec/tang_app/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
tang-0.1.0 spec/tang_app/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js
tang-0.0.9 spec/tang_app/node_modules/webpack-dev-server/lib/utils/setupExitSignals.js