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

@componet17/firebaseorm

v1.0.6

Published

ORM for Google Firebase. Alpha version

Readme

Reactive Google Firebase ORM

Reactive Google Firebase ORM

!!! Alpha Version !!!

https://github.com/component17/firebaseORM/wiki

Methods

  • create
  • update
  • delete
  • find
  • save
  • query
  • all

| method | params | description | | ----- | ----- | ---------- | | create |params*| Model object with data e.g {title: "Post title", text: "new post"}| | update | key*, params* | update row with key key | | delete | key* | remove row. if key not set, row will be removed with model key, if has call after Post.find() e.g, or manual setted by Model.key = 'somekey'| | find | key*, callback | find row with key key | | save | | save model | | query | | see bottom for more info about query | | all | callback| get all rows of table from the model |

all params with * required

Query

  • Query setters
    • where(value1, value2)
    • orderBy(field)
    • orderByKey(key)
    • limit(limit = 25)
  • Query getters
    • first(callback)
    • last(callback)
    • get(callback)
Post.where('New title').orderBy('pub_date').limit(10).get((posts) => {
    this.posts = posts;
});

Example

Posts.js

'use strict'
const firebaseorm = require('@componet17/firebaseorm');

export default class Posts extends firebaseorm {
    constructor() {
        super();

        this.firebase = {
            apiKey: "",
            authDomain: "",
            databaseURL: "",
            projectId: "",
            storageBucket: "",
            messagingSenderId: ""
        };
        this.table = 'posts';
        /** with validation **/
        this.fields = {
            name: {
                required: true,
                type: Number,
                min: 3,
                max: 20
            },
            email: {
                required: true,
                type: 'email',
            },
            password: {
                required: true,
                type: String,
                regex: /^[a-z0-9]{6,32}$/i
            },
            phone: {
                required: false,
                type: Number,
                defaults: 89663632121
            }
        };
        /** without validation**/
        //this.fields = ['name', 'email', 'password', 'phone'];

        /** don't forget call __construct method! **/
        this.__construct();

    };

    user = () => {
        console.log('user');
        return this.belogonsTo('test', 'user');
    };

    MTM = () => {
        return this.belongsToMany('post-user', 'post', 'test');
    };

}

Vue example

    import Posts from './Posts';
    export default {
        data() {
            return {
                posts: {},
                post: {}
            }
        },


        methods: {
             query() {
                //
             },
             manyToMany() {
                let Post = new Posts;
                let User = new Users;
                Post.find('-Kr0OupE6kfS38QDrJff').then((post) => {
                    User.find('-KqxS6Gm0vtBUJT-ng-3').then((user) => {
                        Post.MTM().attach(User);
                        //Post.MTM().attach(User2);
                        //Post.MTM().attach(User3);
                    });
                });
             },

             getManyToMany() {
                let Post = new Posts;
                let User = new Users;
                Post.find('-Kr0OupE6kfS38QDrJff').then((post) => {
                    Post.MTM().get((data) => {
                        console.log(data);
                    });
                });
            }

             belognsTo() {
                let User = new Users();
                User.find('-Kqw4Tvobvdr-RbtX8ZO').then((data) => {
                    let Post = new Posts();
                    Post.title = 123;
                    Post.text = `lorem50`;
                    Post.save().then((post) => {
                        Post.user().attach(User);
                    });

                }).catch((e) => {
                    console.error(e);
                })

            },

            findPost() {
                let Post = new Posts();
                /**
                    with callback for reactivity
                **/
                Post.find('-postid', (post) => {
                    //reactive update with callback
                    this.post = post;
                    // post = Post Model with data
                    // post.save(), post.delete() and any methods works
                }).then((post) => {
                    setTimeout(() => {
                        Post.title = "New title";
                        Post.save();
                    }, 10000); //this.post.title = "New title";
                });

                /**
                    just get post data
                **/
                Post.find('-badpostid').then((post) => {
                    this.post = post;
                }).catch( e =>  console.error(e);//row not found );

            },


            editPost() {
                Post.find('-postid').then((post) => {
                    Post.title = "New title";
                    Post.save();
                }).catch((e) => {
                    console.error(e);
                });
            }

            deletePost() {
                let Post = new Posts();
                Post.delete('-postid');
            },

            createPost() {
                let Post = new Posts();
                Post.title = "My first post";
                Post.text  = "lorem...";
                Post.save().then((post) => {
                    console.log(post);
                    this.post = post;
                }).catch((e) => {
                    console.error(e);
                });
            }
        }
    }