firebase-save
v3.0.0
Published
Save data to firebase
Downloads
7
Readme
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'
}
}