aboutsummaryrefslogtreecommitdiff
path: root/test/js/node/child_process/fixtures/child-process-exit-event.js
blob: 4400ace1b34a39d6cbb0211b695a41424e4d96d4 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
const { spawn } = require("node:child_process");

function exitHandler() {
  console.log("exithHandler called");
}
function closeHandler() {
  console.log("closeHandler called");
}

const p = spawn("bun", ["--version"]);

p.on("exit", exitHandler);
p.on("close", closeHandler);