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 🙏

© 2024 – Pkg Stats / Ryan Hefner

h2o-lilies

v0.0.8

Published

Convert nested li's into a JS Object

Downloads

2

Readme

h2o-lilies

h2o-lilies is pronounced "water lilies". It is a non-visual custom element. "h2o" stands for "HTML to Object" and "li" refers to the li html element.

h2o-lilies generates a nested object from a previous element, which is assumed to be a (recursive) list based on the list element (li).

h2o-lilies takes the philosophical stance that there is honor in providing highly specialized, mundane products or esoteric, limited services that are useless by themselves.

The mission

We may want the server to render an initial list of items in format that is fast and SEO-friendly. I.e. just send HTML to the browser. If the content is particularly large, perhaps only a portion can be displayed, the rest hidden via styling. But the total tree(displayed and hidden) has embedded in it all the needed data for a richer view. Once the necessary dependencies needed to generate this rich view are downloaded, containing some expensive renderer (tree, chart, or grid, etc), we can pass the Plain Old JavaScript Object (POJO) to the fancy renderer.

Another scenario where this web component may be useful is in helping bringing the data contained in light DOM children into a more verbose HTML structure contained within the ShadowDOM of a web component. This scenario is illustrated below, based on CSS-Only Nested Dropdown Navigation (ARIA) found on code-pen:

h2o-lilies doesn't hide or remove the DOM element it extracts the data from. The reason is that the fancy renderer that needs the data may not be ready yet. So the responsibility to hide the original (light) DOM nodes is left to other components. As we said, h2o-lilies is quite specialized.

To customize how the POJO is generated, extend this web component and override / extend the initTransform method