Skip to content

Latest commit

 

History

16 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fire Grabber

Build Status

Simple wrapper / helper method for getting data from a different node in Firebase

Installation

npm install fire-grabber

Usage

The retrieve method accepts two arguments that should be valid firebase paths. Say you have a team node /teams/{teamid}/members with a list of uids, but would like to get the associated user information for all team members stored under /Users/{uid}. You would pass /teams/{teamid}/members as the first argument and /Users as the second argument.

Example:

// import
var fireGrabber = require('fire-grabber');

// Firebase config
var config = {...}

// initialize
fireGrabber.initialize(config);

// example usage
var teamMemberInfo = fireGrabber.retrieve('/teams/12345/members', '/Users').then(data => {
// returns all the user info from the list of member keys
console.log(data);
});

The retrieveWithArr method also accepts two arguments, one being an array of firebase keys, and the second being a valid firebase path. This is useful if you already have an array of keys that correspond to data stored in another path.

Example:

fireGrabber.retrieveWithArr('/teams/12345/members', [10,20,30,40]).then((data) => {
  // returns all the user info from the array of user keys
  console.log(data);
});

Tests

npm test

Contributing

Feel free to add/change anything you feel is needed.

About

Simple wrapper / helper method for getting data from a different node in Firebase

Topics

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Used by

Contributors

Languages