write-file-utf8.js
function writeFileUtf8 (filePath, content, callback) {
  // Argument callback defaults to throwError.
  if (typeof callback !== 'function') callback = throwError

  if (typeof content === 'string') {
    fs.writeFile(filePath, content, 'utf8', callback)
  } else {
    throw TypeError(error.contentIsNotString)
  }
}
function writeFileUtf8 (filePath, content, callback) {
  // Argument callback defaults to throwError.
  if (typeof callback !== 'function') callback = throwError

  if (typeof content === 'string') {
    fs.writeFile(filePath, content, 'utf8', callback)
  } else {
    throw TypeError(error.contentIsNotString)
  }
}
function writeFileUtf8 ( filePath , content , callback ) { // Argument callback defaults to throwError. if ( typeof callback !== 'function' ) callback = throwError if ( typeof content === 'string' ) { fs . writeFile ( filePath , content , 'utf8' , callback ) } else { throw TypeError ( error . contentIsNotString ) } }
Write content to file using utf8 encoding

@param {String} filePath
@param {String} content
@param {Function} [callback]
Write content to file using utf8 encoding