at

Templates with less features but still more than PHP.

npm install at
9 downloads in the last week
18 downloads in the last month

@

@ is another template engine. All the rest of them have too many features.

Syntax

If there’s an @ at the beginning of a line (excluding tabs and spaces at the beginning of a line), it’s treated as code. For example:

@ if(false) {
    <p>Strange things are happening.</p>
@ } else {
    <p>Oh, good.</p>
@ }

Outside of those code blocks, @(…) sections are treated as expressions and inserted as text, escaped as HTML. For raw HTML, use @!(…). It even counts parentheses, so you can totally do things like this:

Operator precedence! <code>(5 + 3) * (2 + 8) = @((5 + 3) * (2 + 8))</code>

If you have an ambiguity with @( appearing at the start of a line that should be a code block, just put a space between then:

@ (odd + prototypes).whatever();

Installation

npm install at

Usage

var at = require('at');
var template = at.compile('@(data.subject) is simplish!');

template({subject: '@'}) // @ is simplish!
npm loves you