# templato

> One interface to many template engines for browser and Node.js.

Latest version **0.1.0** (published 2012-05-29) · 0 weekly downloads

## Install

```sh
npm install templato
pnpm add templato
yarn add templato
bun add templato
```

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2012-05-29 |
| First published | 2012-05-29 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+6 in 2 direct dependencies) |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Vadim Demedes |
| Maintainers | vdemedes |

## Links

- npm: https://www.npmjs.com/package/templato
- Repository: https://github.com/vdemedes/templato
- npm.io page: https://npm.io/package/templato

## Dependencies (3)

- [eco](https://npm.io/package/eco.md) 1.1.0-rc-3
- [ejs](https://npm.io/package/ejs.md) 0.7.1
- [jade](https://npm.io/package/jade.md) 0.26.1

## Recent versions

- 0.1.0 (latest) — 2012-05-29

## README

# Templato

Templato is a library for browsers and Node.js, which provides one interface to many templating engines.

# Installation

For browsers:

```html
<script src="engines/ejs.min.js"></script> <!-- include only those engines you need -->
<script src="engines/jade.min.js"></script>
<script src="engines/mustache.min.js"></script>

<script src="templato.min.js"></script>
```

For Node.js:

```javascript
var Templato = require('templato');
```

# Usage

```javascript
Templato.registerHelper('uppercase', function(arg){ // registering helper for all templates
	arg.toUpperCase();
});

var template = new Templato;
template.registerHelper('downcase', function(arg){ // registering helper only for this template
	arg.toLowerCase();
});
template.set({
	engine: 'ejs',
	template: '<%= uppercase('hello') %>, <%= attr %> <%= downcase('WORLD') %>!'
});
template.render({ attr: 'beautiful' }); // "HELLO, beautiful world!"
```

# Available engines

- EJS
- Eco **(only for Node.js)**
- Jade
- Mustache

# Tests

Run tests this way:

- ```mocha test/node/*``` for Node.js
- open ```test/browser/test.html``` in browsers, if you want to test Templato in browser

# License

(The MIT License)

Copyright (c) 2011 Vadim Demedes sbioko@gmail.com

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

---
_Source: https://npm.io/package/templato · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
