https://github.com/nicolashov/mouchetasse
🪰☕️ Minimalist templating tool for TypeScript :{
https://github.com/nicolashov/mouchetasse
jest nodejs templating-engine typescript
Last synced: about 1 month ago
JSON representation
🪰☕️ Minimalist templating tool for TypeScript :{
- Host: GitHub
- URL: https://github.com/nicolashov/mouchetasse
- Owner: NicolasHov
- Created: 2022-08-31T15:31:30.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-02-03T17:29:46.000Z (over 2 years ago)
- Last Synced: 2025-02-10T15:13:48.097Z (over 1 year ago)
- Topics: jest, nodejs, templating-engine, typescript
- Language: TypeScript
- Homepage:
- Size: 56.6 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# 🪰☕️ Mouchetasse `{`
[](https://badge.fury.io/js/mouchetasse)
_Minimalist templating tool for TypeScript_
## Get started
Install the package:
```
npm install mouchetasse
```
## Quick start example
- `index.ts`:
```ts
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}`)
})
```
- `index.html`:
```html
Hello {{name}}, do you {{hobby}}?
```
- Result :
```
Hello Dragon, do you fly?
```
## Unit tests
Run the test:
```
npm jest
```
## ROADMAP
- Add conditionnals
- make it work for mardkown...