1. fiery-firebase-memory
An in memory TypeScript/JS clone of Firebase & Firestore
fiery-firebase-memory
Package: fiery-firebase-memory
Last modified: Mon, 02 May 2022 08:59:50 GMT
Version: 1.0.0
License: MIT
Downloads: 255

Install

npm install fiery-firebase-memory
yarn add fiery-firebase-memory

Fiery Firebase Memory

This is a clone of Firebase Realtime Database & Firestore in TypeScript/JS which stores the data in memory.

!!! At the moment, only the Firestore code is "fully" developed !!!

Installation

npm install fiery-firebase-memory

Example with default app (just like normal firebase)

 import firebase from 'fiery-firebase-memory'

firebase.initializeApp({
  // config for default app - doesn't mean anything for this library
});

var fs = firebase.firestore();

// fs.app is available

fs.doc('path/to/doc')
  .set({ values: 'many', created_at: new Date() });

fs.collection('path/to')
  .where('values', '==', 'many')
  .orderBy('created_at')
  .onSnapshot(querySnapshot => {
    // realtime changes on the results of the query
  })
;

Example with named app

 var app = firebase.initializeApp({ /* config */ }, 'namedApp');
var fs = firebase.firestore('namedApp');

Where can I access the stored data?

  • firestoreInstance._docs: an object of documents where the key is their full path
  • firestoreInstance._collections: an object of collections (array of document ids) where the key is their full path

Currently Unsupported Functionality

  • firebase#database
  • firebase.app.App#auth
  • firebase.app.App#database
  • firebase.app.App#delete
  • firebase.app.App#messaging
  • firebase.app.App#storage
  • firebase.firestore.Firestore#disableNetwork
  • firebase.firestore.Firestore#enableNetwork
  • firebase.firestore.Firestore#enablePersistence
  • firebase.firestore.Firestore#setLogLevel
  • firebase.firestore.FieldPath
  • firebase.firestore.Transaction
  • firebase.firestore.WriteBatch

RELATED POST

10 Must-Know Windows Shortcuts That Will Save You Time

10 Must-Know Windows Shortcuts That Will Save You Time

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Arrays vs Linked Lists: Which is Better for Memory Management in Data Structures?

Navigating AWS Networking: Essential Hacks for Smooth Operation

Navigating AWS Networking: Essential Hacks for Smooth Operation

Achieving Stunning Visuals with Unity's Global Illumination

Achieving Stunning Visuals with Unity's Global Illumination

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code

Nim's Hidden Gems: Lesser-known Features for Writing Efficient Code