-
-
Notifications
You must be signed in to change notification settings - Fork 32.8k
process,tty: allow reading/writing from duplex sockets #23053
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
Changes from 6 commits
a4e4e48
4467b66
dd5b960
c39c8ac
5266788
2fb5f00
df004fb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1550,18 +1550,6 @@ An attempt was made to operate on an already closed socket. | |
|
||
A call was made and the UDP subsystem was not running. | ||
|
||
<a id="ERR_STDERR_CLOSE"></a> | ||
### ERR_STDERR_CLOSE | ||
|
||
An attempt was made to close the `process.stderr` stream. By design, Node.js | ||
does not allow `stdout` or `stderr` streams to be closed by user code. | ||
|
||
<a id="ERR_STDOUT_CLOSE"></a> | ||
### ERR_STDOUT_CLOSE | ||
|
||
An attempt was made to close the `process.stdout` stream. By design, Node.js | ||
does not allow `stdout` or `stderr` streams to be closed by user code. | ||
|
||
<a id="ERR_STREAM_CANNOT_PIPE"></a> | ||
### ERR_STREAM_CANNOT_PIPE | ||
|
||
|
@@ -1713,12 +1701,6 @@ A `Transform` stream finished with data still in the write buffer. | |
|
||
The initialization of a TTY failed due to a system error. | ||
|
||
<a id="ERR_TTY_WRITABLE_NOT_READABLE"></a> | ||
### ERR_TTY_WRITABLE_NOT_READABLE | ||
|
||
This `Error` is thrown when a read is attempted on a TTY `WriteStream`, | ||
such as `process.stdout.on('data')`. | ||
|
||
<a id="ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET"></a> | ||
### ERR_UNCAUGHT_EXCEPTION_CAPTURE_ALREADY_SET | ||
|
||
|
@@ -1958,6 +1940,37 @@ removed: v10.0.0 | |
|
||
The `repl` module was unable to parse data from the REPL history file. | ||
|
||
|
||
<a id="ERR_STDERR_CLOSE"></a> | ||
### ERR_STDERR_CLOSE | ||
<!-- YAML | ||
removed: REPLACEME | ||
changes: | ||
- version: REPLACEME | ||
pr-url: https://github.com/nodejs/node/pull/23053 | ||
description: Rather than emitting an error, `process.stderr.end()` now | ||
only closes the stream side but not the underlying resource, | ||
making this error obsolete. | ||
--> | ||
|
||
An attempt was made to close the `process.stderr` stream. By design, Node.js | ||
does not allow `stdout` or `stderr` streams to be closed by user code. | ||
|
||
<a id="ERR_STDOUT_CLOSE"></a> | ||
### ERR_STDOUT_CLOSE | ||
<!-- YAML | ||
removed: REPLACEME | ||
changes: | ||
- version: REPLACEME | ||
pr-url: https://github.com/nodejs/node/pull/23053 | ||
description: Rather than emitting an error, `process.stderr.end()` now | ||
only closes the stream side but not the underlying resource, | ||
making this error obsolete. | ||
--> | ||
|
||
An attempt was made to close the `process.stdout` stream. By design, Node.js | ||
does not allow `stdout` or `stderr` streams to be closed by user code. | ||
|
||
<a id="ERR_STREAM_READ_NOT_IMPLEMENTED"></a> | ||
### ERR_STREAM_READ_NOT_IMPLEMENTED | ||
<!-- YAML | ||
|
@@ -2065,6 +2078,13 @@ instance.setEncoding('utf8'); | |
An attempt has been made to create a string larger than the maximum allowed | ||
size. | ||
|
||
<a id="ERR_TTY_WRITABLE_NOT_READABLE"></a> | ||
### ERR_TTY_WRITABLE_NOT_READABLE | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done … this seems like something that our linter could maybe catch as well? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems, in this case, it will not be clear for a linter if this is a new level or just a typo. |
||
|
||
This `Error` is thrown when a read is attempted on a TTY `WriteStream`, | ||
such as `process.stdout.on('data')`. | ||
|
||
|
||
[`--force-fips`]: cli.html#cli_force_fips | ||
[`'uncaughtException'`]: process.html#process_event_uncaughtexception | ||
[`child_process`]: child_process.html | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
require('../common'); | ||
process.stdin.end('foobar\n'); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foobar |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Hello! |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
'use strict'; | ||
const common = require('../common'); | ||
process.stderr.on('data', common.mustCall(console.log)); |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
<Buffer 48 65 6c 6c 6f 21 0a> |
This file was deleted.
Uh oh!
There was an error while loading. Please reload this page.