# basictemplate

> A simple template engine

Latest version **0.1.8** (published 2012-05-20) · 0 weekly downloads

## Install

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

## 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.8 |
| Published | 2012-05-20 |
| First published | 2012-05-18 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Kevin Whitman |
| Maintainers | keverw |

## Links

- npm: https://www.npmjs.com/package/basictemplate
- Repository: https://github.com/keverw/basictemplate
- npm.io page: https://npm.io/package/basictemplate

## Recent versions

- 0.1.8 (latest) — 2012-05-20
- 0.1.7 — 2012-05-20
- 0.1.6 — 2012-05-19
- 0.1.5 — 2012-05-19
- 0.1.4 — 2012-05-18
- 0.1.3 — 2012-05-18
- 0.1.2 — 2012-05-18
- 0.1.1 — 2012-05-18
- 0.1.0 — 2012-05-18

## README

#Basic Template v0.1.8#

A basic template engine.

A main view and data. Optionally a subview. uses `{variable}` styles.

## Setup ##
To set up Basic Template on your Node.js server use npm.

    npm install basictemplate

## Basic Usage ##


```
var basictemplate = require('basictemplate');
basictemplate.render('./view.bt', {hello: 'World'}, function(err, html)
{
    console.log(err);
    console.log(html);
});
```

If you include a subview.

```
var basictemplate = require('basictemplate');
basictemplate.render_sub('./view.bt', './subview.bt', {hello: 'World'}, function(err, html)
{
    console.log(err);
    console.log(html);
});
```

To display a subview within the view, use `{{_SUBVIEW}}`

`{variable}` = escaped to HTML entities

`{{variable}}` = unescaped


##error:##

error is an object. 

`type`: the type of error. If it's a file system error, type will be `file`, and then another variable called `file` will contain the filesystem error object, if you want to analyze it. 

##Used by: ##

**MailKit** - [https://github.com/keverw/mailkit](https://github.com/keverw/mailkit)

If you're using Basic Template, let me know! [@keverw](https://twitter.com/keverw)

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