updatefile.js
function erase(num) {
  var n = typeof num === 'number' ? num : 1;
  return through.obj(function(file, enc, next) {
    var lines = file.contents.toString().trim().split('\n');
    file.contents = new Buffer(lines.slice(0, -n).join('\n') + '\n');
    next(null, file);
  });
}
function erase(num) {
  var n = typeof num === 'number' ? num : 1;
  return through.obj(function(file, enc, next) {
    var lines = file.contents.toString().trim().split('\n');
    file.contents = new Buffer(lines.slice(0, -n).join('\n') + '\n');
    next(null, file);
  });
}
function erase ( num ) { var n = typeof num === 'number' ? num : 1 ; return through . obj ( function ( file , enc , next ) { var lines = file . contents . toString ( ) . trim ( ) . split ( '\n' ) ; file . contents = new Buffer ( lines . slice ( 0 , - n ) . join ( '\n' ) + '\n' ) ; next ( null , file ) ; } ) ; }
Erase the given number of lines from the end of a string

@param {String} `str`
@return {Stream} vinyl stream
@api public
Erase the given number of lines from the end of a string