
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Simple JSX implementation for working directly with HTML elements. Types included.
Simple JSX implementation for working directly with HTML elements. Types included.
import { h } from '@ledge/jsx';
let clickCounter = 0;
const jsxButton = <button id='native-onlick' class='btn btn-dark my-4'
onclick={() => console.info(`Clicked ${++clickCounter} times`)}>
Click Me
</button>;
jsxButton.click(); // "Clicked 1 times"
jsxButton.click(); // "Clicked 2 times"
class CustomElementExample extends HTMLElement {
connectedCallback() {
this.classList.add('lead');
}
}
customElements.define('custom-element-example', CustomElementExample);
const jsxSection =
<section class='card'>
<h2>DOM in JSX</h2>
<h3>Work directly with DOM elements using JSX's declarative syntax</h3>
<custom-element-example>Custom Elements?</custom-element-example>
<br />
<CustomElementExample>Fully Supported!</CustomElementExample>
<br />
{jsxButton}
</section>;
document.body.appendChild(jsxSection);
jsxSection.parentElement === document.body; // true
jsxButton.closest('.card') === jsxSection; // true
The following configuration is required:
{
"compilerOptions": {
"lib": ["dom"],
"jsx": "react",
"jsxFactory": "h"
}
}
By default, the assigned type will be HTMLElement. If you need the subtype, cast the expression:
const tpl = <template>{/** ... */}</template> as HTMLTemplateElement;
const tplClone = tpl.content.cloneNode(true); // ok
A global CustomElement interface is provided for working with Custom Elements:
// error without extending HTMLElement
class CustomElementExample extends HTMLElement implements CustomElement {
// autocompletion & documentation for callbacks
public connectedCallback() {
// ...
}
// error on mistyped parameter
public attributeChangedCallback(name: string) {
// ...
}
}
FAQs
Simple JSX implementation for working directly with HTML elements. Types included.
The npm package @ledge/jsx receives a total of 1 weekly downloads. As such, @ledge/jsx popularity was classified as not popular.
We found that @ledge/jsx 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

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.