Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Remove spaces and tabs around line breaks.
This package is a tiny utility that removes spaces and tabs around line endings, keeping the line endings, and not removing whitespace at the start or end of the 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+, or 18.0+), install with npm:
npm install trim-lines
In Deno with esm.sh
:
import trimLines from 'https://esm.sh/trim-lines@3'
In browsers with esm.sh
:
<script type="module">
import trimLines from 'https://esm.sh/trim-lines@3?bundle'
</script>
import {trimLines} from 'trim-lines'
console.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 spaces and tabs around line breaks in value
(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+, 16.0+, and 18.0+. It also works in Deno and modern browsers.
Yes please! See How to Contribute to Open Source.
FAQs
Remove spaces and tabs around line-breaks
The npm package trim-lines receives a total of 3,029,353 weekly downloads. As such, trim-lines popularity was classified as popular.
We found that trim-lines 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.
Research
Security News
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.