write file fs node options utf-8 code example Example: write in utf8 fs fs.writeFileSync(dir, "Text", "utf8")