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

firestore-tools

v1.0.2

Published

firestore CLI toolbox

Readme

firestore-tools CLI

A CLI for firestore data management.

size dependencies downloads license

Features

  • export data from firestore into json
  • import data into firestore from json

Must Read Before Use

firestore-tools CLI is not suitable to use directly on production database or large datasets. It's recommended to use during concept validation, test, data mock of project development.

Getting Started

Install

Install firestore-tools globally

yarn global add firestore-tools
# or
npm install --global firestore-tools

Alternatively, you can run it using npx without install, for example

npx firestore-tools ...

Get Firebase Service Account Private Key JSON file

Go to GCP IAM & Identity Console, select your firebase project on the top. Then select the firebase adminsdk service account, create a private key and download the JSON file. This file will be used to authenticate the CLI to access firestore database with admin access.

firebase-service-account

Export

# if arguments supplied from command line, you will be prompt to give that information
firestore-tools export

# you can also supply arguments from command line
firestore-tools export --key project-id-36257f6a2dcc.json --json data.json -spaces 2 --collections Users,Posts
  • export - command name, could also use alias e
  • key - required service account private key json file
  • json - output JSON file
  • spaces - indentation in JSON file
  • collections - comma separated top level collections to export

Import

# if arguments supplied from command line, you will be prompt to give that information
firestore-tools import

# you can also supply arguments from command line
firestore-tools import --key project-id-36257f6a2dcc.json --json data.json
  • import - command name, could also use alias i
  • key - required service account private key json file

JSON

firestore-tools use JSON data schema to map the data in firestore database, below is an example.

Any key prefixed with lower dash _ has special meaning of indicating data type and structure.

{
  "collection-id": {
    "document-id": {
      "_data": {
        "geopoint": {
          "_latitude": 47.7558843,
          "_longitude": 122.2646634
        },
        "null": null,
        "number": 123456,
        "array": [
          "hello",
          "world"
        ],
        "reference": {
          "_segments": [
            "Test",
            "referred"
          ]
        },
        "map": {
          "field": "hellofield"
        },
        "timestamp": {
          "_seconds": 1580848496,
          "_nanoseconds": 0
        },
        "boolean": true,
        "string": "helloworld"
      },
      "_collections": {
        "subcollection-id": {
          "document-id": {
            "_data": {
              "text": "hello"
            },
            "_collections": {}
          }
        }
      }
    }
  }
}