Skip to content

LevelDOWN adapter for Firebase realtime database

Notifications You must be signed in to change notification settings

digidem/firebase-down

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

firebase-down

Travis Coverage Status npm npm

LevelDOWN adapter for Firebase realtime database

A drop-in replacement for LevelDOWN that works with Firebase realtime database.

Can be used as a backend for LevelUP rather than an actual LevelDB store.

Table of Contents

Install

npm install --save firebase-down

Usage

var levelup = require('levelup')
var FirebaseDOWN = require('firebase-down')
var firebase = require('firebase/app')
require('firebase/database')

var config = {
  apiKey: "apiKey",
  databaseURL: "https://databaseName.firebaseio.com"
}

var firebaseApp = firebase.initializeApp(config)
var firebaseDown = FirebaseDOWN(firebaseApp)

var db = levelup('level', {db: firebaseDown})

API

`var firebaseDown = FirebaseDOWN(firebaseApp)``

Returns a constructor function that can be passed to levelup, implements the abstract-leveldown interface. firebaseApp should be an instance of firebase.app.App.

Call levelup with var db = levelup(location, {db: firebaseDown}) where location should be a string path to a key in a firebase database, e.g. /path/to/key. The leveldown database will be stored under this key.

Contribute

PRs accepted.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT © Gregor MacLennan

About

LevelDOWN adapter for Firebase realtime database

Resources

Stars

Watchers

Forks

Packages

No packages published