Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@guidb/google-sheets

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@guidb/google-sheets

Google Sheets Api (V4) library crud database

  • 0.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Buy Me A Coffee


❄Content-Library

  • 📰 0% Ads
  • 💸 0% Tracker
  • 📃 0% Logging

❄Docs

  1. Get All getAll(range_name) example

const { googleSheets } = require("@guidb/google-sheets")
async function test() {
  var db = new googleSheets("your_sheet_id", "credentials.json")
  var range_name = "Sheet1!A2:Z";
  var data = await db.getAll(range_name)
  console.log(JSON.stringify(data, null, 2))
}

test()
//--! Result log here !--\\
/*
[
  [
    "12345",
    "azkadev",
    "azka"
  ],
  [
    "123456",
    "devano",
    "devan",
    "alaska"
  ],
  [
    "1234567",
    "",
    "farel",
    "farel"
  ]
]
*/

  1. Get getRow db.getRow(range_name, user_data, get_row_num, return_row_number) example
const { googleSheets } = require("@guidb/google-sheets")
async function test() {
  var db = new googleSheets("your_sheet_id", "credentials.json")
  var range_name = "Sheet1!A2:Z"; //--! fil your range_name !--\\
  var user_data = "12345" //--! fill find data !--\\
  var get_row_num = 0 //--! the data is 0 because it is in range a, if b is 1 and next !!--\\
  var return_row_num = 1 //--! retur row b if you want c fill 2 next... !--\\
  var data = await db.getRow(range_name,user_data, get_row_num, return_row_num)
  console.log(JSON.stringify(data, null, 2))
}

test()
//--! Result log here !--\\
/*
"azkadev"
*/

  1. Get getRows getRows(range_name, user_data, get_row_num) example
const { googleSheets } = require("@guidb/google-sheets")
async function test() {
  var db = new googleSheets("your_sheet_id", "credentials.json")
  var range_name = "Sheet1!A2:Z";
  var user_data = "12345"
  var get_row_num = 0
  var data = await db.getRows(range_name,user_data, get_row_num)
  console.log(JSON.stringify(data, null, 2))
  console.log(JSON.stringify(data, null, 2))
}

test()
//--! Result log here !--\\
/*
{
  "0": "12345",
  "1": "azkadev",
  "2": "azka"
}
*/

Before

After

  1. save save(range_name, user_data, array_save, array_update, range_name_update) example
const { googleSheets } = require("@guidb/google-sheets")
async function test() {
  var db = new googleSheets("your_sheet_id", "credentials.json")
  var array_save = [ "data1", "data 2", "data 3" ]
  var array_update = [ "data1", "data 2 update", " data 3", "new data" ]
  var range_name = "Sheet1!A2:Z";
  var range_name_update = "Sheet1!A:Z"
  var data = await db.save(range_name, array_save[0], array_save, array_update, range_name_update)
  console.log(JSON.stringify(data, null, 2))
}

test()
//--! Result log here !--\\
/*
true
*/

Before

After

  1. saverow saveRow(range_name, user_data, get_row_num, new_data, range_name0) example
const { googleSheets } = require("@guidb/google-sheets")
async function test() {
  var db = new googleSheets("your_sheet_id", "credentials.json")
  var range_name = "Sheet1!A2:Z";
  var range_name_update = "Sheet1!A:Z"
  var data = await db.saveRow(range_name, 123456, 0, "gibran", "Sheet1!C")
  console.log(JSON.stringify(data, null, 2))
}

test()
//--! Result log here !--\\
/*


*/

Before

After

  1. saverows saveRows(range_name, user_data, get_row_num, new_data_array, range_name_update, range_name_update0) example
const { googleSheets } = require("@guidb/google-sheets")
async function test() {
  var db = new googleSheets("your_sheet_id", "credentials.json")
  var range_name = "Sheet1!A2:Z";
  var data = await db.getRow(range_name, user_data, get_row_num, return_row_number)
  console.log(JSON.stringify(data, null, 2))
}

test()
//--! Result log here !--\\
/*


*/

❄To-Do

A list that i should do more for this project...

  • ✔ crud
  • 🔜 clone
  • 🔜 diagram

🖥Requirements

  • Node v10+ (Node v14 Recommended)
  • Network connection

Keywords

FAQs

Package last updated on 12 Jul 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc