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 🙏

© 2026 – Pkg Stats / Ryan Hefner

upload-gsheet

v1.0.0

Published

Upload data to Google Sheet from repository services

Readme

Script to upload info to Google Sheets

Requirements

NOTE This information is taken from the google-api documentation for nodejs from: https://github.com/googleapis/google-api-nodejs-client#service-account-credentials

Create a service account

Service accounts allow you to perform server to server, app-level authentication using a robot account. You will create a service account, download a keyfile, and use that to authenticate to Google APIs. To create a service account:

  • Go to the Create Service Account Key page
  • Click the button Create new service account
  • Enter the service account name and the corresponding id.
  • Add the additional information regarding users and project permissions (optional)
  • Create the service account.

Once it is created you should create a keyfile, then follow the next steps:

  • Enter to the newly created service account
  • Go to the Keys tab
  • Click the button Add key and select JSON.

Save the service account credential file somewhere safe, and do not check this file into source control!

Add permissions to the document

If you want to perform operations in a private file, you should add the service mail (e.g. [email protected]) to the list of shared users in your document.

You can read this reference which explains this specific requirement: https://github.com/juampynr/google-spreadsheet-reader

How to use

The script could be used installed in your local environment, or directly from the location of the package source.

If you have installed it, the command name is upload-gsheet and admits the next options:

upload-gsheet [options]

Options:

  • -V, --version output the version number

  • -l, --log-level <level>

    Specify the log-level, by default info. Possible values: error, warning, notice, info, debug

  • --sheet-id <id>

    Specify the Spreadsheet ID which serves to update data. Also, can be specified by environmental variable GOOGLE_SHEET_ID

  • --key-file <filename>

    Specify the key filename to authenticate with Google service. By default, it is key.json.

  • -s, --service <service>

    Specify the service name from which obtain the data to upload. The available option is: github

  • --github-username <username>

    Specify the GitHub username to obtain information about repositories. Used when --service is github.

  • --github-token <token>

    Specify the GitHub Token to obtain information. Used when --service is github.

  • -h, --help display help for command

From these options, providing the --sheet-id is mandatory either via the command line or via an environmental variable GOOGLE_SHEET_ID.

Then, it is required also that you provide the key file downloaded from the Google service account, explained above.

In case you are using the script from the source folder, you can call it via:

npm run upload -- [options]

Where [options] are the options described above.

Available services

GitHub

To use this service, it requires some environment variables set:

| Variable name | Description | | ------------- | ------------ | | GITHUB_TOKEN | API token to obtain information from GitHub | | GITHUB_USERNAME | GitHub user to obtain repositories info |

These variables are required to obtain the user repositories information from GitHub. If not set, this information can also be specified via the command line options --github-token and --github-username, respectively.