Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Line clamp a DOM element in vanilla JavaScript.
-webkit-line-clamp
…
)HTML:
<div class="line-clamp">
Lorem ipsum dolor sit amet, <strong>consectetur adipiscing</strong> elit.
</div>
CSS:
.line-clamp {
width: 100px;
line-height: 20px;
}
JavaScript:
const element = document.querySelector('.line-clamp')
lineClamp(element, 3)
Boom:
<div class="line-clamp" style="overflow: hidden; overflow-wrap: break-word; word-wrap: break-word;">
Lorem ipsum dolor sit amet, <strong>consectetur…</strong>
</div>
window.getComputedStyle
.const lineClamp = require('line-clamp')
Returns true
if text was truncated, else returns false
.
options
is an optional object literal.
options.ellipsis
to change the string to be appended to the truncated text. Defaults to …
.See Usage.
Install via yarn:
$ yarn add line-clamp
Or npm:
$ npm install --save line-clamp
FAQs
Line clamp a DOM element in vanilla JavaScript
The npm package line-clamp receives a total of 4,118 weekly downloads. As such, line-clamp popularity was classified as popular.
We found that line-clamp 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.