lib/consumers/v1/forEach.js
function forEachJson(stream, onData, onEnd) {

  forEach(stream, function (chunk) {
    var parsed;

    try {
      parsed = JSON.parse(chunk);
    } catch (e) {
      return stream.emit('error', e);
    }

    return onData(parsed);
  }, onEnd);
}
function forEachJson(stream, onData, onEnd) {

  forEach(stream, function (chunk) {
    var parsed;

    try {
      parsed = JSON.parse(chunk);
    } catch (e) {
      return stream.emit('error', e);
    }

    return onData(parsed);
  }, onEnd);
}
function forEachJson ( stream , onData , onEnd ) { forEach ( stream , function ( chunk ) { var parsed ; try { parsed = JSON . parse ( chunk ) ; } catch ( e ) { return stream . emit ( 'error' , e ) ; } return onData ( parsed ) ; } , onEnd ) ; }
Read the items in a stream and parse each item for JSON.

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

@param    {Stream}    stream - Stream that will be read for this function.
@param    {Function}  onData - Callback for each item in the stream.
@param    {Function}  onEnd  - Callback when the stream has been read completely.
@returns  {undefined}
Read the items in a stream and parse each item for JSON .