--- name: Listen to OS signals --- Bun supports the Node.js `process` global, including the `process.on()` method for listening to OS signals. ```ts process.on("SIGINT", () => { console.log("Received SIGINT"); }); ``` --- If you don't know which signal to listen for, you listen to the umbrella `"exit"` event. ```ts process.on("exit", (code) => { console.log(`Process exited with code ${code}`); }); ``` --- If you don't know which signal to listen for, you listen to the [`"beforeExit"`](https://nodejs.org/api/process.html#event-beforeexit) and [`"exit"`](https://nodejs.org/api/process.html#event-exit) events. ```ts process.on("beforeExit", (code) => { console.log(`Event loop is empty!`); }); process.on("exit", (code) => { console.log(`Process is exiting with code ${code}`); }); ``` --- See [Docs > API > Utils](/docs/api/utils) for more useful utilities. ion> Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/builtins/cpp/ReadableByteStreamInternalsBuiltins.cpp (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2022-11-11Don't rm cachedGravatar Jarred Sumner 4-4/+0
2022-11-11try thisGravatar Jarred Sumner 4-0/+4
2022-11-11Update bun-linux-build.ymlGravatar Jarred Sumner 1-1/+0
2022-11-11try using git actionGravatar Jarred Sumner 4-7/+8
2022-11-11Remove with `git rm`Gravatar Jarred Sumner 2-8/+0