diff options
Diffstat (limited to 'src/sleep.ts')
-rw-r--r-- | src/sleep.ts | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/sleep.ts b/src/sleep.ts new file mode 100644 index 0000000..94d7547 --- /dev/null +++ b/src/sleep.ts @@ -0,0 +1,8 @@ +let sleepTimeout: Timer; + +export function keepAwake() { + if (sleepTimeout) clearTimeout(sleepTimeout); + sleepTimeout = setTimeout(function () { + process.exit(0); + }, 60_000); +} |