# html-standard

> A TypeScript library for working with the HTML Living Standard specification.

Latest version **0.0.13** (published 2026-02-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install html-standard
pnpm add html-standard
yarn add html-standard
bun add html-standard
```

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.0.13 |
| Published | 2026-02-20 |
| First published | 2025-04-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 2 |
| Unpacked size | 334.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | yeonjuan |
| Maintainers | yeonjuan-joah |

## Links

- npm: https://www.npmjs.com/package/html-standard
- npm.io page: https://npm.io/package/html-standard

## Dependencies (2)

- [vscode-css-languageservice](https://npm.io/package/vscode-css-languageservice.md) ^6.3.9
- [vscode-languageserver-textdocument](https://npm.io/package/vscode-languageserver-textdocument.md) ^1.0.12

## Recent versions

- 0.0.13 (latest) — 2026-02-20
- 0.0.12 — 2026-02-16
- 0.0.11 — 2026-02-13
- 0.0.10 — 2026-02-12
- 0.0.9 — 2026-02-10
- 0.0.8 — 2026-02-03
- 0.0.7 — 2026-02-01
- 0.0.6 — 2025-04-19
- 0.0.5 — 2025-04-18
- 0.0.4 — 2025-04-17
- 0.0.3 — 2025-04-13
- 0.0.2 — 2025-04-13
- 0.0.1 — 2025-04-05

## README

# html-standard

A TypeScript library for working with the HTML Living Standard specification.

> ⚠️ **Experimental**: This project may introduce breaking changes frequently.

## Installation

```bash
npm install html-standard
```

## Usage

### Get Implicit ARIA Roles

```typescript
import { element } from "html-standard";

// Basic elements
element("button").implicitRole(); // 'button'
element("nav").implicitRole(); // 'navigation'

// Attribute-dependent roles
element("a", {
  attributes: { get: (key) => (key === "href" ? "https://example.com" : null) },
}).implicitRole(); // 'link'

element("a").implicitRole(); // 'generic' (no href)

element("input", {
  attributes: { get: (key) => (key === "type" ? "checkbox" : null) },
}).implicitRole(); // 'checkbox'
```

### Validate Attributes

```typescript
import { element } from "html-standard";

const link = element("link");

// Validate 'rel' attribute
link.attributes.get("rel")?.validateValue("stylesheet"); // { valid: true, ... }
link.attributes.get("rel")?.validateValue("invalid-value"); // { valid: false, ... }
```

## Features

- Implicit ARIA roles per [HTML-ARIA spec](https://www.w3.org/TR/html-aria/)
- Attribute validation based on HTML Standard
- Case-insensitive element names
- TypeScript support

## License

MIT

---
_Source: https://npm.io/package/html-standard · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
