1.0.10 • Published 2 years ago

mouchetasse v1.0.10

Weekly downloads
-
License
ISC
Repository
-
Last release
2 years ago

🪰☕️ Mouchetasse {

npm version

Minimalist templating tool for TypeScript

Get started

Install the package:

npm install mouchetasse

Quick start example

  • index.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:
<!DOCTYPE html>
<html lang="en">
<body>
    <h1>Hello {{name}}, do you {{hobby}}?</h1>
</body>
</html>

Unit tests

Run the test:

npm jest
1.0.10

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago