CLI tool that trims trailing whitespace from a file and preserves the correct OS newlines.
npm install whitespace -g
pass a filename or glob as arguments and whitespace will remove trailing whitespace and update them in-place
whitespace file.js
# or
whitespace *.js