visionmedia/co-monk — pull request #5 by marcusoftnet (2014-05-13 07:47:06+00:00)
Title: Get collection helper

I grew tired writing the same four lines over and over again, so I started to implement a little helper function in my projects. After a while I thought that it might be a nice addition to the co-monk project itself.

So instead of doing
```js
var monk = require('monk');
var wrap = require('co-monk');
var db = monk('localhost/test');
var users = wrap(db.get('users'));
```
you can now just go
```js
var users = require('co-monk').getCollection('localhost/test', 'users');
````
which is a bit nicer I think.

Preferably I wanted to create an overload constructor, eliminating the need for the ```.getCollection()``` function call, but my Node knowledge failed me. Especially with the funky "looping over methods and thunkify them" thing that was going on.

If you think that would be better, please give me some pointers and I'll try to fix it up.

I was starting to think if monk itself now can be hidden by this project. Are you only using the helper method there's not use for the database. I have created a method to return the monk database too, btw. But for the client using co-monk you should not need to use monk.

I have also updated the README to reflect the changes.

HTH