{"id":35004778,"url":"https://github.com/naveen-ithappu/html-element-registry","last_synced_at":"2026-02-15T21:17:45.228Z","repository":{"id":327788429,"uuid":"1110780168","full_name":"naveen-ithappu/html-element-registry","owner":"naveen-ithappu","description":"A lightweight, type-safe npm library containing a scraped database of all standard HTML elements.","archived":false,"fork":false,"pushed_at":"2025-12-05T19:29:04.000Z","size":176,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-12-28T18:27:09.358Z","etag":null,"topics":["block-elements","html-elements","html-elements-registry","inline-elements","mdn-docs"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/naveen-ithappu.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-05T17:53:28.000Z","updated_at":"2025-12-05T19:29:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/naveen-ithappu/html-element-registry","commit_stats":null,"previous_names":["naveen-ithappu/html-element-registry"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/naveen-ithappu/html-element-registry","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naveen-ithappu%2Fhtml-element-registry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naveen-ithappu%2Fhtml-element-registry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naveen-ithappu%2Fhtml-element-registry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naveen-ithappu%2Fhtml-element-registry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/naveen-ithappu","download_url":"https://codeload.github.com/naveen-ithappu/html-element-registry/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/naveen-ithappu%2Fhtml-element-registry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29489781,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-15T19:29:10.908Z","status":"ssl_error","status_checked_at":"2026-02-15T19:29:10.419Z","response_time":118,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["block-elements","html-elements","html-elements-registry","inline-elements","mdn-docs"],"created_at":"2025-12-27T04:33:32.082Z","updated_at":"2026-02-15T21:17:45.223Z","avatar_url":"https://github.com/naveen-ithappu.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# html-element-registry\n\n\u003e A lightweight, type-safe npm library containing a scraped database of all standard HTML elements.\n\n[![npm version](https://img.shields.io/npm/v/html-element-registry.svg)](https://www.npmjs.com/package/html-element-registry)\n[![npm downloads](https://img.shields.io/npm/dm/html-element-registry.svg)](https://www.npmjs.com/package/html-element-registry)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Bundle Size](https://img.shields.io/bundlephobia/minzip/html-element-registry)](https://bundlephobia.com/package/html-element-registry)\n\n## Features\n\n- 📦 **Comprehensive Database** - All standard HTML elements scraped from MDN Web Docs\n- 🔍 **Type-Safe** - Full TypeScript support with detailed type definitions\n- 🎯 **Element Classification** - Query elements by type (block, inline, table, form, etc.)\n- 🏷️ **Category Support** - Access MDN content categories for each element\n- ⚡ **Zero Runtime Dependencies** - Pure data, no external runtime dependencies\n- 🔒 **Immutable** - All returned data is immutable to prevent accidental mutations\n- 🤖 **Auto-Updated** - Weekly automated scraping keeps data fresh\n\n## Installation\n\n```bash\nnpm install html-element-registry\n```\n\n```bash\nyarn add html-element-registry\n```\n\n```bash\npnpm add html-element-registry\n```\n\n## Usage\n\n### Basic Element Lookup\n\n```typescript\nimport { getElement } from 'html-element-registry';\n\nconst div = getElement('div');\nconsole.log(div);\n// {\n//   tag: 'div',\n//   description: 'The generic container for flow content.',\n//   type: 'block',\n//   category: 'Text content',\n//   url: 'https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/div',\n//   isVoid: false\n// }\n```\n\n### Type Checking\n\n```typescript\nimport { isBlock, isInline, isVoid, isForm } from 'html-element-registry';\n\nisBlock('div');        // true\nisInline('span');      // true\nisVoid('img');         // true\nisForm('input');       // true\n```\n\n### Filter by Type or Category\n\n```typescript\nimport { getElementsByType, getElementsByCategory } from 'html-element-registry';\n\n// Get all form elements\nconst formElements = getElementsByType('form');\n// [{ tag: 'button', ... }, { tag: 'input', ... }, ...]\n\n// Get all elements in \"Text content\" category\nconst textElements = getElementsByCategory('Text content');\n// [{ tag: 'div', ... }, { tag: 'p', ... }, ...]\n```\n\n### Get Metadata\n\n```typescript\nimport { getAllCategories, getAllTypes, getVoidElements } from 'html-element-registry';\n\n// Get all unique categories\nconst categories = getAllCategories();\n// ['Main root', 'Document metadata', 'Content sectioning', ...]\n\n// Get all element types\nconst types = getAllTypes();\n// ['block', 'inline', 'meta', 'table', 'form', ...]\n\n// Get all void (self-closing) elements\nconst voidElements = getVoidElements();\n// [{ tag: 'br', ... }, { tag: 'img', ... }, ...]\n```\n\n## API Reference\n\n### Element Lookup\n\n- **`getElement(tagName: string): ElementSummary | null`**  \n  Get an element by its tag name (case-insensitive). Returns a copy to prevent mutation.\n\n### Type Checkers\n\n- **`isElementType(tag: string, type: ElementType): boolean`**  \n  Check if an element matches a specific type.\n\n- **`isBlock(tag: string): boolean`**  \n  Check if element is block-level.\n\n- **`isInline(tag: string): boolean`**  \n  Check if element is inline.\n\n- **`isMeta(tag: string): boolean`**  \n  Check if element is metadata.\n\n- **`isTable(tag: string): boolean`**  \n  Check if element is table-related.\n\n- **`isForm(tag: string): boolean`**  \n  Check if element is form-related.\n\n- **`isMultimedia(tag: string): boolean`**  \n  Check if element is multimedia.\n\n- **`isScript(tag: string): boolean`**  \n  Check if element is script-related.\n\n- **`isVoid(tag: string): boolean`**  \n  Check if element is void (self-closing).\n\n### Filters\n\n- **`getElementsByCategory(category: string): ElementSummary[]`**  \n  Get all elements in a specific category (case-insensitive).\n\n- **`getElementsByType(type: ElementType): ElementSummary[]`**  \n  Get all elements of a specific type.\n\n- **`getVoidElements(): ElementSummary[]`**  \n  Get all void elements.\n\n### Metadata\n\n- **`getAllCategories(): string[]`**  \n  Get list of all unique categories.\n\n- **`getAllTypes(): ElementType[]`**  \n  Get list of all unique element types.\n\n## TypeScript Types\n\n```typescript\nexport type ElementType = \n  | 'block' \n  | 'inline' \n  | 'meta' \n  | 'root' \n  | 'body' \n  | 'multimedia' \n  | 'script' \n  | 'table' \n  | 'form';\n\nexport type ElementSummary = {\n  tag: string;\n  description: string;\n  url: string;\n  category: string;\n  type: ElementType;\n  isVoid: boolean;\n};\n```\n\n## Data Source\n\nAll element data is scraped from [MDN Web Docs](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements), the authoritative source for web standards documentation.\n\nThe scraper runs weekly via GitHub Actions to keep the data up-to-date with the latest HTML specifications.\n\n## Development\n\n```bash\n# Install dependencies\nnpm install\n\n# Run the scraper\nnpm run scrape\n\n# Build the library\nnpm run build\n\n# Run tests\nnpm test\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit a Pull Request.\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -m 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\n## License\n\nMIT © [html-element-registry contributors](LICENSE)\n\n## Acknowledgments\n\n- Data sourced from [MDN Web Docs](https://developer.mozilla.org/)\n- Built with [TypeScript](https://www.typescriptlang.org/)\n- Bundled with [tsup](https://tsup.egoist.dev/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaveen-ithappu%2Fhtml-element-registry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnaveen-ithappu%2Fhtml-element-registry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnaveen-ithappu%2Fhtml-element-registry/lists"}