Node.js 26.14: subprocess.timedOut Ends the Guesswork
Node.js 26.14.0 "Lithium" landed on the LTS line on November 30, 2026, and among its notable changes is a small addition to child_process with an outsized effect: the subprocess.timedOut property. It settles a question that has followed anyone who shells out from application code — did the process die because its deadline expired, or for some entirely different reason?
The problem: a signal carries no reason
Pass the timeout option to spawn or exec and Node.js sends the signal named by killSignal — 'SIGTERM' by default — once the child outlives its budget. The trouble is that the signal arrives stripped of its cause. The exit event hands over code and signal and nothing else, and a SIGTERM from an expired timeout looks exactly like a SIGTERM from a process supervisor, a teammate cancelling a job, or an orchestrator recycling a container.
That is precisely the motivation recorded in PR #66639: callers could not distinguish the timeout kill from a signal sent for another reason. The workarounds were brittle — a parallel timer in application code trying to guess the same moment, a flag raised by hand before calling kill, or worse, retry logic that fires on every SIGTERM, deliberate shutdowns included. As more systems run commands on our behalf, from build pipelines to agent tooling, that guesswork becomes a permanent source of surprising behavior.
What changed
The release adds a boolean on the child object, set when the timeout expires and the kill signal is sent because of it:
import { spawn } from 'node:child_process';
const child = spawn('npm', ['test'], { timeout: 60_000 });
child.on('exit', (code, signal) => {
if (child.timedOut) {
// Over budget: retry with a wider window, or record the slowdown
return scheduleRetry({ budgetMs: 180_000 });
}
if (signal) {
// Someone else ended it: a deliberate stop or memory pressure
return reportExternalTermination(signal);
}
return handleExit(code);
});The property is available for spawn, exec, execFile and fork. With the callback forms it also reaches the error object as error.timedOut:
import { execFile } from 'node:child_process';
execFile('ffmpeg', args, { timeout: 30_000 }, (error, stdout) => {
if (error?.timedOut) return queueForSlowLane();
if (error) return reportFailure(error);
return deliver(stdout);
});The gain is not the lines saved. It is that the reason for termination is now part of the API instead of an inference built on partial evidence.
That reaches further than retry logic. Logs can finally separate "a slow command exceeded its budget" from "a command was stopped from outside" — two cases that lead to completely different engineering decisions. The first points at the timeout value or the command's own performance; the second points at the surrounding environment: a restart, a memory ceiling, a shutdown policy. Collapsing both into one metric hides the real problem behind a misleading number.
Real-world caveats
The flag means the signal was sent, not that the process is gone. The documentation is explicit: like subprocess.killed, timedOut does not indicate that the child has terminated. A child that traps and ignores SIGTERM can stay alive after the flag is raised.
The default kill signal is gentle. SIGTERM is catchable. Where the deadline is a hard ceiling — a build pipeline, a command-execution tool — set killSignal: 'SIGKILL', or send SIGTERM first and escalate after a short grace period.
Synchronous forms are not covered. spawnSync, execSync and execFileSync have no such property; this is for the asynchronous APIs only.
Check your release line. The documentation records the addition in v26.14.0, and it does not appear in the 24.x changelog as of this writing. Relying on it today means moving to 26.x.
Takeaway
The value here is not brevity. It is that retry logic can finally branch on a known cause rather than a guess. An expired deadline deserves a second attempt with a wider budget; an external signal deserves to be respected and obeyed immediately. That distinction was awkward to express accurately, and it is now a single condition — exactly the kind of detail that decides the quality of the tooling built around processes.
The practical rule is simple: give every deadline an explicit budget and a known escalation path, and let the API tell you the reason instead of reconstructing it. The same release's notable changes also brought the fs.mkstemp() addition.
Source: Node.js 26.14.0 release notes and the subprocess.timedOut documentation.