Skip to main content

Timeline for How to exit in Node.js

Current License: CC BY-SA 3.0

6 events
when toggle format what by license comment
Jun 26, 2020 at 0:13 comment added dturvene This should be the accepted answer. It explains process.exit(), process.exitCode, signal handling and (what I want) throw new Error to exit.
Mar 29, 2018 at 16:50 comment added supercat If one has a bunch of code which is supposed to execute continuously until a shutdown request is received, is there any nice convention for registering events that would allow subscriptions to be abandoned in response to a shutdown request, without that requiring the code using the events or the code requesting the shutdown have specific knowledge about each other? Unfortunately, the only way I can think of to kinda-sorta implement that would be to require that any piece of code that registers an event also create a wrapper which includes a closure to unregister it.
May 23, 2017 at 12:02 history edited URL Rewriter Bot
replaced http://stackoverflow.com/ with https://stackoverflow.com/
May 12, 2017 at 12:39 comment added AvadData Amazing response. Process.exit() looks like major overkill for most applications. I was looking for an equivalent to php's die() function... more like: throw new Error('die msg')
Oct 29, 2016 at 17:12 review Late answers
Oct 29, 2016 at 17:17
Oct 29, 2016 at 16:51 history answered teq CC BY-SA 3.0