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

x/lume/deps/sheetjs.ts>XLSX$Utils

🔥 Static site generator for Deno 🦕
Very Popular
Go to Latest
interface XLSX$Utils
import { type XLSX$Utils } from "https://deno.land/x/lume@v1.16.1/deps/sheetjs.ts";

General utilities

Methods

aoa_to_sheet<T>(data: T[][], opts?: AOA2SheetOpts): WorkSheet

Converts an array of arrays of JS data to a worksheet.

aoa_to_sheet(data: any[][], opts?: AOA2SheetOpts): WorkSheet
json_to_sheet<T>(data: T[], opts?: JSON2SheetOpts): WorkSheet

Converts an array of JS objects to a worksheet.

json_to_sheet(data: any[], opts?: JSON2SheetOpts): WorkSheet
table_to_sheet(data: any, opts?: Table2SheetOpts): WorkSheet

BROWSER ONLY! Converts a TABLE DOM element to a worksheet.

table_to_book(data: any, opts?: Table2SheetOpts): WorkBook
sheet_add_dom(
data: any,
): WorkSheet
sheet_to_json<T>(worksheet: WorkSheet, opts?: Sheet2JSONOpts): T[]

Converts a worksheet object to an array of JSON objects

sheet_to_json(worksheet: WorkSheet, opts?: Sheet2JSONOpts): any[][]
sheet_to_json(worksheet: WorkSheet, opts?: Sheet2JSONOpts): any[]
sheet_to_csv(worksheet: WorkSheet, options?: Sheet2CSVOpts): string

Generates delimiter-separated-values output

sheet_to_txt(worksheet: WorkSheet, options?: Sheet2CSVOpts): string

Generates UTF16 Formatted Text

sheet_to_html(worksheet: WorkSheet, options?: Sheet2HTMLOpts): string

Generates HTML

sheet_to_formulae(worksheet: WorkSheet): string[]

Generates a list of the formulae (with value fallbacks)

sheet_to_dif(worksheet: WorkSheet, options?: Sheet2HTMLOpts): string

Generates DIF

sheet_to_slk(worksheet: WorkSheet, options?: Sheet2HTMLOpts): string

Generates SYLK (Symbolic Link)

sheet_to_eth(worksheet: WorkSheet, options?: Sheet2HTMLOpts): string

Generates ETH

encode_cell(cell: CellAddress): string

Converts 0-indexed cell address to A1 form

encode_row(row: number): string

Converts 0-indexed row to A1 form

encode_col(col: number): string

Converts 0-indexed column to A1 form

encode_range(s: CellAddress, e: CellAddress): string

Converts 0-indexed range to A1 form

encode_range(r: Range): string
decode_cell(address: string): CellAddress

Converts A1 cell address to 0-indexed form

decode_row(row: string): number

Converts A1 row to 0-indexed form

decode_col(col: string): number

Converts A1 column to 0-indexed form

decode_range(range: string): Range

Converts A1 range to 0-indexed form

format_cell(
cell: CellObject,
v?: any,
opts?: any,
): string

Format cell

book_new(): WorkBook

Creates a new workbook

book_append_sheet(
workbook: WorkBook,
worksheet: WorkSheet,
name?: string,
roll?: boolean,
): string

Append a worksheet to a workbook, returns new worksheet name

book_set_sheet_visibility(
workbook: WorkBook,
sheet: number | string,
visibility: number,
): void

Set sheet visibility (visible/hidden/very hidden)

cell_set_number_format(cell: CellObject, fmt: string | number): CellObject

Set number format for a cell

cell_add_comment(
cell: CellObject,
text: string,
author?: string,
): void

Add comment to a cell

sheet_set_array_formula(
range: Range | string,
formula: string,
dynamic?: boolean,
): WorkSheet

Assign an Array Formula to a range

sheet_add_aoa<T>(
data: T[][],
opts?: SheetAOAOpts,
): WorkSheet

Add an array of arrays of JS data to a worksheet

sheet_add_aoa(
data: any[][],
opts?: SheetAOAOpts,
): WorkSheet
sheet_add_json(
data: any[],
): WorkSheet

Add an array of JS objects to a worksheet

sheet_add_json<T>(
data: T[],
): WorkSheet