Skip to content

A simple templating language written as part of a tutorial on JavaScript.

Notifications You must be signed in to change notification settings

hackygolucky/templatingLanguage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 

Repository files navigation

templatinglanguage

A simple templating language written as part of a tutorial on JavaScript.

var parse = require('templatinglanguage');
var template = parse('hello {{ world }}');
var context = {world: '?'};

console.log(template(context));  // === 'hello ?'

API

parse = require('templatinglanguage') -> function(str)

returns a function that accepts a string to parse it into a templating function.

parse(str) -> function(context)

returns a function that accepts context to render a string.

LICENSE

MIT

About

A simple templating language written as part of a tutorial on JavaScript.

Resources

Stars

Watchers

Forks

Packages

No packages published