npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@lydio/semantics

v1.0.0

Published

HTML standard nodes extension for Lydio

Readme

@lydio/semantics

Canonical URL: https://alexstevovich.com/r/lydio-semantics-nodejs

HTML standard nodes extension for Lydio

@lydio/semantics provides a structured approach to HTML generation, emphasizing semantic correctness and hierarchical meaning extraction. It extends Lydio’s core capabilities by introducing specialized semantic node classes that mirror real-world document structure.

Features:

  • Semantic Elements – Direct representations of <article>, <section>, <nav>, and more.

  • Extract Meaning – Convert Lydio structures into meaningful JSON representations.

  • Accessible Defaults – Encourages aria-label and alt attributes where relevant.

  • Audit - Automatically audits semantic components for correctness.

Installation


npm  install  @lydio/semantics

Usage


import  semantics  from  '@lydio/semantics';


const  mySite  =  new  Site('example.com', 'Example Site');
const  homepage  =  mySite.addNode(new  Page())
homepage.route = '/'
homepage.description =  'A demo page'
homepage.html.head.addNode(new  Nav());
homepage.html.body
.addNode(new  Main())
.addNode(new  Article())
.addNode(new  P())
.addText('Welcome to our site!')
mySite.addNode(homepage);
mySite.audit();

console.log(mySite.toHtml());
console.log(mySite.toMeaning());

Semantic Elements Overview

Page Composition

  • Site(domain, name) → Represents a website structure.

  • Page(route, options) → A structured page with metadata.

  • Html(lang) → The root <html> element with language attributes.

  • Head() → The <head> section.

  • Body() → The <body> section.

Document Structure Elements

  • Main()<main> wrapper.

  • Article()<article> content block.

  • Section()<section> element.

  • Nav()<nav> for navigation menus.

  • Header() / Footer()<header> and <footer>.

Content Elements

  • H1 - H6 → Headings (<h1> to <h6>).

  • P() → Paragraph (<p>).

  • Ul() / Ol() → Unordered and ordered lists.

  • A().href(value)<a> link with an optional aria-label.

  • Img().src(value).alt(value)<img> with required alt.

  • Button().ariaLabel(value)<button> element with aria-label.

Auditing and Meaning Extraction

Lydio Semantics extends Lydio’s core auditing and meaning extraction capabilities, providing richer analysis and more structured insights into semantic correctness.

Audit

Every semantic node can be audited to provide feedback on best practices, accessibility compliance, and SEO optimizations.

Semantic Meaning

Every semantic node can be converted into a structured JSON representation using toMeaning(). This ensures that content retains its logical intent when processed, analyzed, or repurposed.

const section = new Section();
section.addNode(new H1().addText('Our Services'));
section.addNode(new P().addText('We offer high-quality software solutions.'));

console.log(section.toMeaning());

Output

{
    "type": "section",
    "content": [
        { "type": "h", "depth": 1, "content": "Our Services" },
        { "type": "p", "content": "We offer high-quality software solutions." }
    ]
}

See Everything At Once

Unlike raw HTML, which can obscure important attributes or dynamically hidden text, structured meaning extraction allows you to see all relevant content at once. This includes:

  • ARIA labels, alt text, and metadata that might not be visible in a normal rendered page.

  • Nested content relationships, showing how different elements fit together.

  • Full textual content, making proofreading and editing easier.

This is particularly useful for:

  • SEO analysis

  • Accessibility verification

  • Large-scale content audits

  • Machine-readable site overviews

Futurism

By pairing layout and meaning as structured data, @lydio/semantics enables new possibilities for web rendering and accessibility:

  • Adaptive Browsing – Users could define how they want content presented, separating structure from display.

  • Intelligent Content Processing – Meaningful data extraction makes websites more interpretable by AI and assistive technologies.

  • Editable JSON-Based Site Representation – Websites could be edited as structured meaning rather than raw HTML.

License

Licensed under the Apache License 2.0.

Trademark

“Lydio” and related marks are trademarks of Alex Stevovich.

See TRADEMARK.md for details.