npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

rekord-firebase

v1.5.6

Published

A rekord binding to firebase - implementing Rekord.rest & Rekord.live

Readme

rekord-firebase

Build Status devDependency Status Dependency Status License Alpha

A rekord binding to firebase - implementing Rekord.rest (Rekord.live & Rekord.store implicitly)

The easiest way to install is by using bower via bower install rekord-firebase.

  • rekord-firebase.js is 5.6KB (1.1KB gzipped)
  • rekord-firebase.min.js is 1.9KB (0.7KB gzipped)

Example Usage

var fire = firebase.database();

// Executed after options are applied but before the store, rest, & live
// implementations are added. It's good to prepare your database in this
// function so if you switch backends there's only one place you need to do so.
// You can also pass a prepare function as a Rekord option.
Rekord.Defaults.prepare = function(db, options) {
  db.api = options.api || fire.ref( options.name );
};

// Default behavior
var TaskList = Rekord({
  name: 'task_list',
  field: ['name', 'done']
});

// Override (or default behavior if prepare method isn't used like above)
var Task = Rekord({
  name: 'task',
  api: fire.ref('task'),
  field: ['name', 'done', 'task_list_id']
});

// Or dynamically return a firebase reference
var Item = Rekord({
  name: 'item',
  fields: ['name', 'list_id'],
  // for all, create, update, remove & query (when getQueryFirebase is not given)
  getFirebase: function(model, database) {
    // model is undefined for all() and query() functions
    return fire.ref( 'list/' + model.list_id + '/items' );
  },
  // for query
  getQueryFirebase: function(url, data) {
    return fire.ref( url );
  }
  // which reference to listen to for child events
  getLiveFirebase: function(database) {
    return fire.ref( database.name );
  }
});

Querying Example

// API REMINDER: Task.search( url, options, data, run? )

// Querying by passing an object where the keys are functions to execute on
// the query and the values are the argument to pass to the function.
var queryObject = {
  orderByChild: 'name',
  limitToFirst: 10
};
var search = Task.search( 'task', {} , queryObject, true );
search.$results; // 0-10 tasks ordered by name

// Querying by passing a function which is given a Firebase query object which
// you can call its functions as you desire.
var queryFunction = function(query) {
  query.orderByChild('name');
  query.limitToLast(10);
};
var customSearch = Task.search( 'task', {}, queryFunction, true );
customSearch.$results; // 0-10 tasks ordered by name (descending order)