Code Monkey home page Code Monkey logo

fiery-firebase-memory's Introduction

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

fiery-firebase-memory's People

Contributors

clickermonkey avatar

Watchers

 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.