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 🙏

© 2026 – Pkg Stats / Ryan Hefner

angular-firebase

v1.1.6

Published

A Firebase Module for Angular and Ionic.

Readme

angular-firebase

A package to help you using firebase in angular and ionic in an easy way.

Installation

First, install the package using npm:

   $ npm install angular-firebase --save

Then, import the package in your app.module.ts like so:

import {FirebaseModule, FirebaseProvider} from 'angular-firebase'

@NgModule({
  imports: [
    FirebaseModule
  ],
  providers: [
    FirebaseProvider
  ]
})

Finally, Intialize your firebase in app.component.ts :

  import * as firebase from 'firebase';

  constructor() {
    const config = {
      // copy firebase configuration from your firebase project
    };
    firebase.initializeApp(config);
  }

Usage

First, Inject the service in the component you want to use firebase in:

   import {FirebaseProvider} from 'angular-firebase';

   constructor(private fb: FirebaseProvider) {
 
   }

Then, run the method you want from our service:

Example:

    this.fb.getDataArr('users','value',{limitToFirst:2}).then((v)=>{
      console.log(v)
    });

Notes

  • this package is depending on firebase main package.
  • this package installs the firebase package so you can use it normally.

angular-firebase methods

Authentication

  • signupMail(email,password)
    this.fb.signupMail('[email protected]','password').then((value) => {
      console.log(value); //return any validation message like 'this email not valid'
    });
  • signinMail(email,password)
    this.fb.signinMail('[email protected]','password').then((value) => {
      console.log(value); //return any validation message like 'the email or password not correct'
    });
  • signin3rdparty(credential)
    signin3rdparty(credential).then((value) => {
      console.log(value); //return any validation message.'
    });

note this used with facebook, Google, Twitter or GitHub just setup your firebase to use this authentication methods and prepare your authentication provider to allow firebase using it

after this you should download the library for the provider to authenticate with its account at last the authentication will return the credential witch used to sign in to firebas

  • signout()
    this.fb.signout();
    //will notify the firebase that this user signed out by removing the token
  • getProfile()
    this.fb.getProfile().then((v)=>{
      console.log(v);    //show loged in user data
    });
  • verificationMail()
    this.fb.verificationMail(); // send verification email to the current loged in user
  • authState()
    this.fb.authState().then((v)=>{
      console.log(v);   //show the current state of the user "logged in as true" or not as "false"
    })
  • resetPassword(email)
    // to send a reset password email
    this.fb.resetPassword("[email protected]").then((v)=>{
      console.log(v);   //show the state of the process faild or successfully
    })
  • updateEmail(password)
    this.fb.updateEmail("password").then((v)=>{
      console.log(v);   //show the state of the process faild or successfully
    })
  • updatePassword(password)
    this.fb.updatePassword("password").then((v)=>{
      console.log(v);   //show the state of the process faild or successfully
    })

Database

  • getData(path, orderby, query object)

path: the location you want to get data from

orderby: the data you want what type of sort you want ('value', 'key', 'parent' or 'child')

query: the firebase query Ex:{startAt : value }, {endAt : value }, {equalTo : value } , {limitToFirst : value } or {limitToLast : value } also you can mixing them like {endAt : value , limitToFirst : value }

    this.fb.getData('users','value',{limitToFirst:2}).then((v)=>{
      console.log(v)
    });
  • getDataArr(path, orderby, query object)

path: the location you want to get data from

orderby: the data you want what type of sort you want ('value', 'key', 'parent' or 'child:childKey')

query: the firebase query Ex:{startAt : value }, {endAt : value }, {equalTo : value } , {limitToFirst : value } or {limitToLast : value } also you can mixing them like {endAt : value , limitToFirst : value }

    this.fb.getDataArr('users','value',{limitToFirst:2}).then((v)=>{
      console.log(v)
    });
  • setData(path, data)
    this.fb.setData('users',data).then((v)=>{
      if(v==='success'){
        //..
      } else {
        console.log(v); //show error
      }
    });
  • pushData(path, data)
    this.fb.pushData('users',data).then((v)=>{
        console.log(v); //show the uid key generated for the pushed data
    });
  • moveFbRecord(pathMoveFrom, pathMoveTo)
    this.fb.moveFbRecord('users','whereToMove');
  • copyFbRecord(pathCopyFrom, pathCopyTo)
    this.fb.copyFbRecord('users','whereToCopy');
  • increase(path)
    this.fb.increase('pressNumber'); //to make a number in this path if not exist or increase it with 1.
  • decrease(path)
    this.fb.decrease('pressNumber'); 
  • deleteData(path)
    this.fb.deleteData('pathToRemove'); 
  • checkExist(path)
    this.fb.checkExist('users'); //check if there is a data in users path
  • startListen(path, callback_method, orderby, query object)
    this.fb.startListen('users', (v)=>{
      console.log(v)
    })
    ,'value',{limitToFirst:2})
  • startListenArr(path, callback_method, orderby, query object)
    this.fb.startListenArr('users', (v)=>{
      console.log(v);
    })
    ,'value',{limitToFirst:2});
  • stopListen(path)
    this.fb.stopListen('users');  //to stop any listener functions on this path

Storage

  • uploadFile(File, filePath, callback)
    this.firebase.uploadFile(file,'images/1.jpg',
    (v)=>{
        console.log(v)    //event detect the data uploaded  used to monitor the persentage of the download process
    }).then((v)=>{
        console.log(v)    //the url of uploaded file
    });
  • uploadString(encodedFile, filePath, fileType, callback)
    this.firebase.uploadString(encodedFile,'images/1.jpg','base64',
    (v)=>{
        console.log(v)    //event detect the data uploaded  used to monitor the persentage of the download process
    }).then((v)=>{
        console.log(v)    //the url of uploaded file
    });
  • removeFile(filePath, successfulCallback, failCallback)
    this.firebase.removeFile('images/1.jpg',
    ()=>{
        // run code after succesfuly removed file
    }), 
    (error)=>{
        console.log(error)    //show any failier error message
    })
  • getFileLink(filePath)
    this.firebase.getFileLink(filePath).then((url)=>{
        console.log(url);
    });

License

MIT