<!-- Run TypeScript via Node -->
<setup>
import {v4} from "uuid";
const data = {
hello: !!v4 ? 123 : null
};
</setup>
<!-- Use `lang` to change the syntax highlighting of the `output` block -->
<output lang="json">
{
"//": "Interpolate values with << >>",
"test": <<data.hello>>
}
</output>
Pass configuration into a .blot file with compilePath, then read it in the
<setup> block with useParams.
import { compilePath } from "tempblot";
const output = await compilePath("./config.json.blot", { name: "Tempblot" });<setup>
import { useParams } from "tempblot";
const params = useParams<{ name: string }>();
</setup>
<output lang="json">
{
"name": <<params.name>>
}
</output>
npm install tempblot- Node v22.18+