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

sheets-parser

v1.0.1

Published

Parsing module for effortless Sheets-to-data conversion .

Downloads

10

Readme

sheets-parser

Parsing module for effortless Sheets-to-data conversion.

Unlike conventional database systems, sheets-parser is a read-only database module with an emphasis on simplicity of use. It takes exactly one line of code to get started with a sheets-parser database:

require('sheets-parser')(API_KEY).getDataFromSheet(SHEET_ID).then(res => console.log(res));

...and it's up and running.

Usecase

So, why use sheets-parser if it's read-only? The simplest answer - you can now deploy public read-only databases for larger datasets while keeping with Google's advanced permissions API to restrict who can manually edit stuff, and since it's in a Google Sheet, you don't need to restrict it to programmers.

As an example, check out this Pokémon GO Database, maintained by the staff of the Pokémon GO chatroom on Pokémon Showdown (shoutouts Mex for their efforts). This resource is updated regularly with no programming knowledge, and is hard to mess up - while anyone can simply read and use this data with a single line of code!

Configuration and Usage

To start a sheets-parser client, simply call the module as a function and pass it your API access key. Make sure to grant this API key access to the Sheets API.

Once you have your API key, you can use it in one of two ways. The first way is to simply pass it directly:

const API_KEY = '5u6aF578gyAH9f7tklH9v9CVT8';
const sheetsParser = require('sheets-parser')(API_KEY);

Alternatively, you can store it in the environment as process.env.GOOGLE_API_KEY.

const sheetsParser = require('sheets-parser')();

Do note that you can also supply an OAuth2 client instead of an API key to the parser - it'll still work!

Using the Parser

Once you have the sheetsParser client ready, you can start using it straight away! Currently, sheetsParser has two available methods:

  • sheetsParser.getCollections(sheetId: String): Returns a promise that resolves with a list of all available collections in the spreadsheet.
  • sheetsParser.getDataFromSheet(sheetId: String, collections?: [String], mapping?: mapFunction): Returns a promise that resolves with the data requested.

Database Layout

Please refer to this file for details on how databases are formatted.

Contributing and Issues

If you have any issues, please open an issue on this repository! I check on my projects on a daily basis, so I should get back to you within a day or two.

If you'd like to contribute to the repository, please open a pull request - I'll be going over them manually. Please stick to existing styling, and feel free to ask me if there's something you're unsure about!

Planned features

  • Add in write methods for users with an API client (as opposed to a simple API key).