1.0.8 • Published 2 years ago

firedata-connect v1.0.8

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Firedata Connect

Firedata Connect is a simple firebase import and export data library

Support

  • Storage
  • Firestore
  • Authentication

Installation

  pnpm i --save-dev firedata-connect@latest

API documentation

Firestore data import command

  firedata-import firestore --path firebase-data.json --serviceAccount serviceAccount.json
ParamsDescriptionDefault
--pathRequired. The file path to be imported-
--serviceAccountOptional. The service account of firebase projectEmulators
--emulatorsOptional. The emulators IP addresslocalhost:8085
--helpOptional. Open the commands list-
--versionOptional. Shows your current lib version-

Firestore data export command

  firedata-export firestore --path firebase-data.json --serviceAccount serviceAccount.json
ParamsDescriptionDefault
--pathRequired. The file path to be exported-
--serviceAccountOptional. The service account of firebase projectEmulators
--emulatorsOptional. The emulators IP addresslocalhost:8085
--helpOptional. Open the commands list-
--versionOptional. Shows your current lib version-

Storage data import command

  firedata-import storage --path storage-data-folder/ --bucket example-project.appspot.com --projectId example-project --serviceAccount serviceAccount.json
ParamsDescriptionDefault
--pathRequired. The file and folders path to be uploaded-
--bucketRequired. The firebase storage bucket-
--projectIdRequired if don't using emulators. The firebase project id-
--serviceAccountOptional. The service account of firebase projectEmulators
--emulatorsOptional. The emulators IP addresslocalhost:9199
--helpOptional. Open the commands list-
--versionOptional. Shows your current lib version-

Storage data export command

  firedata-export storage --dest destination-folder/ --bucket example-project.appspot.com --projectId example-project --serviceAccount serviceAccount.json
ParamsDescriptionDefault
--destRequired. The destination folder-
--bucketRequired. The firebase storage bucket-
--projectIdRequired if don't using emulators. The firebase project id-
--pathOptional Path to be exported in bucket if needed-
--serviceAccountOptional. The service account of firebase projectEmulators
--emulatorsOptional. The emulators IP addresslocalhost:9199
--helpOptional. Open the commands list-
--versionOptional. Shows your current lib version-

Examples

Firestore data JSON example:

{
  "__collections": {
    "Collection": {
      "documentId": {
        "docReference": {
          "__datatype__": "reference",
          "value": { "path": "collection/anotherdocumentid" }
        },
        "test": "test",
        "created_at": {
          "__datatype__": "timestamp",
          "value": { "seconds": 1695343756, "nanoseconds": 508000000 }
        },
        "geolocation": {
          "__datatype__": "geopoint",
          "value": { "latitude": 25, "longitude": 71 }
        }
      }
    }
  }
}

Contribuiting

Be free to open an issue or pull request!

Contribuitors

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago