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

rapt-modelrizerly

v0.2.2

Published

Object-modeling framework for mongodb and redis.

Readme

Modelrizerly

An object-modeling framework for mongodb and redis.

Status

This software is actively under development and should not yet be used in production environments!

Contributors

Originally created by Max Seiden.

Currently maintained by Jamie Pitts.

Installation

First install node.js, mongodb 2.x, and redis 2.x.

npm install rapt-modelrizerly

Overview

Initializing Modelrizerly

First, an application context must be defined. It contains a winston logger instance and configuration data:



var Winston = require('winston'),
    logger = new (Winston.Logger) ({ });

var app_context = {
  logger: logger,
  log: function (message, attr) {
    logger.log(attr.level, message, attr);
  },
  config: {
    mongodb: {
      host: '127.0.0.1',
      port: 27017,
      db: 'rapt_modelrizerly_demo'
    },
    redis: {
      host: '127.0.0.1',
      port: 6379,
      options: {}
    }
  }
};

Initialization with the app_context occurs after the models are loaded:

var Modelrizerly = require("modelrizerly"),
    ModelLoader = require("./models/bootloader"),
    Models = Modelrizerly.init({ context: app_context });

After initialization, you can then interact with the database:

Models.Lyric().find({}, {}, function(err, lyrics) {
  for (var i=0; i<lyrics.length; i++) {
    console.log(lyrics[i].title);
  } 
});

Defining Models

The basics:

var Modelrizerly = require("modelrizerly");

var Lyric = Modelrizerly.define_model("lyric", function() {

  var model = this;
  model.db_driver("mongodb");

  // identity
  model.pk_name("_id");

  // attributes
  model.string('title');
  model.string('author');
  model.string('words');
  model.number('word_count');
  model.number('line_count');
  model.boolean('is_public');

});

Interacting With Models

Find

Query with mongodb operators:

var query = { created_at: { $gt: since_epoch } };
var query_options = { sort: {title: 1} };

Models.Lyric().find(query, query_options, function(err, lyrics) {
  for (var i=0; i<lyrics.length; i++) {
    console.log(lyrics[i].title);
  }
});

Read

Models.Lyric({ _id: mongoid_as_string }).read(null, function(err, lyric) {
  console.log(lyric.title);
});

Create

var new_lyric = {title:'My Lyric', author:'The Source', words:'My words are few.'};

Models.Lyric(new_lyric).create(function(err, created_lyric) {
  console.log(created_lyric.pk_value());
});

Update

var lyric_update = {title: 'My Lyricism'};

Models.Lyric({ _id: mongoid_as_string }).read(null, function(err, lyric) {
  lyric.update({ query: '$set': lyric_update }, function (err, updated_lyric) {
    console.log(updated_lyric.title);
  });
});

Delete

Models.Lyric({ _id: mongoid_as_string }).destroy(function(err) {
  console.log('deleted!');
});

Example Apps

See the mongodb example web application.