Big update!Announcing Socket for GitHub 1.0. Learn more ā†’
Socket
BlogLoveFAQ
Install
Log in

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
15,392,145
increased by0.01%

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 12,493,997 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. It has 1 open source maintainer collaborating on the project.

Last updated on 10 Jun 2021
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