writeFile
expects data
to be a String
or a Buffer
, so it is printing the .toString()
representation of your array. This looks something like "Every,Dog,Must"...
.
Wrap it with JSON.stringify(output)
to get a nice JSON representation "['Every','Dog','Must',....]"
.