title: Convert a JSON Object to Buffer and Buffer to JSON Object back
body: <p>I have a JSON object and I'm converting it to a <code>Buffer</code> and doing some process here. Later I want to convert the same buffer data to convert to valid JSON object.</p>
  
  <p>I'm working on Node V6.9.1</p>
  
  <p>Below is the code I tried but I'm getting <code>[object object]</code> when I convert back to JSON and cannot open this object.</p>
  
  <pre><code>var obj = {
     key:'value',
     key:'value',
     key:'value',
     key:'value',
     key:'value'
  }
  
  var buf = new Buffer.from(obj.toString());
  
  console.log('Real Buffer ' + buf);  //This prints --&gt; Real Buffer &lt;Buffer 5b 6f 62 6a 65 63 74&gt;
  
  var temp = buf.toString();
  
  console.log('Buffer to String ' + buf);  //This prints --&gt; Buffer to String [object Object]
  </code></pre>
  
  <p>So I tried to print whole object using inspect way</p>
  
  <pre><code>console.log('Full temp ' + require('util').inspect(buf, { depth: null }));  //This prints --&gt; '[object object]' [not printing the obj like declared above]
  </code></pre>
  
  <p>If i try to read it like an array</p>
  
  <pre><code> console.log(buf[0]);  // This prints --&gt; [ 
  </code></pre>
  
  <p>I tried parsing also it throw <code>SyntaxError: Unexpected token o in JSON at position 2</code></p>
  
  <p>I need to view it as real object like I created (I mean like declared above).</p>
  
  <p>Please help..</p>