We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c7a2470 commit b6e41b5Copy full SHA for b6e41b5
cli.js
@@ -1,5 +1,18 @@
1
#!/usr/bin/env node
2
3
+// Handle signals properly
4
+// see: https://github.com/nodejs/node-v0.x-archive/issues/9131
5
+exitOnSignal('SIGINT');
6
+exitOnSignal('SIGTERM');
7
+
8
+function exitOnSignal(signal) {
9
+ process.on(signal, function() {
10
+ console.log('\ncaught ' + signal + ', exiting');
11
+ // perform all required cleanup
12
+ process.exit(0);
13
+ });
14
+}
15
16
var argv = require('minimist')(process.argv.slice(2))
17
18
if (argv.help) {
0 commit comments