Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
function $consoleSize.consoleSizeSync
Unstable
import { $consoleSize } from "https://deno.land/x/dxx@rf/src/lib/$locals.ts";
const { consoleSizeSync } = $consoleSize;

Get the size of the console used by rid as columns/rows, using options.

  • unstable ~ requires the Deno --unstable flag for successful resolution (b/c the used Deno.consoleSize() function is unstable API [as of Deno v1.19.0, 2022-02-17])
  • results are cached; cached entries will be ignored/skipped when using the { useCache: false } option
const { columns, rows } = consoleSizeSync(Deno.stdout.rid, {...});

Parameters

optional
rid: number = [UNSUPPORTED]

~ resource ID

optional
options_: Partial<ConsoleSizeOptions> = [UNSUPPORTED]

Returns

ConsoleSize | undefined