您可以在节点和浏览器环境中从代码中调用 Tact 编译器。
import { run } from "@tact-lang/compiler"; // Virtual FSconst fs = { ["main.tact"]:Buffer.from("...").toString("base64"),}; const config = { projects:[ { name: "Sample", path:"main.tact", output:"./output", }, ],}; // Run compilerlet successful = await run({ config, fs }); // NOTE: Output from is written to the same fs object.
您可以使用 verify 函数验证编译后的软件包。
verify
import { verify } from "@tact-lang/compiler";const pkg: string = '...';const res = await verify(pkg);