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.
@joyned/html-fairy
Advanced tools
Readme
A simple, tiny, and XSS-protected tool for creating HTML structures from strings and arguments.
npm install @joyned/html-fairy
import htmlFairy from "@joyned/html-fairy";
const element = htmlFairy`<div data-attribute="value">Content</div>`;
Any argument that is an HTML element will be included in the resulting structure in the same position as the corresponding placeholder in the template string. Non-element arguments will be converted to HTML-escaped strings and included in the resulting structure.
import htmlFairy from "@joyned/html-fairy";
const value = 'foo';
const element = htmlFairy`<div data-attribute="${value}">Content</div>`;
Arrays of elements can also be passed as arguments, and the resulting structure will include all the elements from the array in the correct nested position.
import htmlFairy from "@joyned/html-fairy";
const list = ['a', 'b', 'c'].map((x) => htmlFairy`<li>${x}</li>`);
const element = htmlFairy`<ul>${list}</ul>`;
It's prevent XSS by default.
import htmlFairy from "@joyned/html-fairy";
const evilUserInput = '<script>alert("XSS")</script>';
const someElement = htmlFairy`<div>no xss</div>`;
const element = htmlFairy`<div>${someElement}${evilUserInput}</div>`;
html-fairy is released under the MIT License. See the LICENSE file for details.
FAQs
A simple, tiny, and XSS-protected tool for creating HTML structures from strings and arguments.
The npm package @joyned/html-fairy receives a total of 0 weekly downloads. As such, @joyned/html-fairy popularity was classified as not popular.
We found that @joyned/html-fairy demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
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.