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

@giancarlosgza/blog-firebase

v0.4.6

Published

Firebase backend for the blog packages: Firestore and Storage rules, indexes and the scheduled-publish Cloud Function

Readme

@giancarlosgza/blog-firebase

The Firebase side of the blog packages: Firestore and Storage security rules, Firestore indexes and the scheduled-publish Cloud Function. Install it in the repo that deploys the Firebase project (usually the admin), so rules, indexes and functions upgrade with the layers.

The data contract is described in docs/schema.md.

Rules and indexes

npm install -D @giancarlosgza/blog-firebase

Point firebase.json at the package files:

{
  "firestore": {
    "rules": "node_modules/@giancarlosgza/blog-firebase/firestore.rules",
    "indexes": "node_modules/@giancarlosgza/blog-firebase/firestore.indexes.json"
  },
  "storage": {
    "rules": "node_modules/@giancarlosgza/blog-firebase/storage.rules"
  }
}

Staff access comes from admins/{uid}.role (admin or editor) in Firestore; the Storage rules read it too. To customize the rules, copy the files into the repo instead.

That Firestore read from the Storage rules is a cross-service call, which Firebase only allows once the Storage service agent may read Firestore. Run the first Storage rules deploy interactively and accept the prompt (--non-interactive skips it), or click Fix issue on the Storage rules banner in the console. Without it, every upload is denied, staff included.

Scheduled publishing

Publishes posts whose status is scheduled once publishAt has passed, with the same steps as the admin's publish route (sanitized body into postContents, status, history event). It runs hourly.

In the functions codebase, add this package as a regular dependency next to firebase-admin and firebase-functions (Cloud Build skips devDependencies):

// functions/index.js
const { createPublishScheduledPosts } = require('@giancarlosgza/blog-firebase')

exports.publishScheduledPosts = createPublishScheduledPosts({ region: 'us-central1' })

Any onSchedule option (schedule, region, timeZone, memory...) can be passed. The Admin SDK is initialized on the first run when the codebase has not done it. publishDuePosts(db, now) and publishScheduledPost(db, slug, now) are exported for custom triggers and tests.

Development

pnpm test:rules (from the repo root) runs the rules tests on the Firestore and Storage emulators. It needs the Firebase CLI and Java.