Big update!Introducing GitHub Bot Commands. Learn more
Socket
Log inBook a demo

strip-final-newline

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Issues
File Explorer

Advanced tools

strip-final-newline

Strip the final newline character from a string/buffer

    3.0.0latest

Version published
Maintainers
1
Weekly downloads
22,039,211
decreased by-11.05%

Weekly downloads

Changelog

Source

Breaking

  • Require Node.js 12 84716c6
  • This package is now pure ESM. Please read this.

https://github.com/sindresorhus/strip-final-newline/compare/v2.0.0...v3.0.0

Readme

Source

strip-final-newline

Strip the final newline character from a string/buffer

Can be useful when parsing the output of, for example, ChildProcess#execFile, as binaries usually output a newline at the end. Normally, you would use stdout.trim(), but that would also remove newlines at the start and whitespace.

Install

$ npm install strip-final-newline

Usage

import stripFinalNewline from 'strip-final-newline'; stripFinalNewline('foo\nbar\n\n'); //=> 'foo\nbar\n' stripFinalNewline(Buffer.from('foo\nbar\n\n')).toString(); //=> 'foo\nbar\n'
Get professional support for this package with a Tidelift subscription
Tidelift helps make open source sustainable for maintainers while giving companies
assurances about security, maintenance, and licensing for their dependencies.

Keywords

FAQs

What is strip-final-newline?

Strip the final newline character from a string/buffer

Is strip-final-newline popular?

The npm package strip-final-newline receives a total of 17,062,738 weekly downloads. As such, strip-final-newline popularity was classified as popular.

Is strip-final-newline well maintained?

We found that strip-final-newline demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.

Last updated on 03 May 2021

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket

Product

Subscribe to our newsletter

Get open source security insights delivered straight into your inbox. Be the first to learn about new features and product updates.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc