🪰☕️ Mouchetasse {
Minimalist templating tool for TypeScript
Get started
Install the package:
npm install mouchetasse
Quick start example
import { readFileSync } from 'fs'
import compile from 'mouchetasse'
const express = require('express')
const app = express()
const port = 3000
app.get('/', (req, res) => {
const html = readFileSync("index.html", { encoding: "utf8" })
const data = { name: "Dragon", hobby: "fly"}
res.send(compile(html, data))
})
app.listen(port, () => {
console.log(`Example app listening on port http://localhost:${port}`)
})
<!DOCTYPE html>
<html lang="en">
<body>
<h1>Hello {{name}}, do you {{hobby}}?</h1>
</body>
</html>