{"repo":"VemtoOrg/vemto-template-engine","free":true,"listed":false,"github":"https://github.com/VemtoOrg/vemto-template-engine","clone":"git clone https://github.com/VemtoOrg/vemto-template-engine.git","description":"A template engine for code and text generation","language":"JavaScript","stars":56,"topics":["code-generation","template","template-engine","text-generation","vemto"],"license":"MIT","category":"dev-tools","readme_excerpt":"Vemto Template Engine Introduction Vemto Template Engine (VTE, former SilverB) is a template engine for code and text generation. It was initially created to be used with PWC Code Generator. In the past, I tested some template engines with PWC, like Handlebars, Dot, and others. However, these engines are made for another purpose (HTML templates), and because of this, I decided to make my own. VTE can be used for any dynamic text generation and accepts all Javascript syntaxes inside its special tags. Disclaimer: This project was created in 2018 and has had few changes. The code style is a bit dated, but the engine works very well and rarely needs any updates. Installation To use VTE in your project, install it using npm or yarn: Then you can import it in your code: Finally, build something amazing! :D Example Let's consider we have this data: And we have this text template: As you can see, we can attach the data object to the template scope and can access it using this . Any javascript command is accepted inside tags. Then we can compile the template: The result will be: See this example running here. Tags - - Used for line comments - - Used to show variables or expression values. Commands inside these tags will be executed and transformed into text - - It is like , but will put the result on the previous line (only if the tags are at the start of a new line) - - Used for javascript logic blocks like if , for , etc. Commands inside these tags will not be transformed to text. A","default_branch":null,"files":null,"tree":[],"storefront":"/r/VemtoOrg","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/VemtoOrg/vemto-template-engine/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}