tinymist/crates/tinymist-core/tests/simple.mjs
Myriad-Dreamin d32f6261f1
feat: build tinymist targeting web (#1102)
* feat: add web target

* dev: simple package rule

* dev: update web release

* dev: update workspace

* ci: setup wasm pack

* ci: correct path to upload

* ci: build artifact

* fix: update metadata and launch config
2025-01-03 10:30:38 +08:00

14 lines
359 B
JavaScript

import tinymist_init from "../pkg/tinymist_core.js";
import * as tinymist from "../pkg/tinymist_core.js";
import fs from "fs";
const wasmData = fs.readFileSync("pkg/tinymist_core_bg.wasm");
async function main() {
await tinymist_init({
module_or_path: new Uint8Array(wasmData),
});
console.log(tinymist.version());
}
main().catch(console.error);