jprichardson / node-jsonfile

Easily read/write JSON files.
MIT License
1.2k stars 321 forks source link

Add a final newline #13

Closed bajtos closed 10 years ago

bajtos commented 10 years ago

It is a good practice on most UNIX systems to add a final newline at the end of text files like .json. EOL should be treated as "line terminator", not "line separator". Git diff prints an extra message for files that are missing the last newline character.

I am asking jsonfile to conform to this convention and add a trailing newline to the files produced.

I am happy to submit a patch. Since this change can be considered as controversial, I'd rather wait with my work until there is an agreement that such patch will be accepted.

Related reading:

jprichardson commented 10 years ago

Ya, I'm in favor of this. For some reason, I thought that I had done this very recently and was going to respond as such... but sure enough, looking at the code, I haven't. Haha. I'd accept a PR for this. Thanks.

bajtos commented 10 years ago

Excellent, submitted a pull request as #14.