-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
doc: refactor signal info in child_process.md #37528
doc: refactor signal info in child_process.md #37528
Conversation
Maybe we should add the info in the YAML list as well: - version: v15.4.0
pr-url: https://github.com/nodejs/node/pull/36308
description: AbortSignal support was added. |
doc/api/child_process.md
Outdated
@@ -246,6 +248,9 @@ async function lsExample() { | |||
lsExample(); | |||
``` | |||
|
|||
The `signal` option works exactly the same way it does in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
An example would be nice here :]
doc/api/child_process.md
Outdated
}); | ||
controller.abort(); | ||
``` | ||
The `signal` option works exactly the same way it does in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I actually think examples in APIs are better than not - since users often don't know all the APIs they're working with - sending them to another API (spawn) when they're trying to use execFile isn't better than an example using execFile IMO.
The fact internally execFile delegates to spawn to save code internally is an implementation detail
I like adding it to missing APIs but I strongly prefer having examples in APIs to illustrate to users how to use them. (And half the days I don't remember the difference between exec/execFile/fork/spawn myself, and I've been a collaborator for 5 years and a user for ±10 and I implemented the signal support for child_process :D) |
8a9f442
to
48ea299
Compare
@aduh95 thanks! I added it. |
48ea299
to
8b5765a
Compare
* Since exec calls execFile and execFile internally calls spawn with options.signal, the signal parameter has been documented under exec as well. * Refactor the description of signal under all the functions. * Add examples of usage of signal under all the functions and add missing requires in the other examples.
8b5765a
to
940959e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with the lint issues fixed.
The lint errors are fixed. Thanks for reviewing! :) |
Can you add the YAML metadata for |
* Since exec calls execFile and execFile internally calls spawn with options.signal, the signal parameter has been documented under exec as well. * Refactor the description of signal under all the functions. * Add examples of usage of signal under all the functions and add missing requires in the other examples. PR-URL: #37528 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
Landed in 5248a17 |
* Since exec calls execFile and execFile internally calls spawn with options.signal, the signal parameter has been documented under exec as well. * Refactor the description of signal under all the functions. * Add examples of usage of signal under all the functions and add missing requires in the other examples. PR-URL: #37528 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Since exec calls execFile and execFile internally calls spawn with options.signal, the signal parameter has been documented under exec as well. * Refactor the description of signal under all the functions. * Add examples of usage of signal under all the functions and add missing requires in the other examples. PR-URL: nodejs#37528 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
* Since exec calls execFile and execFile internally calls spawn with options.signal, the signal parameter has been documented under exec as well. * Refactor the description of signal under all the functions. * Add examples of usage of signal under all the functions and add missing requires in the other examples. PR-URL: #37528 Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
exec
callsexecFile
andexecFile
internally callsspawn
withoptions.signal
, thesignal
parameter has been documented underexec
as well.
signal
under all the functions.signal
under all the functions and addmissing
require
s in the other examples.