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
| Parameter | Type | Description |
|---|---|---|
sheet | string | The sheet name |
schema | S | Output schema mapping of each row |
options? | SheetOptions | SheetOptions |
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);