refactor: modularize cli helpers
This commit is contained in:
8
src/cli/wait.ts
Normal file
8
src/cli/wait.ts
Normal file
@@ -0,0 +1,8 @@
|
||||
export function waitForever() {
|
||||
// Keep event loop alive via an unref'ed interval plus a pending promise.
|
||||
const interval = setInterval(() => {}, 1_000_000);
|
||||
interval.unref();
|
||||
return new Promise<void>(() => {
|
||||
/* never resolve */
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user