Skip to main content
The Deno 2 Release Candidate is here
Learn more
Latest
function consoleSizeViaFFI
allow-ffi
Unstable
import { consoleSizeViaFFI } from "https://deno.land/x/dxx@rf/src/lib/consoleSizeViaFFI.ts";

Get the size of the console as columns/rows, via the FFI.

  • unstable ~ requires the Deno --unstable flag for successful resolution (b/c the used unstable.UnsafePointer is unstable API, as of Deno v1.19.0 [2023-01-01; rivy])
const { columns, rows } = consoleSizeViaFFI();

Returns

ConsoleSize | undefined