doc, child_process: clean up Windows example #61422
Open
+28
−34
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
In #53616, we added MJS snippets for the page. In the section about Windows batch files, we also combined two previous snippets who demonstrated the three ways of using
spawn/execdescribed in the above paragraph.The first snippet showed the
spawnofcmd.exeway:node/doc/api/child_process.md
Lines 112 to 114 in dc74f17
The other snippet showed the
execandspawnwithshell: trueways:node/doc/api/child_process.md
Lines 130 to 132 in dc74f17
node/doc/api/child_process.md
Line 141 in dc74f17
This makes these changes:
// OR...comment, since we only have one snippet now, so there's nothing to "or" with :)spawn('cmd.exe')example, which got lost in the shuffleexeccallback body, since the focus of the snippet is just the invocations ofspawn/exec, not the usage ofexecspecifically