-
Notifications
You must be signed in to change notification settings - Fork 5.7k
feat(ext/process): add collector utilities to ChildProcess.stdout
& ChildProcess.stderr
#30552
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
feat(ext/process): add collector utilities to ChildProcess.stdout
& ChildProcess.stderr
#30552
Conversation
* Reads the stream to completion. It returns a promise that resolves with | ||
* the result of parsing the body text as JSON. | ||
*/ | ||
json(): Promise<any>; |
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.
Promise<unknown>
?
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.
it should be any, as that is what Response
has, and when ReadableStream gets these utilities directly on it, we would get a conflict on this
json(): Promise<any>; | ||
/** | ||
* Reads the stream to completion. It returns a promise that resolves with | ||
* a `USVString` (text). |
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.
Why does this say USVString?
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.
This commit adds
SubprocessReadableStream
interface that are usedfor
ChildProcess.stdout
andChildProcess.stderr
. It's an extension toa regular
ReadableStream
that provides convenience methods to collectthe output and parse it with
.bytes()
,.arrayBuffer()
,.text()
and.json()
helper methods (similarly to the ones available on
Response
).Closes #30323