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

  firstObj(stream, function (err, data) {

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

    return onEnd(null, new Buffer(data));
  });
}
function first(stream, onEnd) {

  firstObj(stream, function (err, data) {

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

    return onEnd(null, new Buffer(data));
  });
}
function first ( stream , onEnd ) { firstObj ( stream , function ( err , data ) { if ( err ) { return onEnd ( err ) ; } return onEnd ( null , new Buffer ( data ) ) ; } ) ; }
Get the first item in a stream and convert to a buffer.

@private
@deprecated
@static
@since    0.0.4
@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}
Get the first item in a stream and convert to a buffer .