<commit_before>[![MIT License][license-image]][license-url]

# Tangular - A simple template engine like Angular.js for JavaScript or node.js

- syntax like __Angular.js__ templates
- supports custom helpers
- supports conditions (+ nested conditions)
- supports simple looping (doesn't support nested looping)
- no dependencies
- 4 kB minified
- best of use with www.totaljs.com - web application framework for node.js
- Live example on [JSFiddle / Tangular](http://jsfiddle.net/petersirka/ftfvba65/)

## Example

```javascript
var template = Tangular.compile('Hello {{name}} and {{name | raw}}!');
var output = Tangular.render(template, { name: '<b>world</b>' });
// Hello &lt;b&gt;world&lt;/b&gt; and <b>world</b>!
```

## Conditions

```html
{{if name.length > 0}}
    <div>OK</div>
{{else}}
    <div>NO</div>
{{endif}}
```

```html
{{if name !== null}}
    <div>NOT NULL</div>
{{endif}}
```

## Looping<commit_msg>update: description<commit_after>[![MIT License][license-image]][license-url]

# Tangular - A simple template engine like Angular.js for JavaScript or node.js

- syntax like __Angular.js__ templates
- supports custom helpers
- supports conditions (+ nested conditions)
- supports simple looping (doesn't support nested looping)
- no dependencies
- 4 kB minified
- best of use with www.totaljs.com - web application framework for node.js
- Live example on [JSFiddle / Tangular](http://jsfiddle.net/petersirka/ftfvba65/)

## Example

```javascript
var output = Tangular.render('Hello {{name}} and {{name | raw}}!', { name: '<b>world</b>' });
// Hello &lt;b&gt;world&lt;/b&gt; and <b>world</b>!
```

## Best performance with pre-compile

```javascript
// cache
var template = Tangular.compile('Hello {{name}} and {{name | raw}}!');

// render
var output = Tangular.render(template);
```

## Conditions

```html
{{if name.length > 0}}
    <div>OK</div>
{{else}}
    <div>NO</div>
{{endif}}
```

```html
{{if name !== null}}
    <div>NOT NULL</div>
{{endif}}
```

## Looping
{'fraction_non_alphanumeric': 0.17966784096628083, 'fraction_numerical': 0.004026170105686965, 'mean_word_length': 4.416893732970027, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 25, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7071831', 'n_tokens_mistral': 682, 'n_tokens_neox': 647, 'n_words': 186}