deleteLines

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

function ยท experimental

function deleteLines(x: number = 1): string

Deletes x lines at cursor position. Shifting below lines up.

x: number = 1

The number of lines to delete.

Returns

The ANSI escape code for deleting lines.

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() + Ansi.deleteLines());
await delay(1000);
console.log("and Goodbye!");

Source