Gathering detailed insights and metrics for @gio-shara/google-sheets-api
Gathering detailed insights and metrics for @gio-shara/google-sheets-api
Gathering detailed insights and metrics for @gio-shara/google-sheets-api
Gathering detailed insights and metrics for @gio-shara/google-sheets-api
npm install @gio-shara/google-sheets-api
Typescript
Module System
Node Version
NPM Version
60.9
Supply Chain
97.4
Quality
74.8
Maintenance
100
Vulnerability
98.4
License
TypeScript (81.35%)
JavaScript (18.65%)
Total Downloads
637
Last Day
39
Last Week
39
Last Month
51
Last Year
458
MIT License
43 Commits
1 Watchers
1 Branches
1 Contributors
Updated on Feb 16, 2023
Minified
Minified + Gzipped
Latest Version
1.0.16
Package Id
@gio-shara/google-sheets-api@1.0.16
Unpacked Size
8.20 kB
Size
3.36 kB
File Count
5
NPM Version
9.1.2
Node Version
18.12.0
Published on
Feb 18, 2023
Cumulative downloads
Total Downloads
Last Day
0%
39
Compared to previous day
Last Week
0%
39
Compared to previous week
Last Month
-69.6%
51
Compared to previous month
Last Year
627%
458
Compared to previous year
1
4
This package is a wrapper for googleapis and guides you to setup google spread sheets api for basic operations such as getting rows with a certain structure in the sheet and inserting one or multiple rows.
Let's say you have the following data in your excel spread sheet file:
If you execute the following command:
1const rows = await googleSheetsApi.getRows(); 2console.log(rows);
You'll get the following result:
1[ 2 { 3 "id": "9c00b6843944908376c3539b07d128d5", 4 "email": "hello@world.com", 5 "password": "123456789" 6 }, 7 { 8 "id": "9c00b6843944908376c3539b07d128d5", 9 "email": "hello@world.com", 10 "password": "123456789" 11 }, 12 { 13 "id": "9c00b6843944908376c3539b07d128d5", 14 "email": "hello@world.com", 15 "password": "123456789" 16 } 17]
Important: The titles has to be in the first row. Otherwise it won't work.
The caller does not have permission
which is a known issue.Import GoogleSpreadSheetsApi
class:
1const { GoogleSpreadSheetsApi } = require("@gio-shara/google-sheets-api"); 2// or 3import { GoogleSpreadSheetsApi } from "@gio-shara/google-sheets-api";
1const googleSheetsApi = new GoogleSpreadSheetsApi({ 2 spreadSheetId: process.env.SPREAD_SHEET_ID, 3 scope: "write", // or "read" 4 credentials: { 5 clientEmail: process.env.GCP_CLIENT_EMAIL, 6 privateKey: process.env.GCP_PRIVATE_KEY, 7 }, 8});
1const rows = await googleSheetsApi.getRows();
1googleSheetsApi.insertRow(["1", "hello@world.com", "123456789"]); 2 3// or 4 5googleSheetsApi.insertRows([ 6 ["1", "hello@world.com", "123456789"], 7 ["2", "hello2@world.com", "123456789"], 8]);
Let me guys know if I can improve something or implement a new feature. Request them on the following email giorgi.sharashenidze@code.berlin
No vulnerabilities found.
No security vulnerabilities found.