firebase-down
v2.0.0
Published
LevelDOWN adapter for Firebase realtime database
Downloads
4
Readme
firebase-down
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