Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/shakyshane/pretemplater

Add your own template sugar
https://github.com/shakyshane/pretemplater

Last synced: about 2 months ago
JSON representation

Add your own template sugar

Awesome Lists containing this project

README

        

##pretemplater

Because I wanted to define my own syntax, but still use simple templating from lodash.

```
<% loop items as item %>
<% if item.name %>
<%= item.name %>
<% /if %>
<% /loop %>
```

ends up being:

```
<% items.forEach(function(item) { %>
<% if (item.name) { %>
<%= item %>
<% } %>
<% } %>
```

###usage

```
var pretemplater = require("pretemplater");

var readyForLodash = pretemplater("some string");
```