mirror of
https://github.com/vercel-labs/scriptc.git
synced 2026-10-22 05:59:31 +08:00
11 lines
411 B
TypeScript
11 lines
411 B
TypeScript
// @exit: 3
|
|
// process.exit() runs the 'exit' listeners too (Node's contract), with
|
|
// the REAL code, before the teardown-free exit — and nothing after the
|
|
// exit call runs. The cursor-restore pattern this exists for
|
|
// (audio-preview's process.once("exit", restore)) is exactly this shape.
|
|
process.once("exit", (code) => {
|
|
console.log("restore at", code);
|
|
});
|
|
console.log("before exit");
|
|
process.exit(3);
|