6

I need to deploy a node.js server for some complicated business logic.

Is there any firebase library/module which allows me to use promises and not callbacks for the query and update/set methods?

I've found firebase-client, but it is based on REST. Am much prefer one based on the javascript API, if there is one out there?

Thanks.

2
  • In addition to fireproof, several promise libraries can promisify libraries. Commented Jan 31, 2015 at 1:40
  • 1
    You can use the Bluebird promise library to automatically wrap an entire API in promises for you. Commented Jan 31, 2015 at 4:19

2 Answers 2

6

You're looking for Fireproof.

Fireproof wraps Firebase objects with lightweight promise support.

var Fireproof = require('fireproof'),
  Firebase = require('firebase');

var fb = new Firebase('https://test.firebaseio.com/thing'),
  fp = new Fireproof(fb);

fireproof.auth('my_auth_token').then(function() {
  fp.child('path/to/data').then(...);
}, function(err) {
  console.error('Error authenticating to Firebase!');
})
Sign up to request clarification or add additional context in comments.

Comments

3

now they have integrated promises in firebase it self. https://www.firebase.com/blog/2016-01-21-keeping-our-promises.html

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.