Gathering detailed insights and metrics for trim-margin
Gathering detailed insights and metrics for trim-margin
Gathering detailed insights and metrics for trim-margin
Gathering detailed insights and metrics for trim-margin
npm install trim-margin
Module System
Min. Node Version
Typescript Support
Node Version
NPM Version
3 Stars
118 Commits
2 Watching
14 Branches
1 Contributors
Updated on 16 Jun 2022
TypeScript (93.17%)
JavaScript (6.83%)
Cumulative downloads
Total Downloads
Last day
-15.6%
687
Compared to previous day
Last week
-3.8%
4,497
Compared to previous week
Last month
-7.9%
21,121
Compared to previous month
Last year
232%
153,997
Compared to previous year
6
trimMargin
like Kotlin and stripMargin
like Scala.
trimMargin
or stripMargin
.$ npm i -S trim-margin
1const { 2 trimMargin, 3 tm, 4 inject, 5} = require("trim-margin"); 6 7console.log(trimMargin(` 8 |trim 9 | indent 10 | spaces`)); 11// => "\ntrim\n indent\n spaces" 12 13console.log(trimMargin(` 14 #other 15 # delimiter`, "#")); 16// => "\nother\n delimiter" 17 18const template = ` | template`; 19const literal = ` | literal`; 20console.log(tm`\ 21 |tagged 22 ${template} 23 |${literal}`); 24// => "tagged\n template\n | literal" 25 26inject(); 27console.log(`\ 28 |inject 29 to | string`.trimMargin()); 30// => "inject\n to | string"
Trim indent spaces.
More detail "spaces":
Matches a single character other than white space. Equivalent to
[^ \f\n\r\t\v\u00a0\u1680\u180e\u2000-\u200a\u2028\u2029\u202f\u205f\u3000\ufeff]
.
From: MDN web docs
Expect, /\r?\n/
Indented string.
Indent delimiter.
This is used as an argument to a RegExp
object.
defalut: "\\|"
Same trimMargin
.
Use as Tagged template literals.
Same trimMargin(literal)
.
Same tm
.
Inject to String
: trimMargin
and stripMargin
.
You can use it like method of string type.
Inject to String
: trimMargin
.
You can use it like method of string type.
Inject to String
: stripMargin
.
You can use it like method of string type.
Inject to String
.
You can use it like method of string type.
Method name injected into string type.
MIT © tee-talog
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
no SAST tool detected
Details
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 effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
51 existing vulnerabilities detected
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