deleteCharacters

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

function ยท experimental

function deleteCharacters(x: number = 1): string

Deletes x characters at cursor position and to the right. Shifting line content left.

x: number = 1

The number of characters to delete.

Returns

The ANSI escape code for deleting characters.

Example: Usage

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

console.log("Hello World!");
await delay(1000);
console.log(
  Ansi.moveCursorUpStart() +
    Ansi.deleteCharacters(5) +
    "Bye",
);

Source