title: Convert a node.js buffer to string and then to JSON
body: <p>I have a node.js readstream which emits a buffer and using toString() function i convert the buffer to string and after that when i try to convert the string to JSON via JSON.parse() function it throws parse error.</p>
  
  <p>Is there a best way to convert buffer to string and then that string to JSON?</p>
  
  <p>JSON String looks like below,</p>
  
  <p>[{"data1": 1487328824948, "encrypt": false, "version": "1.0.0", "data2": "value2", "data3": "value3", "data4": "value4", "data5": "value5"},{"data1": 148732882448, "encrypt": false, "version": "1.0.0", "data2": "value2", "data3": "value3", "data4": "value4", "data5": "value5"}.........]</p>