Deno
Deno resolves the deno export condition. The glue fetches each .wasm file from next to itself (a file: URL), so reading files needs --allow-read.
This is the Deno runner of the example suite, which CI runs with cargo xtask pdf-runtimes deno. It reads each input with Deno.readFile and registers each example with Deno.test:
// The shared example list (test/suite/examples.ts) in Deno, through the `deno` export condition// (dist/index.js: the glue fetches its `.wasm` next to itself, a file: URL). Run by// `cargo xtask pdf-runtimes deno`: `deno test --sloppy-imports --no-check --allow-read` (the// suite imports `.ts` files by their `.js` paths, as tsc wants; tsc checks the types, with// deno.d.ts standing in for Deno's). The measurement registers first, so it runs cold in this// file's fresh module instance.import { runSuite } from "../suite/examples.js";
const root = new URL("../../../../", import.meta.url);
runSuite("deno", (path) => Deno.readFile(new URL(path, root)), Deno.test);The suite it runs, runSuite, calls await init({ text: true }) once, then builds each example, such as hello, and compares its bytes with the Rust golden.