firebase-save

3.0.0 • Public • Published

Build Status js-standard-style

firebase-save

Save data to firebase

Installation

$ npm i firebase-save --save

Usage

Saves and loookups values for a specific key in firebase.

  • Uses value as key if no key supplied.
  • Defaults to {} if no value is presented.
  • Supports promises and callbacks
const fbs = require('firebase-save')
const options = {
  databaseURL: '<your-database-url>'
}
 
const database = fbs(options)
 
const someData = {
  key: 'somedata',
  value: {
    fishy: true,
    birdy: true,
    ugly: {
      facts: 'alternative'
    }
  }
}
 
database.save(someData).then(data => console.log(data))
 
database.lookup({'key': 'somedata'}).then(data => console.log(data))

returns

  birdy: true, 
  fishy: true, 
  ugly: { 
    facts: 'alternative' 
  } 
}

License

MIT

alt text

Readme

Keywords

Package Sidebar

Install

npm i firebase-save

Weekly Downloads

3

Version

3.0.0

License

MIT

Unpacked Size

5.88 kB

Total Files

10

Last publish

Collaborators

  • zrrrzzt