strip-eof

Strip the final newline character from a string/buffer

Renamed to `strip-final-newline` to better represent its functionality.
Last updated 2 years ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install strip-eof 
SYNC missed versions from official npm registry.

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

Current Tags

  • 2.0.0                                ...           latest (2 years ago)

2 Versions

  • 2.0.0 [deprecated]           ...           2 years ago
  • 1.0.0                                ...           5 years ago

Copyright 2014 - 2017 © taobao.org |