The process.stdout property returns a stream connected tostdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is
a Writable stream.
For example, to copy process.stdin to process.stdout:
import{ stdin, stdout }from'node:process';
stdin.pipe(stdout);
process.stdout differs from other Node.js streams in important ways. See note on process I/O for more information.
Sends data on the socket. The second parameter specifies the encoding in the
case of a string. It defaults to UTF8 encoding.
Returns true if the entire data was flushed successfully to the kernel
buffer. Returns false if all or part of the data was queued in user memory.'drain' will be emitted when the buffer is again free.
The optional callback parameter will be executed when the data is finally
written out, which may not be immediately.
See Writable stream write() method for more
information.
The process.stdout property returns a stream connected tostdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is
a Writable stream.
For example, to copy process.stdin to process.stdout:
import{ stdin, stdout }from'node:process';
stdin.pipe(stdout);
process.stdout differs from other Node.js streams in important ways. See note on process I/O for more information.
stdout.
WriteStream.columns: number
A number specifying the number of columns the TTY currently has. This property
is updated whenever the 'resize' event is emitted.
@since ― v0.7.7
columns,
TermOptions.height: number
height:
var process:NodeJS.Process
process.
NodeJS.Process.stdout: NodeJS.WriteStream &{
fd:1;
}
The process.stdout property returns a stream connected tostdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is
a Writable stream.
For example, to copy process.stdin to process.stdout:
import{ stdin, stdout }from'node:process';
stdin.pipe(stdout);
process.stdout differs from other Node.js streams in important ways. See note on process I/O for more information.
stdout.
WriteStream.rows: number
A number specifying the number of rows the TTY currently has. This property
is updated whenever the 'resize' event is emitted.
The process.stdout property returns a stream connected tostdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is
a Writable stream.
For example, to copy process.stdin to process.stdout:
import{ stdin, stdout }from'node:process';
stdin.pipe(stdout);
process.stdout differs from other Node.js streams in important ways. See note on process I/O for more information.
Sends data on the socket. The second parameter specifies the encoding in the
case of a string. It defaults to UTF8 encoding.
Returns true if the entire data was flushed successfully to the kernel
buffer. Returns false if all or part of the data was queued in user memory.'drain' will be emitted when the buffer is again free.
The optional callback parameter will be executed when the data is finally
written out, which may not be immediately.
See Writable stream write() method for more
information.
@since ― v0.1.90
@param ― encoding Only used when data is string.
write(
let output:Uint8Array<ArrayBufferLike>
output);
}
var process:NodeJS.Process
process.
NodeJS.Process.stdout: NodeJS.WriteStream &{
fd:1;
}
The process.stdout property returns a stream connected tostdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is
a Writable stream.
For example, to copy process.stdin to process.stdout:
import{ stdin, stdout }from'node:process';
stdin.pipe(stdout);
process.stdout differs from other Node.js streams in important ways. See note on process I/O for more information.
Adds the listener function to the end of the listeners array for the event
named eventName. No checks are made to see if the listener has already
been added. Multiple calls passing the same combination of eventName and
listener will result in the listener being added, and called, multiple times.
server.on('connection',(stream)=>{
console.log('someone connected!');
});
Returns a reference to the EventEmitter, so that calls can be chained.
By default, event listeners are invoked in the order they are added. The emitter.prependListener() method can be used as an alternative to add the
event listener to the beginning of the listeners array.
Change dimensions in place (renderer-spec 7.7). Synchronous. The
next render() after a non-no-op update emits a complete redraw,
and output views from prior renders become invalid.
update({
width: number
width:
var process:NodeJS.Process
process.
NodeJS.Process.stdout: NodeJS.WriteStream &{
fd:1;
}
The process.stdout property returns a stream connected tostdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is
a Writable stream.
For example, to copy process.stdin to process.stdout:
import{ stdin, stdout }from'node:process';
stdin.pipe(stdout);
process.stdout differs from other Node.js streams in important ways. See note on process I/O for more information.
stdout.
WriteStream.columns: number
A number specifying the number of columns the TTY currently has. This property
is updated whenever the 'resize' event is emitted.
@since ― v0.7.7
columns,
height: number
height:
var process:NodeJS.Process
process.
NodeJS.Process.stdout: NodeJS.WriteStream &{
fd:1;
}
The process.stdout property returns a stream connected tostdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is
a Writable stream.
For example, to copy process.stdin to process.stdout:
import{ stdin, stdout }from'node:process';
stdin.pipe(stdout);
process.stdout differs from other Node.js streams in important ways. See note on process I/O for more information.
stdout.
WriteStream.rows: number
A number specifying the number of rows the TTY currently has. This property
is updated whenever the 'resize' event is emitted.
@since ― v0.7.7
rows,
});
var process:NodeJS.Process
process.
NodeJS.Process.stdout: NodeJS.WriteStream &{
fd:1;
}
The process.stdout property returns a stream connected tostdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is
a Writable stream.
For example, to copy process.stdin to process.stdout:
import{ stdin, stdout }from'node:process';
stdin.pipe(stdout);
process.stdout differs from other Node.js streams in important ways. See note on process I/O for more information.
Sends data on the socket. The second parameter specifies the encoding in the
case of a string. It defaults to UTF8 encoding.
Returns true if the entire data was flushed successfully to the kernel
buffer. Returns false if all or part of the data was queued in user memory.'drain' will be emitted when the buffer is again free.
The optional callback parameter will be executed when the data is finally
written out, which may not be immediately.
See Writable stream write() method for more
information.
@since ― v0.1.90
@param ― encoding Only used when data is string.
write("\x1b[2J");
function(local function)frame():void
frame();
});
function(local function)frame():void
frame();
}
update() takes one of two forms:
Option
Type
Description
{ width, height }
number, number
The new size in columns and rows
{ events }
Array<{ type: string }>
A list of events. Only { type: "resize", width, height } events are read, and the last one wins
update() is synchronous. After a real size change, the next render() redraws every cell. An update to the same size changes nothing.
update() does not clear the screen. When the terminal shrinks, cells outside the new size stay visible, so clear the screen before the next frame, as the example does with \x1b[2J.
update() also empties the output of earlier renders. Write each frame’s output before you call update(), or copy it with output.slice().
The process.stdout property returns a stream connected tostdout (fd 1). It is a net.Socket (which is a Duplex stream) unless fd 1 refers to a file, in which case it is
a Writable stream.
For example, to copy process.stdin to process.stdout:
import{ stdin, stdout }from'node:process';
stdin.pipe(stdout);
process.stdout differs from other Node.js streams in important ways. See note on process I/O for more information.
Sends data on the socket. The second parameter specifies the encoding in the
case of a string. It defaults to UTF8 encoding.
Returns true if the entire data was flushed successfully to the kernel
buffer. Returns false if all or part of the data was queued in user memory.'drain' will be emitted when the buffer is again free.
The optional callback parameter will be executed when the data is finally
written out, which may not be immediately.
See Writable stream write() method for more
information.
Schedules execution of a one-time callback after delay milliseconds.
The callback will likely not be invoked in precisely delay milliseconds.
Node.js makes no guarantees about the exact timing of when callbacks will fire,
nor of their ordering. The callback will be called as close as possible to the
time specified.
When delay is larger than 2147483647 or less than 1 or NaN, the delay
will be set to 1. Non-integer delays are truncated to an integer.
If callback is not a function, a TypeError will be thrown.
This method has a custom variant for promises that is available using
timersPromises.setTimeout().
@since ― v0.0.1
@param ― callback The function to call when the timer elapses.
@param ― delay The number of milliseconds to wait before calling the
callback. Default:1.
@param ― args Optional arguments to pass when the callback is called.