Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/indent_and_wrap/private/indent.ts>calcLines

Finds and replaces common indent, hard-wraps text, generates text tables and table-based complex text layouts. Can work on text that contains terminal escape sequences.
Go to Latest
function calcLines
import { calcLines } from "https://deno.land/x/indent_and_wrap@v0.0.15/private/indent.ts";

Count number of lines in text string, and determine column number after the last character. This function only considers text substring from from to to. Lines and columns counter starts from provided values: nLine and nColumn. If options.mode is term, skips terminal escape sequences (like VT100 color codes).

Parameters

text: string
optional
options: CalcLinesOptions
optional
from = [UNSUPPORTED]
optional
to = [UNSUPPORTED]
optional
nLine = [UNSUPPORTED]
optional
nColumn = [UNSUPPORTED]