flatten writeFile options