open-index/open-npm huggingface dataset:
npm package: @holmwell/couch
Description: Quickstart with CouchDB
Author: Philip Manijak
Latest version: 1.0.0

# couch
A small wrapper around nano for getting up and running with CouchDB
and some design docs.

## Usage

```javascript
    var db;
    var designDocs = [{
        url: '_design/members',
        body: 
        {
            version: "1.0.2",
            language: "javascript",
            views: {
                byMemberId: {
                    map: function (doc) {
                        if (doc.type === "member") {
                            emit(doc.memberId, doc);
                        }
                    }
                }
            }
        }
    ];

    var couch = require("@holmwell/couch")('my-local-database', designDocs);
    couch.whenReady(function () {
       db = couch.db; 
    });

    // Assert: db === require('nano')('http://localhost:5984').use('my-local-database')
    // ... and your design docs are in the database.
npm package: @holmwell/errors
Description: Error handling for Express projects
Author: Phil Manijak
Latest version: 1.0.1

# errors
Error handling for Node.js and Express

To install:

    npm install @holmwell/errors

To use:

    var errors = require("@holmwell/errors");

### errors.log(Error)

Logs an Error object, or just a string, to the
console. Future versions may log to some 
framework.

### errors.guard(response, function (result))

Used for refactoring all your error conditionals. 
That is, it is for turning code like this:

    db.circles.getAll(function (err, circles) {
        if (err) {
             handleError(err, res);
        }
        // <deal with circles>
    });

Into this:

    db.circles.getAll(guard(res, function (circles) {
        // <deal with circles>
    }));

### errors.handle(Error, response)

Primarily used internally, but you can also use it
to send and an error code back to the Express client.

### errors.middleware

Handle uncaught errors in your Express middleware stack.
Typically this should be put near the end / bottom of
your middleware.

    var app = require('express')();
    // Define routes, app.use(...), etc
    app.use(errors.middleware);


### license

This module is available under a BSD 2-clause license.

### author

Phil Manijak / Holmwell Software