{"_id":"@cjser/strip-final-newline__v3_0_0","name":"@cjser/strip-final-newline__v3_0_0","dist-tags":{"latest":"3.0.0-cjser.2"},"versions":{"3.0.0-cjser.2":{"name":"@cjser/strip-final-newline__v3_0_0","version":"3.0.0-cjser.2","description":"Strip the final newline character from a string/buffer","license":"MIT","repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"funding":"https://github.com/sponsors/sindresorhus","author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"type":"module","exports":{"require":"./dist-cjser/index.cjs","default":"./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"},"main":"./dist-cjser/index.cjs","cjser":{"sourceVersion":"3.0.0","cjserVersion":2,"original":{"name":"strip-final-newline","version":"3.0.0","exports":"./index.js","repository":"sindresorhus/strip-final-newline","files":["index.js"],"scripts":{"test":"xo && ava"}}},"_id":"@cjser/strip-final-newline__v3_0_0@3.0.0-cjser.2","gitHead":"a4bef54d7d22d3d9a6b84528457938d84cd65fe7","_nodeVersion":"20.14.0","_npmVersion":"10.7.0","dist":{"integrity":"sha512-oe2mu5VfEFmJeCYJLT44hUKRhHOYttKLv2amHJhRlYSAqYr+tzWlBlhXyq3UjT+mZC3adcR1bnID2cco+7V/lg==","shasum":"5ae457ae75c8c82002ff89d943d098eac419da82","tarball":"https://registry.npmjs.org/@cjser/strip-final-newline__v3_0_0/-/strip-final-newline__v3_0_0-3.0.0-cjser.2.tgz","fileCount":5,"unpackedSize":5605,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDzp7UiMhCet1ved1XHcYVuOyrtYT+8sNNKLQYpz/PPYQIhAMkJwr+QwLfpc1HJk2iTV/gkWDL0UpBLNvqKIa8A7f7y"}]},"_npmUser":{"name":"nanahira","email":"nanahira@momobako.com"},"directories":{},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/strip-final-newline__v3_0_0_3.0.0-cjser.2_1778160185208_0.28829827398591723"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-07T13:23:05.147Z","3.0.0-cjser.2":"2026-05-07T13:23:05.363Z","modified":"2026-05-07T13:23:05.513Z"},"maintainers":[{"name":"nanahira","email":"nanahira@momobako.com"}],"description":"Strip the final newline character from a string/buffer","keywords":["strip","trim","remove","delete","final","last","end","file","newline","linebreak","character","string","buffer"],"repository":{"type":"git","url":"https://code.moenext.com/3rdeye/cjser.git"},"author":{"name":"Sindre Sorhus","email":"sindresorhus@gmail.com","url":"https://sindresorhus.com"},"license":"MIT","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\n## cjser\n\nThis package is a CommonJS-compatible build generated by cjser for projects that still need `require()` support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.\nOriginal repository: https://github.com/sindresorhus/strip-final-newline\n","readmeFilename":"readme.md","_rev":"1-2da641f005889330cd9a3638297427fa"}