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

google-sheet-apis

v0.0.3

Published

![npm](https://img.shields.io/npm/v/google-sheet-apis) ![npm](https://img.shields.io/npm/dw/google-sheet-apis) ![npm bundle size](https://img.shields.io/bundlephobia/min/google-sheet-apis)

Downloads

13

Readme

npm npm npm bundle size

NPM

google-sheet-apis

How to use it

1. Install the package

npm

npm install google-sheet-apis

yarn

yarn add google-sheet-apis

2. Set up to access Google Sheet API

2.1 Create a new project in Google Console

Go to Google Console >> Select a project >> NEW PROJECT >> Type your project's name >> CREATE

2.2 Enable Google Sheets API

Select your project >> Search: Google Sheet API >> ENABLE

2.3 Create Service Accounts Credentials

Credentials >> + CREATE CREDENTIALS >> Service account >> Type your service'name >> CREATE AND CONTINUE >> CONTINUE >> DONE

2.4 Add JSON keys

Click on the email in Service Accounts >> KEYS >> ADD KEY >> Create new key >> JSON >> CREATE >> The key will be downloaded in your machine

3. Prepare a Google Sheet

Copy the email in Service Accounts >> Create a new Google Sheet >> Type your sheet name >> Share with the copied email >> Editor >> Done

Then, add some dummy data to test

4. Example to use the package

Example

const PRIVATE_KEY = 'your_private_key_in_the_json_file';
const CLIENT_EMAIL = 'your_client_email_in_the_json_file';

const { GoogleSheetApis } = require('google-sheet-apis');
const googleSheetApis = new GoogleSheetApis({
      private_key: PRIVATE_KEY,
      client_email: CLIENT_EMAIL,
});

const SPREADSHEET_ID = 'get_spreadsheet_id_in_the_sheet_URL';
// example https://docs.google.com/spreadsheets/d/1gJitO5lxYo499VYf_SyTob2Cg_iLsMwQVLDnPjBDbao/edit#gid=0
// spreadsheet id: 1gJitO5lxYo499VYf_SyTob2Cg_iLsMwQVLDnPjBDbao
const TAB_NAME = 'your_tab_name';
const START_COLUMN = 'A';
const END_COLUMN = 'F';

const getData = async () => {
      const data = await googleSheetApis.getData({
            spreadsheetId: SPREADSHEET_ID,
            tabName: TAB_NAME,
            startColumn: START_COLUMN,
            endColumn: END_COLUMN,
      });
      console.log(data);
};

getData();