lib/consumers/v2/wait.js
function wait(callback) {

  return pipeline.obj(
    waitObj(),
    through.obj(function (chunk, enc, next) {
      next(null, Buffer.concat(chunk.map(function (item) {
        return new Buffer(item, enc);
      })));
    }),
    throughWithCallback(callback)
  );
}
function wait(callback) {

  return pipeline.obj(
    waitObj(),
    through.obj(function (chunk, enc, next) {
      next(null, Buffer.concat(chunk.map(function (item) {
        return new Buffer(item, enc);
      })));
    }),
    throughWithCallback(callback)
  );
}
function wait ( callback ) { return pipeline . obj ( waitObj ( ) , through . obj ( function ( chunk , enc , next ) { next ( null , Buffer . concat ( chunk . map ( function ( item ) { return new Buffer ( item , enc ) ; } ) ) ) ; } ) , throughWithCallback ( callback ) ) ; }
Creates a new stream with a single value that's a Buffer of the entire
contents of the stream.

@static
@since    1.0.0
@category Consumers

@param    {Function} callback - A function to be called with the contents
of the stream. This is a convenience to
avoid listening to the data/end events of
the stream.
@returns  {Stream.Transform}  - Transform stream.

@example

// get the entire contents of a file
fs.createReadStream('example.txt')
.pipe(nodeStream.wait());
// => Buffer
Creates a new stream with a single value that s a Buffer of the entire contents of the stream .