Adam Mark

Web design and development

Introducing Markup.js: Powerful JavaScript Templates

When I started making App Cloud apps, I thought I could benefit from using a JavaScript templating system. So I toyed around with two popular frameworks, Mustache and jQuery Templates. Unfortunately I didn’t like either. I found Mustache to be too simplistic (it prides itself on being logicless), while jQuery Templates required me to use jQuery.

So I decided to write my own templating system with the following goals:

  • It should have an elegant syntax with minimal punctuation
  • It should be fast and lightweight
  • It should have no library dependencies
  • It should not require a browser or DOM
  • It should be flexible enough to support internationalization (i18n) tasks

The result: Markup.js. Weighing in at only 1.7KB after minification and gzipping, it includes a simple yet powerful expression language for transforming structured data into HTML and other text formats. So far, I’m loving it.