rauchg/xeet
Developer ToolsRender X posts to pixel-accurate PNGs without a browser, in Rust and WebAssembly.
Overview
xeet renders X (Twitter) posts as PNG images that reproduce what Chrome shows on x.com: line breaks, emoji, fallback fonts, "Show more" placement, cards, quotes, polls and media posters. Instead of screenshotting with headless Chromium, it reimplements the relevant parts of X's client rules, Blink/HarfBuzz text layout, the flexbox frame and Skia-style anti-aliasing in safe Rust. The core does no I/O and uses no system fonts, so output is deterministic and needs no network, filesystem or clock.
It targets three surfaces from one core: a WebAssembly module for browsers and Node (packages/xeet), a native Rust library (xeet-core, plus xeet-resolve for hydration), and a CLI (xeet-cli). It is useful for generating shareable post images, previews, tests and bots that cannot or do not want to run a browser.
Getting started
There are two entry points. To try the WebAssembly playground locally, run vercel dev, which builds and serves the site (build script); the hosted playground is at xeet-rs.vercel.app.
To build and test from source:
npm run build
npm test
cargo test --workspace
cargo build --release --bin xeet
xeet render post.json --width 390 --theme dark --dpr 3 -o post.png
The Chrome-parity oracle needs its own dev dependency: pnpm --dir tools install. A Post JSON object only requires text; optional fields cover author, media, cards, quotes, polls, counts and timestamps (Post model). The CLI also supports explain for layout diagnostics, sheet for contact sheets, and resolve to turn an x.com URL into a Post before rendering:
npm i -g @xeet/cli
xeet resolve https://x.com/NASA/status/2119833829389041896 --media | xeet render - -o nasa.png
For JavaScript, install @xeet/core and load the singleton in Node:
import { loadXeet } from "@xeet/core/node";
const xeet = await loadXeet();
const { png, report } = xeet.render(post, { width: 390, theme: "dark", dpr: 3 });
In the browser, initialize the wasm module and bind it to the same Xeet surface. From Rust, call xeet_core::render::render(&post, &opts) for PNG bytes plus a report (render API).
Constraints
- Fonts. Six font packs are shipped, but redistribution is limited: X's Chirp and the reference fonts are vendored only for CI and parity checks under their own terms, not Apache-2.0. Public binaries should ship only licensed fonts or rely on host-supplied fonts (license). Scripts without a bundled face render as
.notdeftofu boxes;XEET_FONT_DIRcan add runtime fonts. - Network stays outside the core.
xeet-coreis pure and needs no I/O. Link resolution throughxeet-resolverequires the caller to supplyfetch, optional DNS lookup and cache, and permissions (redirects are followed by hand, up to 10 hops, with SSRF guards); without those callbacks you cannot hydrate anx.comURL (resolver). - Upstream coupling. X rules are pinned to a client revision (
x-web@55591fe0), so future X markup or rules changes require updatingSPEC.mdandrules/x-web.json. - Scope. The renderer reproduces the four verified surfaces (web/iOS timeline and detail) and the image output depends on supplying media bytes. Inputs are validated against
limits.rsand failures throwXeetError. Rendering is CPU-only but the WASM target is aimed at browser/Node contexts; a native CLI is also available.
HotRepo's take
xeet is a new project with a modest but real early footprint: it appeared on HotRepo's new-project list for JavaScript on 2026-11-17 at 105 stars and 9 forks, with 3 stars gained in the recorded one-hour window. That is not enough to judge adoption, but the repository itself is substantive: a documented X rules spec, conformance suites against Chrome (0 line-break and 0 height mismatches across 13,440 layouts), 2,119 twitter-text cases, and byte-identical native/WASM output on 24 cases. The distinguishing design choice is to keep the renderer a pure function and push all network policy to the caller, which makes it easy to embed in servers and CI without a browser.
Written by AI from the project's README, updated . The project's own docs are the source of truth.
Hacker News
You might also like
- bytecodealliance/wasmtimeRun WebAssembly modules and components outside the browser, as a CLI or embedded in your host language.
- denoland/denoA secure JavaScript, TypeScript and WebAssembly runtime for building and running applications, especially web servers.
- pithings/unkernelBoots a real Linux kernel compiled to WebAssembly, giving a fast Alpine shell in the browser or via Node.
- tokio-rs/topcoatA batteries-included Rust web framework that keeps templates, reactivity and assets in one typed codebase, aimed at teams already using Rust.
- serde-rs/serdeA Rust framework for serializing and deserializing data structures, with support for many formats through separate crates.