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

html5rw-jsoo

v1.0.0

Published

Pure OCaml HTML5 parser and validator compiled to JavaScript/WebAssembly via js_of_ocaml

Readme

html5rw

Pure OCaml HTML5 parser compiled to JavaScript and WebAssembly via js_of_ocaml.

Note: This package is browser-only. It uses DOM APIs and browser events for initialization and cannot be used in Node.js.

This is a fully compliant HTML5 parser implementing the WHATWG HTML5 specification, passing the html5lib-tests conformance suite. It is based on transpiling https://github.com/validator/validator into OCaml.

Installation

npm install html5rw-jsoo

Usage (Browser Only)

JavaScript Version

<!DOCTYPE html>
<html>
<head>
  <script src="node_modules/html5rw/htmlrw.js"></script>
</head>
<body>
  <script>
    // The library initializes on DOMContentLoaded
    // API documentation coming soon
  </script>
</body>
</html>

WebAssembly Version

<!DOCTYPE html>
<html>
<head>
  <script src="node_modules/html5rw/htmlrw.wasm.js"></script>
</head>
<body>
  <script>
    // Same API as JavaScript version, but runs as WASM
    // Automatically loads WASM modules from htmlrw_js_main.bc.wasm.assets/
  </script>
</body>
</html>

Web Worker (Background Validation)

For non-blocking HTML validation in a separate thread:

const worker = new Worker('node_modules/html5rw/htmlrw-worker.js');

worker.onmessage = (e) => {
  console.log('Validation result:', e.data);
};

worker.postMessage({ html: '<div><p>Hello' });

WASM version:

const worker = new Worker('node_modules/html5rw/htmlrw-worker.wasm.js');

Files Included

| File | Description | |------|-------------| | htmlrw.js | Main library (JavaScript) | | htmlrw.wasm.js | Main library (WebAssembly loader) | | htmlrw-worker.js | Web Worker (JavaScript) | | htmlrw-worker.wasm.js | Web Worker (WebAssembly loader) | | htmlrw-tests.js | Browser test runner (JavaScript) | | htmlrw-tests.wasm.js | Browser test runner (WebAssembly loader) | | htmlrw_js_main.bc.wasm.assets/ | WASM modules for main library | | htmlrw_js_worker.bc.wasm.assets/ | WASM modules for web worker | | htmlrw_js_tests_main.bc.wasm.assets/ | WASM modules for test runner |

Features

  • Full HTML5 parsing per WHATWG specification
  • Encoding detection and conversion
  • Error recovery (like browsers)
  • CSS selector queries
  • DOM manipulation
  • HTML serialization

Source Code

The OCaml source code is available on the main branch: https://tangled.org/anil.recoil.org/ocaml-html5rw

License

MIT