1.1.2 • Published 1 year ago

node-googlesheet v1.1.2

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

node-googlesheet

Accelerate your productivity with this easy-to-use library for Node js

Installation

npm install node-googlesheet

The Most Stable Version is "v1.1.2" so kindly upgrade to same.

Sample Code to read data

const { GoogleSheet } = require("node-googlesheet");

// update below variables value with your credential details...
const client_id = "";
const client_secret = "";
const refresh_token = "";
const redirect_uri = "";

const gs = new GoogleSheet("client_id_client_secret", {
    client_id, client_secret, refresh_token, redirect_uri
});

gs.setSpreadSheetToWorkWith(""); // For Ex: "1yFKedpLbKZ5MCHJaoXIz_9oc2_qoXZkUEyxTQQEfXtE"

(
    async () => {
        try {

            const data = await gs.read();

            console.log("Data : ", data);

        } catch (err) {
            console.log("err: ", err);
        }
    }
)();

Add Data

const res = await gs.append([2, "MK", 20]); 
// append method takes two parameter having an array (array of values repesenting each cell) and second is string (range where you want to append the data)

console.log("res : ", res);

Update Data

const res = await gs.update([2, "MK", 20], "Sheet!A1"); 
// update method takes two parameter having an array (array of values repesenting each cell) and second is string (range where you want to append the data)

console.log("res : ", res);

Delete Rows / Column

const res = await gs.deleteRowsOrColumn({
    sheetName: "Sheet1",
    indexesToBeDelete: {
        startIndex: 1, endIndex: 2
    }
});

console.log("res : ", res);

Submit Your Issue / Bug / Feedback

1.1.2

1 year ago

1.1.1

1 year ago

1.1.0

1 year ago

1.0.20

1 year ago

1.0.19

1 year ago

1.0.18

1 year ago

1.0.17

1 year ago

1.0.16

1 year ago

1.0.15

1 year ago

1.0.14

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago