{"_id":"jazz","_rev":"1212452","name":"jazz","description":"A simple template engine built specifically for nodejs.","dist-tags":{"latest":"0.0.18"},"maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"},{"name":"shinesolutions","email":"opensource@shinesolutions.com"}],"time":{"modified":"2021-10-13T05:46:08.000Z","created":"2011-02-14T08:22:58.914Z","0.0.18":"2012-02-14T19:33:29.934Z","0.0.14":"2011-02-14T08:22:58.914Z","0.0.4":"2011-02-14T08:22:58.914Z","0.0.3":"2011-02-14T08:22:58.914Z","0.0.1":"2011-02-14T08:22:58.914Z"},"users":{},"author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"versions":{"0.0.18":{"name":"jazz","description":"A simple template engine built specifically for nodejs.","version":"0.0.18","author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"keywords":["template","engine"],"main":"./lib/jazz.js","directories":{"lib":"./lib/jazz"},"scripts":{"test":"node test/all.js"},"engines":{"node":">= 0.1.102"},"_npmUser":{"name":"cliffano","email":"cliffano@gmail.com"},"_id":"jazz@0.0.18","dependencies":{},"devDependencies":{},"optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.0-2","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"8704ff96297fdd0895b998be17fc40df9fa66e2d","size":13653,"noattachment":false,"key":"/jazz/-/jazz-0.0.18.tgz","tarball":"http://registry.cnpm.dingdandao.com/jazz/download/jazz-0.0.18.tgz"},"maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"},{"name":"shinesolutions","email":"opensource@shinesolutions.com"}],"publish_time":1329248009934,"_cnpm_publish_time":1329248009934,"_hasShrinkwrap":false},"0.0.14":{"name":"jazz","description":"A simple template engine built specifically for nodejs.","version":"0.0.14","author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"keywords":["template","engine"],"main":"./lib/jazz","directories":{"lib":"./lib/jazz"},"engines":{"node":">= 0.1.102"},"_id":"jazz@0.0.14","_engineSupported":true,"_npmVersion":"0.2.15","_nodeVersion":"v0.2.6","modules":{"ast.js":"lib/jazz/ast.js","compiler.js":"lib/jazz/compiler.js","error.js":"lib/jazz/error.js","parser.js":"lib/jazz/parser.js","scanner.js":"lib/jazz/scanner.js","tokens.js":"lib/jazz/tokens.js"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"33cb3bc0ca5ab7ea902c2954a3215cfab7de3608","size":13046,"noattachment":false,"key":"/jazz/-/jazz-0.0.14.tgz","tarball":"http://registry.cnpm.dingdandao.com/jazz/download/jazz-0.0.14.tgz"},"publish_time":1297671778914,"maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"},{"name":"shinesolutions","email":"opensource@shinesolutions.com"}],"_cnpm_publish_time":1297671778914,"_hasShrinkwrap":false},"0.0.4":{"name":"jazz","description":"A simple template engine built specifically for nodejs.","version":"0.0.4","author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"keywords":["template","engine"],"main":"./lib/jazz","directories":{"lib":"./lib/jazz"},"engines":{"node":">= 0.1.102"},"_id":"jazz@0.0.4","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"shasum":"c083a7301661ff2bba3692294cf619b0d778e150","size":12108,"noattachment":false,"key":"/jazz/-/jazz-0.0.4.tgz","tarball":"http://registry.cnpm.dingdandao.com/jazz/download/jazz-0.0.4.tgz"},"publish_time":1297671778914,"maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"},{"name":"shinesolutions","email":"opensource@shinesolutions.com"}],"_cnpm_publish_time":1297671778914,"_hasShrinkwrap":false},"0.0.3":{"name":"jazz","description":"A simple template engine built specifically for nodejs.","version":"0.0.3","author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"keywords":["template","engine"],"main":"./lib/jazz","directories":{"lib":"./lib/jazz"},"engines":{"node":">= 0.1.102"},"_id":"jazz@0.0.3","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"shasum":"d3f12513f89c0ba28021c35876c1fa3b62d8621a","size":12032,"noattachment":false,"key":"/jazz/-/jazz-0.0.3.tgz","tarball":"http://registry.cnpm.dingdandao.com/jazz/download/jazz-0.0.3.tgz"},"publish_time":1297671778914,"maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"},{"name":"shinesolutions","email":"opensource@shinesolutions.com"}],"_cnpm_publish_time":1297671778914,"_hasShrinkwrap":false},"0.0.1":{"name":"jazz","description":"A simple template engine built specifically for nodejs.","version":"0.0.1","author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"keywords":["template","engine"],"main":"./lib/jazz","directories":{"lib":"./lib/jazz"},"engines":{"node":">= 0.1.102"},"_id":"jazz@0.0.1","_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"shasum":"e52115e24e1ee3235c28d91d3e3252a9e091fcd5","size":17491,"noattachment":false,"key":"/jazz/-/jazz-0.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/jazz/download/jazz-0.0.1.tgz"},"publish_time":1297671778914,"maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"},{"name":"shinesolutions","email":"opensource@shinesolutions.com"}],"_cnpm_publish_time":1297671778914,"_hasShrinkwrap":false}},"readme":"Jazz is a simple template engine built specifically for nodejs.\n\n# Usage\n\n    var jazz = require(\"jazz\");\n\n    var template = jazz.compile(\"my template source code {someVariable}\");\n    template.eval({\"someVariable\": \"lolmuffin\"}, function(data) { sys.puts(data); });\n\nThis example would output the following:\n\n    my template source code lolmuffin\n\n# Syntax\n\n## Printing variables\n\n    {someVariable}\n\nThis works for any type of expression, so the following should also work:\n\n    {users.fred}\n    {\"hello\"}\n    {45}\n    {a eq b}\n\n## Filter functions\n\nYou can call filter functions like so:\n\n    {someFilter(arg1, arg2)}\n\nFilter functions are statements, NOT expressions so they cannot be chained\nnor used in if/forelse/etc. tests. However, calls can be made on any type\nof expression -- e.g.\n\n    {math.sin(45)}\n\n### Implementing filter functions\n\nFilter functions may block so rather than returning the value you want\nrendered as you might in other frameworks, jazz passes in a callback to\nyour filter function that you then call to indicate that you have a\nresult. e.g. here we simulate a blocking operation using setTimeout().\n\n    // sum.jazz\n\n    {sum(5, 10)}\n\n    // sum.js\n\n    var jazz = require(\"jazz\");\n\n    var params = {\n        sum: function(arg1, arg2, cb) {\n            setTimeout(function() {\n                cb((arg1 + arg2).toString());\n            }, 2000);\n        }\n    }\n    jazz.compile(\"sum.jazz\").eval(params, function(output) { console.log(output); });\n\nNote that even though the execution of the callback is delayed, this example still\nworks.\n\n## Conditional Statements\n\nYou can check if a variable evaluates to a true value like so:\n\n    {if name}\n        Hello, {name}\n    {end}\n\nElse clauses are also supported:\n\n    {if name}\n        Hello, {name}\n    {else}\n        Hello, Captain Anonymous\n    {end}\n\nAs are else..if clauses:\n\n    {if firstName}\n        Hello, {firstName}\n    {elif lastName}\n        Hello, Mr. {lastName}\n    {else}\n        Hello, Captain Anonymous\n    {end}\n\nLimited logical expressions are also possible:\n\n    {if user.lastName and user.isVip}\n        Hello, Mr. {user.lastName}, my good man!\n    {end}\n\n    {if fred.tired or fred.bored}\n        Fred: \"Yawn!\"\n    {end}\n\n    {if not awake}\n        Zzz\n    {end}\n\neq & neq comparison operators are available for comparing two values:\n\n    {if config.feature eq \"enabled\"}\n        Feature is enabled!\n    {end}\n\n    {if status neq \"inactive\"}\n        Huzzah!\n    {end}\n\nYou can also group expressions using parentheses:\n\n    {if (a and b) or c}\n        ...\n    {end}\n\n## Looping over an array\n\n    {foreach item in someArray}\n        <p>{item}</p>\n    {end}\n\n\nThe value being iterated over can be any expression supporting\nan Array-like interface.\n\n","_attachments":{}}