[READ-ONLY] Mirror of https://github.com/crutchcorn/tempblot. A modern type-safe templating engine tempblot.dev
README.md

Tempblot

splatter

A modern type-safe templating engine


<!-- 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>

Passing Params #

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>

Installation #

npm install tempblot

VS Code Extension #

Install Tempblot Language Features for .blot syntax highlighting and IntelliSense in VS Code.

Prerequisites #

  • Node v22.18+