Precompiling with Squirrelly
var Sqrl = require('squirrelly')
var template = "This is my template. It will be autofilled with: {{somevalue}}"
var precompiledTemplate = Sqrl.Compile(template) // This returns a function
console.log(precompiledTemplate.toString()) // This is the precompiled template. You could either save it to a file, or just keep it stored in a variable.
var result = Sqrl.Render(precompiledTemplate, {somevalue: "Squirrelly is awesome!"})
no comments