npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vsolution-dev/google-spreadsheet

v1.0.3

Published

A brief description of what this project does and who it's for.

Downloads

1

Readme

@vsolution-dev/google-spreadsheet

A brief description of what this project does and who it's for.

Description

This project utilizes the @vsolution-dev/google-spreadsheet npm package to interact with Google Sheets through the Google Sheets API. It allows for easy manipulation of spreadsheet data programmatically, enabling operations such as reading, updating, and managing records in a Google Sheets document.

Installation

To get started, you'll first need to install the @vsolution-dev/google-spreadsheet package via npm. Run the following command in your project directory:

npm install @vsolution-dev/google-spreadsheet

Setup

Before you can start using the package, you need to set up authentication with Google Cloud. Follow these steps:

  • Go to the Google Cloud Console.
  • Create a new project or select an existing one.
  • Enable the Google Sheets API for your project.
  • Create a service account and download its credentials as a JSON file.
  • Save the service account email and private key as environment variables in your project, typically in a .env file:
GOOGLE_CLOUD_PRIVATE_EMAIL=your_service_account_email_here
GOOGLE_CLOUD_PRIVATE_KEY=your_private_key_here
GOOGLE_SPREADSHEET_ID=your_spreadsheet_id_here
  • Ensure you replace your_service_account_email_here, your_private_key_here, and your_spreadsheet_id_here with your actual service account email, private key, and the ID of your Google Spreadsheet.

Basic Usage

Below is a basic example of how to use this package to open a worksheet, read a record, update a column value, and save the changes back to Google Sheets.

import { Worksheet, GoogleSheetsAPI } from "@vsolution-dev/google-spreadsheet";

// Create a GoogleSheetsAPI client
const client = GoogleSheetsAPI.create({
spreadsheetId: process.env.GOOGLE_SPREADSHEET_ID,
email: process.env.GOOGLE_CLOUD_PRIVATE_EMAIL,
key: process.env.GOOGLE_CLOUD_PRIVATE_KEY,
});

// Open a worksheet
const worksheet = await Worksheet.open("Sheet 1", { client });

// Access a record
const record = worksheet.records[0];
record['Column'] = 'New Value';

// Update the record
await record.update();

Replace "Sheet 1" with the actual name of your worksheet and 'Column' with the actual column name where you want to update the value to 'New Value'.

Contributing

Contributions are always welcome! Please adhere to this project's code of conduct.

License

MIT

Feel free to adjust the sections to fit the specifics of your project, including adding more details about the package capabilities, advanced usage examples, and any other relevant information.