{"id":13555103,"url":"https://github.com/jloosli/node-firestore-import-export","last_synced_at":"2026-02-12T17:00:55.168Z","repository":{"id":30495041,"uuid":"124147311","full_name":"jloosli/node-firestore-import-export","owner":"jloosli","description":"Firestore data import and export","archived":false,"fork":false,"pushed_at":"2024-11-14T06:39:12.000Z","size":1170,"stargazers_count":395,"open_issues_count":90,"forks_count":81,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-10-27T19:11:41.974Z","etag":null,"topics":["backup","export","firebase","firestore","import","restore"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/node-firestore-import-export","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jloosli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":".github/CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null},"funding":{"github":"jloosli","patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2018-03-06T22:36:54.000Z","updated_at":"2025-10-14T16:36:52.000Z","dependencies_parsed_at":"2023-11-28T15:28:43.642Z","dependency_job_id":"95f98e6c-0af2-4b92-b601-b3c81f49cd2c","html_url":"https://github.com/jloosli/node-firestore-import-export","commit_stats":{"total_commits":196,"total_committers":12,"mean_commits":"16.333333333333332","dds":0.3571428571428571,"last_synced_commit":"58db1841731d99ea95255e3f05be28f0a8daa0c7"},"previous_names":[],"tags_count":31,"template":false,"template_full_name":null,"purl":"pkg:github/jloosli/node-firestore-import-export","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jloosli%2Fnode-firestore-import-export","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jloosli%2Fnode-firestore-import-export/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jloosli%2Fnode-firestore-import-export/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jloosli%2Fnode-firestore-import-export/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jloosli","download_url":"https://codeload.github.com/jloosli/node-firestore-import-export/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jloosli%2Fnode-firestore-import-export/sbom","scorecard":{"id":523577,"data":{"date":"2025-08-11","repo":{"name":"github.com/jloosli/node-firestore-import-export","commit":"58db1841731d99ea95255e3f05be28f0a8daa0c7"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Code-Review","score":0,"reason":"Found 1/13 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE.md:0","Info: FSF or OSI recognized license: MIT License: LICENSE.md:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"SAST","score":0,"reason":"SAST tool is not run on all commits -- score normalized to 0","details":["Warn: 0 commits out of 18 are checked with a SAST tool"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Vulnerabilities","score":0,"reason":"75 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-fpm5-vv97-jfwg","Warn: Project is vulnerable to: GHSA-4g6q-77j7-vvjc","Warn: Project is vulnerable to: GHSA-pp75-xfpw-37g9","Warn: Project is vulnerable to: GHSA-7v5v-9h63-cj86","Warn: Project is vulnerable to: GHSA-4x6g-3cmx-w76r","Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-pp7h-53gx-mx7r","Warn: Project is vulnerable to: GHSA-qwcr-r2fm-qrc7","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-pxg6-pf52-xh8x","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-r92x-f52r-x54g","Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c","Warn: Project is vulnerable to: GHSA-9j49-mfvp-vmhm","Warn: Project is vulnerable to: GHSA-wm7h-9275-46v2","Warn: Project is vulnerable to: GHSA-rv95-896h-c2vc","Warn: Project is vulnerable to: GHSA-qw6h-vgh9-j6wx","Warn: Project is vulnerable to: GHSA-2j2x-2gpw-g8fm","Warn: Project is vulnerable to: GHSA-4q6p-r6v2-jvc5","Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6","Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-78xj-cgh5-2h22","Warn: Project is vulnerable to: GHSA-2p57-rm9w-gvfp","Warn: Project is vulnerable to: GHSA-wgfq-7857-4jcc","Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33","Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959","Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6","Warn: Project is vulnerable to: GHSA-jg8v-48h5-wgxg","Warn: Project is vulnerable to: GHSA-36fh-84j7-cv5h","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-6xwr-q98w-rvg7","Warn: Project is vulnerable to: GHSA-4c7m-wxvm-r7gc","Warn: Project is vulnerable to: GHSA-pch5-whg9-qr2r","Warn: Project is vulnerable to: GHSA-w7rc-rwvf-8q5r","Warn: Project is vulnerable to: GHSA-r683-j2x4-v87g","Warn: Project is vulnerable to: GHSA-92xj-mqp7-vmcj","Warn: Project is vulnerable to: GHSA-wxgw-qj99-44c2","Warn: Project is vulnerable to: GHSA-5rrq-pxf6-6jx5","Warn: Project is vulnerable to: GHSA-8fr3-hfg3-gpgp","Warn: Project is vulnerable to: GHSA-gf8q-jrpm-jvxq","Warn: Project is vulnerable to: GHSA-2r2c-g63r-vccr","Warn: Project is vulnerable to: GHSA-cfm4-qjh2-4765","Warn: Project is vulnerable to: GHSA-x4jg-mjrx-434g","Warn: Project is vulnerable to: GHSA-3j8f-xvm3-ffx4","Warn: Project is vulnerable to: GHSA-4p35-cfcx-8653","Warn: Project is vulnerable to: GHSA-7f3x-x4pr-wqhj","Warn: Project is vulnerable to: GHSA-jpp7-7chh-cf67","Warn: Project is vulnerable to: GHSA-q6wq-5p59-983w","Warn: Project is vulnerable to: GHSA-j9fq-vwqv-2fm2","Warn: Project is vulnerable to: GHSA-pqw5-jmp5-px4v","Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j","Warn: Project is vulnerable to: GHSA-rhx6-c78j-4q9w","Warn: Project is vulnerable to: GHSA-g6ww-v8xp-vmwg","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-m6fv-jmcg-4jfg","Warn: Project is vulnerable to: GHSA-cm22-4g7w-348p","Warn: Project is vulnerable to: GHSA-hpqj-7cj6-hfj8","Warn: Project is vulnerable to: GHSA-4vrv-93c7-m92j","Warn: Project is vulnerable to: GHSA-6hwc-9h8r-3vmf","Warn: Project is vulnerable to: GHSA-qqqw-gm93-qf6m","Warn: Project is vulnerable to: GHSA-69f9-h8f9-7vjf","Warn: Project is vulnerable to: GHSA-52f5-9888-hmc6","Warn: Project is vulnerable to: GHSA-g78m-2chm-r7qv","Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7","Warn: Project is vulnerable to: GHSA-776f-qx25-q3cc","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-20T03:43:08.584Z","repository_id":30495041,"created_at":"2025-08-20T03:43:08.584Z","updated_at":"2025-08-20T03:43:08.584Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29373837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-12T08:51:36.827Z","status":"ssl_error","status_checked_at":"2026-02-12T08:51:26.849Z","response_time":55,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["backup","export","firebase","firestore","import","restore"],"created_at":"2024-08-01T12:03:01.944Z","updated_at":"2026-02-12T17:00:55.152Z","avatar_url":"https://github.com/jloosli.png","language":"TypeScript","readme":"# node-firestore-import-export\nFirestore data importing, exporting, and data clearing tool.\n\n[![codebeat badge](https://codebeat.co/badges/c7db349c-8de5-4b49-b366-55a0448eb18a)](https://codebeat.co/projects/github-com-jloosli-node-firestore-import-export-master)\n[![Codacy Badge](https://api.codacy.com/project/badge/Grade/578282c87d824a1e9aa650cdcadcdd31)](https://www.codacy.com/app/jloosli/node-firestore-import-export?utm_source=github.com\u0026amp;utm_medium=referral\u0026amp;utm_content=jloosli/node-firestore-import-export\u0026amp;utm_campaign=Badge_Grade)\n[![David badge](https://david-dm.org/jloosli/node-firestore-import-export.svg)](https://david-dm.org/jloosli/node-firestore-import-export)\n[![Known Vulnerabilities](https://snyk.io/test/github/jloosli/node-firestore-import-export/badge.svg)](https://snyk.io/test/github/jloosli/node-firestore-import-export)\n[![CircleCI](https://circleci.com/gh/jloosli/node-firestore-import-export.svg?style=svg)](https://circleci.com/gh/jloosli/node-firestore-import-export)\n\nExport a Firestore database, including collections and documents, while keeping the structure \nintact. \n\n## Table of Contents\n\n- [Data format](#data-format)\n- [Installation](#installation)\n- [Retrieving credentials](#retrieving-google-cloud-account-credentials)\n- [Usage](#usage)\n   - [Command line](#command-line)\n     - [Export](#export)\n     - [Import](#import)\n     - [Clear](#clear)\n   - [Library](#library)\n     - [Export](#exporting)\n     - [Import](#importing)\n     - [Clear](#clearing)\n- [Contributions](#contributions)\n\n\n### Data Format\n\nExports a json file with the following format:\n\n\n```json\n{\n  \"__collections__\": {\n    \"companies\": {\n      \"docA\": {\n        \"name\": \"Big Co\",\n        \"employee_count\": 2012,\n        \"created\": {\n          \"__datatype__\": \"timestamp\",\n          \"value\": {\n            \"_seconds\": 12343456,\n            \"_nanoseconds\": 7890\n          }\n        },\n        \"location\": {\n          \"__datatype__\": \"geopoint\",\n          \"value\": {\n            \"_latitude\": -123.456789,\n            \"_longitude\": 34.5678\n          }\n        },\n        \"AdministratorRef\": {\n          \"__datatype__\": \"documentReference\",\n          \"value\": \"path/to/the/document\"\n        },\n        \"__collections__\": {\n          \"employees\": ...,\n          \"products\": ...\n        }\n      },\n      \"docB\": ...,\n      \"docC\": ...\n    },\n    \"administrators\": {\n      \"docA\": ...,\n      \"docB\": ...\n    }\n  }\n}\n```\n\nwhere `__collections__` holds the collections for a given document (or the root of the database).\n\nImports need to be from a file with the same structure (e.g. from an exported file). \n\n__Be careful!__ This can easily overwrite or mess up your data if you import \nto the wrong location.\n\n#### Special Datatypes\n\nThree types of data are serialized in the export: \n\n* Timestamps\n* Geopoints\n* DocumentReferences\n\nThey each are serialized in the following format:\n\n```json\n{\n  \"__datatype__\": \"timestamp|geopoint|documentReference\",\n  \"value\": \"The serialized value\"\n}\n```\n\n## Installation\nInstall using [__npm__](https://www.npmjs.com/).\n\n```bash\nnpm install -g node-firestore-import-export\n```\n\n or [__yarn__](https://yarnpkg.com/en/)\n\n```bash\nyarn global add node-firestore-import-export\n```\n\nAlternatively download the source.\n\n```bash\ngit clone https://github.com/jloosli/node-firestore-import-export.git\n```\n\n### Retrieving Google Cloud Account Credentials\n\n1. Visit the [Firebase Console](https://console.firebase.google.com)\n1. Select your project\n1. Navigate to __Project Settings__ (at the time of writing the __gear__ icon button at the top left of the page).\n1. Navigate to __Service Accounts__\n1. Click _Generate New Private Key_\n\nThis downloaded json file contains the proper credentials needed for __node-firestore-import-export__ to authenticate.\n\n### Using Firebase Firestore Emulator\n\nIf using [Firebase Emulators](https://firebase.google.com/docs/rules/emulator-setup), all commands \n([Export](#export), [Import](#import), and [Clear](#clear)) will override the account credentials \nsetting if the `FIRESTORE_EMULATOR_HOST` environment variable is set.\n\n## Usage\n\n### Command Line\nThe path to the account credentials can either be passed with the `-a/--accountCredentials` flag, or placed in the\n`GOOGLE_APPLICATION_CREDENTIALS` environment variable. For example:\n\n```bash\nexport GOOGLE_APPLICATION_CREDENTIALS=path/to/my/credentials.json\nfirestore-export -p\n```\n\n#### Export\n* `-a`, `--accountCredentials` `\u003cpath\u003e` - path to Google Cloud account credentials JSON file. \n  If missing, will look at the `GOOGLE_APPLICATION_CREDENTIALS` environment variable for the path. \n* `-b`, `--backupFile` `\u003cpath\u003e`- Filename to store backup. (e.g. backups/full-backup.json).\n  Defaults to `firestore-export.json` if missing.\n* `-n`, `--nodePath` `\u003cpath\u003e`- Path to database node to start (e.g. collectionA/docB/collectionC).\n  Backs up full database if empty or missing.\n* `-p`, `--prettyPrint` - JSON backups done with pretty-printing.\n\n##### Examples\n###### Export full database\n```bash\nfirestore-export --accountCredentials path/to/credentials/file.json --backupFile /backups/myDatabase.json\n```\n\n###### Export with pretty printing\n```bash\nfirestore-export --accountCredentials path/to/credentials/file.json --backupFile /backups/myDatabase.json --prettyPrint\n```\n\n###### Export from a specific path (and all its children/collections)\n```bash\nfirestore-export --accountCredentials path/to/credentials/file.json --backupFile /backups/myDatabase.json --nodePath collectionA/document1/collectionCC\n```\n\n#### Import\n* `-a`, `--accountCredentials` `\u003cpath\u003e` - path to Google Cloud account credentials JSON file. \n  If missing, will look at the `GOOGLE_APPLICATION_CREDENTIALS` environment variable for the path. \n* `-b`, `--backupFile` `\u003cpath\u003e`- Filename with backup data. (e.g. backups/full-backup.json).\n* `-n`, `--nodePath` `\u003cpath\u003e`- Path to database node to start (e.g. collectionA/docB/collectionC).\n* `-y`, `--yes` - Unattended import without confirmation (like hitting \"y\" from the command line).\n\n##### Examples\n###### Import full database\n```bash\nfirestore-import --accountCredentials path/to/credentials/file.json --backupFile /backups/myDatabase.json\n```\n\n###### Import to a specific path\n```bash\nfirestore-import --accountCredentials path/to/credentials/file.json --backupFile /backups/myDatabase.json --nodePath collectionA/document1/collectionCC\n```\n\n#### Clear\n* `-a`, `--accountCredentials` `\u003cpath\u003e` - path to Google Cloud account credentials JSON file. \n  If missing, will look at the `GOOGLE_APPLICATION_CREDENTIALS` environment variable for the path. \n* `-n`, `--nodePath` `\u003cpath\u003e`- Path to database node to start (e.g. collectionA/docB/collectionC).\n* `-y`, `--yes` - Unattended clear without confirmation (like hitting \"y\" from the command line). Command will wait 5\n  seconds so you can `Ctrl-C` to stop.\n* `-w`, `--noWait` - Combine this with the `--yes` confirmation to not wait 5 seconds\n\n##### Example\n###### Clear everything under a specific node\n```bash\nfirestore-clear --accountCredentials path/to/credentials/file.json --yes\n```\n\n### Library\nThe underlying library can be used in a node or web application for importing and exporting data\nin a similar fashion\n\n#### Exporting\n\n```typescript\nimport {firestoreExport} from 'node-firestore-import-export';\nimport * as firebase from 'firebase-admin';\n\nfirebase.initializeApp({\n    apiKey: \"AIza....\",                             \n    authDomain: \"YOUR_APP.firebaseapp.com\",         \n    databaseURL: \"https://YOUR_APP.firebaseio.com\", \n    storageBucket: \"YOUR_APP.appspot.com\",          \n    messagingSenderId: \"123456789\"                  \n});\n\nconst collectionRef = firebase.firestore().collection('collectionA/docB/collectionC');\n\nfirestoreExport(collectionRef)\n    .then(data=\u003econsole.log(data));\n```\n\n#### Importing\n\n```typescript\nimport {firestoreImport} from 'node-firestore-import-export';\nimport * as firebase from 'firebase-admin';\n\nfirebase.initializeApp({\n    apiKey: \"AIza....\",                             \n    authDomain: \"YOUR_APP.firebaseapp.com\",         \n    databaseURL: \"https://YOUR_APP.firebaseio.com\", \n    storageBucket: \"YOUR_APP.appspot.com\",          \n    messagingSenderId: \"123456789\"                  \n});\n\nconst data = {\n  docA: {\n    name: 'bob',\n    __collections__: {}\n  },\n  docB: {\n    name: 'jill',\n    __collections__: {}\n  }\n};\n\nconst collectionRef = firebase.firestore().collection('collectionA/docB/collectionC');\n\nfirestoreImport(data, collectionRef)\n    .then(()=\u003econsole.log('Data was imported.'));\n```\n\n#### Clearing\n\n```typescript\nimport {firestoreClear} from 'node-firestore-import-export';\nimport * as firebase from 'firebase-admin';\n\nfirebase.initializeApp({\n    apiKey: \"AIza....\",                             \n    authDomain: \"YOUR_APP.firebaseapp.com\",         \n    databaseURL: \"https://YOUR_APP.firebaseio.com\", \n    storageBucket: \"YOUR_APP.appspot.com\",          \n    messagingSenderId: \"123456789\"                  \n});\n\nconst collectionRef = firebase.firestore().collection('collectionA/docB/collectionC');\n\nfirestoreClear(collectionRef)\n    .then(()=\u003econsole.log('Everything under collectionA/docB/collectionC was removed.'));\n```\n\n## Contributions\nFeel free to report bugs and make feature requests in the [Issue Tracker](https://github.com/jloosli/node-firestore-import-export/issues), fork and create pull requests!\n\n### Inspiration\nThe command line was inspired heavily by SteadyEquipment's [node-firestore-backup](https://github.com/steadyequipment/node-firestore-backup) \n\n## Support on Beerpay\nHey dude! Help me out for a couple of :beers:!\n\n[![Beerpay](https://beerpay.io/jloosli/node-firestore-import-export/badge.svg?style=beer-square)](https://beerpay.io/jloosli/node-firestore-import-export)  [![Beerpay](https://beerpay.io/jloosli/node-firestore-import-export/make-wish.svg?style=flat-square)](https://beerpay.io/jloosli/node-firestore-import-export?focus=wish)","funding_links":["https://github.com/sponsors/jloosli"],"categories":["TypeScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjloosli%2Fnode-firestore-import-export","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjloosli%2Fnode-firestore-import-export","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjloosli%2Fnode-firestore-import-export/lists"}