Constructor
new Spreadsheet(associated, rules, convert_times_to_datesopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
associated |
Object | object to synchronise the spreadsheet with | |
rules |
SpreadsheetRules | rules to convert between objects and spreadsheets | |
convert_times_to_dates |
boolean |
<optional> |
guess the dates associated with times
The spreadsheet rules can include a formats member, specifying how numbers will be formatted in the associated member. Each value can be null (no special formatting), an Excel number format code, or number/time/duration (aliases for common formats). |
- Source:
Examples
console.log( spreadsheet["sheets"].length ); // number of sheets
console.log( spreadsheet["sheets"][0]["name"] ); // name of the first sheet
console.log( spreadsheet["sheets"][0]["cells"][0][1] ); // value of cell A2
-> {
"value": new Date(...),
"style": "#FFFFFF00,#FF000000FF",
}
Members
"sheets"
- Source:
associated
- Source:
Methods
(static) buffer_to_spreadsheet()
- Source:
(static) create_cell(valueopt, styleopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
* |
<optional> |
contents of the cell |
style |
string |
<optional> |
cell formatting |
- Source:
(static) parse_all_timestamps(sheet, raw_spreadsheetopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
sheet |
Array | sheet to process | |
raw_spreadsheet |
Object |
<optional> |
raw spreadsheet object from which the value was taken |
- Source:
(static) parse_csv(contents) → {Object|undefined}
Parameters:
Name | Type | Description |
---|---|---|
contents |
string | CSV file to load from |
- Source:
Returns:
- Type
- Object | undefined
(static) parse_timestamp(value, raw_spreadsheetopt) → {number}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
value |
Object | cell or value to analyse | |
raw_spreadsheet |
Object |
<optional> |
raw spreadsheet object from which the value was taken |
- Source:
Returns:
- Type
- number
load(spreadsheet) → {boolean}
Parameters:
Name | Type | Description |
---|---|---|
spreadsheet |
Object | spreadsheet to load from |
- Source:
Returns:
- Type
- boolean
serialise() → {Promise}
- Source:
Returns:
- Type
- Promise
synchronise() → {boolean}
- Source:
Returns:
- Type
- boolean