title: Stringify only one object in Fabric.js
body: <p>I'm working with fabricJS. It's an awesome library for drawing.</p>
  
  <pre><code>var data = JSON.stringify(canvas);
  </code></pre>
  
  <p>Above command is used to get all the objects along with their properties in <code>JSON</code> format. However, I want to stringfy only an object.</p>
  
  <p>For eg. Creating a rectangle using fabric</p>
  
  <pre><code>var rec = new fabric.Rect({
      left: mouse_pos.x,
      top: mouse_pos.y,
      width: 75,
      height: 50,
      fill: 'white',
      stroke: 'black',
      strokeWidth: 3,
      padding: 10
    });
  canvas.add(rec);
  </code></pre>
  
  <p>I want to get the <code>JSON</code> of only this object(rectangle) being added to the canvas and not the <code>JSON</code> of whole of the canvas being rendered.
  May be something like <code>var data = JSON.stringfy(rec);</code>. Is there any way to do so because I want to send the latest object being added to the canvas over sockets and not the whole canvas object which will in turn consumes unnecessary bandwidth because of the JSON object size.</p>