Skip to main content
Module

x/indent_and_wrap/mod.ts>calcLines

Finds and replaces common indent, hard-wraps text, and generates text tables. 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.12/mod.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]