Tool to read 📊 v4 GoogleSheets API and convert to JSON collection
Node.js library to read a Google Sheet (v4) and convert to JSON collection
npm install googlesheet-to-json --save
npm install -g googlesheet-to-json
googlesheet-to-json <spreadsheetId> -s 'Sheet1' > out.json
// see 'Getting Credentials' below
const { private_key, client_email } = require('./googleServiceAccount.json')
const GoogleSheetToJSON = require('googlesheet-to-json')
const gSheetToJSON = new GoogleSheetToJSON({ private_key, client_email })
const spreadsheetId = '1gTERIVPV_0yoMXc6mlBtBpNvaoH5pIU2IC-75V_Qcas'
const range = 'Sheet1'
gSheetToJSON.getRows({ spreadsheetId, range })
.then(rows => console.log('rows:', rows))
.catch(console.error)
googleServiceAccount.json
googleServiceAccount.json
to root of your project and add to .gitignore