strip-eof

Strip the final newline character from a string/buffer

MIT 2 个版本
安装
npm install strip-eof
yarn add strip-eof
pnpm add strip-eof
bun add strip-eof
README

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

版本列表
2.0.0 2018-10-28
1.0.0 2015-12-05