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

untrue

v5.18.0

Published

Render user interfaces.

Readme

Untrue

JavaScript library for rendering user interfaces.

Installation

The easiest way to get started with Untrue is through a web app.

npm i untrue @untrue/web

Compatible with any build tool: Parcel, Vite, Webpack, etc.

Native app development available with Detonator.

Get started

You can add Untrue to any part of your page.

import $ from "untrue";

import { Tree } from "@untrue/web";

import App from "./App";

const tree = new Tree(document.body);

// $ is a shorthand to represent slots

tree.mount($(App));

In this case, we're adding Untrue to body.

More on App in the next section.

Basic features

Interactivity

A component state can change at any time and Untrue knows which nodes should be updated in the DOM.

import $, { Hook } from "untrue";

function App() {
  const [counter, updateCounter] = Hook.useState(0);

  const onIncrement = () => {
    updateCounter(counter + 1);
  };

  // regular arrays are used to return a list of slots

  // after the first click, counter is no longer 0 but 1

  return [
    $("span", counter),
    $("button", { onclick: onIncrement }, "increment"),
  ];
}

export default App;

The output HTML will be:

<span>0</span> <button>increment</button>

button will have an onclick listener attached to it.

span will be updated with the new counter every time button is clicked.

Modularity

Components can be classes or functions and are used to group multiple slots.

import $, { Hook, Props } from "untrue";

function App() {
  return [
    $(Header, { title: "Untrue" }), // pass title as prop (external data)
    $(Footer, { year: 2049 }), // pass year as prop (external data)
  ];
}

interface HeaderProps extends Props {
  title: string;
}

function Header({ title }: HeaderProps) {
  const [counter, updateCounter] = Hook.useState(0); // internal data

  const onIncrement = () => {
    updateCounter(counter + 1);
  };

  return $("header", [
    $("h1", title),
    $("div", [
      $("span", counter),
      $("button", { onclick: onIncrement }, "increment"),
    ]),
  ]);
}

interface FooterProps extends Props {
  year: number;
}

function Footer({ year }: FooterProps) {
  return $("footer", [
    $("span", `copyright, ${year}`),
    $("br"),
    $("a", { href: "https://example.com" }, "some anchor link"),
  ]);
}

export default App;

The output HTML will be:

<header>
  <h1>Untrue</h1>
  <div>
    <span>0</span>
    <button>increment</button>
  </div>
</header>
<footer>
  <span>copyright, 2049</span>
  <br />
  <a href="https://example.com">some anchor link</a>
</footer>

Header has some counter that will be updated with button.

Lifecycle events

  • mount: The first render.
  • update: Every render after the first one.
  • render: Every render. It's fired after mount or update events.
  • unmount: Component has been unmounted.

Multiple event listeners can be attached to a single event. Specially useful to have more organized code.

import $, { Hook } from "untrue";

function App() {
  const [running, updateRunning] = Hook.useState(false);

  const onClick = () => {
    updateRunning(!running);
  };

  return [
    $("button", { onclick: onClick }, running ? "end timer" : "start timer"),
    $("br"),
    running ? $(Timer) : null,
  ];
}

function Timer() {
  const [counter, updateCounter] = Hook.useState(0);

  Hook.useMountLifecycle(() => {
    console.log("Timer mounted");
  });

  Hook.useUpdateLifecycle(() => {
    console.log("Timer updated");
  });

  Hook.useEffect(() => {
    const timeout = setTimeout(() => {
      updateCounter(counter + 1);
    }, 1000);

    return () => {
      clearTimeout(timeout);
    };
  }, [counter]);

  return $("span", counter);
}

export default App;

After the button click, the output HTML will be:

<button>end timer</button>
<br />
<span>0</span>

counter is incremented every second.

Timer mounted is logged first followed by Timer updated for updates.