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 🙏

© 2025 – Pkg Stats / Ryan Hefner

rx-vdom

v0.1.6

Published

Tiny library to render HTML documents using reactive programing primitives.

Downloads

238

Readme

rx-vdom Logo

Open source package for observable-based declarative DOM representations.

Features

  • Compact Size & Dependency-Free: The compressed bundle size is less than 5 kB. Reactivity, usually with RxJS, is opt-in by the consumer. The library is only necessary for rendering components; defining them does not require it.

  • Simple & Consistent API: The API is minimal, building directly on standard HTML and reactive programming principles.

  • Type Safety: Supported by the strongly-typed VirtualDOM structure, it provides robust type checking and inline guidance within a TypeScript environment.

Installation

Install via npm or yarn:

npm install rx-vdom

or

yarn add rx-vdom

Alternatively, you can include the library directly from a CDN with a tag:

<script src="
https://cdn.jsdelivr.net/npm/rx-vdom@latest/dist/rx-vdom.min.js
"></script>

Configuration

In a TypeScript environment, you need to configure rx-vdom.config.ts. This file can be automatically generated and referenced in your tsconfig.json using the following command:

npx rx-vdom-init

or

yarn rx-vdom-init

The configuration file optimizes compilation time by ensuring only the HTML tags you actually use are included in the build process.

Basic Usage

import { render } from 'rx-vdom'
import { timer } from 'rxjs'
// Create an observable emitting values every second
const time$ = timer(0, 1000)

render({
    tag: 'div',
    class: 'border rounded p-1',
    children: [
        {
            tag: 'i',
            // Bind the class attribute to the observable
            class: {
                source$: time$,
                // Toggle green color every other second
                vdomMap: (tick) => (tick % 2 ? 'text-success' : ''),
                // Add clock icon class
                wrapper: (d) => `${d} fas fa-clock`,
            },
        },
        // Bind a child element to the observable
        {
            source$: time$,
            vdomMap: () => ({
                tag: 'i',
                class: 'mx-1',
                // Display current time
                innerText: new Date().toLocaleTimeString(),
            }),
        },
    ]
})

Documentation

For detailed tutorials, usage examples, and the full API specification, visit the documentation.

License

MIT License. See LICENSE for details.