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

cvdom

v0.0.3

Published

cvdom =====

Downloads

3

Readme

cvdom

Conditional virtual-dom templates to inject data and repeat/skip sections as the template renders by calling h. We splice in our own controller called ch which is required at runtime just like h.

Install

npm install cvdom

Test

npm test

History

I first used the approach taken in this virtual-dom overlay implementation in a PHP templating library I wrote 10+ years ago. At some point I will look for it and try to port all features.

The cvdom approach (conditions + hyperscript) is compatible with the domplate library used in Firebug. domplate also deals with event listeners (which cvdom does not directly) and hyperscript has a JSON intermediate representation (VTree) which domplate does not.

The goal of cvdom is to provide a thin layer on top of hyperscript that allows for conditional and repeated control of sections using a JSON control object or equivalent module hooks that plays nice with the hyperscript JSON intermediate representation and h runtime library.

Ultimately one should be able to write an adapter to run existing domplate modules using the cvdom implementation vs the generated domplate templates and also compile templates written in other formats to cvdom and then to a domplate runtime template.

domplate is important because it uses a runtime representation that does NOT reflect original source logic details. i.e. Its a runtime format that can be used to keep hard-earned higher order logic hidden as it is removed in the compile process. hscript has the same benefit but ultimately domplate compiles closer to the DOM due to it also directly dealing with event handlers.

domplate modules have been proven extremely compact and useful within Firebug and have stood the test of time. They are currently being migrated to the new mozilla devtools projects which will renew their (or compatible implementations) life significantly.

A potential improvement over the domplate runtime approach could be the incremental-dom approach (as it could ultimately lead to less runtime source code per module) HOWEVER it has yet to be proven if a DOM generator from objects like incremental-dom is superior over JS code operating directly on the DOM like domplate does.

Provenance

Original source logic UNLICENSED by Christoph Dorn