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

sheetstore

v1.3.0

Published

An alternative for firebase firestore using google sheets

Downloads

9

Readme

SheetStore

npm version License: ISC

🚀 Try It Live

Try SheetStore right now with our live demo at https://spock-mauve.vercel.app/

SheetStore is a lightweight JavaScript library that provides a Firestore-like API for storing and retrieving data using Google Sheets as your backend database. It's perfect for small to medium-sized projects where you want a simple, cost-effective alternative to Firebase Firestore.

🚀 Features

  • Familiar Firestore-like API (getDocs, getDoc, addDoc, etc.)
  • Use Google Sheets as your database
  • Free tier usage with Google Sheets
  • No complex setup or authentication required (compared to Firestore)
  • Simple document-based data structure
  • Minimal dependencies

📦 Installation

npm install sheetstore

or

yarn add sheetstore

🔧 Setup

1. Create a Google Sheet

  1. Go to Google Sheets and create a new spreadsheet
  2. Name your spreadsheet (e.g., "MyAppDatabase")
  3. Create worksheets for your collections (e.g., "users", "posts")
  4. Share the sheet with the service account email:
  5. Make sure your Google Sheet is shared with the appropriate permissions:
    • For development: "Anyone with the link can edit"
    • For production: Use a service account with Google Sheets API

2. Get Your Google Sheet ID

The Sheet ID is the long string in your Google Sheet URL:

https://docs.google.com/spreadsheets/d/YOUR_SHEET_ID_HERE/edit#gid=0

📖 Usage Examples

Import SheetStore

import { getDocs, getDoc, addDoc, updateDoc, setDoc, deleteDoc } from 'sheetstore';

Fetching All Documents

const fetchUsers = async () => {
  const sheetId = 'YOUR_GOOGLE_SHEET_ID';
  const sheetName = 'users';
  
  const users = await getDocs(sheetId, sheetName);
  console.log(users);
  // Returns an array of all user documents
};

Fetching a Single Document

const fetchUser = async (userId) => {
  const sheetId = 'YOUR_GOOGLE_SHEET_ID';
  const sheetName = 'users';
  
  const user = await getDoc(sheetId, sheetName, userId);
  console.log(user);
  // Returns a single user document
};

Adding a New Document

const addUser = async () => {
  const sheetId = 'YOUR_GOOGLE_SHEET_ID';
  const sheetName = 'users';
  
  const userData = {
    name: 'John Doe',
    email: '[email protected]',
    age: 30
  };
  
  const response = await addDoc(sheetId, sheetName, userData);
  
  if (response.ok) {
    console.log('User added successfully!');
  }
};

Updating a Document

const updateUser = async (userId) => {
  const sheetId = 'YOUR_GOOGLE_SHEET_ID';
  const sheetName = 'users';
  
  const updates = {
    age: 31,
    status: 'active'
  };
  
  const response = await updateDoc(sheetId, sheetName, userId, updates);
  
  if (response.ok) {
    console.log('User updated successfully!');
  }
};

Replacing a Document

const replaceUser = async (userId) => {
  const sheetId = 'YOUR_GOOGLE_SHEET_ID';
  const sheetName = 'users';
  
  const newData = {
    name: 'John Smith',
    email: '[email protected]',
    age: 32
  };
  
  const response = await setDoc(sheetId, sheetName, userId, newData);
  
  if (response.ok) {
    console.log('User replaced successfully!');
  }
};

Deleting a Document

const removeUser = async (userId) => {
  const sheetId = 'YOUR_GOOGLE_SHEET_ID';
  const sheetName = 'users';
  
  const response = await deleteDoc(sheetId, sheetName, userId);
  
  if (response.ok) {
    console.log('User deleted successfully!');
  }
};

📊 Data Structure

SheetStore stores data in Google Sheets with the following structure:

  • Each worksheet corresponds to a collection
  • Each row represents a document
  • The first column contains a unique document ID
  • Other columns store data in the format key:value

Example Sheet Structure:

| docId:abc123 | name:John Doe | email:[email protected] | age:30 | |--------------|---------------|------------------------|--------| | docId:def456 | name:Jane Smith | email:[email protected] | age:25 |

🤝 Contributing

Contributions are welcome! Whether you're reporting bugs, suggesting features, or submitting code, your help is greatly appreciated. Feel free to open issues or submit pull requests.

📝 License

This project is licensed under the ISC License - see the LICENSE file for details.

✨ Acknowledgements

  • Inspired by Firebase Firestore
  • Built with Google Sheets API