🟢 JavaScript runtime
Keep your Mac awake while Node.js runs
Long-lived Node.js processes - dev servers, file watchers, queue workers - sit quietly waiting for the next request. AwakeMate keeps your Mac awake the whole time they run so a sleep cycle never drops the connection.
Free 14-day trial · one-time $39.99 · no telemetry · macOS 13+
When your Mac sleeps mid-Node.js
A Node dev server or watcher spends most of its life idle, waiting on a request, a file change or a socket. macOS reads that quiet as "nobody's working" and sends the Mac to sleep, killing your npm run dev session, dropping websockets and forcing a cold restart. Anything mid-flight - a long upload, a streaming build, an in-progress request - is lost.
AwakeMate keeps it awake while Node.js runs
Node tools rarely show up as themselves. A CLI installed through npm usually appears to macOS as just node, so a naive matcher can't tell your dev server from any other script. AwakeMate watches for the node process, and its Deep CLI detection (on by default) reads the real script name underneath so the right tool is recognised.
Detected process: node
Tip: leave "Sleep when tools go idle" off
Leave "sleep when idle" OFF for Node.js. A dev server or watcher is idle by design - it waits on the network and file system far more than it burns CPU - so idle-sleep would read those quiet stretches as finished work and cut the session mid-wait. With it off, your Mac stays awake the entire time the process runs. Only flip it on for a one-shot CPU-bound job, like a big node build script that ends when the work ends.
Get the most out of it
- Add
nodeto your watched tools and keep idle-sleep off so dev servers and HMR survive long quiet stretches. - Running a one-off batch script instead of a server? Turn idle-sleep on so the Mac sleeps the moment the script finishes.
More questions about Node.jstap to expand
Will it keep my Mac awake during a long-running dev server?
Yes. With idle-sleep off, AwakeMate holds the Mac awake the entire time node is running, so your dev server, HMR and websockets stay alive through quiet periods that would otherwise trigger sleep.
My CLI tool just shows up as "node" - will detection still work?
Yes. Many npm-installed tools run as the node binary, so AwakeMate's Deep CLI detection reads the underlying script name to recognise the actual tool rather than matching blindly.
Does it change my energy or sleep settings?
No. AwakeMate uses the same gentle IOKit power assertion as macOS's own caffeinate. It prevents idle sleep only while your tool runs and never touches your saved energy preferences.
What's the best way to keep my Mac awake while a Node server runs?
The simplest way is to let AwakeMate do it automatically. Add node to your watched tools once and your Mac stays awake whenever a Node process is running, then sleeps when it exits. There's nothing to start or stop per session, so you can run npm run dev and walk away without babysitting a terminal command.
Should I just use caffeinate to keep my Mac awake for Node instead?
You can - caffeinate node app.js works and uses the very same IOKit assertion AwakeMate does. The catch is that it's manual and all-or-nothing: you have to remember to wrap every command, it holds the whole Mac awake until that process ends, and there's no per-tool detection, no low-battery cutoff and no notch status. AwakeMate automates the same thing per tool so you don't have to think about it.
Why does my Mac keep falling asleep while my Node dev server is running?
Because a dev server mostly waits on requests and file changes, so the CPU looks idle and macOS triggers idle sleep. AwakeMate prevents that idle sleep the whole time node runs (with the lid open). If you leave it running overnight on battery, set a low-battery cutoff so the Mac is allowed to sleep once the charge drops below your threshold.
Will it keep my Mac awake for Node.js with the lid closed, even on battery?
Yes. Turn on "Keep awake with the lid closed" in Settings - Options and approve the one-time helper; AwakeMate then keeps the Mac awake with the lid shut while Node.js runs, and dims the built-in screen so it is not draining the battery under the lid. It works on most Apple Silicon Macs (Apple forces sleep on some, so close your lid once to confirm). It works on battery too, but real work drains it faster, so keep it on power for long runs. See how it works.