Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/shakyshane/pretemplater
- Owner: shakyShane
- Created: 2014-07-05T20:01:04.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-07-06T10:30:33.000Z (over 10 years ago)
- Last Synced: 2024-08-09T21:23:25.427Z (5 months ago)
- Language: JavaScript
- Size: 131 KB
- Stars: 0
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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");
```