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

hapi-mongoose-resource

v0.0.7

Published

resourceful mongoose objects for the hapi framework

Readme

not under active development

I am no longer actively developing this project. If anyone finds it useful, go ahead an fork it or email me and I'll transfer it over.

hapi-mongoose-resource

resourceful mongoose objects for the hapi framework

  • easily create handlers for your mongoose models
  • automatically generate routes for your handlers
  • resourceful use of references for api responses

installation

npm

$ npm install hapi-mongoose-handler

clone into project

$ cd /path/to/your/vendor/sources/
$ git clone https://github.com/vforgione/hapi-mongoose-resource.git
$ cd hapi-mongoose-resource
$ npm install
$ coffee -o ./lib -c ./src

that last coffee compile shouldn't be necessary, but do it just in case i forget to do it before committing.

documentation

all api documentation can be found on the projects github page: http://vforgione.github.io/hapi-mongoose-resource.

issues and feature requests

open tickets on the project's issues tab: https://github.com/vforgione/hapi-mongoose-resource/issues. i'll try to get to them as soon as i can.

pull requests

if you really took the time to fork this and make some improvements, by all means send me a pull request: https://github.com/vforgione/hapi-mongoose-resource/pulls.

please test things out first before issuing a request.

tests

the tests are written for mocha (hence the mocha.opts file). compile the coffee script, fire up mongo, and run npm test. this will invoke the Makefile, which will run the tests.

examples

there is an examples directory in the project - it's simple but it covers things pretty well: rolling a hapi server, setting up schemas and models, creating resources, adding routes.

i also included a few sample payloads in a comment at the bottom of examples/app.coffee. however you issue them, it will give a shallow jumping-off point.

to get it going:

$ cd /path/to/resource/tests
$ coffee -c ./
$ node app.js

and take it from there.

why

tl;dr i missed tastypie.

i am a python developer, thoroughly. however, i am beginning to embrace node. i've done a number of api projects with python and tastypie, and it's a great combination. i wanted to emulate its ease of use and ubiquity.

i also have done some cursory test-drives with other node frameworks, but i found hapi to be the best fit for me.

given these two points, i went in search of a solid resource plugin for hapi. i was disappointed. hapi-mongoose-handler got me close to where i wanted to be, but it just wasn't the end-all-be-all. (sidebar: it is pretty damned solid and much of my handler code was inspired by hmh). i wanted something to take away the redundancy of creating router configs. i also wanted easy linking between referenced docs. i also wanted the minty-freshest hapi version to be supported.

right now, the project isn't super verbose. i will add to it in the future, i just wanted a jumping-off point.