View on GitHub

Mangusu

sugared mongoose resources for the express framework

Download this project as a .zip file Download this project as a tar.gz file

API Docs

Project Information

What's mangusu?
Put simply, mangusu is a library for creating resources around mongoose models. If you want a quick and simple CRUD API for your models, this will knock it out for you with minimal effort.

What's the sugar?
The sugary side of mangusu is the stuff I added to the response bodies. For example, I added in things like resource_uri to the response document (but not to the actual document) and resource pointers for references to other documents.

What's the point - aren't there a bunch of these out there?
Short answer: yeah, there are a bunch of mongoose-express-resource-handler-wrapper things floating around out there, but they're not for me.
Longer answer: I wanted something that operates cleanly, quickly, adds a small amount of helpful information, and then gets the hell out of my way. I wanted something that would also generate routes and add simplicity to handling. This doesn't exist. Or if it does, I couldn't find it, or its documentation sucks, or some other stuff that's bitchy and not worth getting into.

How do I get it?
Using npm:

$ npm install mangusu

Download the source:
$ git clone https://github.com/vforgione/mangusu
$ cd mangusu
$ coffee -o lib/ -c src

Compilation of the coffeescript may not be necessary, but it's a good idea anyway.

What's with the name?
The obvious choices where taken, but the projects aren't maintained, and their code sucks so it wasn't worth forking. So I just went with mongoose, but in Japanese/Romaji (マングース if you really care). Made sense, I guess. ¯\(°_o)/¯