Docx-Handlebars: Process Docx Files with Handlebars Templates in Rust/WASM

1 month ago 6

A Rust library that intelligently processes DOCX templates using Handlebars syntax. Works natively in Rust and compiles to WASM for Node.js, Deno, and browsers.

Key features: - Smart merging algorithm that handles Handlebars syntax split by Word's XML tags - Full template support: variables, conditionals, loops, helpers, and image insertion - Zero dependencies in WASM binary - Cross-platform: Rust, Node.js, Deno, Browser - Built-in DOCX validation

The core innovation is automatically reassembling template syntax that Word splits across multiple XML tags. For example, Word might break "{{name}}" into separate tags, and this library intelligently merges them back together.

Use cases: automated report generation, contract templates, document batch processing.

Available on crates.io, npm, and JSR. MIT licensed.

Read Entire Article