import { consumeChars } from "https://dotland.deno.dev/x/cliffy@v1.0.0-rc.7/table/consume_words.ts";
Consumes the maximum amount of chars from a string which is not longer than given length, ignoring ANSI codes when calculating the length. This function returns at least one char.
import { consumeChars } from "./consume_words.ts";
const str = consumeChars(9, "\x1b[31mThis is an example."); // returns: "\x1b[31mThis is a"