GithubHelp home page GithubHelp logo

sindresorhus / strip-final-newline Goto Github PK

View Code? Open in Web Editor NEW
33.0 7.0 10.0 16 KB

Strip the final newline character from a string/buffer

License: MIT License

JavaScript 88.76% TypeScript 11.24%

strip-final-newline's Issues

How about using `str.trimEnd()`

Normally, you would use stdout.trim(), but that would also remove newlines at the start and whitespace.

i would either recommend that ppl switch to using trimEnd or that you refrace this line to something in lines of:

Normally, you would use stdout.trimEnd(), but that would also remove all trailing newlines and whitespaces at the end.

This package is misnamed

It doesn't strip out EOF (end of file) characters. It strips EOL (end of line) characters. An EOF character would mark the end of an entire file or stream, not just the end of a line. There isn't any EOF character in ASCII or Unicode, but EOT (0x04) and SUB (0x1a) come close.

This issue also exists in the readme for the execa package.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.