1.1.3 • Published 4 years ago

firesheets v1.1.3

Weekly downloads
2
License
MIT
Repository
github
Last release
4 years ago

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:

ArgumentTypeDescription
sheet.idStringSheet ID of your Google Sheet.
sheet.credStringFull 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.nameStringName of your Firestore database.
db.credStringFull 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):

TypeDescription
StringString value type, if there are no type specified in the header, this will be used as the default type.
NumberInt/Double value type, automatically detect if there's any decimal and convert them to the correct int/double type.
BoolBoolean value type
MapObject 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 WorldThis is my hello world application.design, developmentus: 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 <jazzpeh@gmail.com> © 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.

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.0

4 years ago