You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

google-api-wrapper

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

google-api-wrapper

Google API Wrapper

1.1.0
Source
npmnpm
Version published
Weekly downloads
15
7.14%
Maintainers
1
Weekly downloads
 
Created
Source

Google API Wrapper

Install

Simple Wrapper around Google Sheets & Drive APIs

npm install google-api-wrapper

This will add googleapis as dependency.

Basic Usage

const Google = require('google-api-wrapper');

async main() {
  Google.setCred(cred);
  Google.setToken(token);
  const sheets = Google.getSheets();
  const rows = await sheets.read('1nZqgw5otHxvg7by-qnYmjkyNdHAPQYgduv7Tbf5aKlw');
  console.log(rows);
}

Reading

await sheets.read(id, range = 'Sheet1');

Returns two-dimensional array of rows and column values of sheet data.

Writing

sheets.set(id, range = 'Sheet1');
await sheets.clear();
await sheets.write(row1);
await sheets.write(row2);
await sheets.endWrite();

Batches up multiple rows and then write once at interval of 500 rows, or when endWrite() is called.

Keywords

google

FAQs

Package last updated on 11 Jun 2020

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