Precompiling with Squirrelly

node v10.24.1
version: master
endpointsharetweet
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!"})
Loading…

no comments

    sign in to comment