New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

@ledge/jsx

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ledge/jsx

Simple JSX implementation for working directly with HTML elements. Types included.

npmnpm
Version
1.2.0
Version published
Weekly downloads
3
50%
Maintainers
1
Weekly downloads
 
Created
Source

@ledge/jsx test status

Simple JSX implementation for working directly with HTML elements. Types included.

import { h } from '@ledge/jsx';

class CustomElementExample extends HTMLElement {
	public connectedCallback() {
		this.classList.add('lead');
	}
}

customElements.define('custom-element-example', CustomElementExample);

let clickCounter = 0;
const jsxButton = <button id='native-onlick' class='btn btn-dark my-4'
	onclick={() => console.info(`Clicked ${++clickCounter} times`)}>
	Try clicking this button!
</button>;

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);

jsxButton.click(); // "Clicked 1 times"
jsxButton.click(); // "Clicked 2 times"

console.log(jsxSection.parentElement === document.body); // true
console.log(jsxButton.closest('.card') === jsxSection);  // true

FAQs

Package last updated on 10 Dec 2020

Did you know?

Socket

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.

Install

Related posts