Skip to content

Interface: TSpreadsheet

Spreadsheet object type

Methods

get()

get<S>(sheet, schema, options?): Promise<StaticDecode<S>[]>

Fetch and parse the sheet from given sheet name.

Type Parameters

Type Parameter
S extends TCsvSchema

Parameters

ParameterTypeDescription
sheetstringThe sheet name
schemaSOutput schema mapping of each row
options?SheetOptionsSheetOptions

Returns

Promise<StaticDecode<S>[]>

An array of objects corresponded to the sheet definition

Throws

If fail to fetch or parse the sheet

Example

ts
const output = await sheets.get('sheet-name', schema);

Defined in

src/parser/spreadsheet.ts:53

Released under the MIT License.