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

trim-newlines

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Issues
File Explorer

Advanced tools

trim-newlines

Trim newlines from the start and/or end of a string

    4.0.2latest

Version published
Maintainers
1
Weekly downloads
14,738,043
decreased by-11.73%

Weekly downloads

Changelog

Source

  • Minor performance improvement 4676273

https://github.com/sindresorhus/trim-newlines/compare/v4.0.1...v4.0.2

Readme

Source

trim-newlines

Trim newlines from the start and/or end of a string

Install

$ npm install trim-newlines

Usage

import trimNewlines from 'trim-newlines'; trimNewlines('\n🦄\r\n'); //=> '🦄' trimNewlines.start('\n🦄\r\n'); //=> '🦄\r\n' trimNewlines.end('\n🦄\r\n'); //=> '\n🦄'

API

trimNewlines(string)

Trim from the start and end of a string.

trimNewlines.start(string)

Trim from the start of a string.

trimNewlines.end(string)

Trim from the end of a string.

  • trim-left - Similar to String#trim() but removes only whitespace on the left
  • trim-right - Similar to String#trim() but removes only whitespace on the right.

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 trim-newlines?

Trim newlines from the start and/or end of a string

Is trim-newlines popular?

The npm package trim-newlines receives a total of 11,735,660 weekly downloads. As such, trim-newlines popularity was classified as popular.

Is trim-newlines well maintained?

We found that trim-newlines 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 10 Jun 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