{"_id":"@corbet-labs/ctypst","_rev":"2-5924fc67b6243c086d78ce3036741773","name":"@corbet-labs/ctypst","dist-tags":{"latest":"0.3.1"},"versions":{"0.3.0":{"name":"@corbet-labs/ctypst","version":"0.3.0","license":"FSL-1.1-ALv2","_id":"@corbet-labs/ctypst@0.3.0","maintainers":[{"name":"julian-corbet","email":"admin+npmjs@sys.corbet.ch"}],"homepage":"https://github.com/corbet-labs/ctypst#readme","bugs":{"url":"https://github.com/corbet-labs/ctypst/issues"},"dist":{"shasum":"dcb2930e7831778a6f837d9129e73ca50e8f2b0d","tarball":"https://registry.npmjs.org/@corbet-labs/ctypst/-/ctypst-0.3.0.tgz","fileCount":32,"integrity":"sha512-BoohmC2wX0odxa90q9VsfqjzwL0lmBA/b5LXzmdrN4pi+1z3UsGf6bm73HIoJZprnLBkzpdMGVHLoPpsX2MO+w==","signatures":[{"sig":"MEQCIFPIHrt3LKa+AoB/2niiWwUUuQlnKgywcVs8jYtqdVSSAiBAU6bHvs9vK3k5a04OqsNQYSwL1avedOG52Cs4QbBAdg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@corbet-labs%2fctypst@0.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":63562924},"main":"./src/index.ts","type":"module","types":"./src/index.ts","exports":{".":"./src/index.ts","./wasm/*":"./wasm/*","./fonts/*":"./fonts/*","./assets/measure-v1.typ":"./assets/measure-v1.typ"},"gitHead":"a78d0bb1747dfe73225e00ed839ed43b149f2fde","scripts":{"prepack":"bash ./scripts/sync-assets.sh","typecheck":"tsc --noEmit -p ./tsconfig.json","conformance":"bun ./scripts/conformance.mts"},"_npmUser":{"name":"julian-corbet","email":"admin+npmjs@sys.corbet.ch"},"repository":{"url":"git+https://github.com/corbet-labs/ctypst.git","type":"git","directory":"js/@corbet-labs/ctypst"},"_npmVersion":"11.19.0","description":"Shared Typst measurement: versioned protocol, Typst-WASM adapter, font manifest and assets. Mirrors the ctypst Rust crate release line.","directories":{},"_nodeVersion":"24.20.0","_hasShrinkwrap":false,"devDependencies":{"typescript":"6.0.3","@types/node":"25.8.0","@myriaddreamin/typst.ts":"0.7.0-rc2","@myriaddreamin/typst-ts-web-compiler":"0.7.0-rc2"},"peerDependencies":{"@myriaddreamin/typst.ts":"0.7.0-rc2"},"_npmOperationalInternal":{"tmp":"tmp/ctypst_0.3.0_1788661629968_0.5212279862031641","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@corbet-labs/ctypst","version":"0.3.1","description":"Shared Typst measurement: versioned protocol, Typst-WASM adapter, font manifest and assets. Mirrors the ctypst Rust crate release line.","license":"FSL-1.1-ALv2","publishConfig":{"access":"public","provenance":true},"repository":{"type":"git","url":"git+https://github.com/corbet-labs/ctypst.git","directory":"js/@corbet-labs/ctypst"},"type":"module","main":"./src/index.ts","types":"./src/index.ts","exports":{".":"./src/index.ts","./assets/measure-v1.typ":"./assets/measure-v1.typ","./fonts/*":"./fonts/*","./wasm/*":"./wasm/*"},"scripts":{"prepack":"bash ./scripts/sync-assets.sh","conformance":"bun ./scripts/conformance.mts","typecheck":"tsc --noEmit -p ./tsconfig.json"},"peerDependencies":{"@myriaddreamin/typst.ts":"0.7.0-rc2"},"devDependencies":{"@myriaddreamin/typst-ts-web-compiler":"0.7.0-rc2","@myriaddreamin/typst.ts":"0.7.0-rc2","@types/node":"25.8.0","typescript":"6.0.3"},"gitHead":"4bcc23edf45fc2b92cfb82afcd49bbe4c47e0360","_id":"@corbet-labs/ctypst@0.3.1","bugs":{"url":"https://github.com/corbet-labs/ctypst/issues"},"homepage":"https://github.com/corbet-labs/ctypst#readme","_nodeVersion":"24.20.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-PZSXp/CtlAd2Ir4nVOX/hdv310WeGBKmZlUxCGUQ9j4aEVTbdr9IwRaWmuSfkfbzTsbYgdH7Z/Jd2EAtbnGFPQ==","shasum":"55eb1986be0c993ffca3d9de24f135608965dd98","tarball":"https://registry.npmjs.org/@corbet-labs/ctypst/-/ctypst-0.3.1.tgz","fileCount":32,"unpackedSize":47777751,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@corbet-labs%2fctypst@0.3.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD9bZGrKAlamDjV7NoqWf0rwyfZSJfaSvnthZw1pjkGtgIhAKWzxyFbx6P4jk0vZAWJ6FKnmP8kYdNdXl7N2hJzwNyo"}]},"_npmUser":{"name":"julian-corbet","email":"admin+npmjs@sys.corbet.ch"},"directories":{},"maintainers":[{"name":"julian-corbet","email":"admin+npmjs@sys.corbet.ch"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ctypst_0.3.1_1788667223659_0.6709422710795274"},"_hasShrinkwrap":false}},"time":{"created":"2026-09-06T02:27:09.757Z","modified":"2026-09-06T04:00:24.389Z","0.3.0":"2026-09-06T02:27:10.404Z","0.3.1":"2026-09-06T04:00:24.060Z"},"bugs":{"url":"https://github.com/corbet-labs/ctypst/issues"},"license":"FSL-1.1-ALv2","homepage":"https://github.com/corbet-labs/ctypst#readme","repository":{"type":"git","url":"git+https://github.com/corbet-labs/ctypst.git","directory":"js/@corbet-labs/ctypst"},"description":"Shared Typst measurement: versioned protocol, Typst-WASM adapter, font manifest and assets. Mirrors the ctypst Rust crate release line.","maintainers":[{"name":"julian-corbet","email":"admin+npmjs@sys.corbet.ch"}],"readme":"# `@corbet-labs/ctypst`\n\nShared Typst measurement for browser and Node runtimes: the versioned\n`ctypst-measure-v1` protocol, the Typst-WASM adapter, the font manifest,\nand the canonical font bytes. Mirrors the `ctypst` Rust crate release\nline — both artifacts are cut from the same tag with matching hashes.\n\n```ts\nimport { createTypstCompiler, loadFonts } from '@myriaddreamin/typst.ts';\nimport { CtypstMeasure } from '@corbet-labs/ctypst';\n\nconst compiler = createTypstCompiler();\nawait compiler.init({ beforeBuild: [loadFonts(fontBytes, { assets: false })] });\nconst measure = new CtypstMeasure(compiler);\nconst results = await measure.measureAll(items, format);\n```\n\n## Layout\n\n- `src/protocol.ts` — request/result types.\n- `src/adapter.ts` — `CtypstMeasure` (transport, validation, caching).\n  Bring your own compiler: the browser keeps its worker, incremental\n  compiler, and font initialization.\n- `src/generated/measure-asset.ts` — generated by `scripts/sync-assets.sh`\n  (runs on `prepack`): the Typst program text, the manifest, the font\n  file list, and the crate version. Never edited by hand.\n- `assets/`, `fonts/` — generated copies of the canonical sources for\n  bundlers and servers that load bytes from disk.\n- `scripts/conformance.mts` — WASM side of the cross-runtime gate: runs\n  `protocol/measure-v1` vectors through the adapter and compares with\n  `expected.json`.\n\nRequests are data, never generated Typst source. Failures are loud:\nunknown versions, empty or duplicate ids, unknown weights, bad\ndimensions, missing or unexpected results, and compiler errors all throw.\n","readmeFilename":"README.md"}