writeFileSync instead of pipe