Moveline/mongoose-pagination — pull request #1 by natural (2013-02-02 23:30:59+00:00)
Title: Made pagination installable, converted to CoffeeScript

Hey,

The problem I was having was that my app couldn't see the changed `Query.prototype` because mongoose-pagination was installing it on its copy of `mongoose`, not mine. In other words, my apps `node_modules/mongoose` is different from `mongoose-pagination/node_modules/mongoose` and the prototype modification didn't work.

I solve this by adding an additional function to the pagination module that installs the pagination function on the supplied object. Like:

```coffeescript
mongoose = require 'mongoose'
pagination = require 'mongoose-pagination'
pagination.install mongoose
```

I updated the tests and everything passes.

Also, I went ahead and converted the library to coffeescript and added a prepublish hook in the `package.json` to account for that.

Lemme know what you think.