Created
March 23, 2021 19:10
-
-
Save riccardogiorato/beeed823d576f9da850616d70b0a24a3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// import Sheets from 'node-sheets'; | |
const Sheets = require("node-sheets").default; | |
const dotenv = require("dotenv"); | |
dotenv.config(); | |
/* | |
Google Sheet example with a list of students here | |
https://docs.google.com/spreadsheets/d/1-UeQshwrIbxUwYuTIspGlSdUsy6cR1gDR6texuyB7G4/edit?usp=sharing | |
*/ | |
(async () => { | |
try { | |
const gs = new Sheets("1-UeQshwrIbxUwYuTIspGlSdUsy6cR1gDR6texuyB7G4"); | |
await gs.authorizeApiKey(process.env.GOOGLE_SHEET_KEY); | |
const table = await gs.tables("Class Data!A:F"); | |
console.log(table.headers); | |
console.log(); | |
console.log(table.rows); | |
} catch (err) { | |
console.error(err); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment