Firebase javascript in NodeJS

I need to deploy the node.js server for some complex business logic.

Is there a firebase library / module that allows me to use promises rather than callbacks for query and update / set methods?

I found firebase-client, but it is based on REST. Do I prefer one based on javascript API if it is there?

Thanks.

+6
source share
2 answers

You are 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!'); }) 
+6
source

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

+1
source

Source: https://habr.com/ru/post/981793/


All Articles