-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathsignal-exit.node.txt
22 lines (18 loc) · 1.44 KB
/
signal-exit.node.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
┏━━━━━━━━━━━━━━━━━┓
┃ SIGNAL-EXIT ┃
┗━━━━━━━━━━━━━━━━━┛
VERSION ==> #4.1.0
onExit(FUNC[, OPTS])->FUNC2() #Like process.on('exit', FUNC) except also fired on exit signals,
#providing those signals don't already have a listener.
#Handler is FUNC(EXIT_CODE|null, 'SIGNAL'|null) instead of FUNC(EXIT_CODE)
#FUNC can return true to abort exit, but only if exit was due to 'SIGNAL'
#FUNC2() removes the listener
#Noop in browsers
#OPTS:
# - alwaysLast BOOL (def: false): fired after other 'exit' handlers, not among them
#Issues:
# - patches process.emit|reallyExit() and uses a global EVENTLISTENER
signals #'SIGNAL'_ARR. Cross-browser exit signals:
# - all OS: 'SIGHUP|SIGINT|SIGTERM'
# - Linux|macOS: 'SIGABRT|SIGALRM|SIGVTALRM|SIGXCPU|SIGXFSZ|SIGUSR2|SIGTRAP|SIGSYS|SIGQUIT|SIGIOT'
# - Linux: 'SIGIO|SIGPOLL|SIGPWR|SIGSTKFLT'