Document and type more subprocess.*
properties/methods
#968
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.
This PR adds better documentation and types for
subprocess.stdin
,subprocess.stdout
,subprocess.stderr
,subprocess.stdio
,subprocess.all
,subprocess.send()
,subprocess.on('message')
andsubprocess.pid
.This intentionally leaves out the following
subprocess.*
properties/methods:subprocess.channel
: advanced feature, not very useful (?)subprocess.connected
,subprocess.disconnect()
: IPC features which will be superseded by our upcoming IPC helper (IPC helper #900)subprocess.exitCode
: users should useresult.exitCode
insteadsubprocess.signalCode
: users should useresult.signal
insteadsubprocess[Symbol.dispose]
: terminating processes with a signal is not graceful, and we should not promote itsubprocess.killed
: confusing property which does not mean what people think it does. It just meanssubprocess.kill()
has been called, successfully or not, and with any signal (including non-termination signals). It is just meant for idempotency, i.e. is not very useful sincesubprocess.kill()
is already idempotent.subprocess.unref()
andsubprocess.ref()
: arguably useful in some edge cases? Left out for the moment, but I'm happy to document it if you think we should.subprocess.spawnargs
,subprocess.spawnfile
: can be useful for debugging, but maybe not that much. I have personally never used it, despite the thousands of tests on Execa that required some levels of debugging.A link to the official Node.js documentation is still left, since those are still available (and typed).