Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
adaptable-text
Advanced tools
Adapt font size to a specified width.
npm install adaptable-text
import adaptableText from "adaptable-text";
console.log(adaptableText);
Object
Kind: global class
Creates an instance of AdaptableText.
Param | Type |
---|---|
element | HTMLElement |
[options] | Options |
Initialise the adaptor.
Kind: instance method of AdaptableText
Set the desired width for adaptation from options.width or getBoundingClientRect().width
Kind: instance method of AdaptableText
Adapt font size to a specified width
Kind: instance method of AdaptableText
Object
Kind: global typedef
Properties
Name | Type | Default | Description |
---|---|---|---|
[step] | number | 0.5 | The step used by the generator to calculate the width of the element. |
[minFontSize] | number | 0 | A minimum font size for the element (max would be the size defined in a stylesheet retrieved by window.getComputedStyle(this.element) ). |
[width] | number |
| A maximum widht for the container.. |
MIT. See license file.
FAQs
Adapt font size to a specified width using either binary search or linear steps.
We found that adaptable-text demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.