@getmate/compiler
v0.8.0
Published
Mate compiler runtime and WASM artifacts
Readme
@getmate/compiler
Compiler runtime package for Mate with WASM API.
Published runtime artifacts are distributed from dist/.
Installation
bun add @getmate/compilerUsage
import { Matec } from '@getmate/compiler';
const { compile } = await Matec();
const js = compile('<h1>Hello</h1>', 'hello-world');API
Matec(): Promise<{ compile(source: string, name: string): string }>
CLI
matec --helpIf the package is installed in your project, run it with Bun:
bunx matec --helpCompile a .mate file:
matec src/app.mateWrite output to a file:
matec src/app.mate --out src/app.js- Binary wrapper:
dist/bin/matec.js - Bundled native binary:
dist/artifacts/vendor/<target>/matec(.exe)
WASM Runtime
- Entry:
dist/artifacts/wasm/index.js - Loader:
dist/artifacts/wasm/matec-runtime.js - Module:
dist/artifacts/wasm/matec.wasm
