Skip to content

Instantly share code, notes, and snippets.

@blacksun1
Created March 31, 2015 21:53
Show Gist options
  • Save blacksun1/6a0479722b2a36ed8622 to your computer and use it in GitHub Desktop.
Save blacksun1/6a0479722b2a36ed8622 to your computer and use it in GitHub Desktop.
Very simple test of Handlebars and Nodejs
var Handlebars = require('handlebars'),
assert = require('assert'),
templateSource = '<h1>{{title}}</h1>',
template = Handlebars.compile(templateSource),
data = { title: 'I like cake' },
result = template(data);
assert.equal(result, '<h1>I like cake</h1>');
console.log('All good mate.');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment