Weird template engine 👉👈

use at your own risk am making this for fun

Performance benchmark 🔥

benchmark

How to use

// example using deno: https://deno.land/
import { compile } from "https://cdn.jsdelivr.net/gh/Aiko-Suzuki/uwu-template@main/bundle.js";
const template = Deno.readTextFileSync("bench/test.nnt");
const compiled = compile(template);

const data = {
    title: "Test Title 1",
    slug: "test-title-1",
    id: 1,
    type: "TV",
    startdate: "2020-01-01",
    visible: true,
};

const result = compiled([data]);
console.log(result);

Helper

registerHelper("JSON",(data) => {
  return JSON.stringify(data)
})
// {{JSON users}}

supported block

  • if 🟢
  • each 🟢
  • elseif 🟢

default helper

  • json
  • raw