npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

firebase-connector

v1.0.5

Published

Firebase Connector - simple javascript (ES6) library to create connection with Firebase.

Downloads

12

Readme

Firebase Connector

Firebase Connector - simple javascript (ES6) library to create connection with Firebase.

Install

Just copy & paste to your command line

npm i firebase-connector --save

Repo

https://github.com/michalstol/firebase-connector/

Start

Firebase Connector is simple to use.

  • upload to your project

  • extend your class like this:

    class App extends FirebaseConnector {
    }
  • pass the firebase config like this:

    constructor() {
        super({
            apiKey: "your-api-key",
            authDomain: "your-app.firebaseapp.com",
            databaseURL: "https://your-app.firebaseio.com",
            projectId: "your-app",
            storageBucket: "your-app.appspot.com",
            messagingSenderId: "your-app-sender"
        });
    }

    How generate this config you can found on this site -> Firebase Console Page

  • use specific method & fun! :)

Variables

This library give you only few method but you can use all Firebase method. How? Just using this useful variables:

// Firebase initialize
this.app

// Firebase auth
this.auth

// Firebase database
this.db

// Firebase storage
this.storage

Method

Just few method to use Firebase

SignIn

In your extended class just call and past 2 variables:

this.signInFirebase(email, pass)

You can catch callback using this method:

this.eventSignIn(user) {
    // your code
}

this.eventSignInError(data) {
    // your code
}

this.eventSignOut(user) {
    // your code
}

GetDB

In your extended class just call and past 1 variable:

this.getDBRef(pathOfRef);

This method return object from your ref.

GetStorage

In your extended class just call and past 1 variable:

this.getStorageRef(pathOfStorage);

This method return object from your ref.

SaveDB

In your extended class just call and past 2 variables:

this.saveDBFirebase(pathOfRef, data);

UploadFiles

In your extended class just call and past object with 3 variables.

Warning - for now you can only upload file using data_url - eg. image base64.

const newFile = {
    path: 'pathOfStorage',
    file: 'userFile',
    name: 'fileName'
};

this.uploadFilesByDataUrl(newFile);

This method have 2 callbacks:

During transfer

this.eventTransferDuring(data) {
    // your code
}

During transfer

this.eventTransferComplete(event) {
    // your code
}

Test

You can also make a test. Upload repo from this place. Next install all package:

npm install

Change config in test.js and build app using this commend:

npm run test

Last step is run from /test folder test.html. Now you can signUp and build test app.