Using writeFileSync instead of writeFile.