function writeToFile (html, file, append) {
  'use strict';
  // If a flag is passed, it means we should append instead of overwriting.
  // Only works with files, obviously
  var write = (append) ? fs.appendFileSync : fs.writeFileSync;
  try {
    write(file, html);
  } catch (err) {
    throw new Error('Could not write to file ' + file + ', readon: ' + err.message);
  }
}
Writes to file
@param {string} html HTML to write
@param {string} file Filepath
@param {boolean} append If the result should be appended