Gathering detailed insights and metrics for trim-trailing-lines
Gathering detailed insights and metrics for trim-trailing-lines
Gathering detailed insights and metrics for trim-trailing-lines
Gathering detailed insights and metrics for trim-trailing-lines
Remove final newline characters from a string
npm install trim-trailing-lines
99.2
Supply Chain
97.6
Quality
75.5
Maintenance
100
Vulnerability
100
License
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
5 Stars
58 Commits
2 Forks
4 Watching
1 Branches
2 Contributors
Updated on 09 Feb 2024
Minified
Minified + Gzipped
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-1.7%
450,694
Compared to previous day
Last week
5.6%
2,413,222
Compared to previous week
Last month
15.9%
9,729,007
Compared to previous month
Last year
-42.6%
125,259,847
Compared to previous year
Remove final line endings from a string.
This is a tiny package that removes final line endings (CR, LF, CR+LF) from a string.
This package is rather niche, I found myself repeating this code when working with a lot of markdown.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
1npm install trim-trailing-lines
In Deno with esm.sh
:
1import {trimTrailingLines} from 'https://esm.sh/trim-trailing-lines@2'
In browsers with esm.sh
:
1<script type="module"> 2 import {trimTrailingLines} from 'https://esm.sh/trim-trailing-lines@2?bundle' 3</script>
1import {trimTrailingLines} from 'trim-trailing-lines' 2 3trimTrailingLines('foo\nbar') // => 'foo\nbar' 4trimTrailingLines('foo\nbar\n') // => 'foo\nbar' 5trimTrailingLines('foo\nbar\n\n') // => 'foo\nbar'
This package exports the identifier trimTrailingLines
.
There is no default export.
trimTrailingLines(value)
Remove final line endings from value
.
valeu
Value with trailing line endings, coerced to string (unknown
).
Value without trailing line endings (string
).
This package is fully typed with TypeScript. It exports no additional types.
This package is at least compatible with all maintained versions of Node.js. As of now, that is Node.js 14.14+ and 16.0+. It also works in Deno and modern browsers.
Yes please! See How to Contribute to Open Source.
This package is safe.
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 0/30 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
Project has not signed or included provenance with any releases.
Details
Reason
branch protection not enabled on development/release branches
Details
Score
Last Scanned on 2024-11-18
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More