Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
trim-margin
Advanced tools
Readme
trimMargin
like Kotlin and stripMargin
like Scala.
trimMargin
or stripMargin
.$ npm i -S trim-margin
const {
trimMargin,
tm,
inject,
} = require("trim-margin");
console.log(trimMargin(`
|trim
| indent
| spaces`));
// => "\ntrim\n indent\n spaces"
console.log(trimMargin(`
#other
# delimiter`, "#"));
// => "\nother\n delimiter"
const template = ` | template`;
const literal = ` | literal`;
console.log(tm`\
|tagged
${template}
|${literal}`);
// => "tagged\n template\n | literal"
inject();
console.log(`\
|inject
to | string`.trimMargin());
// => "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
FAQs
"trimMargin" like Kotlin and "stripMargin" like Scala.
The npm package trim-margin receives a total of 1,735 weekly downloads. As such, trim-margin popularity was classified as popular.
We found that trim-margin demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.