index.js
function writeFile (outDir, vars, file) {
  return function (done) {
    const fileName = file.path
    const inFile = file.fullPath
    const parentDir = file.parentDir
    const outFile = path.join(outDir, maxstache(removeUnderscore(fileName), vars))

    mkdirp(path.join(outDir, maxstache(parentDir, vars)), function (err) {
      if (err) return done(err)

      const rs = fs.createReadStream(inFile)
      const ts = maxstacheStream(vars)
      const ws = fs.createWriteStream(outFile)

      pump(rs, ts, ws, done)
    })
  }
}
function writeFile (outDir, vars, file) {
  return function (done) {
    const fileName = file.path
    const inFile = file.fullPath
    const parentDir = file.parentDir
    const outFile = path.join(outDir, maxstache(removeUnderscore(fileName), vars))

    mkdirp(path.join(outDir, maxstache(parentDir, vars)), function (err) {
      if (err) return done(err)

      const rs = fs.createReadStream(inFile)
      const ts = maxstacheStream(vars)
      const ws = fs.createWriteStream(outFile)

      pump(rs, ts, ws, done)
    })
  }
}
function writeFile ( outDir , vars , file ) { return function ( done ) { const fileName = file . path const inFile = file . fullPath const parentDir = file . parentDir const outFile = path . join ( outDir , maxstache ( removeUnderscore ( fileName ) , vars ) ) mkdirp ( path . join ( outDir , maxstache ( parentDir , vars ) ) , function ( err ) { if ( err ) return done ( err ) const rs = fs . createReadStream ( inFile ) const ts = maxstacheStream ( vars ) const ws = fs . createWriteStream ( outFile ) pump ( rs , ts , ws , done ) } ) } }
write a file to a directory str -> stream
write a file to a directory str - > stream