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

firesheets

v1.1.3

Published

Import data to firestore using Google sheets via CLI

Downloads

9

Readme

npm version

Firesheets

This package makes it easy use to maintain your firebase database (Firestore) using Google Sheets via CLI.

Table of Contents

  1. Installation
  2. CLI Commands
  3. Release Notes
  4. Google Sheet Formatting
  5. More Information
  6. License

Installation

Installing Build Tools as a global module will give you command-line access to all tasks available.

You can install globally by typing the following in your terminal:

npm install firesheets  -g

To verified that it is successfully installed, run this:

firesheets --version

CLI Commands

You can use this command to import data from your Google Sheet and export to Firebase:

firesheets --args=<values>

Arguments allowed are:

| Argument | Type | Description | |--------|--------|--------| | sheet.id | String | Sheet ID of your Google Sheet. | sheet.cred | String | Full path to your Google Credential. You will need to enable your Google Sheets API. Check out here on a quick way to enable it. | db.name| String | Name of your Firestore database. | db.cred| String | Full path to your Firebase Credential. Check out here for more information on how to generate a private key file for your service account.

Example usage of arguments:

firesheets --sheet.id 1BxiMVs0XRA5nFMdKvBdBZjgmUUqptlbs74OgvE2upms --sheet.cred /Users/john/.google/credentials.json --db.name firesheets-9e63f --db.cred /Users/john/.firebase/firesheets-9e63f-firebase-adminsdk-abcdef-ghi.json

Google Sheet Formatting

First row will always be used as the column name. Indicate the type next to the column name enclosed by <>.

Allowed types are (do note that they are not case sensitve):

| Type | Description | |--------|--------| | String | String value type, if there are no type specified in the header, this will be used as the default type. | Number | Int/Double value type, automatically detect if there's any decimal and convert them to the correct int/double type. | Bool | Boolean value type | Map | Object value type, use , to separate the properties. If you need to use , in your property value, enclosed them with a double " quote. | type[] | For array, use the type of array that you want. So if you want to use a String array, enter the value as String[], map array Map[] etc. Use , to split the values for primitive value array and use ,, for Map array.

E.g.:

| Title<String> | Description<String> | Categories<String[]> | English<Map> | Localization<Map[]> | |--------|--------|--------|--------|--------| | Hello World | This is my hello world application. | design, development | us: hello, uk: hi, sg: "what's up", | country: China, text: 你好,, country: Spain, text: hola |

This will translate to:

{
    "title": "Hello World",
    "description": "This is my hello world application.",
    "categories": ["design", "development"],
    "english": {
        "us": "hello",
        "uk": "hi",
        "sg": "what's up"
    },
    "localization": [
        {
            "country": "China",
            "text": "你好",
        },
        {
            "country": "Spain",
            "text": "hola",
        }
    ]
}

Release Notes

Please refer to the Github releases section for the changelog

More Information

Small Print

Author: Jazz Peh <[email protected]> © 2020

License: MIT - do anything with the code, but don't blame me if it does not work.

Support: if you find any problems with this module, email / tweet / open issue on Github

MIT License

Copyright (c) 2020 Jazz Peh (twitter: @jazzpeh) Licensed under the MIT license.