Skip to content

Latest commit

 

History

History
43 lines (33 loc) · 1.08 KB

README.md

File metadata and controls

43 lines (33 loc) · 1.08 KB

csv-to-firebase

A small command line tool to update firebase database on firebase from a csv file.

Installation

 npm install -g csvtofirebase

Usage

csvtofirebase <path/to/csv-file> <path/to/private-key-file> "your-database-url.firebaseio.com" <reference in firebase> <key for each csv row>

You can get your private key JSON file by going to Service Accounts tab in your project's settings page.

Example

Let's say we have a csv data file containing users information. Now we wanna store user's data at the /users reference in the database. For each item, we want the key to be userId. So the command that we'll run will be:

csvtofirebase myUsers.csv private.json "your-database-url.firebaseio.com" users memberId

This will save data in the firebase /users reference like this:

- users
  - 10001
    - name
    - userId
    - favColor
  - 10002
    - name
    - userId
    - favColor

License

License

MIT © ateev