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

node-group

v0.1.4

Published

Zero-runtime vanilla JavaScript library providing transparent DOM grouping via DocumentPersistentFragment - live parent semantics without wrappers, shadow roots or DOM patching.

Readme

Group

Live virtual parent for nodes. Transparent group of nodes. No DOM patching. Production targeted.

npm package

StackBlitz Playground

const parent1 = document.createElement("div")
parent1.style.background = "hsl(0 40% 60%)"

const parent2 = document.createElement("div")
parent2.style.background = "hsl(200 40% 60%)"


const group = new Group
group.append("123", "456", "789")

parent1.append(group) // So far acts exactly as `DocumentFragment`.
parent2.append(group) // The difference is that the nodes are actually moved.

group.append("000") // And changing nodes of `group` will be reflected in the `parent2`.

group is transparent to CSS Selectors, Box Model and Layout Flow, while changes to group are streamed to parent1 - allowing remote nodes rearranging or owned nodes area.


This is trying to follow as many aspects as possible from my comment. Even though it has several "flaws" or deviations since this implementation sets "No DOM patching" as a goal. Meaning some things may not be possible to fully implement. Other things may not be implemented

This is an implementation variant of DOM DocumentPersistentFragment proposal.

Another implementation variant is made by @WebReflection.

Motivation

React impacted Web development a lot by introducing JSX. It shifted element composition from "Side Effect" to "Ownership Sharing". And as 1/3 of developers use React (including me), it not only shifts this paradigm for people who uses React, it also affects how people perceive VanillaJS after using React.

I can talk only for myself, but seeing this proposal, it tells me I'm not alone in thinking we need to inherit best practices from React.

I started this project as an experiment since React recently become too conservative, which led to me to understand VanillaJS in a such way that made me realize, it actually could be better than React.

By adopting best things from React like JSX, Fragments, Lifecycle events and "Ownership Sharing" element composition, VanillaJS can easily become the only tool I need to build UI on the daily.

My proposal of NodeGroup and this implementation without DOM patching is my attempt to make this future closer.

I'm also willing to (at least trying to) make this production-ready product, I'm using this in React/SolidJS-like ui building library.

"Ownership Sharing"

@robbiespeed comment covers this neatly, I also have exact same impression when doing my own research.

Fragments

This implementation is exactly about fragments, which allows proper "Ownership Sharing" in VanillaJS.

Serialization/Parsing

The plan is to implement widely accepted standard that used by frameworks like React, which is based on comment nodes (<!--$-->) that can be customized for wider usage.

Naming

One of the proposed feature of NodeGroup is named groups.

<!--$Named-->
<!--/$Named-->
<!--<Named>-->
<!--</Named>-->

Which are parsed and added to document.groups by names. This is not possible without DOM patching (even little one).

If anyone shows interest in having this feature, it can be added as Group.list (or similar).

Parent Strategies

There are two parent determining strategies:

  • Nodes read parentNode as a targeted parent of group as if nodes are attached without group.
  • Nodes read parentNode as group as if they were direct children of group, while actually being not.

Both these approaches cause confusion (@justinfagnani comment).

[!Note] In current implementation, the children of the group are not patched, meaning they will read their parentNode as if nodes are attached without group.

How it works

It uses custom element lifecycle callbacks to indicate where Group, which extends DocumentFragment, was attached to. Then the custom element, i.e. <group-relay /> is returned back to Group for future attachments.

Group overrides several properties and methods to pretend it is attached to a parent and is actively carrying nodes. <group-relay /> also overrides properties and methods to mirror Group behavior in case it is mistakenly referenced somewhere.

[!Note] Don't worry, referencing or manipulate <group-relay /> should be ok. It acts as Group, DocumentFragment can't exist in DOM while custom elements can, so Group needs a relay.

<group-relay /> represents a live Group node, but as relaying mechanism, that's why it's called group-relay.