@mdscript/mds-wasm
v0.3.0
Published
WebAssembly build of the MDS (Markdown Script) compiler — used as the portable fallback by @mdscript/mds
Maintainers
Readme
@mdscript/mds-wasm
WebAssembly build of the MDS (Markdown Script) compiler.
This package is the portable fallback used by @mdscript/mds
when the native addon (@mdscript/mds-napi) is unavailable, and it powers the
browser build. Most users should depend on @mdscript/mds, not this package
directly. @mdscript/mds selects the native addon on Node and this WASM build
on the web (or as a Node fallback) automatically.
What's inside
Two builds, selected by package exports conditions:
| Condition | Entry | Module type | Init |
|-----------|-------|-------------|------|
| node | dist/node/mds_wasm.js | CommonJS (wasm-pack --target nodejs) | none |
| browser / default | dist/web/mds_wasm.js | ESM (wasm-pack --target web) | call default() with the .wasm URL |
Each build exposes compile(source, options), check(source, options), and
scanImports(source).
Build
npm run build -w @mdscript/mds-wasmRequires wasm-pack and the
wasm32-unknown-unknown Rust target. Output is written to dist/node and
dist/web.
License
MIT. See LICENSE.
