
Security News
Axios Maintainer Confirms Social Engineering Attack Behind npm Compromise
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.
Allows coding HTML transformation via a CSS-like declarative Object
Array of objects or just one object, keys are CSS selectors
{
h3: e=>a.length + " animals total",
li: e=>a.map((e,i)=>({
innerHTML: e.name.big(),
className: "text-danger",
title: "#"+(i+1)
})),
'li big': e=>({
className: Math.random
})
}
"li:nth-child(2)"
CSS selectors for the rules
A collection of key:value pairs, or a string of content, an array of new clone's content/props, or a function that returns one of those values.
h3: e=> data.animals.length + " animals total", // returns a string to set content
Functions simply return one of the value types below in a late-run fashion.
"h3.status": "Ready", // a string sets content
Strings simply define the content of any element(s) the key matches.
option: ["M", "T", "W", "R", "F"], // populate select with days
Arrays clone the matched element(s) and append one for each element of the array. If the array is an Array of Strings, the clone's content will be set by the string. If it's an Array of Objects, the rule objects procedure is applied to each clone.
Rule objects define one or more transformations on the same matched selector elements. Like rule key selectors, rule object property keys point to specific properties or attributes, with a couple enhancements as well. Like rule values, the type of the rule object property value determines its effect on the match element(s).
Name a property of the element, with two special additions: a + postfix will cause the value to be appended (as a string or added as a number on content/attribs), while a @ prefix will set an attribute with the property. Using both (@attribute+) appends an attribute with the value.
Must be a Function, Number, String, or Boolean. Objects will be assessed using .toString().
Defines events for keys like onclick and provides lambda for non-events. Use functions for events as properties, not as attributes. If you want to bind event attributes, use a string because functions are treated as lambda when attributes (@) are detected.
{// key value
"@title": x=> "Element #"+index,
onclick: function(e){ alert("Clicks work!"); },
}
Define arguments to pass to an element method, and are only valid in that context.
"scrollIntoView": [true, true]
Set or append properties and attributes.
{// key value
"@title": "Sets title attribute to this text",
className: "class tokens go here",
"value+": " appends to value property",
"selectedIndex+": 1 // move to next option in a select
}
Controls boolean properties and attribs. In attribute mode, it will remove an attrib if false and set the attrib to "" if true. For properties, it will simple set the property to the value.
{// key value
"@disabled": true, // sets disabled=""
"@readonly": false, // removes the readonly attrib
hidden: true // hides the element using the hidden DOM4 property
}
FAQs
html transformation syntax
We found that htx 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
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.