Socket
Socket
Sign inDemoInstall

gspread-async

Package Overview
Dependencies
69
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    gspread-async

Wrapper for the google-spreadsheet npm module using modern async methods.


Version published
Weekly downloads
1
decreased by-75%
Maintainers
1
Install size
7.47 MB
Created
Weekly downloads
 

Readme

Source

gspread-async

This module provides a wrapper for the google-spreadsheet module, exposing a subset of the most common used functionalities, using a modern async interface.

Note: The module relies on the service account authentication method described in the google-spreadsheet module.

Install

You can install with [npm]:

$ npm install --save gspread-async


Usage

You need to define an object with 3 parameters in order to get or write data to an spreadsheet:

  1. The gooogle spreadsheet id.
  2. The name of sheet you want to use.
  3. The path of the JSON file containing the authentication credentials.
const parameters = {
    docid: '<your spreadsheetid>',
    credspath: '<your path with the google credentials file>',
    sheetid: '<your sheetid>'
}

Once you have this object you can use it to either getRows, getCells or addRow to a particular sheet:


const gspreadasync = require('gspread-async')

const parameters = {
    docid: '<your spreadsheetid>',
    credspath: '<your path with the google credentials file>',
    sheetid: '<your sheetid>'
}

async function test () {
  // Get Rows
  const rows = await gspreadasync.getRows(parameters)
  // Get Cells
  const cells = await gspreadasync.getCells(parameters)
  // Add Row. The column names have to match the ones in the spreadsheet
  const cells = await gspreadasync.getCells(parameters, {col1: 'val1', col2: 'val2'})
}

test()

License

Copyright © 2019, Juan Convers. Released under the MIT License.

Keywords

FAQs

Last updated on 20 Sep 2019

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc