2.0.0 • Published 7 years ago

firebase-down v2.0.0

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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

2.0.0

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.0

7 years ago