<canvas id = "canvas" height='400' width='500'></canvas>
var canvas = new fabric.Canvas(document.getElementById('canvas'));
console.log(JSON.stringify(canvas)); // '{"objects":[],"background":""}'
canvas.add(new fabric.Rect({
left: 10,
...