Install
lamina isn’t published to npm or crates.io yet. Until it is, use it from a checkout of the repository, which needs Rust (the toolchain in rust-toolchain.toml installs itself), Node 22 or newer and pnpm.
TypeScript: @lamina/pdf
Section titled “TypeScript: @lamina/pdf”Build the WebAssembly modules and the package once:
pnpm installcargo xtask wasm # builds packages/wasm/dist/ and packages/pdf/dist/, then tests themThen use one of these:
- A tarball: run
pnpm packinpackages/wasmand inpackages/pdf, then add both.tgzfiles to your project.@lamina/pdfdepends on@lamina/wasm, so install both tarballs at once. - A workspace dependency: inside this repository, add
"@lamina/pdf": "workspace:*"to a package underpackages/orapps/.
The package is ESM only. It has one entry per runtime (the workerd, deno, browser, node and default export conditions), and each entry loads the .wasm its own way. The quick starts show each one.
Rust: lamina
Section titled “Rust: lamina”Add a path dependency on the façade crate:
[dependencies]lamina = { path = "../lamina/crates/lamina" }A git dependency (lamina = { git = "…" }) works too, once you can read the repository. The default features are text (fonts and text, which includes the builder and text extraction) and saslprep (passwords for AES-256 files). For reading and editing only, use default-features = false.
API docs
Section titled “API docs”- TypeScript: the
@lamina/pdfreference, generated from the package’s TSDoc comments. - Rust: rustdoc, built by CI or by
cargo doc --open.