Kata是一个JavaScript模板引擎。包括:Templateblocks,Interpolateblocks,Iterateblocks,Conditionalblocks,Else/Elseifblocks,Invokeblocks,Yieldblocks,Importblocks,Evaluateblocks,andPluginblocks.
示例代码:
var kata = require('kata');var fs = require('fs');fs.readFile('template.kata', {encoding: 'utf8'}, function(err, src){ var template; if (err) return; template = kata(src); console.log(template({greeting: 'Hello', name: 'World'}));});
评论