File tree Expand file tree Collapse file tree 1 file changed +23
-0
lines changed
Expand file tree Collapse file tree 1 file changed +23
-0
lines changed Original file line number Diff line number Diff line change @@ -1785,6 +1785,29 @@ subprocess.stdout.on('data', (data) => {
17851785The ` subprocess.stdout ` property can be ` null ` or ` undefined `
17861786if the child process could not be successfully spawned.
17871787
1788+ ### ` subprocess.timedOut `
1789+
1790+ <!-- YAML
1791+ added: REPLACEME
1792+ -->
1793+
1794+ * {boolean}
1795+
1796+ The ` subprocess.timedOut ` property indicates whether the child process
1797+ was killed due to the ` timeout ` option set in [ ` child_process.spawn() ` ] [ ] ,
1798+ [ ` child_process.exec() ` ] [ ] , [ ` child_process.execFile() ` ] [ ] , or
1799+ [ ` child_process.fork() ` ] [ ] .
1800+
1801+ ``` js
1802+ const { spawn } = require (' node:child_process' );
1803+
1804+ const subprocess = spawn (' sleep' , [' 10' ], { timeout: 100 });
1805+
1806+ subprocess .on (' exit' , () => {
1807+ console .log (subprocess .timedOut ); // true
1808+ });
1809+ ```
1810+
17881811### ` subprocess.unref() `
17891812
17901813<!-- YAML
You can’t perform that action at this time.
0 commit comments