-
-
Notifications
You must be signed in to change notification settings - Fork 36
newChainable
Julian Halliwell edited this page Sep 17, 2021
·
1 revision
Creates a "chainable" version of the library which doesn't require the workbook currently being operated on to be passed into each call.
newChainable( [ existingWorkbookOrNewWorkbookType ] )
-
existingWorkbookOrNewWorkbookType
spreadsheet object OR string default="": An existing spreadsheet object (workbook), or the type of new workbook to create and operate on - possible values "xls", "xlsx", "streamingXlsx".
If you don't pass an existing workbook or specify a new type, you will need to set up the workbook to operate on as the next call in the chain, for example using the .read()
, .fromCsv()
or .fromQuery()
methods.
spreadsheet.newChainable( "xlsx" )
.addRows( data )
.formatRow( { bold: true }, 1 )
.write( filepath, true );