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-nodejs

v1.0.1-1.1

Published

Firebase core for Node.js

Downloads

6

Readme

firebase-nodejs Build Status Build Status Build Status

Fixed bugs 8/2/2017

  • [x] Add callback to the some function
  • [x] Remove default path

List function update, have a callback function

  • [x] selectData
  • [x] authFacebook
  • [x] authUser updateUser updateEmail sendVerifyEmail changePassword deleteUser logout

Example new version updated.

Before updated : Have a error from return Promise, now edit.

firebaseDom.default.selectData(firebase, data_path, 'value');

New version : Remove default path. Before :

firebaseDom.default.firebaseConfig

Now :

firebaseDom.firebaseConfig

New version : Add callback function for return value from firebase query. But can't return out the function, you can use state from push on state.

firebaseDom.selectData(firebase, data_path, 'value', callback => {
   this.setState({
      callback: callback,
   });
});

Firebase SDK for Node.js

Get install !!

npm install --save firebase-nodejs firebase

Optionals

  • selectData For select data from firebase
  • insertData For insert data into firebase
  • deleteData For delete data on firebase
  • updateData For update data on firebase
  • authUser For manage user on firebase
  • authFacebook For auth from facebook

New update 5/3/2017

  • searchData => searchByValue You can use for search data by value

How to use it ?

Create firebase.js on you app folder, and write code below. You can use data from your firebase project.

import * as firebaseDom from 'firebase-nodejs';

var config = {
    apiKey: '',
    authDomain: '',
    databaseURL: '',
    storageBucket: '',
};
const firebase = firebaseDom.firebaseConfig(config);
export default firebase;

So you add my code on you another file for use firebase.

Examples

import firebase from './firebase'; //add you firebase.js path
import * as firebaseDom from 'firebase-nodejs';

export class TestApp extends Component{
  constructor(props) {
    super(props);
    this.state = {
      member: {},
    };
  }
  
  getMemberData(){
    let memberData = firebaseDom.selectData(firebase, '/member/id/1', 'value', callback => {
        this.setState({
           member: callback,
        });
    });
  }
  
  render(){
     return(
       .
       .
       .
     )
   }
}

Use another

authUser an authFacebook

You can authen user from firebase, Use facebook loggin only.

Get current user.

const data = firebaseDom.authUser.currentUser(firebase);

Logon by use facebook access token.

firebaseDom.authFacebook(firebase, accessToken , callback => {
    console.log(callback);
});

User data.

let currentUserData = firebaseDom.authUser.currentUser(firebase);
currentUserData.name = 'new my name';
firebaseDom.authUser.updateUser(firebase, currentUserData, callback => {
    console.log(callback);
});

User email.

firebaseDom.authUser.updateEmail(firebase, '[email protected]', callback => {
    console.log(callback);
});

User delete.

firebaseDom.authUser.deleteUser(firebase, callback => {
    console.log(callback);
});

Logout !

firebaseDom.authUser.logout(firebase, callback => {
    console.log(callback);
});

searchData

Search by value

const searchKey = 'member_name';
const searchValue = 'handdleName';
firebaseDom.searchData.searchByValue(firebase, '/member/id/', searchKey, searchValue, callback => {
    console.log(callback);
})

selectData

firebaseDom.selectData(firebase, '/member/id/1', 'value', callback => {
    console.log(callback);
});

insertData

const member = {
  name: 'test',
  age: 17,
}
const insertStatus = firebaseDom.insertData(firebase, '/member/id/2', member);

updateData

const member = {
  name: 'test',
  age: 18,
}
const updateStatus = firebaseDom.updateData(firebase, '/member/id/2', member);

deleteData

const deleteStatus = firebaseDom.deleteData(firebase, '/member/id/2');