@mcpher/fiddler
v1.0.2
Published
A port of Apps Script library bmfiddler to Node - Google Sheets
Readme
Fiddler
Node port of Apps Script bmFiddler library
More info
See fiddler for more information and search mcpher.com for fiddler - there are lots of articles about things you can do with fiddler.
gas-fakes
This uses built in Apps Script Services, so for running in Node, we need to simulate them with gas-fakes - see gas-fakes for more information and related articles.
Getting started
Fiddler can be used without apps script services, but whenever you access sheets you'll also need gas-fakes on Node which emulates Apps Script built in services. See gas-fakes for more information and related articles and the gas-fakes repository for more information.
To install fiddler
npm i @mcpher/fiddler
To use with gas fakes
npm i @mcpher/gas-fakes
Authentication
You can use gas-fakes-cli for authentication - see gas-fakes for more information.
usage
For details on using fiddler, see fiddler and related articles. These are written for Apps Script, but gas-fakes emulation on Node means it's exactly the same.
// create a fiddler for a given sheet
const fiddler = new Fiddler(SpreadsheetApp.openById(myssid).getSheetByName("people"));
// do things with the data
fiddler.insertColumn("full name")
fiddler.mapRows (row=> {
row["full name"] = row["first name"] + " " + row["last name"]
return row
})
// dump the data back to the sheet
fiddler.dumpValues()
You can also use the preFiddler helper to create a fiddler from a sheet name and id. For details see https://ramblings.mcpher.com/vuejs-apps-script-add-ons/helper-for-fiddler/
const fiddler = new PreFiddler().getFiddler({ sheetName: "people", id: myssid, createIfMissing: true })