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

worker-dom

v0.1.0

Published

A facsimile of a modern DOM implementation intended to run in a Web Worker.

Readme

WorkerDOM

An in-progress implementation of the DOM API intended to run within a Web Worker.

Purpose: Move complexity of intermediate work related to DOM mutations to a background thread, sending only the necessary manipulations to a foreground thread.

Use Cases:

  1. Embedded content from a third party living side by side with first party code.
  2. Mitigation of expensive rendering for content not requiring syncronous updates to user actions.
  3. Retaining main thread availablity for high priority updates by async updating elsewhere in a document.

Installation

npm install @ampproject/worker-dom

Usage

Include the WorkerDOM main thread code within your document directly or via a bundler.

<script src="./dist/index.mjs" type="module"></script>
<script src="./dist/index.js" nomodule defer></script>

Upgrade a specific section of the document to be driven by a worker.

Note: The nomodule format exposes the global MainThread whereas the module format allows one to directly import the upgradeElement method.

<div src="hello-world.js" id="upgrade-me"></div>
<script type="module">
  import {upgradeElement} from './dist/index.mjs';
  upgradeElement(document.getElementById('upgrade-me'), './dist/worker.mjs');
</script>
<script nomodule async=false defer>
  document.addEventListener('DOMContentLoaded', function() {
    MainThread.upgradeElement(document.getElementById('upgrade-me'), './dist/worker.js');
  }, false);
</script>

Running Debug Demos

After installing the library locally, you can try out the debug demos with the following.

npm run debug

"Safe" mode

WorkerDOM has a special output variant that includes safety features e.g. HTML sanitization and a web worker sandbox. This variant is distributed under the ".safe" suffix for main and worker thread binaries:

index.safe.mjs
index.safe.js

worker.safe.mjs
worker.safe.js

Security disclosures

The AMP Project accepts responsible security disclosures through the Google Application Security program.

Code of conduct

The AMP Project strives for a positive and growing project community that provides a safe environment for everyone. All members, committers and volunteers in the community are required to act according to the code of conduct.

License

worker-dom is licensed under the Apache License, Version 2.0.