1.1.2 • Published 3 years ago
node-googlesheet v1.1.2
node-googlesheet
Accelerate your productivity with this easy-to-use library for Node js
Installation
npm install node-googlesheetThe 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);1.1.2
3 years ago
1.1.1
3 years ago
1.1.0
3 years ago
1.0.20
3 years ago
1.0.19
3 years ago
1.0.18
3 years ago
1.0.17
3 years ago
1.0.16
3 years ago
1.0.15
3 years ago
1.0.14
3 years ago
1.0.13
3 years ago
1.0.12
3 years ago
1.0.11
3 years ago
1.0.10
3 years ago
1.0.9
3 years ago
1.0.8
3 years ago
1.0.7
3 years ago
1.0.6
3 years ago
1.0.5
3 years ago
1.0.4
3 years ago
1.0.3
3 years ago
1.0.2
3 years ago
1.0.1
3 years ago
1.0.0
3 years ago