Sag-JS is a JavaScript library for working with CouchDB that works in both
browsers and Node.JS. It is a port of the popular Sag PHP library and is
completely API compliant, with the addition of callbacks for dealing with
JavaScript's asynchronous nature.

Sag is designed to not force any particular programming method on its users -
you just pass objects in and get objects back. This makes it trivial to
include Sag in your application, build different functionality on top of it,
and expand Sag to include new CouchDB functionality.

Sag's paradigm of simplicity is carried into its error handling by allowing
you to send data to CouchDB that will result in errors (ex., malformed JSON).
This is because CouchDB knows when there is an error better than Sag. This
also makes Sag more future proof, instead of worrying about each of CouchDB's
API changes. Therefore, Sag will only look for Sag-JS interface problems and
issues that are native to JS, such as passing an int instead of a string.

All local errors are floated back to your application with exceptions. Sag
does not catch any errors itself, allowing your application to care about them
or not.

CouchDB errors will be exposed through the response object. Additionally the
second parameter of the callback functions is set to true if a non-2xx HTTP
status was returned.