Git Product home page Git Product logo

firesheets's Introduction

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.

firesheets's People

Contributors

jazzpeh avatar dependabot[bot] avatar

Stargazers

ildar avatar

Watchers

James Cloos avatar  avatar

firesheets's Issues

Integrate Travis CL

After implementing the tests from #3, we can then run travis CL to help the deployment to npm registry.

Unit Tests

Should include some unit tests to prevent any changes that would break the program.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.