Methods
clearLine(directionopt)
Clears the current line in this WriteStream.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
direction |
number
|
<optional> |
1 |
Which part of the line to clear:
|
cursorTo(x, yopt)
Moves this WriteStream's cursor to the specified position.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
x |
number
|
The horizontal position (column). |
|
y |
number
|
<optional> |
The vertical position (row). If omitted, only the horizontal position is changed. |
end(dataopt, encodingopt)
Marks the TTY stream as no longer writable.
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
data |
String
|
Uint8Array
|
<optional> |
The last data to be written to the TTY stream. |
encoding |
String
|
<optional> |
The character encoding to use. |
getWindowSize() → {Array.<number>}
Returns the size of the TTY.
Returns:
- Type:
-
Array.<number>
An array containing 2 numbers [numColumns, numRows].
moveCursor(dx, dy)
Moves this WriteStream's cursor relative to its current position.
Parameters:
| Name | Type | Description |
|---|---|---|
dx |
number
|
The horizontal displacement. |
dy |
number
|
The vertical displacement. |
setEncoding(encodingopt)
Sets the encoding for the TTY write stream.
Parameters:
| Name | Type | Attributes | Default | Description |
|---|---|---|---|---|
encoding |
String
|
<optional> |
utf-8 |
The character encoding to use. |