strip-eof

v2.0.0
Strip the final newline character from a string/buffer
strip trim remove delete final last end file newline and 5 more...

strip-eof Build Status

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

npm i strip-eof

Metadata

  • MIT
  • >=6
  • Sindre Sorhus
  • released 10/28/2018

Downloads

Maintainers