You can invoke the Tact compiler from your code in node and browser environments.
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.
You can always verify the compiled package with the verify function.
verify
import { verify } from "@tact-lang/compiler";const pkg: string = '...';const res = await verify(pkg);