Your First Template
Last updated
Last updated
var Sqrl = require("squirrelly")
//Or you could: import * as Sqrl from "squirrelly"
//Or, if you're in the browser, Sqrl is already globalvar myTemplate = `
This is a template
My favorite template engine is: {{fav}}
My favorite kind of cake is: {{cake}}
`var templateResult = Sqrl.Render(myTemplate, {
fav: "Squirrelly", cake: "Chocolate"
})
console.log(templateResult)
//This is a template
//My favorite template engine is: Squirrelly
//My favorite kind of cake is: Chocolate