Wondering what’s next for npm?Check out our public roadmap! »

templayed

0.2.3 • Public • Published

node-templayed

A simple port of templayed.js for node.js

The fastest and smallest Mustache compliant Javascript templating library See more

Getting Started

Install it just running npm install templayed into your project.

HOW TO USE

var templayed = require('templayed');
 
var tpl  = "<ul>{{#names}}<li>{{../fullName}}</li>{{/names}}</ul>",
    data = {
        names: [{firstName: "Paul", lastName: "Engel"}, {firstName: "Chunk", lastName: "Norris"}],
        fullName: function() {
            return this.lastName + "" + this.firstName;
        }
    };
 
var html = templayed(tpl)(data);
 
console.log( html ); //=> "<ul><li>Engel, Paul</li><li>Norris, Chunk</li></ul>";

CREDITS

Paul Engel and Helder Santana

Keywords

none

Install

npm i templayed

DownloadsWeekly Downloads

24,388

Version

0.2.3

License

none

Last publish

Collaborators

  • avatar