Skip to content
This repository has been archived by the owner on Apr 1, 2022. It is now read-only.

SKE-12/csv-to-firestore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CSV to Firebase

Ultimate Fast CLI to migrate your csv data to Firebase Firestore!!!

Installation

npm i -g csv-to-firestore

Usage

Preparation

Move your CSV file and your Google Service Account (Step to get Service Account) into the same directory

Configuration File

Before start, you have to write your own configuration file like the following template.

module.exports = {
    path: 'example.csv', // Your CSV file name
    firebase: {
        credential: 'serviceAccount.json', // Your service account file name
        collection: 'sample', // target Collection in Firestore
    },
    mapper: (dataFromCSV) => { // Mapper Method as optional field
        return dataFromCSV // Return data for saving in Firestore
    }
}

Let's Transfer!

In your Terminal or CMD run the following command.

csv-to-firestore -c <your-js-config-file> // or
csv-to-firestore --config <your-js-config-file>

Result

✔ Config File is ready !
✔ Data from CSV is ready !
✔ Firebase Admin is ready !
✔ Firebase Data Transfer Successfully !