title: How to use the lib section of a Design Document in CouchDB 0.11
body: <p>I want to add some custom javascript functions to my design document, I can't find any examples of how to actually add these functions to the "lib" section of a design document. Can someone show me an example of how to add a function definition to the "lib" section?</p>
  
  <p><strong>Follow up:</strong></p>
  
  <p>I started using <a href="http://github.com/couchapp/couchapp" rel="nofollow noreferrer">couchapp</a> to manage my design documents and it has a really nice macro facility for injecting javascript into map and reduce functions before sending them to the server.</p>