<commit_before># tplify

A Browserify plugin used internally at Timpex AS that allows to `require` html templates.<commit_msg>README.md: Added API-description.<commit_after># tplify

A Browserify plugin used internally at Timpex AS that allows to `require` html templates.

## Installation
`npm install tplify`

### Add to build
```javascript
browserify({...})
    .plugin('tplify')
    .bundle();
```

## Usage
### Javascript
```javascript
var view = require('./path/to/view.tpl.html');

view.activate(parentNode);
view.deactivate();
view.setData({data-property: value, ...});
view.getData(); // => {data-property: value, ...}
view.data-name; // => HTMLElement
```
### Template
```html
// available for view.setData({someProperty: value}) and view.getData();
<div data-property="someProperty"></div>

// available as property on view.someName
<div data-name="someName"></div>
```
{'fraction_non_alphanumeric': 0.17613636363636365, 'fraction_numerical': 0.0, 'mean_word_length': 4.758169934640523, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '5637381', 'n_tokens_mistral': 280, 'n_tokens_neox': 264, 'n_words': 76}