title: JSON.stringify or how to serialize binary data as base64 encoded JSON?
body: <p>I have a Javascript object which will consists of a non-cyclic object hierarchy with parameters and child objects. Some of these objects may hold binary data loaded from files or received via XHRs (not defined yet if Blob, ArrayBuffer or something else).</p>
  
  <p>Normally I would use JSON.stringify() to serialize it as JSON but how can I then specify that binary data will be base64 encoded?</p>
  
  <p>What binary data object (Blob, ArrayBuffer,...) would you recommend me then?</p>
  
  <p>EDIT: Other data formats than plain JSON is not an option.</p>