{"_id":"jazz","_rev":"24-735a398dfa4280f9f2a6b57383f9bd57","name":"jazz","dist-tags":{"latest":"1.2.0"},"versions":{"0.0.4":{"name":"jazz","version":"0.0.4","keywords":["template","engine"],"author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"_id":"jazz@0.0.4","dist":{"shasum":"c083a7301661ff2bba3692294cf619b0d778e150","tarball":"https://registry.npmjs.org/jazz/-/jazz-0.0.4.tgz","integrity":"sha512-f1SLPjpY6QpPBQl8jjcVc+QGJcKR7tnkcdJsNqwWNMY2nNeECPdqquDgF37GgzMBiPErVZCDeajMB1vd11y5sQ==","signatures":[{"sig":"MEQCIBee1bCZEsCqsBhVCRDwEq4yjzJqvelP1MockgZI2a1lAiAtPwhqNyZPp1qMKRJ4DwngqUHrSsEbK5De+jmQRq3XdA==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/jazz","engines":{"node":">= 0.1.102"},"_npmVersion":"0.2.7-2","description":"A simple template engine built specifically for nodejs.","directories":{"lib":"./lib/jazz"},"_nodeVersion":"v0.3.1-pre","_nodeSupported":true},"0.0.14":{"name":"jazz","version":"0.0.14","keywords":["template","engine"],"author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"_id":"jazz@0.0.14","dist":{"shasum":"33cb3bc0ca5ab7ea902c2954a3215cfab7de3608","tarball":"https://registry.npmjs.org/jazz/-/jazz-0.0.14.tgz","integrity":"sha512-Cj/kozhN5Zfheb4x8XMrSmRqjGci2kjcLImQ6UsI2Nhi3dSse8nehPiNydd3SxVSncogeXH2dxuUFZpsIn5XsQ==","signatures":[{"sig":"MEUCIBZI2bGrdHrfwIo4/PPc8W62yiIsjwHfwCF6Fe+0WT06AiEA0YXb/vN1qravAeWv39k7i8tqPtB2LzIWAg/UzUI4i2Q=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/jazz","files":[""],"engines":{"node":">= 0.1.102"},"modules":{"ast.js":"lib/jazz/ast.js","error.js":"lib/jazz/error.js","parser.js":"lib/jazz/parser.js","tokens.js":"lib/jazz/tokens.js","scanner.js":"lib/jazz/scanner.js","compiler.js":"lib/jazz/compiler.js"},"_npmVersion":"0.2.15","description":"A simple template engine built specifically for nodejs.","directories":{"lib":"./lib/jazz"},"_nodeVersion":"v0.2.6","_defaultsLoaded":true,"_engineSupported":true},"0.0.1":{"name":"jazz","version":"0.0.1","keywords":["template","engine"],"author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"_id":"jazz@0.0.1","dist":{"shasum":"e52115e24e1ee3235c28d91d3e3252a9e091fcd5","tarball":"https://registry.npmjs.org/jazz/-/jazz-0.0.1.tgz","integrity":"sha512-TWORTYfzCDpZzFXO84ZWrEZxJ7LjFcUfgYJyTXdC/r4Pb2idlMiX17EKqOi9j6zq4bKQaTYMeaewQQ6NBEkaOA==","signatures":[{"sig":"MEUCIQC/qNVAqpMQHsagN/TnCymfsJ2eTacmwFRHDwoCKcVmGAIgfyUPe6/+nwdVc5O4eEHXF+4utI26vj0WLrr/hYWN6WM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/jazz","engines":{"node":">= 0.1.102"},"_npmVersion":"0.2.7-2","description":"A simple template engine built specifically for nodejs.","directories":{"lib":"./lib/jazz"},"_nodeVersion":"v0.3.1-pre","_nodeSupported":true},"0.0.3":{"name":"jazz","version":"0.0.3","keywords":["template","engine"],"author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"_id":"jazz@0.0.3","dist":{"shasum":"d3f12513f89c0ba28021c35876c1fa3b62d8621a","tarball":"https://registry.npmjs.org/jazz/-/jazz-0.0.3.tgz","integrity":"sha512-gKPLJw4eRF4IdRCgskukKgW4nKmoPOSU/FWzibEK9rlM/mbdRtZTtk3zXVGUgr16sMaKr+RHsrtDp6vREyOJ9w==","signatures":[{"sig":"MEUCIQDXsYWUnvy5SvA/KOJ9hTQ/5BxQA/y7GMhAW3dvsHsfvAIgdFuO4qDgF/CG8UpzLn03pYZgJkdd8hCR5cf9yV7mmT8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/jazz","engines":{"node":">= 0.1.102"},"_npmVersion":"0.2.7-2","description":"A simple template engine built specifically for nodejs.","directories":{"lib":"./lib/jazz"},"_nodeVersion":"v0.3.1-pre","_nodeSupported":true},"0.0.18":{"name":"jazz","version":"0.0.18","keywords":["template","engine"],"author":{"name":"Thomas Lee","email":"thomas.lee@shinetech.com"},"_id":"jazz@0.0.18","maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"}],"dist":{"shasum":"8704ff96297fdd0895b998be17fc40df9fa66e2d","tarball":"https://registry.npmjs.org/jazz/-/jazz-0.0.18.tgz","integrity":"sha512-EaQJD/lHUEuUjqv5z86QG0qXisyglHGW6J+eCP9xJ1br9qqXak1GkDdicYmtUryOaciW+ybse2y7EA19zvRVeA==","signatures":[{"sig":"MEUCIQDSAXcAZz7OhTbrET/T+wefIRU6hFwtiyUDONGjvnoaPQIgSKB0wLj0euPuPGtof9Iy3lNmYdRt67KJseNCdz3Sch8=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}]},"main":"./lib/jazz.js","engines":{"node":">= 0.1.102"},"scripts":{"test":"node test/all.js"},"_npmUser":{"name":"cliffano","email":"cliffano@gmail.com"},"_npmVersion":"1.1.0-2","description":"A simple template engine built specifically for nodejs.","directories":{"lib":"./lib/jazz"},"_nodeVersion":"v0.6.8","dependencies":{},"_defaultsLoaded":true,"devDependencies":{},"_engineSupported":true,"optionalDependencies":{}},"1.0.0":{"name":"jazz","version":"1.0.0","keywords":["template"],"author":{"url":"https://cliffano.com","name":"Cliffano Subagio","email":"blah@cliffano.com"},"license":"MIT","_id":"jazz@1.0.0","maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"}],"contributors":[{"url":"https://github.com/cliffano/jazz/graphs/contributors","name":"All contributors"}],"homepage":"https://github.com/cliffano/jazz","bugs":{"url":"https://github.com/cliffano/jazz/issues"},"bin":{"jazz":"bin/jazz.js"},"dist":{"shasum":"dde755a83eff06687b130fbba34e36fd5b9edb99","tarball":"https://registry.npmjs.org/jazz/-/jazz-1.0.0.tgz","fileCount":62,"integrity":"sha512-PJt43IB5joyLQxLAizq22Z+SVEWqxT3A2Z/f2FCBwNFfJH1O+lw+/MBeJKNbzFA/WjvJWgFxXXp0rpEKg2pxRQ==","signatures":[{"sig":"MEUCIAVLUemHQ99xWxMY9XIbHfqFs+bt1If9jHygrGDCBPpAAiEA5mzw1BurbOg8oOVRXEOnquPbzpXWfx7EqlalGO8m/+Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/jazz@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":129279},"main":"./lib/jazz","type":"module","engines":{"node":">= 20.0.0"},"gitHead":"b735e373f45046d2168577baeaa5569d2999820a","scripts":{},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9643200e-f3c6-4607-9e70-c8ae6357a94c"}},"repository":{"url":"git+https://github.com/cliffano/jazz.git","type":"git"},"_npmVersion":"11.13.0","description":"A minimalistic template engine with zero runtime dependency","directories":{"bin":"./bin","lib":"./lib","test":"./test"},"_nodeVersion":"26.2.0","preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"sinon":"^21.0.0","esmock":"^2.7.3","@sinonjs/referee":"^11.0.1"},"_npmOperationalInternal":{"tmp":"tmp/jazz_1.0.0_1779603185336_0.6618232317277377","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"jazz","version":"1.1.0","keywords":["template"],"author":{"url":"https://cliffano.com","name":"Cliffano Subagio","email":"blah@cliffano.com"},"license":"MIT","_id":"jazz@1.1.0","maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"}],"contributors":[{"url":"https://github.com/cliffano/jazz/graphs/contributors","name":"All contributors"}],"homepage":"https://github.com/cliffano/jazz","bugs":{"url":"https://github.com/cliffano/jazz/issues"},"bin":{"jazz":"bin/jazz.js"},"dist":{"shasum":"24c4583a91f4d09f05eb25b97f6a8cecfe60f168","tarball":"https://registry.npmjs.org/jazz/-/jazz-1.1.0.tgz","fileCount":63,"integrity":"sha512-PeikjMx9xueKKO8jkmWAdlYuiqGL5n5WZgxBBzD8280TXEP6mW33uNcli5aWkGVkwNCY1XWH9fwYvORWaeHEiw==","signatures":[{"sig":"MEQCIGbB8rXhkxRG8BkTg1vcSPbIxFErQCLxQORI/J3A/X0wAiA4IPe5B3M9yHix/ZlOiGPiIjf+2mEPaWFApkUuEAhg2g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/jazz@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":143004},"main":"./lib/jazz","type":"module","engines":{"node":">= 20.0.0"},"gitHead":"4b9914956cbf2bf7a2f09bed462953ac2a4f9949","scripts":{},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9643200e-f3c6-4607-9e70-c8ae6357a94c"}},"repository":{"url":"git+https://github.com/cliffano/jazz.git","type":"git"},"_npmVersion":"11.17.0","description":"A minimalistic template engine with zero runtime dependency","directories":{"bin":"./bin","lib":"./lib","test":"./test"},"_nodeVersion":"26.4.0","preferGlobal":true,"_hasShrinkwrap":false,"devDependencies":{"sinon":"^22.0.0","esmock":"^2.7.6","@sinonjs/referee":"^11.0.2"},"_npmOperationalInternal":{"tmp":"tmp/jazz_1.1.0_1783174267805_0.5285502469619552","host":"s3://npm-registry-packages-npm-production"}},"1.2.0":{"name":"jazz","type":"module","description":"A minimalistic template engine with zero runtime dependency","keywords":["template"],"version":"1.2.0","homepage":"https://github.com/cliffano/jazz","author":{"name":"Cliffano Subagio","email":"blah@cliffano.com","url":"https://cliffano.com"},"contributors":[{"name":"All contributors","url":"https://github.com/cliffano/jazz/graphs/contributors"}],"main":"./lib/jazz.js","bin":{"jazz":"bin/jazz.js"},"preferGlobal":true,"repository":{"type":"git","url":"git+https://github.com/cliffano/jazz.git"},"bugs":{"url":"https://github.com/cliffano/jazz/issues"},"directories":{"bin":"./bin","lib":"./lib","test":"./test"},"devDependencies":{"@sinonjs/referee":"^11.0.2","esmock":"^2.7.6","sinon":"^22.1.0"},"scripts":{},"engines":{"node":">= 22.0.0"},"license":"MIT","gitHead":"39251410a9724cf642cb8569a68ad227413ea2f6","_id":"jazz@1.2.0","_nodeVersion":"26.7.0","_npmVersion":"11.19.0","dist":{"integrity":"sha512-v7N8W9wiD2gkdiaWsS6KSJjqiWoayrY/BL6DXUOBSle0EetSEX0uTiAk83Yc6zMl46bX3/Y0tb07H0TxSBfapg==","shasum":"85d4b6a516aef8ffaeceb8749bb58b47d778ff0c","tarball":"https://registry.npmjs.org/jazz/-/jazz-1.2.0.tgz","fileCount":62,"unpackedSize":145447,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/jazz@1.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD9X+Q0PgHD2P5+OzSkdcx5lOYSZ3jDvvdYqsD4uBEVHgIhANVDcHzKyrh0S80KDY2ir3BcMrPnuFKt0JZTHLRyQuip"}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:9643200e-f3c6-4607-9e70-c8ae6357a94c"}},"maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/jazz_1.2.0_1787397947639_0.9408401442269987"},"_hasShrinkwrap":false}},"time":{"created":"2011-02-14T08:22:58.914Z","modified":"2026-08-22T11:25:48.045Z","0.0.4":"2011-02-14T08:22:58.914Z","0.0.14":"2011-02-14T08:22:58.914Z","0.0.1":"2011-02-14T08:22:58.914Z","0.0.3":"2011-02-14T08:22:58.914Z","0.0.18":"2012-02-14T19:33:29.934Z","1.0.0":"2026-05-24T06:13:05.496Z","1.1.0":"2026-07-04T14:11:07.940Z","1.2.0":"2026-08-22T11:25:47.771Z"},"bugs":{"url":"https://github.com/cliffano/jazz/issues"},"author":{"name":"Cliffano Subagio","email":"blah@cliffano.com","url":"https://cliffano.com"},"license":"MIT","homepage":"https://github.com/cliffano/jazz","keywords":["template"],"repository":{"type":"git","url":"git+https://github.com/cliffano/jazz.git"},"description":"A minimalistic template engine with zero runtime dependency","contributors":[{"name":"All contributors","url":"https://github.com/cliffano/jazz/graphs/contributors"}],"maintainers":[{"name":"cliffano","email":"cliffano@gmail.com"}],"readme":"<!-- BEGIN:AVATAR -->\n![Avatar](avatar.jpg)\n<!-- END:AVATAR -->\n\n<!-- BEGIN:BADGES -->\n[![Build Status](https://github.com/cliffano/jazz/workflows/CI/badge.svg)](https://github.com/cliffano/jazz/actions?query=workflow%3ACI)\n[![Dependencies Status](https://img.shields.io/librariesio/release/npm/jazz)](https://libraries.io/npm/jazz)\n[![Code Scanning Status](https://github.com/cliffano/jazz/workflows/CodeQL/badge.svg)](https://github.com/cliffano/jazz/actions?query=workflow%3ACodeQL)\n[![Coverage Status](https://coveralls.io/repos/github/cliffano/jazz/badge.svg?branch=main)](https://coveralls.io/r/cliffano/jazz?branch=main)\n[![Security Status](https://snyk.io/test/github/cliffano/jazz/badge.svg)](https://snyk.io/test/github/cliffano/jazz)\n[![Published Version](https://img.shields.io/npm/v/jazz.svg)](https://www.npmjs.com/package/jazz)\n<!-- END:BADGES -->\n\n# Jazz\n\nJazz is a minimalistic template engine with zero runtime dependency.\n\nOne of the OG template engines with first commit from 2010.\n\n## Installation\n\n```shell\nnpm install jazz\n```\n\n## Usage\n\n```javascript\nimport jazz from \"jazz\";\nimport sys from \"sys\";\n\nconst template = jazz.compile(\"my template source code {someVariable}\");\ntemplate.eval({\"someVariable\": \"lolmuffin\"}, function(data) { sys.puts(data); });\n```\n\nThis example would output the following:\n\n```text\nmy template source code lolmuffin\n```\n\n### Printing variables\n\n```text\n{someVariable}\n```\n\nThis works for any type of expression, so the following should also work:\n\n```text\n{users.fred}\n{\"hello\"}\n{45}\n{a eq b}\n```\n\n### Filter functions\n\nYou can call filter functions like so:\n\n```text\n{someFilter(arg1, arg2)}\n```\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```text\n{math.sin(45)}\n```\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```text\n// sum.jazz\n\n{sum(5, 10)}\n```\n\n```javascript\n// sum.js\n\nimport jazz = from \"jazz\";\n\nconst params = {\n    sum: function(arg1, arg2, cb) {\n        setTimeout(function() {\n            cb((arg1 + arg2).toString());\n        }, 2000);\n    }\n}\njazz.compile(\"sum.jazz\").eval(params, function(output) { console.log(output); });\n```\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```text\n{if name}\n    Hello, {name}\n{end}\n```\n\nElse clauses are also supported:\n\n```text\n{if name}\n    Hello, {name}\n{else}\n    Hello, Captain Anonymous\n{end}\n```\n\nAs are else..if clauses:\n\n```text\n{if firstName}\n    Hello, {firstName}\n{elif lastName}\n    Hello, Mr. {lastName}\n{else}\n    Hello, Captain Anonymous\n{end}\n```\n\nLimited logical expressions are also possible:\n\n```text\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```\n\neq & neq comparison operators are available for comparing two values:\n\n```text\n{if config.feature eq \"enabled\"}\n    Feature is enabled!\n{end}\n\n{if status neq \"inactive\"}\n    Huzzah!\n{end}\n```\n\nYou can also group expressions using parentheses:\n\n```text\n{if (a and b) or c}\n    ...\n{end}\n```\n\n### Looping over an array\n\n```html\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### Looping over an object\n\n```html\n{foreach pair in someObject}\n    <p>{pair.key} = {pair.value}</p>\n{end}\n```\n\n### Synchronous functions\n\n```html\n{if @blah('a')}\n    <p>There were so many blahs in a</p>\n{end}\n```\n\nThe function is provided to the template the same way asynchronous functions are, just with a return instead of a cb.\n\n### Loop counters / index\n\n```html\n{foreach pair in someObject}\n    <p>Loop number (1 based): {__count}</p>\n    <p>Index (0 based): {__index}</p>\n    <p>{pair.key} = {pair.value}</p>\n{end}\n```\n\n### Looking into arrays/objects\n\n```html\n<p>{object['array'][0].cheese}</p>\n```\n\n## Credits\n\nJazz was created by the brilliant Thomas Lee and Daniel Brain during the era of Shine Technologies early adoption of node.\n\n## Colophon\n\n<!-- BEGIN:DEVELOPERS_GUIDE -->\n[Developer's Guide](https:/cliffano.github.io/developers-guide-nodejs.html)\n<!-- END:DEVELOPERS_GUIDE -->\n\n<!-- BEGIN:BUILD_REPORTS -->\nBuild reports:\n\n* [Code complexity report](https://cliffano.github.io/jazz/complexity/plato/index.html)\n* [Unit tests report](https://cliffano.github.io/jazz/test/mocha.txt)\n* [Test coverage report](https://cliffano.github.io/jazz/coverage/c8/index.html)\n* [Integration tests report](https://cliffano.github.io/jazz/test-integration/mocha.txt)\n* [API Documentation](https://cliffano.github.io/jazz/doc/jsdoc/index.html)\n\n<!-- END:BUILD_REPORTS -->\n","readmeFilename":"README.md"}