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

htm0

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

htm0

Fast and elegant Web Components framework

latest
npmnpm
Version
0.1.4
Version published
Weekly downloads
4
300%
Maintainers
1
Weekly downloads
 
Created
Source

htm0

Fast and elegant Web Components framwork

  • super simple
  • 0 dependency
  • super small (2 KB)
  • super fast (~47ms FCP)
  • native web components
  • jsx support
  • vitual dom
  • shared state
  • local state
  • events

Install

npm i htm0

Example Component

import { Component } from 'htm0';

class AppComponent extends Component {
  render() {
    return (
      <div class="app">
        Hello World !
      </div>
    );
  }
}

Example Stateful Component

import { Component } from 'htm0';

class AppComponent extends Component {
    state = {
        username: 'Michael'
    }

  render() {
    return (
      <div class="app">
        {this.state.username}
      </div>
    );
  }
}

Example Shared State

import { Component, data } from 'htm0';
import { userData } from './userData'

@data(userData, 'user')
class AppComponent extends Component {
  render() {
    return (
      <div class="app">
        {this.user.username}
      </div>
    );
  }
}
import { Data } from "framework";

class UserData extends Data {
  data = {
    username: "Michael",
  };
}

export const userData = new UserData();

Example Event

import { Component } from 'htm0';

class AppComponent extends Component {
  click() {
    console.log('hi');
  }

  render() {
    return (
      <button click={this.click}>click me</button>
    );
  }
}

FAQs

Package last updated on 11 Nov 2023

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