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

gsheetobj

v1.0.6

Published

Simple objects from Google Sheets using the version 4 API.

Readme

Google Sheets Simplifier

const gsobj = require('gsheetobj')

const data = gsobj.fetch({
  spreadsheetId: <YOURSHEETID>,
  key: <YOURAPIKEY>,
}).then( ... )

const data = gsobj.save({ ... }).then( ... )

const data = gsobj.fetchMeta({ ... }).then( ... )

const data = gsobj.fetchTable({ ... },'mysheet').then( ... )

You know all that Google API stuff? Awesome, right? Well this makes it into what you really want, JavaScript objects implied from the sheet itself.

Created initially to pull down the data in a friendlier (albeit larger) way for populating Mustache templates in custom static, serverless JAMstack site generation using only Gulp (which is much simpler than setting up GraphQL as Gatsby requires). In fact, you can just include the data.json in your static site as a poor-man's read API for simple, smaller data-driven web sites.

Algorithm

The sheet meta data is first requested to get the list of tables/sheets and the timeZone. This can be done explicitly by calling fetchMeta(params).

Schema

The sheet name is required and becomes the effective table name. This means only one range per sheet.

A range is assumed to represent a collection of one-dimensional objects always with headers as property names. The default return type for any range is therefore a list of objects with properties.

If the first row of the first column is blank then the first column is assumed to be key name instead giving the object two dimensions of values, the primary from the column header, and secondary from the first column values.

Obviously headers and first-rows have to contain only unique values.

Names

Names are kept as they are allowing developers to decide to use long-hand indexing (with []) or stick with dotted notation legal names.

The only reserved name is the spreadsheet/table name meta which is used to contain information about all of the parsed data as detected. Just do not name any individual sheet in your spreadsheet meta and you are good.

Dates

By default all dates are returned as strings they way they are formatted. Usually these are going to be directly included in other output views. If conversion is needed be sure to pick a format that can be easily parsed.

This keeps strings like 7-12 from being interpreted as dates even if the field type of the spreadsheet column is not explicitly set. This simply saves time for most practical applications, which is the point of this module.

Data Preparation Suggestions

Remove any rows or columns that are not being used to avoid blanks being returned.

Although you can have as many columns as Google allows, you should limit the number of columns to the letters of the alphabet (27). This is plenty and will encourage you to keep your data at least somewhat normalized.

Hidden rows and columns are not hidden. Data will have to either be deleted from the sheet or filtered after the data is fetched and returned by the caller. This encourages you to create an aging data strategy.

Testing

Since this requires setting up a Google Sheets spreadsheet with an API key testing has been commented out by default but left in to demonstrate. (If you have a good suggestions on how that could be automated without blowing up the quota let me know.)