# firebase-import

> npm config for Firebase Import

Latest version **2.2.2** (published 2021-02-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install firebase-import
pnpm add firebase-import
yarn add firebase-import
bun add firebase-import
```

Provides the command `firebase-import`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.2.2 |
| Published | 2021-02-24 |
| First published | 2013-06-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 12.1 KB |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 382 |
| Author | Firebase |
| Maintainers | hiranya911, firebase-ops, feiyang.chen, chholland, google-wombot |
| Keywords | firebase, import |

## Links

- npm: https://www.npmjs.com/package/firebase-import
- Repository: https://github.com/firebase/firebase-import
- Homepage: https://github.com/firebase/firebase-import#readme
- Issues: https://github.com/firebase/firebase-import/issues
- npm.io page: https://npm.io/package/firebase-import

## Dependencies (5)

- [firebase](https://npm.io/package/firebase.md) ^3.4.0
- [optimist](https://npm.io/package/optimist.md) ^0.6.1
- [progress](https://npm.io/package/progress.md) ^1.1.8
- [JSONStream](https://npm.io/package/JSONStream.md) ^1.2.1
- [firebase-admin](https://npm.io/package/firebase-admin.md) ^6.0.0

## Recent versions

- 2.2.2 (latest) — 2021-02-24
- 2.2.0 — 2018-10-11
- 2.1.0 — 2018-03-09
- 2.0.0 — 2016-09-19
- 1.1.3 — 2016-01-05
- 1.1.2 — 2014-06-02
- 1.1.1 — 2014-04-30
- 1.0.0 — 2013-06-14

## README

# Firebase-Import
Firebase-import is a helper utility for importing large JSON files into your 
[Firebase Realtime Database](https://firebase.google.com/docs/database/). It breaks the JSON into smaller
chunks and uploads them individually through the Firebase API.

This utility is designed and tested for imports of files up to 400MB.

## Installing

Install the firebase-import module globally:

    $ npm install -g firebase-import

or install it locally and add it to your path:

    $ npm install firebase-import
    $ export PATH=$PATH:`npm bin`

## Obtaining Service account file
Using your Google account, login to Firebase console: https://console.firebase.google.com/

See Example below

1. Project Settings ->
2. Service Accounts ->
3. Generate new private key

![Service Account Image](https://image.ibb.co/cBuuo9/service_account.png)


## Usage

    $ firebase-import
    Usage: firebase-import

    Options:
      --database_url     Firebase database URL (e.g. https://databaseName.firebaseio.com).   [required]
      --path             Database path (e.g. /products).                                     [required]
      --json             The JSON file to import.                                            [required]
      --merge            Write the top-level children without overwriting the whole parent.
      --force            Don't prompt before overwriting data.
      --service_account  Path to a JSON file with your service account credentials.

## Example

    $ firebase-import --database_url https://test.firebaseio-demo.com --path / --json test.json --service_account /path/to/your/service_account.json
    All data at https://test.firebaseio-demo.com/ will be overwritten.
    Press <enter> to proceed, Ctrl-C to abort.

    Reading /Users/michael/tmp/test.json... (may take a minute)
    Preparing JSON for import... (may take a minute)
    Importing [=================================================] 100% (9431/9431)
    Import completed.

Or an example of merging the contents of test.json with what's already in Firebase:

    $ firebase-import --database_url https://test.firebaseio-demo.com --path / --json test.json --merge --service_account /path/to/your/service_account.json
    Each top-level child in test.json will be written under https://test.firebaseio-demo.com/.
    If a child already exists, it will be overwritten.
    Press <enter> to proceed, Ctrl-C to abort.

    Reading /Users/michael/tmp/test.json... (may take a minute)
    Preparing JSON for import... (may take a minute)
    Importing [=================================================] 100% (9431/9431)
    Import completed.

---
_Source: https://npm.io/package/firebase-import · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
