UNPKG
on-exit
Version:
latest (1.0.1)
1.0.1
1.0.0
Register tasks to perform when the process exits.
github.com/Prestaul/on-exit
on-exit
/
tests
/
child-continuous.js
16 lines
(12 loc)
•
262 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
var
onExit =
require
(
'../'
);
function
send
(
val
) {
return
function
(
) { process.
send
(val); }; }
onExit
(
send
(
1
));
onExit
(
send
(
2
));
onExit
(
send
(
3
));
setTimeout
(
function
(
) {
throw
new
Error
(
'This process should be killed before the timeout fires'
); },
1500
);