strip-eof
v2.0.0 strip trim remove delete final last end file newline and 5 more...
strip-eof
Strip the End-Of-File (EOF) character from a string/buffer
Install
$ npm install strip-eof
Usage
const stripEof = require('strip-eof');
stripEof('foo\nbar\n\n');
//=> 'foo\nbar\n'
stripEof(Buffer.from('foo\nbar\n\n')).toString();
//=> 'foo\nbar\n'
License
MIT © Sindre Sorhus