
Security News
npm Adopts OIDC for Trusted Publishing in CI/CD Workflows
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
htmlmodule
Advanced tools
HtmlModule is a library for creating user interfaces. It implements the "virtual DOM" approach and provides a convenient object-oriented API with a JavaScript-compatible syntax.
Unlike modern React, which has switched to a functional programming style and hooks, HtmlModule relies on the power of object-oriented programming and uses its advantages.
The library provides a set of components, each of which represents one of the HTML elements. These components can be extended by the developer to implement the necessary functionality.
One of the key features is the syntax for describing the component tree. It uses the "new" operator with the name of the component class. It looks natural and more convenient than JSX. No code transpiling is required.
In addition to presenting HTML elements, the library provides a set of components representing WAI-ARIA roles and attributes that help the developer create an accessible user interface.
Example of a simple authorization form:
import { HtmlForm, HtmlInput, HtmlButton } from 'htmlmodule'
class LoginForm extends HtmlForm
{
static class = 'LoginForm'
static defaultProps = { method : 'post' }
state = {
login : '',
password : '',
}
render() {
return [
new HtmlInput({
name : 'login',
placeholder : 'Login',
value : this.state.login,
oninput : e => this.setState({ login : e.target.value }),
}),
new HtmlInput({
type : 'password',
name : 'password',
placeholder : 'Password',
value : this.state.password,
oninput : e => this.setState({ password : e.target.value }),
}),
new HtmlButton('Login'),
]
}
}
LoginForm.render({ action : '/login' }, document.body)
This code creates and processes a form with the appropriate DOM structure:
<form class="LoginForm" method="post" action="/login">
<input name="login" placeholder="Login">
<input type="password" name="password" placeholder="Password">
<button>Login</button>
</form>
More complex examples:
FAQs
Library for creating UI
The npm package htmlmodule receives a total of 7 weekly downloads. As such, htmlmodule popularity was classified as not popular.
We found that htmlmodule 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
npm now supports Trusted Publishing with OIDC, enabling secure package publishing directly from CI/CD workflows without relying on long-lived tokens.
Research
/Security News
A RubyGems malware campaign used 60 malicious packages posing as automation tools to steal credentials from social media and marketing tool users.
Security News
The CNA Scorecard ranks CVE issuers by data completeness, revealing major gaps in patch info and software identifiers across thousands of vulnerabilities.