var through = require("through"),
  gutil = require("gulp-util"),
  Buffer = require("buffer").Buffer,
  PluginError = gutil.PluginError,
  fs = require("fs"),
  File = gutil.File,
  ns = "gulp-file-insert";

module.exports = function (options) {
  if (typeof options !== "object") {
    options = {};
  }

  var key,
    file = null,
    keys = [];

  for (key in options) {
    keys.push(key);
  }

  function write (f){
    if (!f.isNull()) {
      if (f.isStream()) {
        this.emit("error", new PluginError(ns,  "Streaming not supported"));
      } else {
        file = f;
      }
    }
  }

  function escapeRegExp(string) {
    return string.replace(/([.*+?^=!:${}()|\[\]\/\\])/g, "\\$1");
  }

  function end () {
    var self = this,
      content = file.contents.toString();

    function finalize() {
      var newFile = new File({
        cwd: file.cwd,
        base: file.base,
        path: file.path,
        contents: new Buffer(content)
      });
      self.emit("data", newFile);
      self.emit("end");
    }

    function next() {
      var key = keys.shift();
      if (key) {
        fs.readFile(options[key], function (err, data) {
          if (err) {
            self.emit('error', new gutil.PluginError(ns, "file (" + options[key] + ") is missing for tag (" + key + ")"));
          } else {
            content = content.replace(new RegExp(escapeRegExp(key), "g"), function() { return data });
          }
          next();
        });
      } else {
        finalize();
      }
    }

    next();
  }

  return through(write, end);
};

@@ -1,44 +1,14 @@
 var
- through = require(%22through%22),%0A  guti
+%0A  Viny
 l = 
@@ -20,16 +20,12 @@
 re(%22
-gulp-uti
+viny
 l%22),
@@ -68,39 +68,36 @@
 ,%0A  
-PluginError = gutil.PluginError
+es = require(%22event-stream%22)
 ,%0A  
@@ -120,29 +120,8 @@
 %22),%0A
-  File = gutil.File,%0A
   ns
@@ -356,12 +356,12 @@
 rite
- 
 (f)
+ 
 %7B%0A  
@@ -438,22 +438,16 @@
 r%22, new 
-Plugin
 Error(ns
@@ -447,17 +447,16 @@
 rror(ns,
- 
  %22Stream
@@ -648,17 +648,16 @@
 tion end
- 
 () %7B%0A   
@@ -767,20 +767,21 @@
 e = new 
-File
+Vinyl
 (%7B%0A     
@@ -1147,20 +1147,8 @@
 new 
-gutil.Plugin
 Erro
@@ -1324,24 +1324,51 @@
 tion
+ 
 () %7B
- return data
+%0A              return data%0A           
  %7D);
@@ -1486,16 +1486,19 @@
  return 
+es.
 through(
@@ -1510,11 +1510,12 @@
 , end);%0A
+%0A
 %7D;%0A

Replace gulp-util with gulp4 Vinyl methods