README
Sheetbase Module: @sheetbase/handlebars-server
Handlebars for Google apps script.
Install
Using npm:
npm install --save @sheetbase/handlebars-server
As a library:
1onxq7LQFPM7BgErdOCogyc6_BIqCpnoINv6BqoYrYpNsj7U0ayRulVB2
Set the Indentifier to Handlebars and select the lastest version, view code.
Examples
function example1(): void {
const source: string =
"<p>Hello, my name is {{name}}. " +
"I am from {{hometown}}. I have {{kids.length}} kids:</p>" +
"<ul>{{#kids}}<li>{{name}} is {{age}}</li>{{/kids}}</ul>";
const template = Handlebars.compile(source);
const data = {
name: "Alan",
hometown: "Somewhere, TX",
kids: [{ name: "Jimmy", age: "12" }, { name: "Sally", age: "4" }]
};
let result = template(data);
Logger.log(result);
}
Documentation
Homepage: http://www.handlebarsjs.com/
License
@sheetbase/handlebars-server is released under the MIT license.