{"_id":"strip-final-newline","_rev":"175677","name":"strip-final-newline","description":"Strip the final newline character from a string/buffer","dist-tags":{"latest":"3.0.0"},"maintainers":[{"name":"sindresorhus","email":""}],"time":{"modified":"2022-10-18T09:10:57.000Z","created":"2018-10-28T08:36:42.180Z","3.0.0":"2021-05-03T12:51:11.608Z","2.0.0":"2018-10-28T08:36:42.180Z"},"users":{},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-final-newline.git"},"versions":{"3.0.0":{"name":"strip-final-newline","version":"3.0.0","description":"Strip the final newline character from a string/buffer","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-final-newline.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":"./index.js","engines":{"node":">=12"},"scripts":{"test":"xo && ava"},"keywords":["strip","trim","remove","delete","final","last","end","file","newline","linebreak","character","string","buffer"],"devDependencies":{"ava":"^3.15.0","xo":"^0.39.1"},"gitHead":"5383387eec921ba4e201879dd03d278c2a43c2f1","bugs":{"url":"https://github.com/sindresorhus/strip-final-newline/issues"},"homepage":"https://github.com/sindresorhus/strip-final-newline#readme","_id":"strip-final-newline@3.0.0","_nodeVersion":"16.0.0","_npmVersion":"7.10.0","dist":{"shasum":"52894c313fbff318835280aed60ff71ebf12b8fd","size":1907,"noattachment":false,"key":"/strip-final-newline/-/strip-final-newline-3.0.0.tgz","tarball":"http://name.csiicloud.com:7001/strip-final-newline/download/strip-final-newline-3.0.0.tgz"},"_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"directories":{},"maintainers":[{"name":"sindresorhus","email":""}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strip-final-newline_3.0.0_1620046271483_0.9109171270738188"},"_hasShrinkwrap":false,"publish_time":1620046271608,"_cnpm_publish_time":1620046271608,"_cnpmcore_publish_time":"2021-12-13T12:02:26.622Z"},"2.0.0":{"name":"strip-final-newline","version":"2.0.0","description":"Strip the final newline character from a string/buffer","license":"MIT","repository":{"type":"git","url":"git+https://github.com/sindresorhus/strip-final-newline.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"sindresorhus.com"},"engines":{"node":">=6"},"scripts":{"test":"xo && ava"},"keywords":["strip","trim","remove","delete","final","last","end","file","newline","linebreak","character","string","buffer"],"devDependencies":{"ava":"^0.25.0","xo":"^0.23.0"},"gitHead":"51c93d6c8683d9fd1cacdb32f2afebac9a1155a1","bugs":{"url":"https://github.com/sindresorhus/strip-final-newline/issues"},"homepage":"https://github.com/sindresorhus/strip-final-newline#readme","_id":"strip-final-newline@2.0.0","_npmVersion":"6.4.1","_nodeVersion":"10.12.0","_npmUser":{"name":"sindresorhus","email":"sindresorhus@gmail.com"},"dist":{"shasum":"89b852fb2fcbe936f6f4b3187afb0a12c1ab58ad","size":1704,"noattachment":false,"key":"/strip-final-newline/-/strip-final-newline-2.0.0.tgz","tarball":"http://name.csiicloud.com:7001/strip-final-newline/download/strip-final-newline-2.0.0.tgz"},"maintainers":[{"name":"sindresorhus","email":""}],"directories":{},"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strip-final-newline_2.0.0_1540715802035_0.22560465362477622"},"_hasShrinkwrap":false,"publish_time":1540715802180,"_cnpm_publish_time":1540715802180}},"readme":"# strip-final-newline\n\n> Strip the final [newline character](https://en.wikipedia.org/wiki/Newline) from a string/buffer\n\nCan be useful when parsing the output of, for example, `ChildProcess#execFile`, as [binaries usually output a newline at the end](https://stackoverflow.com/questions/729692/why-should-text-files-end-with-a-newline). Normally, you would use `stdout.trim()`, but that would also remove newlines at the start and whitespace.\n\n## Install\n\n```\n$ npm install strip-final-newline\n```\n\n## Usage\n\n```js\nimport stripFinalNewline from 'strip-final-newline';\n\nstripFinalNewline('foo\\nbar\\n\\n');\n//=> 'foo\\nbar\\n'\n\nstripFinalNewline(Buffer.from('foo\\nbar\\n\\n')).toString();\n//=> 'foo\\nbar\\n'\n```\n\n---\n\n<div align=\"center\">\n\t<b>\n\t\t<a href=\"https://tidelift.com/subscription/pkg/npm-strip-eof?utm_source=npm-strip-eof&utm_medium=referral&utm_campaign=readme\">Get professional support for this package with a Tidelift subscription</a>\n\t</b>\n\t<br>\n\t<sub>\n\t\tTidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies.\n\t</sub>\n</div>\n","_attachments":{},"homepage":"https://github.com/sindresorhus/strip-final-newline#readme","bugs":{"url":"https://github.com/sindresorhus/strip-final-newline/issues"},"license":"MIT"}