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

json-firestore-seed

v0.1.8

Published

Seed Firestore with JSON data easily.

Readme

Features

  • Fast: Parallel insertions with configurable concurrency.
  • Efficient: Support for Firestore Batch Writes to reduce write pressure.
  • Flexible: Specify document IDs via a field or let Firestore auto-generate them.
  • Safe: Preview transformations with --dry-run mode.
  • Robust: Automatic retries with exponential backoff for transient failures.
  • Timestamps: Native support for Firestore Timestamps using special markers.

Installation

Via Cargo (Recommended)

If you have Rust installed, you can install with cargo:

cargo install json-firestore-seed

Via Homebrew

brew tap shayyz-code/tap
brew install json-firestore-seed

Via NPM

npm install -g json-firestore-seed

Via GitHub Releases

Download the latest binary for your platform from the Releases page.

Authentication

By default, the tool looks for a service account key file named application_default_credentials.json in the current directory.

  1. Firebase Console → Project Settings → Service Accounts
  2. Click Generate new private key
  3. Save it and provide the path using the -k or --credentials flag.

Usage

json-firestore-seed -j data.json -c users -p my-firestore-project

Parameters

| Flag | Long Form | Default | Description | | ---- | --------------- | ---------------------------------------- | --------------------------------------- | | -j | --json | (required) | Path to JSON file (must be an array) | | -c | --collection | (required) | Target Firestore collection name | | -p | --project | (required) | Google Cloud Project ID | | -k | --credentials | ./application_default_credentials.json | Path to service account JSON key file | | -i | --id-field | (auto-generate) | Field in JSON to use as document ID | | -d | --dry-run | false | Preview transformations without writing | | -m | --concurrency | 4 | Number of parallel write tasks | | -r | --retries | 3 | Number of retries for failed writes | | -b | --batch-size | 1 | Items per Firestore batch (max 500) |

JSON Format & Timestamps

The input JSON must be an array of objects.

Firestore Timestamp Markers

  • __fire_ts_now__: Sets the field to the current server time.
  • { "__fire_ts_from_date__": "YYYY-MM-DD HH:MM:SS" }: Parses a specific date string. Supports RFC3339 and common naive formats.

Example:

[
    {
        "id": "user_1",
        "name": "Alice",
        "created_at": { "__fire_ts_from_date__": "2024-11-11T11:21:56Z" },
        "updated_at": "__fire_ts_now__"
    }
]

Troubleshooting

"Authentication failed"

  • Ensure your service account key is valid and has the Cloud Datastore User or Firebase Firestore Admin role.
  • Verify the path to your credentials file using --credentials.

"Permission Denied"

  • Check if the Project ID matches your Firestore instance.
  • Ensure the service account has write access to the specific collection.

"JSON must be an array"

  • The root element of your JSON file must be a [ (array). Individual objects are not supported as top-level elements.

Contributing

  1. Fork the repository.
  2. Create your feature branch (git checkout -b feature/amazing-feature).
  3. Commit your changes (git commit -m 'feat: add amazing feature').
  4. Push to the branch (git push origin feature/amazing-feature).
  5. Open a Pull Request.

License

MIT License — free for personal & commercial use.

Copyright (c) 2025 shayyz-code.