code: function simpleStream(config, transforms) {
    if (!Array.isArray(transforms)) {
      transforms = []
    }
  
    // check that we have a valid config
    let err = null
    if (!isObject(config)) {
      err = `missing config object, received '${typeof config}'`
    } else {
      const { dest, src } = config
      if (typeof dest !== 'string' && typeof dest !== 'function') {
        err = `expected a string or function for 'dest' property in config`
      } else if (!Array.isArray(src) && typeof src !== 'string') {
        err = `expected a string or array for 'src' property in config`
      }
    }
    if (err != null) {
      throw new Error(`${err}\n${JSON.stringify(config, null, 2)}`)
    }
  
    // create plumbed stream
    let stream = gulp
      .src(config.src, { allowEmpty: !options.strict })
      .pipe(catchErrors())
  
    // init sourcemaps
    if (config.sourcemaps) {
      stream = stream.pipe(sourcemaps.init())
    }
  
    // insert transforms in the middle
    for (const transform of transforms.filter(isStream)) {
      stream = stream.pipe(transform)
    }
  
    // log file sizes
    stream = stream.pipe(
      showSizes(typeof config.dest === 'string' ? config.dest + '/' : undefined)
    )
  
    // generate sourcemaps
    if (config.sourcemaps) {
      stream = stream.pipe(
        sourcemaps.write(
          typeof config.sourcemaps === 'string' ? config.sourcemaps : '.'
        )
      )
    }
  
    // write files
    return stream.pipe(gulp.dest(config.dest))
  }
docs: gulp workflow (read files, transform, then write to disk),
  with sourcemaps support and better error and output logging
  @param {object} config
  @param {Array} transforms
  @return {*}