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.
A 1.75kB library for enhancing `html`. `ultrahtml` has zero dependencies and is compatible with any JavaScript runtime.
ultrahtml
A 1.75kB library for enhancing html
. ultrahtml
has zero dependencies and is compatible with any JavaScript runtime.
walk
utilitytransform
utility for easy output manipulationhtml
template utilitywalk
The walk
function provides full control over the AST. It can be used to scan for text, elements, components, or any other validation you might want to do.
import { parse, walk, ELEMENT_NODE } from 'ultrahtml';
const ast = parse(`<h1>Hello world!</h1>`);
walk(ast, (node) => {
if (node.type === ELEMENT_NODE && node.name === 'script') {
throw new Error('Found a script!')
}
})
render
The render
function allows you to serialize an AST back into a string.
import { parse, render } from 'ultrahtml';
const ast = parse(`<h1>Hello world!</h1>`);
const output = await render(ast);
transform
The transform
function provides a straight-forward way to swap in-place elements (or Components) and update them with a new value.
import { transform, html } from 'ultrahtml';
const output = await transform(`<h1>Hello world!</h1>`, {
components: {
h1: (props, children) => html`<h1 class="ultra">${children}</h1>`
}
})
console.log(output) // <h1 class="ultra">Hello world!</h1>
htmlParser
provided a great, lightweight base for this parsermdx
for inspiration0.1.1
FAQs
A 1.75kB library for enhancing `html`. `ultrahtml` has zero dependencies and is compatible with any JavaScript runtime.
The npm package ultrahtml receives a total of 560,896 weekly downloads. As such, ultrahtml popularity was classified as popular.
We found that ultrahtml demonstrated a healthy version release cadence and project activity because the last version was released less than 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.