Three things...
1. When reading/writing text files, should explicitly specify the text format ('utf8' or 'utf-8').
2. You can use the `require` function to read/parse JSON files directly.
3. You should consider pretty-printing your JSON output when writing the file. `JSON.stringify(input, null, 4)` where the second parameter is an optional object serialization method, and the third is a space indentation for pretty printing, usually 2 or 4 when specified.