Skip to content

Instantly share code, notes, and snippets.

@thom4parisot
Created October 4, 2014 20:11
Show Gist options
  • Save thom4parisot/57f80c7904744c1cc3b1 to your computer and use it in GitHub Desktop.
Save thom4parisot/57f80c7904744c1cc3b1 to your computer and use it in GitHub Desktop.
Handlebars template evaluation one liner
handlebars template.hbs -c 'handlebars' | node -e 'process.stdin.on("data", function(d){ eval(String(d)); console.log(Handlebars.templates["template.hbs"]({ items: ["Node.js", "CSS maintenables", "Open Sky"] })) })'
<!DOCTYPE html>
<html>
<head>
<title>{{#if title}}{{title}}{{else}}Template demo{{/if}}</title>
</head>
<body>
<ul>
{{#each items}}
<li>{{.}}</li>
{{/each}}
</ul>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment