vaka
Prevent a system running macOS from going to sleep. Picks the preferred method (pmset
/caffeinate
) depending on system version.
usage
const vaka =// Prevent sleep indefinitely// Prevent sleep until process exits// Prevent sleep for 10 seconds
api
vaka([options])
Returns a Promise which resolves to the pid belonging to the underlying pmset
or caffeinate
instance.