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

fire-easy

v0.0.4

Published

An Angular library for firebase. It simplifies the use of the angular fire library. It abstracts away the unnecessary code and makes it easy to setup a backend connection with firebase.

Readme

FireEasy

An Angular library for firebase. It simplifies the use of the angular fire library. It abstracts away the unnecessary code and makes it easy to setup a backend connection with firebase.

Installation

npm i fire-easy --save

Usages

1. Create Model

Here is a sample model for client. Every model is required to have a toJson() and a static fromDocument(doc) method.

toJson() - This method should return an object that contains the content of the class to be stored in firestore.

fromDocument(doc) - It must take in a document and return a model of the class.

import {FireEasyModel} from "fire-easy";


export class Client implements FireEasyModel {

  id: string;
  name: string;
  email: string;

  public static fromDocument(doc: DocumentSnapshot<any>): Client {

    const client = Object.assign(new Client(), doc.data()) as Client;
    client.id = doc.id;
    return client;
  }

  public toJson(): Object {
    return {
      name: this.name,
      email: this.email,
    };
  }
}

2. Create Service

://firestore-collection-path-placeholder - This is the path to the collection where you want it to be stored.

import {CollectionService} from "fire-easy";

@Injectable()
export class ClientsService extends CollectionService<Client> {

  public constructor(public override firestore: AngularFirestore) {
    super(firestore, "://firestore-collection-path-placeholder");
  }

  protected fromDocument(doc: DocumentSnapshot<any>): Client {
    return Client.fromDocument(doc);
  }
}

3. Using in the component

All you have to do now is use it in you componet just like any other service.

Pagination Feature Usage

class: PaginationService

This library makes pagination through the collection very simple. All you have to do is extend your service to PaginationService.

import {PaginationService} from "fire-easy";

export class ClientsService extends PaginationService<Client> {}

PaginationService extends CollectionService so you get all the functionality of CollectionService plus the pagination feature.

PaginationOptions This is a configuration interface for the PaginationService.

export interface PaginationOptions {
  pageSize: number;

  orderBy: string;

  isAsc: boolean;
}

Methods

| Method | Description | |-------------------|--------------------------------------------| | getFirst() | This returns the first set of documents | | getNext() | This returns the next set of documents | | getPrevious() | This returns the previous set of documents |

Stream Feature Usage

class: CollectionStreamService

import {StreamService} from "fire-easy";

export class ClientsService extends StreamService<Client> {}

The CollectionStreamService extends CollectionService. This class has only one method stream() which make a realtime connection to the firestore collection.

Document Feature Usage

class: DocumentService

import {DocumentService} from "fire-easy";

export class ClientService extends DocumentService<Client> {}

DocumentService is similar to CollectionService the only difference is CollectionService is for firestore collection and DocumentService is for a single firestore document.