code: function(user_doc, password, options) {      
        options = options || {};
        user_doc.password = password;
        user_doc.roles =  user_doc.roles || [];
        user_doc.type =  user_doc.type = "user" || [];
        var user_prefix = "org.couchdb.user:";
        user_doc._id = user_doc._id || user_prefix + user_doc.name;
  
        $.couch.userDb(function(db) {
          db.saveDoc(user_doc, options);
        });
      }
docs: Create a new user on the CouchDB server, <code>user_doc</code> is an
  object with a <code>name</code> field and other information you want
  to store relating to that user, for example
  <code>{"name": "daleharvey"}</code>
  @param {Object} user_doc Users details
  @param {String} password Users password
  @param {ajaxSettings} options
  <a href="http://api.jquery.com/jQuery.ajax/#jQuery-ajax-settings">
  jQuery ajax settings</a>