New:Introducing Socket Scanning for VS Code Marketplace Extensions.Learn more →
Get Started

@vexralabs/zerodom

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vexralabs/zerodom

DOM-to-Interaction-Graph middleware for AI web agents (TypeScript port)

Source
npmnpm
Version
0.0.1
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

zerodom (TypeScript)

TypeScript port of ZeroDOM's core engine — same interaction graph, same selector guarantees, for the Node/TS agent stack (LangChain.js, the Vercel AI SDK, Playwright for Node).

This is a v1 port: the parser, label linker, and a one-line Playwright adapter. The CLI, MCP server, and HTML report inspector are still Python-only — this package is the piece most JS agents actually need (ZeroDOM.fromPage(page) → graph.toCompactText()), not the whole toolchain. See the root README for the full feature set and design rationale; the logic here is a line-for-line port of ../zerodom/parser.py and ../zerodom/label_linker.py, so the same design notes (selector priority, label priority, escaping rules) apply.

Install

npm install @vexralabs/zerodom

Quickstart

import { ZeroDOM } from "@vexralabs/zerodom";

const graph = await ZeroDOM.fromPage(page);   // any object with content()/url(), e.g. a Playwright Page
console.log(graph.toCompactText());           // what you send the model
const selectors = graph.selectorMap();        // { node_01: "#email-input", ... } — stays your side
import { parseHtml } from "@vexralabs/zerodom";

const graph = parseHtml(html, url);           // parse HTML you already have, no browser needed

Why linkedom, not jsdom

linkedom gives a real querySelector/getElementById DOM — needed so every generated selector can be self-verified, the same guarantee the Python version makes against a real browser — at a fraction of jsdom's footprint. One caveat this port works around: unlike jsdom or a real browser, linkedom's parser doesn't normalize a bare HTML fragment into a full <html><body> document, so ZeroDOMParser wraps non-document input itself before handing it to linkedom (page.content() output is unaffected — it's always a full document already).

Development

npm install
npm run build   # tsc -> dist/
npm test        # node's built-in test runner, against the built dist

Keywords

dom

FAQs

Package last updated on 15 Sep 2026

Related posts