# firebase-util

> A set of experimental power tools for Firebase.

Latest version **0.2.5** (published 2015-08-20) · 0 weekly downloads

## Install

```sh
npm install firebase-util
pnpm add firebase-util
yarn add firebase-util
bun add firebase-util
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.2.5 |
| Published | 2015-08-20 |
| First published | 2015-03-23 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 272 |
| Author | Firebase |
| Maintainers | firebase |
| Keywords | firebase, realtime, utilities |

## Links

- npm: https://www.npmjs.com/package/firebase-util
- Repository: https://github.com/firebase/firebase-util
- Issues: https://github.com/firebase/firebase-util/issues
- npm.io page: https://npm.io/package/firebase-util

## Dependencies (1)

- [firebase](https://npm.io/package/firebase.md) 2.2.x

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 0.2.5 (latest) — 2015-08-20
- 0.2.4 — 2015-04-15
- 0.2.3 — 2015-03-31
- 0.2.2 — 2015-03-23
- 0.2.1 — 2015-03-23

## README

# Firebase-util

[![Build Status](https://travis-ci.org/firebase/firebase-util.svg?branch=master)](https://travis-ci.org/firebase/firebase-util)
[![Coverage Status](https://img.shields.io/coveralls/firebase/firebase-util.svg)](https://coveralls.io/r/firebase/firebase-util)
[![Version](https://badge.fury.io/gh/firebase%2Ffirebase-util.svg)](http://badge.fury.io/gh/firebase%2Ffirebase-util)

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](src/NormalizedCollection/README.md)

 - **Firebase.util.Paginate**
   Infinite scrolling and pagination with Firebase data. [View Docs and API](src/Paginate/README.md)

## 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

```javascript
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:

```javascript
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:

```javascript
// 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:

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

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md)

# LICENSE

See [MIT LICENSE](MIT)

---
_Source: https://npm.io/package/firebase-util · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
