lib/consumers/v1/wait.js
function waitJson(stream, onEnd) {

  wait(stream, function (err, data) {

    if (err) {
      return onEnd(err);
    }

    return parse(data, onEnd);
  });
}
function waitJson(stream, onEnd) {

  wait(stream, function (err, data) {

    if (err) {
      return onEnd(err);
    }

    return parse(data, onEnd);
  });
}
function waitJson ( stream , onEnd ) { wait ( stream , function ( err , data ) { if ( err ) { return onEnd ( err ) ; } return parse ( data , onEnd ) ; } ) ; }
Wait for the stream contents, then parse for JSON.

@private
@deprecated
@static
@since    0.0.2
@category Consumers

@param    {Stream}    stream - Stream that will be read for this function.
@param    {Function}  onEnd  - Callback when the stream has been read completely.
@returns  {undefined}
Wait for the stream contents then parse for JSON .