Giter VIP home page Giter VIP logo

firebase-util's Introduction

Firebase-util

Build Status Coverage Status Version

This is a collection of power toys (mostly experimental) and utilities for use in Firebase.

The Tools

  • Firebase.util.NormalizedCollection Sync to multiple Firebase database paths and seamlessly merge the data into a single object. You can use most of your favorite Firebase database methods (on, once, set, etc) normally. The merged data is distributed back to the responsible paths during set/update/remove ops. View Docs and API

  • Firebase.util.Paginate Infinite scrolling and pagination with Firebase data. View Docs and API

Setup

In the browser

With Bower: bower install firebase-util

From the CDN: https://cdn.firebase.com/libs/firebase-util/x.x.x/firebase-util.min.js

<script>
   // off the global Firebase.util namespace
   var emailKey = Firebase.util.escapeEmail( anEmailAddress );

   // or in your browserify packages
   //var fbutil = require('firebase-util');
</script>

In Node

var fbutil = require('./firebase-util.js');
var emailKey = fbutil.escapeEmail( anEmailAddress );

Global Utilities

Firebase.util.logLevel(int)

Log debugging info to JavaScript console (or command line in node.js). Defaults to 'warn' (errors and warnings). This can be set or changed at any time to any of the following:

Firebase.util.logLevel(true);  // default logging (also accepts 'all' or 'on')
Firebase.util.logLevel(false); // all logging off (also accepts 0, 'off' or 'none')
Firebase.util.logLevel('error'); // error, warn, info, log, or debug

Debugging can also be enabled in the browser by adding debugLevel=x into the url's query parameters. This allows one to turn on debugging for quick troubleshooting without having to modify any code.

The logLevel() method returns a revert function that can be used to restore the logging level to it's previous value:

// log a whole lotta junk
var revert = Firebase.util.logLevel('debug');

// ...run some code...

// revert to default logging
revert();

You can also filter log output with a RegExp:

// only print logs that begin with "Path"
Firebase.util.logLevel('debug', /^Path/);

Contributing

See CONTRIBUTING.md

LICENSE

See MIT LICENSE

firebase-util's People

Contributors

bharani91 avatar firebase-ops avatar katowulf avatar lilesper avatar puf avatar startupandrew avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.