Skip to content

Instantly share code, notes, and snippets.

View sangramrath's full-sized avatar

Sangram Rath sangramrath

View GitHub Profile
@sangramrath
sangramrath / index.js
Last active May 8, 2020 14:44 — forked from alexismp/index.js
Node.js 8 Cloud Function to write to a Sheets document
// Copyright 2018 Google LLC.
// SPDX-License-Identifier: Apache-2.0
const {google} = require("googleapis");
const {Storage} = require("@google-cloud/storage");
exports.function2sheet = async (req, res) => {
var fileName = req.name;
const auth = await google.auth.getClient({
scopes: ['https://www.googleapis.com/auth/spreadsheets',
'https://www.googleapis.com/auth/devstorage.read_only']