write(filename, data) {
    if (filename) {
      fs.writeFileSync(filename, data);
    }
    else {
      process.stdout.write(data);
    }
  }
Writes the data to file.
When no filename given, writes to STDIN.
@param  {String} filename
@param  {String} data