🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

googlesheet-to-json

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

googlesheet-to-json

Node.js library to read from Google Sheets API (v4) and convert to JSON collection

latest
Source
npmnpm
Version
1.0.0
Version published
Maintainers
1
Created
Source

Googlesheet-to-json

Node.js library to read a Google Sheet (v4) and convert to JSON collection

Install

npm install googlesheet-to-json --save

Setup Google API credentials (Service Account)

See getting credentials

CLI

npm install -g googlesheet-to-json
googlesheet-to-json <spreadsheetId> -s 'Sheet1' > out.json

API

// 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)

Getting credentials

Keywords

google

FAQs

Package last updated on 10 Nov 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts