Skip to content

niceskylei/awake_mac

Repository files navigation

Make your mac awake

Attention! Only work for macos!!!

example

import {disableScreenSleep, enableScreenSleep} from '@niceskylei/awake_mac'
let ok = disableScreenSleep("marklei");
console.log("disableScreenSleep", ok);
if (ok) {
    setTimeout(() => {
        console.log("enableScreenSleep", enableScreenSleep());
    }, 1000 * 180);
} else {
    console.warn("disableScreenSleep failed");
}