code: function encoder(value) {
  	var transcoderDoc;
  	if (typeof value === 'string' || value instanceof String) {
  		transcoderDoc = { value: new Buffer(value), flags: 0 };
  	} else if (value instanceof Buffer) {
  		transcoderDoc = { value: value, flags: 4 };
  	} else {
  		if (value.value && value.flags) {
  			if (typeof value.value === 'string' || value.value instanceof String) {
  				transcoderDoc = { value: new Buffer(value.value), flags: value.flags };
  			} else if (value.value instanceof Buffer) {
  				transcoderDoc = { value: value.value, flags: value.flags };
  			} else {
  				transcoderDoc = { value: new Buffer(JSON.stringify(value.value)), flags: value.flags };
  			}
  		} else {
  			try {
  				transcoderDoc = { value: new Buffer(JSON.stringify(value)), flags: 2 };
  			} catch (error) {
  				// TODO: NEED BETTER ERROR HANDLING HERE
  				return;
  			}
  		}
  	}
  
  	return transcoderDoc;
  }
docs: See: https://github.com/couchbase/couchnode/pull/49
  
  The code itself is mostly copy/pasted from within
  the Native C code inside couchnode `src/transcoder.cc`
  
  @summary Pass-through encoder for couchnode
  @param {*} value
  @returns {*}