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

@webcontextinterface/distiller

v1.2.0

Published

WCI distiller — prune DOM and serialize agent-optimised views

Readme

@webcontextinterface/distiller

Prune annotated DOM and serialize WciView (JSON) or Markdown for LLM context windows.

Part of the Web Context Interface (WCI).

Install

npm install @webcontextinterface/distiller

Dependency: @webcontextinterface/spec

Quick start

import { WciDistiller } from '@webcontextinterface/distiller';

const distiller = new WciDistiller({
  format: 'json',
  scope: 'registration-form',
  maxNodes: 64,
});

const json = distiller.distilJSON(document);
// Pass to your LLM as tool context or user message

WciDistiller

Constructor options (DistillerOptions)

| Option | Default | Description | |--------|---------|-------------| | format | 'json' | 'json'WciView; 'markdown' → Markdown string | | scope | — | Landmark data-wci-id to restrict pruning | | maxNodes | 128 | Cap nodes after priority sort | | siteContext | — | Embed site summary in every view | | includeState | true | Strip state when false to save tokens |

Methods

| Method | Returns | |--------|---------| | distil(root?) | WciView or Markdown string | | distilJSON(root?) | Pretty-printed JSON string | | distilMarkdown(root?) | Markdown string |

root defaults to document; pass an Element to distil a subtree.

Low-level API

import { pruneDOM, serializeJSON, serializeMarkdown } from '@webcontextinterface/distiller';

const nodes = pruneDOM(document.body, { scope: 'checkout', maxNodes: 32 });
const view = serializeJSON(nodes, { pageTitle: document.title, scope: 'checkout' });

Pruning behavior

  1. Collect elements with data-wci-id or data-wci-role inside the scope (or whole document).
  2. Skip nodes with data-wci-hidden="true".
  3. Sort by data-wci-priority (1 = highest).
  4. Truncate to maxNodes.

Example output (WciView)

{
  "wci_version": "1.0",
  "page_title": "Register",
  "scope": "registration-form",
  "node_count": 8,
  "nodes": [
    {
      "id": "email-input",
      "role": "form",
      "desc": "Email address for account",
      "action": "fill",
      "state": { "value": "" },
      "required": true
    }
  ]
}

Related packages

| Package | Role | |---------|------| | @webcontextinterface/bridge | Execute actions chosen from the distilled view | | @webcontextinterface/context | Attach siteContext from wci.txt / wci.json | | @webcontextinterface/core | All-in-one SDK |

Documentation

License

MIT