jprichardson / node-jsonfile

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

Add option to override final EOL in file #137

Closed asingh04 closed 3 years ago

asingh04 commented 4 years ago

Added a check for an option finalEOL. If the finalEOL is absent in the options object, the EOL(\n) character will be appended at end of file while writing, in order to maintain backward compatibility.

If the finalEOL option has any falsey value, the EOL at the end of the file will be not be written.

asingh04 commented 4 years ago
  1. Changes done in the test files
  2. Used object destructuring in the stringify function of utils file
  3. Updated the README file