Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

trim-newlines

Package Overview
Dependencies
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

trim-newlines - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0

index.d.ts

6

index.js
'use strict';
module.exports = x => x.replace(/^[\r\n]+/, '').replace(/[\r\n]+$/, '');
module.exports.start = x => x.replace(/^[\r\n]+/, '');
module.exports.end = x => x.replace(/[\r\n]+$/, '');
module.exports = string => string.replace(/^[\r\n]+/, '').replace(/[\r\n]+$/, '');
module.exports.start = string => string.replace(/^[\r\n]+/, '');
module.exports.end = string => string.replace(/[\r\n]+$/, '');
{
"name": "trim-newlines",
"version": "2.0.0",
"description": "Trim newlines from the start and/or end of a string",
"license": "MIT",
"repository": "sindresorhus/trim-newlines",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=4"
},
"scripts": {
"test": "xo && ava"
},
"files": [
"index.js"
],
"keywords": [
"trim",
"newline",
"newlines",
"linebreak",
"lf",
"crlf",
"left",
"right",
"start",
"end",
"string",
"str",
"remove",
"delete",
"strip"
],
"devDependencies": {
"ava": "*",
"xo": "*"
}
"name": "trim-newlines",
"version": "3.0.0",
"description": "Trim newlines from the start and/or end of a string",
"license": "MIT",
"repository": "sindresorhus/trim-newlines",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"trim",
"newline",
"newlines",
"linebreak",
"lf",
"crlf",
"left",
"right",
"start",
"end",
"string",
"remove",
"delete",
"strip"
],
"devDependencies": {
"ava": "^1.4.1",
"tsd": "^0.7.2",
"xo": "^0.24.0"
}
}

@@ -9,3 +9,3 @@ # trim-newlines [![Build Status](https://travis-ci.org/sindresorhus/trim-newlines.svg?branch=master)](https://travis-ci.org/sindresorhus/trim-newlines)

```
$ npm install --save trim-newlines
$ npm install trim-newlines
```

@@ -19,4 +19,10 @@

trimNewlines('\nunicorn\r\n');
//=> 'unicorn'
trimNewlines('\n🦄\r\n');
//=> '🦄'
trimNewlines.start('\n🦄\r\n');
//=> '🦄\r\n'
trimNewlines.end('\n🦄\r\n');
//=> '\n🦄'
```

@@ -27,11 +33,11 @@

### trimNewlines(input)
### trimNewlines(string)
Trim from the start and end of a string.
### trimNewlines.start(input)
### trimNewlines.start(string)
Trim from the start of a string.
### trimNewlines.end(input)
### trimNewlines.end(string)

@@ -38,0 +44,0 @@ Trim from the end of a string.

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc