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

@stnd/dom

v0.1.0

Published

Pure HTML DOM manipulation utilities. Extract, remove, partition, and transform elements from HTML strings.

Readme


title: "@stnd/dom" aliases: [] created: 2026-07-05 07:39 modified: 2026-07-05 19:22 last_audited: 2026-07-14 audit_interval_days: 90 next_audit: 2026-10-12 audit_priority: 3 maturity: sprout mode: read publish: false status: active tags:

  • package
  • stnd theme: kernel type: package visibility: private

@stnd/dom

Lightweight DOM manipulation and extraction utilities.

ELI5

Once content is rendered to an HTML string (by @stnd/press, usually), these are the scissors: pull out all the images to lazy-load them, grab the headings to build a table of contents, split the content in two at the first occurrence of a given tag (partition). It works the same whether that HTML lives in a Cloudflare Worker or a browser tab — no Node-only APIs.

Use it:

import { extractHeadings } from "@stnd/dom";
const headings = extractHeadings(html, [1, 2]); // table of contents data

Overview

@stnd/dom provides a set of utilities for processing HTML strings and DOM elements. These are designed to be used both on the server (using linkedom) and in the browser.

Key Exports

  • transformImages(html, callback): Transform all <img /> src attributes.
  • enhanceImages(html, callback): Add srcset and sizes to images.
  • extractImages(html): Get a list of all images and their attributes.
  • extractHeadings(html, levels): Extract heading data for TOCs.
  • extractElements(html, tag): Extract all elements matching a tag name.
  • removeElements(html, pattern): Remove elements based on tag names or selectors.
  • partition(html, tag): Split HTML content at the first occurrence of a tag.

Usage

import { extractHeadings } from "@stnd/dom";

const html = "<h1>Title</h1><p>Text</p><h2>Subtitle</h2>";
const headings = extractHeadings(html, [1, 2]);

// headings = [{ level: 1, text: "Title", id: "title" }, { level: 2, text: "Subtitle", id: "subtitle" }]

Features

  • Edge-Ready: No dependencies on heavy Node.js built-ins.
  • Fast: Minimal overhead for processing large HTML blocks.
  • Isomorphic: Works identically in Node.js, Workers, and Browser.

Notes / Observations

(jot down anything noticed here — quirks, gotchas, ideas)

Todo

  • [ ] Nothing tracked yet. [priority:: 3] [token_scale:: 3] [created:: 2026-07-14] [area:: framework]