How to use the gsheets.getSpreadsheet function in gsheets

To help you get started, we’ve selected a few gsheets examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github durancristhian / futbol / scripts / list-worksheets.js View on Github external
require('isomorphic-fetch');
const gsheets = require('gsheets');

const sheetID = process.env.SPREADSHEET_ID;
const getSpreadsheet = gsheets.getSpreadsheet.bind(gsheets);

Promise.resolve(sheetID)
  .then(
    (sheetID) =>
      typeof sheetID === 'undefined'
        ? Promise.reject('You have to specify a process.env.SPREADSHEET_ID')
        : Promise.resolve(sheetID)
  )
  .then(getSpreadsheet)
  .then((response) => response.worksheets)
  .then((worksheets) => worksheets.forEach((w) => console.log(`${w.title}: ${w.id}`)))
  .catch(console.error);

gsheets

Get public Google Spreadsheets as plain JavaScript/JSON

BSD-3-Clause
Latest version published 3 years ago

Package Health Score

49 / 100
Full package analysis