Cometa
Yet another templating engine 📠
Cometa is a templating engine with no dependencies written in JS
. That was the reason because it was created.
Quickstart 💥
# Install npm i cometa # Run node examples/simple/app.js
Setup 🏗
General Import
// Importconst Cometa = // Initializeconst cometa =
Constructor parameters
views
[Optional] Root template folderextension
[Optional] File extension for the templatesencoding
[Optional] Encoding to be used on the
views: './my/views/folder' extension: 'html'
Installation 🚂
npm i cometa
Reference 📒
Variable
{{myVar}}
Comments
{{# Me Me Comment #}}
If
True is everything that is different from:
undefined
false
null
''
{{? myVar }} Only show me when I exist: {{ myVar }}{{/?}}
Loop
{{* link in links}} {{ link.name }} {{/*}}