moveCursorDownStart

import { moveCursorDownStart } from "jsr:@ende/cli/unstable-ansi";

function ยท experimental

function moveCursorDownStart(x: number = 1): string

Moves cursor position x lines down or up to the bottom margin, and to the beginning of that line.

x: number = 1

The number of lines to move down.

Returns

The ANSI escape code for moving the cursor down and to the beginning of the line.

Example: Usage

import { delay } from "@ende/async/delay";
import * as Ansi from "@ende/cli/unstable-ansi";

console.log("Hello\nWorld!");
await delay(1000);
console.log(
  Ansi.moveCursorUpStart(2) +
    "Goodbye" +
    Ansi.moveCursorDownStart() +
    Ansi.ERASE_LINE +
    "Bob!",
);

Source