--- 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 value='bun-polyfills'>bun-polyfills Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
path: root/src/js_lexer (unfollow)
AgeCommit message (Expand)AuthorFilesLines
2021-11-24deps: add missing mimalloc dep to jsc bindings header generatorGravatar Kenta Iwasaki 2-2/+3
2021-11-24deps: build picohttp and mimalloc using zigGravatar Kenta Iwasaki 2-131/+123
2021-11-23update Next version on globalGravatar Jack Hanford 1-1/+1
2021-11-23Update build-idGravatar Jarred Sumner 1-1/+1
2021-11-23fix shallow routingGravatar Jack Hanford 1-4/+6
2021-11-23remove commentGravatar Jack Hanford 1-1/+0
2021-11-23add react-dom as devDepGravatar Jack Hanford 1-0/+1
2021-11-23stop installing textencoderGravatar Jack Hanford 3-2/+308
2021-11-23begin addressing more feedbackGravatar Jack Hanford 1-3/+3
2021-11-22remove .thenGravatar Jack Hanford 1-12/+3
2021-11-22another tryGravatar Jack Hanford 2-5/+1
2021-11-22add type fnsGravatar Jack Hanford 1-1/+4