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

@surefire/surefire

v1.1.0

Published

Object Document Mapper (ODM) for Firebase

Readme

Introducing StokeJS

A sophisticated ODM (Object-Document Mapper) framework for Google Firebase to easily and rapidly perform typical operations between the front and backends.

Firebase consists of an extensive set of libraries for connecting to, and interacting with the core Firebase services. They are broad in capability, but they do leave opportunity for simplifying those typical interactions.

One key example of this is the absence of an ORM/ODM (such as Sequelize, ActiveRecord etc.) Given the nature of Firebase, some of the typical features, such as associations don't really make sense, but one much needed ability is validations. Having to hand-roll your own, while not difficult, seems unnecessary given the frequency at which it would be used.

Models

It is important to note that there are really two different types of models, those that reside client-side, and those that are server-side (i.e. cloud functions). They are different due to the Firebase/Firestore SDKs that execute in the different environments. Client-side models must remain lightweight while server-side may require more detailed capabilities.

class ServerModel {}
class Model {}

Validations

At the heart of the requirements is the ability to perform validations. Determining the optionality, type, lengths etc of attributes on a model is an integral part of most applications. While we may need to support models on both the client and server side, they must adhere to the same validation rules.

Ignite will utilize an existing, well-rounded validation framework for validating schema. The schema can be applied to either side the model is to be used. They will need to run on demand, or automatically prior to creating or updating a record.

Queries

Firestore again supports a vast range of query constructs through the client sdks. They involve the construction, execution and receipt of results that can then be utilized within the application. While queries can vary and there will be times for specific, nuanced queries, the vast majority are standard. They typically involve simple criteria, pagination and sorting. In many cases, models will also utilize advanced search (i.e. full-text) as well. These must be accounted for.

Hooks

While lifecycle events are necessary, they are achieved in a very different manner to how traditional ORMs work. Specifically, they will happen on the server-side, and as such, need only apply to server-side models.

Model definition

class ProjectModel extends EntityModel {
  // Schema utilizes yup
  static schema = {}
}

class ProjectService extends EntityService {
  // Implied pluralized if not stated
  static collection = 'projects'

  // Schema utilizes yup
  static schema = {}
}

Basic methods

class EntityModel {

  // Static methods
  static async function count () {}
  static async function findOne () {}
  static async function findAll () {}
  static async function findAndCountAll () {}
  static async function searchAll () {}
  static async function searchAndCountAll () {}

  // Instance methods
  async function save () {}
  async function update () {}
  async function delete () {}
  async function validate () {}
  async function isValid () {}

}

Usage

// Client-side
const project = new Project(formData)
await project.save()

// Server-side
const project = new Project()