Gathering detailed insights and metrics for trim-lines
Gathering detailed insights and metrics for trim-lines
Gathering detailed insights and metrics for trim-lines
Gathering detailed insights and metrics for trim-lines
npm install trim-lines
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
51 Stars
67 Commits
2 Forks
4 Watching
1 Branches
3 Contributors
Updated on 20 Apr 2024
JavaScript (100%)
Cumulative downloads
Total Downloads
Last day
-0.8%
795,654
Compared to previous day
Last week
6%
4,291,925
Compared to previous week
Last month
16.7%
17,536,327
Compared to previous month
Last year
117.3%
148,624,851
Compared to previous year
Remove initial and final spaces and tabs around line endings in a value.
This package is a tiny utility that removes initial and final spaces and tabs around line endings in a value, keeping the line endings themselves, while not removing whitespace at the start or end of the entire string. It might look trivial, but it’s actually pretty complex to get performant.
When you need to trim markdown-like whitespace around line endings and don’t want to run into performance problems.
This package is ESM only. In Node.js (version 14.14+, 16.0+), install with npm:
1npm install trim-lines
In Deno with esm.sh
:
1import trimLines from 'https://esm.sh/trim-lines@3'
In browsers with esm.sh
:
1<script type="module"> 2 import trimLines from 'https://esm.sh/trim-lines@3?bundle' 3</script>
1import {trimLines} from 'trim-lines'
2
3console.log(trimLines(' foo\t\n\n bar \n\tbaz ')) // => ' foo\n\nbar\nbaz '
This package exports the identifier trimLines
.
There is no default export.
trimLines(value)
Remove initial and final spaces and tabs around line endings in value
(string
).
Does not trim initial and final spaces and tabs of the value itself.
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.
This package is safe.
Yes please! See How to Contribute to Open Source.
MIT © Titus Wormer
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
no dangerous workflow patterns detected
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/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
detected GitHub workflow tokens with excessive permissions
Details
Reason
dependency not pinned by hash detected -- score normalized to 0
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
Reason
SAST tool is not run on all commits -- score normalized to 0
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