lib/json.js
function parse (str) {
  if (Buffer.isBuffer(str)) str = str.toString();
  type('str', str, 'String');
  try {
    return JSON.parse(str);
  } catch (ex) {
    ex.message = 'Unable to parse JSON: ' + ex.message + '\nAttempted to parse: ' + str;
    throw ex;
  }
}
function parse (str) {
  if (Buffer.isBuffer(str)) str = str.toString();
  type('str', str, 'String');
  try {
    return JSON.parse(str);
  } catch (ex) {
    ex.message = 'Unable to parse JSON: ' + ex.message + '\nAttempted to parse: ' + str;
    throw ex;
  }
}
function parse ( str ) { if ( Buffer . isBuffer ( str ) ) str = str . toString ( ) ; type ( 'str' , str , 'String' ) ; try { return JSON . parse ( str ) ; } catch ( ex ) { ex . message = 'Unable to parse JSON: ' + ex . message + '\nAttempted to parse: ' + str ; throw ex ; } }
Parse a JSON string to a js-value

Note: Small wrapper around standard JSON parser

@param {String} str
@return {*}
Parse a JSON string to a js - value