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

hson-live

v2.0.26

Published

HSON 2025

Downloads

19

Readme

// readme.hson.md

▗▖ ▗▖ ▗▄▄▖ ▗▄▖ ▗▖  ▗▖
▐▌ ▐▌▐▌   ▐▌ ▐▌▐▛▚▖▐▌
▐▛▀▜▌ ▝▀▚▖▐▌ ▐▌▐▌ ▝▜▌                             pre-alpha demo
▐▌ ▐▌▗▄▄▞▘▝▚▄▞▘▐▌  ▐▌       Hypertext Structured Object Notation
----------------------------------------------------------------

[!WARNING] UNSAFE - EXPERIMENTAL

Use for research or educational purposes. Do not use with important or sensitive business data. Do not use with unknown third-party data or html.

HSON is a glue format that unifies JSON and HTML in a minimalist, pared-down syntax of HTML.

It fully represents both data and markup under a single unified format (in a more compact file size than either). By connecting JSON and HTML's consistent, tree-based data structures, HSON can fluently and losslessly translate data from one to the other and back.

This library also provides a stateful API for grafting onto and manipulating live DOM elements, enabling reactive UIs built on a clear, declarative data model that manipulates the DOM itself via traditional JS Object methods and dot-notation access.

The core HSON is a set of seven transformers that convert data between HTML, JSON, and HSON's own minimalist syntax (paredHTML). A small, compact API (hson.transform, hson.liveTree to start*) and simple toolchain are all that is needed to begin manipulating complex on-screen DOM elements with the precision of native JavaScript objects.

This project is a proof of concept and not a final version. Carries a risk of executing unescaped html from unknown sources. Use at your own risk.

Installation

// NOT LIVE ON NPM

// npm install hson
// THIS DOESNT EXIST

This project uses TypeScript. To build:

1. Install dependencies:
   ```bash
   npm install
2. Compile the source:
```bash
npx tsc

This will output compiled JavaScript to the dist/ directory.


Quick Start

Use the hson.transform fluent API to convert between formats.

```JavaScript
import { hson } from 'hson';

// 1. Start with an HTML string
const html = '<div id="main"><p class="greeting">Hello</p></div>';

// 2. Convert it to its HSON representation
const hsonString = hson.transform
  .fromHTML(html)
  .toHSON()
  .serialize();


console.log(hsonString);
/*
<div id="main"
  <p class="greeting" "Hello" />
/>
*/

// 3. Continue the chain to get a clean JSON object
const jsonObject = hson.transform
  .fromHTML(html)
  .toJSON()
  .parse();

console.log(jsonObject);
/*
{
  "div": {
    "_meta": { "attrs": { "id": "main" } },
    "p": {
      "_meta": { "attrs": { "class": "greeting" } },
      "#text": "Hello"
    }
  }
}
*/

Documentation

For HSON's syntax, liveTree API, and core concepts, please see the src//docs directory.