Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@firebase/util

Package Overview
Dependencies
Maintainers
4
Versions
3196
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@firebase/util

_NOTE: This is specifically tailored for Firebase JS SDK usage, if you are not a member of the Firebase team, please avoid using this package_

  • 1.9.7-canary.08bb87b9f
  • Source
  • npm
  • Socket score

Version published
Maintainers
4
Created

What is @firebase/util?

The @firebase/util package provides a collection of utility functions that are used across the Firebase JavaScript SDK. These utilities include tasks such as encoding and decoding, URL manipulation, and deep object merges. This package is mainly used internally by Firebase, but it can also be used directly to leverage some of its utility functions in your projects.

What are @firebase/util's main functionalities?

Encoding and Decoding Base64

This feature allows you to encode and decode strings to and from Base64. It's useful for encoding data that needs to be safely transmitted over a network.

"use strict";
const { base64Encode, base64Decode } = require('@firebase/util');

const encoded = base64Encode('Firebase');
console.log(encoded); // Output: RmlyZWJhc2U=

const decoded = base64Decode(encoded);
console.log(decoded); // Output: Firebase

Deep Merge Objects

This feature provides functions to deeply copy and merge JavaScript objects. It's particularly useful when you need to combine settings or configurations.

"use strict";
const { deepCopy, deepExtend } = require('@firebase/util');

const obj1 = { a: 1, b: { c: 2 } };
const obj2 = { b: { d: 3 }, e: 4 };

const merged = deepExtend(obj1, obj2);
console.log(merged); // Output: { a: 1, b: { c: 2, d: 3 }, e: 4 }

URL Manipulation

This feature allows you to easily construct query strings from objects, which is useful for creating URLs with parameters.

"use strict";
const { querystring } = require('@firebase/util');

const queryString = querystring({ a: 1, b: 'Firebase' });
console.log(queryString); // Output: ?a=1&b=Firebase

Other packages similar to @firebase/util

FAQs

Package last updated on 06 Aug 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc