{"_id":"amulet","_rev":"48-f1777961519f3c1df73a8fc600dca20a","name":"amulet","description":"As-soon-as-possible streaming async mustache templating","dist-tags":{"latest":"1.0.7"},"versions":{"0.1.5":{"name":"amulet","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"version":"0.1.5","homepage":"http://github.com/chbrown/amulet","author":{"name":"Christopher Brown","email":"io@henrian.com"},"main":"./lib/amulet.js","_npmJsonOpts":{"file":"/Users/chbrown/.npm/amulet/0.1.5/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"amulet@0.1.5","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.24","_nodeVersion":"v0.4.10","_defaultsLoaded":true,"dist":{"shasum":"6f426d328141770dd288392d674c2fa6387cdf4f","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.1.5.tgz","integrity":"sha512-IVGEKI71bG24yiFfytfPIEfJrGYzSCsOUVechG3saWZvP3L6vwJfBlfY8lVBhlSPARcMmsRgZtKzFCXkS3/3vw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIGXYbA2cMwtl9r+z6YUGBsKICBKodswYokZJnN9TxVr8AiAOFqsng0G8lHbnRPBChTdX48JHZl/pA8rkCxTHLOn4nw=="}]},"scripts":{},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.1.6":{"name":"amulet","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"version":"0.1.6","homepage":"http://github.com/chbrown/amulet","author":{"name":"Christopher Brown","email":"io@henrian.com"},"main":"./lib/amulet.js","_npmJsonOpts":{"file":"/Users/chbrown/.npm/amulet/0.1.6/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"amulet@0.1.6","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"c788fe8d7d3407457935404a6d888e7d7b5ed24b","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.1.6.tgz","integrity":"sha512-ZZNyvsTvhj3TD3ZZ3/s9X+P0KFTvt5tTxUhDVfRNw/dhQbjbT1i06qKbJZYcaIDo9wmFwvbD+Fqu7dVBND67vw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIG5SRBUKbiLZ3L7D3i2HuDdYrQNhA75x7I447Ysj+B5SAiA/R28OgltWSf5J+8tvmo+achMBR4uhtue8ibBWDItz0g=="}]},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.1.7":{"name":"amulet","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"version":"0.1.7","repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"homepage":"http://github.com/chbrown/amulet","author":{"name":"Christopher Brown","email":"io@henrian.com"},"main":"./lib/amulet.js","_npmJsonOpts":{"file":"/Users/chbrown/.npm/amulet/0.1.7/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"amulet@0.1.7","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.27","_nodeVersion":"v0.4.11","_defaultsLoaded":true,"dist":{"shasum":"f0a8f675e9f1cc708631f10fe0f25d3dd0d28fcc","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.1.7.tgz","integrity":"sha512-Ri3sOWNOKrlMDaUAfWmXmiInALDr8A+yP64VNwZdPRb8PDkkxglIDvMv4yS7EiPnYK29awG1da2rTk/B3IpdVA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFxhUtGHuozMfV9SwrayK34yVNmbqLq+EYUqsurEkdsYAiEAmVUjdNasB3/toXeKQ1WE9ctPq3SCoYArBCiDovG2OME="}]},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.1.8":{"name":"amulet","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"version":"0.1.8","repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"homepage":"http://github.com/chbrown/amulet","author":{"name":"Christopher Brown","email":"io@henrian.com"},"main":"./lib/amulet.js","_npmJsonOpts":{"file":"/Users/chbrown/.npm/amulet/0.1.8/package/package.json","wscript":false,"contributors":false,"serverjs":false},"_id":"amulet@0.1.8","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.30","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"91e9604046c3879f846a116302b1c5f9a17f1da0","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.1.8.tgz","integrity":"sha512-g7+yGotg162VQRuMP7UBVdhsJCR4psQqTfdp4rxYYB4eyT+nH42qAk5T/f6C5dSHUOt/0f5X7zI8z7ZRF/e7CA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAm6rqshc0yIyLSwihaaI7jam73fuwSG3M5qkrIC47chAiB1ffHQ3J2Qa7POavpt/VbgceMsNKTu8T0pJ+Sp93iqZw=="}]},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.1.9":{"name":"amulet","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"version":"0.1.9","repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"homepage":"http://github.com/chbrown/amulet","author":{"name":"Christopher Brown","email":"io@henrian.com"},"main":"./lib/amulet.js","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"_id":"amulet@0.1.9","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-alpha-2","_nodeVersion":"v0.6.3","_defaultsLoaded":true,"dist":{"shasum":"bc1330538ee84f081618a29a67ce88e1b50418b1","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.1.9.tgz","integrity":"sha512-Vom+cLLqqVw3G5OnKZDR1ZFJwa/m7/dhhg7f2IKV8oFwuzEQLwOmf8cqQXjRZjLlnsqfPuuXQauy1TP+gcVpXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGHiyxPALUMD53GXG/MeuoZsXcuJDEZoG5MtIiB2xNKPAiEAtBAe0zrKvwgHWfLwvMeWe+oxNqolg+cwXYSCNOdQQFA="}]},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.2.1":{"name":"amulet","version":"0.2.1","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"http://github.com/chbrown/amulet","bugs":{"email":"Christopher Brown <io@henrian.com","url":"http://github.com/chbrown/amulet/issues"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"main":"./lib/render.js","devDependencies":{"optimist":"x.x.x","js-yaml":"0.x.x"},"scripts":{"test":"./tests/test.js"},"_npmUser":{"name":"chbrown","email":"io@henrian.com"},"_id":"amulet@0.2.1","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.16","_nodeVersion":"v0.6.16","_defaultsLoaded":true,"dist":{"shasum":"611ead22b28560b5bef049f4a598f2a1a6b2099a","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.2.1.tgz","integrity":"sha512-M9AsFDt1ux9bJuiAQ7mTJgFgJ2YHQKRpzJwLUqC+lxu+mYJe8joDQ5pbWiu2zzgindsHGglpwLYnYNpD9/uWlQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCICUILCgtHePq5k4rT1CTurqRj68BzRpwmuQJtTku47qIAiEA6k28QFDInAuS6ltcAWIZwwYzx0z5tMqzFe+p5+IR0u8="}]},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it. \nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n\t<!DOCTYPE html>\n\t<meta name=\"engine\" content=\"amulet\">\n\t<div id=\"container\">\n\t\t{{<}}\n\t</div>\n\n*hello.mu*\n\n\t<p>Hello world!</p>\n\t\n*fib.mu*\n\n\t<h2>{{header}}</h2>            {{{spacer}}}\n\t<!-- the spacers are there just to convince \n\t\t your browser that it has enough content \n\t\t to merit rendering -->\n\t\n\t<p>One: {{one}}</p>            {{{spacer}}}\n\t<p>Ten: {{ten}}</p>            {{{spacer}}}\n\t<p>Hundred: {{hundred}}</p>    {{{spacer}}}\n\t<p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n\tvar amulet = require('amulet');\n\tvar spacer = (new Array(100)).join('&nbsp;');\n\trequire('http').createServer(function(req, res) {\n\t  if (req.url === '/fib') {\n\t    res.writeHead(200, {'Content-Type': 'text/html'});\n\t    var context = {header: 'Fibonacci sequence', spacer: spacer};\n\t    var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n\t    var a = 0, b = 1, c = -1, i = 0;\n\t    (function next() {\n\t      for (var j = 0; j < 500000; j++) {\n\t        var dummy = Math.random();\n\t      }\n\t      c = a + b;\n\t      a = b;\n\t      b = c;\n\t      if (i === 1)\n\t        renderer.extendContext({one: c});\n\t      if (i === 10)\n\t        renderer.extendContext({ten: c});\n\t      if (i === 100)\n\t        renderer.extendContext({hundred: c});\n\t      if (i === 1000)\n\t        renderer.extendContext({thousand: c});\n\t      i++;\n\t      if (i < 1001)\n\t        process.nextTick(next);\n\t    })();\n\t  }\n\t  else {\n\t    amulet.render(res, ['layout.mu', 'hello.mu']);\n\t  }\n\t}).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n    \n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can. \n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n\t<pre>{{doc | JSON.stringify}}</pre>\n\nWhich would return something like \n\n\t<pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n\t{{#obj}}\n\t\t{{#prop}}\n\t\t\t{{val}}\n\t\t{{/prop}}\n\t{{/obj}}\n\t\nYou can just dot a path. Like javascript.\n\n\t{{obj.prop.val}}\n\t\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), meaning that a closing node is never ambiguous. You needn't tell the parser what you're closing in Amulet. It already knows.\n\n\t{{#obj}}\n\t\t{{#prop}}\n\t\t\t{{val}}\n\t\t{{/}}\n\t{{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n\t<!DOCTYPE html>\n\t{{<}}\n\n*index.mu*\n\n\t<p>Just the facts.</p>\n\t\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n\t<!DOCTYPE html>\n\t<p>Just the facts.</p>\n\t\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n\t{{#people -> person}}\n\t\t{{person.first_name}}\n\t{{/}}\n\n\n# License\n\nMIT Licensed, 2010-2011\n\nSee <https://github.com/chbrown/amulet/blob/master/LICENSE>\n","maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.2.3":{"name":"amulet","version":"0.2.3","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"http://github.com/chbrown/amulet","bugs":{"email":"Christopher Brown <io@henrian.com","url":"http://github.com/chbrown/amulet/issues"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"main":"./lib/rendering.js","devDependencies":{"optimist":"x.x.x","js-yaml":"0.x.x"},"scripts":{"test":"./tests/test.js"},"_npmUser":{"name":"chbrown","email":"io@henrian.com"},"_id":"amulet@0.2.3","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.6.17","_defaultsLoaded":true,"dist":{"shasum":"7d82200e5aea871e7bedf9d506b65856ea2dec9d","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.2.3.tgz","integrity":"sha512-dSJgjFgwOPCued7v/ETrBwBrYevJfgMFSpFAeF3tTdO5xJ2F4RGEeRU5ZSyqWABLop7jM5Kv/Mz92pdArj5IEQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGorn4s0BhPJt/Zf4v7hJYBk3hakRFs8DIBbFZU2PmflAiEAyIeQ/iC3EPkhtZHvvTWGN59x6CXcQfS29L/quGld6uU="}]},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it. \nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n\t<!DOCTYPE html>\n\t<meta name=\"engine\" content=\"amulet\">\n\t<div id=\"container\">\n\t\t{{<}}\n\t</div>\n\n*hello.mu*\n\n\t<p>Hello world!</p>\n\t\n*fib.mu*\n\n\t<h2>{{header}}</h2>            {{{spacer}}}\n\t<!-- the spacers are there just to convince \n\t\t your browser that it has enough content \n\t\t to merit rendering -->\n\t\n\t<p>One: {{one}}</p>            {{{spacer}}}\n\t<p>Ten: {{ten}}</p>            {{{spacer}}}\n\t<p>Hundred: {{hundred}}</p>    {{{spacer}}}\n\t<p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n\tvar amulet = require('amulet');\n\tvar spacer = (new Array(100)).join('&nbsp;');\n\trequire('http').createServer(function(req, res) {\n\t  if (req.url === '/fib') {\n\t    res.writeHead(200, {'Content-Type': 'text/html'});\n\t    var context = {header: 'Fibonacci sequence', spacer: spacer};\n\t    var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n\t    var a = 0, b = 1, c = -1, i = 0;\n\t    (function next() {\n\t      for (var j = 0; j < 500000; j++) {\n\t        var dummy = Math.random();\n\t      }\n\t      c = a + b;\n\t      a = b;\n\t      b = c;\n\t      if (i === 1)\n\t        renderer.extendContext({one: c});\n\t      if (i === 10)\n\t        renderer.extendContext({ten: c});\n\t      if (i === 100)\n\t        renderer.extendContext({hundred: c});\n\t      if (i === 1000)\n\t        renderer.extendContext({thousand: c});\n\t      i++;\n\t      if (i < 1001)\n\t        process.nextTick(next);\n\t    })();\n\t  }\n\t  else {\n\t    amulet.render(res, ['layout.mu', 'hello.mu']);\n\t  }\n\t}).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n    \n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can. \n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n\t<pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like \n\n\t<pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n\t{{#obj}}\n\t\t{{#prop}}\n\t\t\t{{val}}\n\t\t{{/prop}}\n\t{{/obj}}\n\t\nYou can just dot a path. Like javascript.\n\n\t{{obj.prop.val}}\n\t\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n\t{{#obj}}\n\t\t{{#prop}}\n\t\t\t{{val}}\n\t\t{{/}}\n\t{{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n\t<!DOCTYPE html>\n\t{{<}}\n\n*index.mu*\n\n\t<p>Just the facts.</p>\n\t\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n\t<!DOCTYPE html>\n\t<p>Just the facts.</p>\n\t\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n\t{{#people -> person}}\n\t\t{{person.first_name}}\n\t{{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n  {{#people}}\n    {{_.first_name}}\n    {{last_name}}\n  {{/}}\n\n\n# License\n\nMIT Licensed, 2010-2012\n\nSee <https://github.com/chbrown/amulet/blob/master/LICENSE>\n","maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.2.4":{"name":"amulet","version":"0.2.4","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"http://github.com/chbrown/amulet","bugs":{"email":"Christopher Brown <io@henrian.com","url":"http://github.com/chbrown/amulet/issues"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"main":"./lib/rendering.js","devDependencies":{"optimist":"x.x.x","js-yaml":"0.x.x"},"scripts":{"test":"./tests/test.js"},"_npmUser":{"name":"chbrown","email":"io@henrian.com"},"_id":"amulet@0.2.4","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.21","_nodeVersion":"v0.8.0","_defaultsLoaded":true,"dist":{"shasum":"a7badcf50ddae50a79758e550f0777c86e2a1f74","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.2.4.tgz","integrity":"sha512-o0TOGt/vH7oVKAQewRQFYYnYCjo4W4UN5XVu6agOXgEF1uLswMDWLZpzZRCwCbGt31PP/7QguwucWmN316/dgA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDKR0aMAXLBNTRDJF8cJxTBUTFCmrqME/O3y9MC71kj7QIgO/S9H7akhx52x3dR7FchMUIfHd1IZu3Lv2CPqbyf1Bk="}]},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it. \nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n\t<!DOCTYPE html>\n\t<meta name=\"engine\" content=\"amulet\">\n\t<div id=\"container\">\n\t\t{{<}}\n\t</div>\n\n*hello.mu*\n\n\t<p>Hello world!</p>\n\t\n*fib.mu*\n\n\t<h2>{{header}}</h2>            {{{spacer}}}\n\t<!-- the spacers are there just to convince \n\t\t your browser that it has enough content \n\t\t to merit rendering -->\n\t\n\t<p>One: {{one}}</p>            {{{spacer}}}\n\t<p>Ten: {{ten}}</p>            {{{spacer}}}\n\t<p>Hundred: {{hundred}}</p>    {{{spacer}}}\n\t<p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n\tvar amulet = require('amulet');\n\tvar spacer = (new Array(100)).join('&nbsp;');\n\trequire('http').createServer(function(req, res) {\n\t  if (req.url === '/fib') {\n\t    res.writeHead(200, {'Content-Type': 'text/html'});\n\t    var context = {header: 'Fibonacci sequence', spacer: spacer};\n\t    var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n\t    var a = 0, b = 1, c = -1, i = 0;\n\t    (function next() {\n\t      for (var j = 0; j < 500000; j++) {\n\t        var dummy = Math.random();\n\t      }\n\t      c = a + b;\n\t      a = b;\n\t      b = c;\n\t      if (i === 1)\n\t        renderer.extendContext({one: c});\n\t      if (i === 10)\n\t        renderer.extendContext({ten: c});\n\t      if (i === 100)\n\t        renderer.extendContext({hundred: c});\n\t      if (i === 1000)\n\t        renderer.extendContext({thousand: c});\n\t      i++;\n\t      if (i < 1001)\n\t        process.nextTick(next);\n\t    })();\n\t  }\n\t  else {\n\t    amulet.render(res, ['layout.mu', 'hello.mu']);\n\t  }\n\t}).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n    \n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can. \n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n\t<pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like \n\n\t<pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n\t{{#obj}}\n\t\t{{#prop}}\n\t\t\t{{val}}\n\t\t{{/prop}}\n\t{{/obj}}\n\t\nYou can just dot a path. Like javascript.\n\n\t{{obj.prop.val}}\n\t\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n\t{{#obj}}\n\t\t{{#prop}}\n\t\t\t{{val}}\n\t\t{{/}}\n\t{{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n\t<!DOCTYPE html>\n\t{{<}}\n\n*index.mu*\n\n\t<p>Just the facts.</p>\n\t\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n\t<!DOCTYPE html>\n\t<p>Just the facts.</p>\n\t\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n\t{{#people -> person}}\n\t\t{{person.first_name}}\n\t{{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n  {{#people}}\n    {{_.first_name}}\n    {{last_name}}\n  {{/}}\n\n\n# License\n\nMIT Licensed, 2010-2012\n\nSee <https://github.com/chbrown/amulet/blob/master/LICENSE>\n","maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.2.6":{"name":"amulet","version":"0.2.6","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"http://github.com/chbrown/amulet","bugs":{"url":"http://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"http://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"main":"./lib/rendering.js","devDependencies":{"optimist":"*","async":"*","js-yaml":"*"},"scripts":{"test":"./tests/test.js"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n# License\n\nMIT Licensed, 2010-2012\n\nSee <https://github.com/chbrown/amulet/blob/master/LICENSE>\n","readmeFilename":"README.md","_id":"amulet@0.2.6","dist":{"shasum":"fe89eb23b6e3ecfc6c890e98be7d28385abc6ca9","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.2.6.tgz","integrity":"sha512-qDCqX82rAf3/J1oAaUmYTankV3vKEh2oCOgZ8ZEWwq3UuH8o2EtewCs+jW7GmC0+lvNqbf/DSxB9vQqeZyakjg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICQVzUcmTmPHi9eaFxh0RCdvrsyB5qvOllParNjYdQUdAiBp3pgo8beUbrbbWCLZ9o2O63jBcdUhLrGKjHZtlYuLzA=="}]},"_from":".","_npmVersion":"1.2.2","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.2.7":{"name":"amulet","version":"0.2.7","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"http://github.com/chbrown/amulet","bugs":{"url":"http://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"http://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"main":"./lib/rendering.js","devDependencies":{"optimist":"*","async":"*","js-yaml":"*"},"scripts":{"test":"./tests/test.js"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n# License\n\nMIT Licensed, 2010-2012\n\nSee <https://github.com/chbrown/amulet/blob/master/LICENSE>\n","readmeFilename":"README.md","_id":"amulet@0.2.7","dist":{"shasum":"caf23985ae571809ef15ba389fa772b9e54310b0","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.2.7.tgz","integrity":"sha512-AL+CqpDy2gk/TUXOslq0dsRCGwfklmfjhcCFgGy5XTfOiohSoSS2XanFgNV/3I4HIMG8+EyhlKRE3+4M/esbgg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC065hIzNCfdzyMckqxf/pGOTYvo07AQlzkZu87FhEoawIgEmCs+h3aElJuQx3cNmJwCaMA0sw/VBPvFPwydA8PhAI="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.2.8":{"name":"amulet","version":"0.2.8","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"http://github.com/chbrown/amulet","bugs":{"url":"http://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"http://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"main":"./lib/rendering.js","devDependencies":{"optimist":"*","async":"*","js-yaml":"*"},"scripts":{"test":"./tests/test.js"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n# License\n\nMIT Licensed, 2010-2012\n\nSee <https://github.com/chbrown/amulet/blob/master/LICENSE>\n","readmeFilename":"README.md","_id":"amulet@0.2.8","dist":{"shasum":"425460d84de80f06d696ca6f3332323743698e26","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.2.8.tgz","integrity":"sha512-OxRLtem4dYOpupvMp7xVMF004xp6JdKmgm/SlQR8sBn0aMAlbnaKWKaYf1EnDvhW7qdFuLDXnZuZP3ViuIrUFg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCrsoLK+DFdmXLH0Ibf1vZB/tv8413wFspHK5Us7OJ5KAIhANlXYT0tkfIStCY5RWcU/E3uffK0A2NGMZgFt/5j/oM8"}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.2.9":{"name":"amulet","version":"0.2.9","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"http://github.com/chbrown/amulet","bugs":{"url":"http://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"http://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","main":"./lib/rendering.js","devDependencies":{"optimist":"*","async":"*","js-yaml":"*"},"scripts":{"test":"./tests/test.js"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@0.2.9","dist":{"shasum":"634c19013fc969ca26261f08d38002febb1a0955","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.2.9.tgz","integrity":"sha512-UddqBFlBYqLXrbuhLIJBAZ8PJOf6sIn1pGVVAwSTNv1EAlMixV5pVoKf6Pa5CZuefL1+/WAejoZFPFc32x0/Mw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDRoxYO49v3MYBq6EN7zwQIYNF9ImvrpkBozOl0hlm4UAiAByHJ5mdpyGz/rkHmu+n12W/t6dFox9QHGdwcblC0VrA=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.3.0":{"name":"amulet","version":"0.3.0","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","main":"index.js","devDependencies":{"async":"*","js-yaml":"*","optimist":"~0.5","tap":"~0.4"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@0.3.0","dist":{"shasum":"0e37f1ec9851cbae9e0157c544cf8f58b5a8fb7e","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.3.0.tgz","integrity":"sha512-6geA0hft/D3YZPcMXKQzP3hFUE30VgbejM8ttCYMY0N3aGT63NcZfyVFbc9vIF8sX/93MtaTi96/XyEM9/8nYA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHzRWQJD84THTvDE38A/8M6Lu+L7AQ/3HKo+MHc8Y26uAiAj8BTV9nSoJ4d8QbUTtlish4YljTYAmq9THMwnMp+2iQ=="}]},"_from":".","_npmVersion":"1.2.11","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"0.3.1":{"name":"amulet","version":"0.3.1","description":"As-soon-as-possible streaming async Mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","devDependencies":{"async":"*","js-yaml":"*","optimist":"~0.5","tap":"~0.4"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@0.3.1","dist":{"shasum":"2a7615ce1d1826c2616524a8338c70a948a262bd","tarball":"https://registry.npmjs.org/amulet/-/amulet-0.3.1.tgz","integrity":"sha512-GRBuuTmlZW3hnvaxOXEWOnDBh0tce8NC8Ovh9X+lBEbaUiCW0IWepQfnF5In99gR+rmqhrykHd5n7WcNw2Ym3Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIHGNGwDuTqpVa0wk/2VMDCK2KlCsODp7wfv2IReahlw2AiAS/MOfpLktWYi8pXahnJ1BvfHvYT0hPNf225FQJznwCw=="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"1.0.0":{"name":"amulet","version":"1.0.0","description":"As-soon-as-possible streaming async mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","devDependencies":{"tap":"*"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## Testing\n\nJust run `tap test` in the package's root directory after installing.\n\nThere are 14 failing tests right now, but it's not a big deal, since those are all edge cases of the full Mustache spec.\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@1.0.0","dist":{"shasum":"4a4268f8c6332aa77583a89e22574630274504b3","tarball":"https://registry.npmjs.org/amulet/-/amulet-1.0.0.tgz","integrity":"sha512-chBjg4a8KC0ixnwt9hp5l+Onul6jz9YdcbHxjBL3tkCUaHy4JT4BgSgD8OzEMTlYYsu9ZKcF6QxD8fO9G8rGaw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDiwluie4Idz9w5ggz7dUgz2/8quD8xl02ZsduGarYgeQIgLGiRr3xO5ZBzwl5mk/5fyi9PpJCGkC/TNWVQhlEkRh8="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"1.0.1":{"name":"amulet","version":"1.0.1","description":"As-soon-as-possible streaming async mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","devDependencies":{"tap":"*"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## Testing\n\nJust run `tap test` in the package's root directory after installing.\n\nThere are 14 failing tests right now, but it's not a big deal, since those are all edge cases of the full Mustache spec.\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@1.0.1","dist":{"shasum":"2d435005c5fadec90514b835ac42e58ea0c25c54","tarball":"https://registry.npmjs.org/amulet/-/amulet-1.0.1.tgz","integrity":"sha512-aa+WxfBUGxh6hH+yZtbbXr2sLCj5GBKJYxVDlT/EkNQIjqygSPxabBfxQbe4V+2NeKMU8r87c9vrjk+kEyHgOw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIC3r7dGVpyMEvbcIRbzKQudcwbBtlRLf0LjcJgvE95qqAiAmoIQvD+pL5Nl8tk5DSp8Lear9hJd8NTRW/fjIqVZvNg=="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"1.0.2":{"name":"amulet","version":"1.0.2","description":"As-soon-as-possible streaming async mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","devDependencies":{"portfinder":"*","request":"*","tap":"*"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## Testing\n\nJust run `tap test` in the package's root directory after installing.\n\nThere are 14 failing tests right now, but it's not a big deal, since those are all edge cases of the full Mustache spec.\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@1.0.2","dist":{"shasum":"d1c59e808187bf0aade8237ae5f1289a4b508b83","tarball":"https://registry.npmjs.org/amulet/-/amulet-1.0.2.tgz","integrity":"sha512-WITZBOIbjbldm1jmP++RUgXd+slMvDR8/9Qy3aKQF6gFkLZQbunygco+1cviA4Sg/aX+jx/THJot7s+e8MsNyQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCvEcIpSrIrOCYGApafaUCYhUO4E0dN8yHzXqnlpqbYmAIgMYnPhZbTmsTID2tHJInumtK1NVbED/SvBWkkN5MyOfE="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"1.0.3":{"name":"amulet","version":"1.0.3","description":"As-soon-as-possible streaming async mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","devDependencies":{"portfinder":"*","request":"*","tap":"*"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## Tests\n\n**Travis CI Build Status**: [![Travis CI Build Status](https://api.travis-ci.org/chbrown/amulet.png)](https://travis-ci.org/chbrown/amulet)\n\nThere are 14 failing tests right now. but it's not a big deal, since those are all edge cases of the formal Mustache spec.\n\n### Testing locally\n\nYou'll need to grab the submodules along with the repository to run tests:\n\n    git clone --recursive https://github.com/chbrown/amulet.git\n\nOr if you've already cloned the repository:\n\n    git submodule update --init --recursive\n\nAnd then just run `tap test` in the root directory (i.e., in the same directory as this `README.md` file).\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@1.0.3","dist":{"shasum":"de5b48a3cedbf8403437455e0a761b31850d5788","tarball":"https://registry.npmjs.org/amulet/-/amulet-1.0.3.tgz","integrity":"sha512-oLeG12XXSIVzfcFYbmM1rn/V3Gaobd4HYCtATn8Tlg0dFviFVoG+m7m+7gGv1VhaQmQlCh0OaTKdpi62s4pZhQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGwqA2r/ieGSpq2fWYglhCEYC207M0w4KYDzUt+2Dg0RAiEArEcxkZMo9tCzNxKmUiOEIJ+Z4h1s05fOJAn2gLolt6w="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"1.0.4":{"name":"amulet","version":"1.0.4","description":"As-soon-as-possible streaming async mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","devDependencies":{"portfinder":"*","request":"*","tap":"*"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## Tests\n\n**Travis CI Build Status**: [![Travis CI Build Status](https://api.travis-ci.org/chbrown/amulet.png)](https://travis-ci.org/chbrown/amulet)\n\nThere are 14 failing tests right now. but it's not a big deal, since those are all edge cases of the formal Mustache spec.\n\n### Testing locally\n\nYou'll need to grab the submodules along with the repository to run tests:\n\n    git clone --recursive https://github.com/chbrown/amulet.git\n\nOr if you've already cloned the repository:\n\n    git submodule update --init --recursive\n\nAnd then just run `tap test` in the root directory (i.e., in the same directory as this `README.md` file).\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@1.0.4","dist":{"shasum":"42d4d5e10e3b75f67c04c5608ea4e4011d30fe44","tarball":"https://registry.npmjs.org/amulet/-/amulet-1.0.4.tgz","integrity":"sha512-hVAmXHnnnfSx5WncktaB2PbkL984Gz037KD7FfmI9qrOWqFgCpL1Z9DrGnzyqiTDqhM8MimjhnDaqXm/EOXoyg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDzf3DZXmpgrAcy3rBuRcJtEJn+gTnf195wMq6VxIO1vgIgNdtcXngBLCmK1hN6hAZ2edB7B6tDSen5g945wsiiYxo="}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"1.0.5":{"name":"amulet","version":"1.0.5","description":"As-soon-as-possible streaming async mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","devDependencies":{"portfinder":"*","request":"*","tap":"*"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## Tests\n\n**Travis CI Build Status**: [![Travis CI Build Status](https://api.travis-ci.org/chbrown/amulet.png)](https://travis-ci.org/chbrown/amulet)\n\nThere are 14 failing tests right now. but it's not a big deal, since those are all edge cases of the formal Mustache spec.\n\n### Testing locally\n\nYou'll need to grab the submodules along with the repository to run tests:\n\n    git clone --recursive https://github.com/chbrown/amulet.git\n\nOr if you've already cloned the repository:\n\n    git submodule update --init --recursive\n\nAnd then just run `tap test` in the root directory (i.e., in the same directory as this `README.md` file).\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@1.0.5","dist":{"shasum":"875a60bbcacff62b0507482c2be3949312f8ac32","tarball":"https://registry.npmjs.org/amulet/-/amulet-1.0.5.tgz","integrity":"sha512-QNQhbr53dIa4EI6IDw8Sqz3RirrTm/0YswnK7D8wrvyq0qgyDDshAkaiemBe3EKQWTxaGukWtRxr7uxc8aOIag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAXByywYLO5Uk2FN4Bvi+2OgJCJig6gIsxWIkl5kW+MdAiAGzCXxFhyokyD4J13oFurEMz/k+KNZG+TJBUQeJBwEXg=="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"1.0.6":{"name":"amulet","version":"1.0.6","description":"As-soon-as-possible streaming async mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","devDependencies":{"portfinder":"*","request":"*","tap":"*"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## Tests\n\n**Travis CI Build Status**: [![Travis CI Build Status](https://api.travis-ci.org/chbrown/amulet.png)](https://travis-ci.org/chbrown/amulet)\n\nThere are 14 failing tests right now. but it's not a big deal, since those are all edge cases of the formal Mustache spec.\n\n### Testing locally\n\nYou'll need to grab the submodules along with the repository to run tests:\n\n    git clone --recursive https://github.com/chbrown/amulet.git\n\nOr if you've already cloned the repository:\n\n    git submodule update --init --recursive\n\nAnd then just run `tap test` in the root directory (i.e., in the same directory as this `README.md` file).\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@1.0.6","dist":{"shasum":"701dd1d11e8ca85e38abeb7cf0615652466308ec","tarball":"https://registry.npmjs.org/amulet/-/amulet-1.0.6.tgz","integrity":"sha512-u42gBbZcJbk5gwDA8rfkvEv/KDW3ZxYU+H1bTbWKQFrDKurGTaz4Q5CIwmU+q8SnAxylBY+K0qjz+qr9ePo5EA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEVwhmaK5cq0+VHnkj3q0nXfssaDFGg5luJSpR2ingxFAiEAkxyY04EbLonaEGfUw4kk0tSIEbf63pMp4yU1DugGExc="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"directories":{}},"1.0.7":{"name":"amulet","version":"1.0.7","description":"As-soon-as-possible streaming async mustache templating","keywords":["template","mustache","mu","asynchronous","streaming","nodeps"],"homepage":"https://github.com/chbrown/amulet","bugs":{"url":"https://github.com/chbrown/amulet/issues","email":"Christopher Brown <io@henrian.com>"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"license":"MIT","devDependencies":{"portfinder":"*","request":"*","tap":"*"},"scripts":{"test":"tap test"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## Tests\n\n**Travis CI Build Status**: [![Travis CI Build Status](https://api.travis-ci.org/chbrown/amulet.png)](https://travis-ci.org/chbrown/amulet)\n\nThere are 14 failing tests right now. but it's not a big deal, since those are all edge cases of the formal Mustache spec.\n\n### Testing locally\n\nYou'll need to grab the submodules along with the repository to run tests:\n\n    git clone --recursive https://github.com/chbrown/amulet.git\n\nOr if you've already cloned the repository:\n\n    git submodule update --init --recursive\n\nAnd then just run `tap test` in the root directory (i.e., in the same directory as this `README.md` file).\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n","readmeFilename":"README.md","_id":"amulet@1.0.7","dist":{"shasum":"34f77074a0517fb21876f58bdf447c4e8cc3c56c","tarball":"https://registry.npmjs.org/amulet/-/amulet-1.0.7.tgz","integrity":"sha512-1oVI2TQBBeyh6w5RyFA8FKzIKv90Op9lecDj6Sio5GmkDCKQLcBGD2f5qp5p76CZ7Xfe59E6L6FzpV++2tdEPA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfUMTQdqX0mNeNOPiBdxMXZnnenErGoec+tg7VleCNaAIgdwflmP2KfGRgWysd1DSIVVNepTbWUuXVAuoKQHPdjSQ="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"chbrown","email":"io@henrian.com"},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}]}},"maintainers":[{"name":"chbrown","email":"io@henrian.com"}],"time":{"modified":"2022-06-13T02:47:03.357Z","created":"2011-08-24T20:49:38.532Z","0.1.5":"2011-08-24T20:49:39.725Z","0.1.6":"2011-09-03T19:26:20.266Z","0.1.7":"2011-09-05T03:06:28.259Z","0.1.8":"2011-10-10T17:45:32.380Z","0.1.9":"2012-01-01T21:14:30.291Z","0.2.1":"2012-05-06T04:57:16.010Z","0.2.2":"2012-05-08T14:24:17.466Z","0.2.3":"2012-05-08T16:53:43.014Z","0.2.4":"2012-06-29T18:00:04.864Z","0.2.6":"2013-01-29T19:07:12.208Z","0.2.7":"2013-04-18T13:17:36.633Z","0.2.8":"2013-05-21T01:15:54.308Z","0.2.9":"2013-05-27T19:34:35.296Z","0.3.0":"2013-06-03T22:31:31.678Z","0.3.1":"2013-06-17T21:01:30.418Z","1.0.0":"2013-09-01T22:49:46.780Z","1.0.1":"2013-09-02T19:17:42.395Z","1.0.2":"2013-09-04T17:09:57.144Z","1.0.3":"2013-09-18T19:25:15.546Z","1.0.4":"2013-09-25T01:43:05.272Z","1.0.5":"2013-12-17T21:26:48.329Z","1.0.6":"2014-01-10T06:43:10.691Z","1.0.7":"2014-01-14T03:24:23.969Z"},"author":{"name":"Christopher Brown","email":"io@henrian.com","url":"http://henrian.com"},"repository":{"type":"git","url":"git://github.com/chbrown/amulet.git"},"readme":"# Amulet - Mustache templating for Node.js\n\nMustache is a simple, restricted, fast template language inspired by [ctemplate](http://code.google.com/p/google-ctemplate/). There is a great introduction to the language [here on github](http://mustache.github.com/mustache.5.html). And a nice overview of the different tags at the [ruby implementation](http://github.com/defunkt/mustache/).\n\nAmulet began as a fork of the v2 branch of [raycmorgan](https://github.com/raycmorgan)'s [Mu](https://github.com/raycmorgan/Mu). I eventually changed so much of the API that I decided to rename it.\nAmulet attempts/intends to implement all of the Mustache specification, except that it does not always honor the whitespace requirements, which, for the purposes of HTML, does not matter. (Obeying the white-space conventions is on the to-do list.)\n\n### Quickstart guide:\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    <meta name=\"engine\" content=\"amulet\">\n    <div id=\"container\">\n        {{<}}\n    </div>\n\n*hello.mu*\n\n    <p>Hello world!</p>\n\n*fib.mu*\n\n    <h2>{{header}}</h2>            {{{spacer}}}\n    <!-- the spacers are there just to convince\n         your browser that it has enough content\n         to merit rendering -->\n\n    <p>One: {{one}}</p>            {{{spacer}}}\n    <p>Ten: {{ten}}</p>            {{{spacer}}}\n    <p>Hundred: {{hundred}}</p>    {{{spacer}}}\n    <p>Thousand: {{thousand}}</p>\n\n*app.js*\n\n    var amulet = require('amulet');\n    var spacer = (new Array(100)).join('&nbsp;');\n    require('http').createServer(function(req, res) {\n      if (req.url === '/fib') {\n        res.writeHead(200, {'Content-Type': 'text/html'});\n        var context = {header: 'Fibonacci sequence', spacer: spacer};\n        var renderer = amulet.render(res, ['layout.mu', 'fib.mu'], context, true);\n        var a = 0, b = 1, c = -1, i = 0;\n        (function next() {\n          for (var j = 0; j < 500000; j++) {\n            var dummy = Math.random();\n          }\n          c = a + b;\n          a = b;\n          b = c;\n          if (i === 1)\n            renderer.extendContext({one: c});\n          if (i === 10)\n            renderer.extendContext({ten: c});\n          if (i === 100)\n            renderer.extendContext({hundred: c});\n          if (i === 1000)\n            renderer.extendContext({thousand: c});\n          i++;\n          if (i < 1001)\n            process.nextTick(next);\n        })();\n      }\n      else {\n        amulet.render(res, ['layout.mu', 'hello.mu']);\n      }\n    }).listen(8080);\n\nThis example code can be found in `example/`\n\nThe main function, `amulet.render`, can be called in a few variations. The basic signature is `function(output, templates, context, asap, callback)`, but a number of the arguments are optional (`output` is the only required argument):\n\nWith callback:\n\n    amulet.render(res, ['layout.mu', 'page.mu'], context, true, function() {\n        console.log(\"Done rendering!\");\n    });\n\n`asap` defaults to false:\n\n    amulet.render(res, 'static.mu', function() { console.log(\"Done!\"); });\n\nWith single template:\n\n    var renderer = amulet.render(res, 'one.mu', {first: 'Chris'}, true);\n\n`amulet.render` always returns a Renderer object, which is useful if you want a way to add context or force it to end.\n\n*one.mu*\n\n    <h3>{{first}} {{last}}</h3>\n    <p>{{description}}</p>\n\n*app.js (snippet)*:\n\n    renderer.extendContext({last: 'Brown'});\n\nAt this point, the renderer would output up to the `<p>`\nand then pause, waiting for the description variable to be filled.\nBut if you decide you want it to skip over the missing variables,\nas any basic Mustache spec would do:\n\n    renderer.force();\n\nWhich sets `asap` to false, and immediately streams through the rest of your template.\n\n\n\n## Why Amulet when there's [Mu](https://github.com/raycmorgan/Mu)?\n\n[Mu](https://github.com/raycmorgan/Mu) is faster for certain benchmarks, because the template rendering itself is synchronous. Amulet does everything A.S.A.P. (as soon as possible), so it will start rendering your templates before any of your context variables are available, only halting when it encounters a missing variable. This functionality is optional -- if you want to render a template with one command, you still can.\n\nPHP appears so fast (while sucking so much at everything else) because it renders as soon as possible, so that the top 90% of the page gets rendered before some cpu-intensive bit gets called to render the footer. That's what Amulet does, too, basically.\n\nLike Mu, Amulet\n\n* Is very fast\n* Supports asynchronous parsing and compiling\n* Renders streamingly\n\nBeyond Mu, Amulet\n\n* Supports template hierarchies\n* Renders as soon as possible, pausing only to wait for missing variables from the controller\n* Adds a number of helpers to the Mustache specification\n\n# Additives\n\nAmulet is Mustache and then some:\n\n### Piping\n\nIf a method is in global scope, you can pipe a variable through it:\n\n    <pre>{{{doc | JSON.stringify}}}</pre>\n\nWhich would return something like\n\n    <pre>{\"_id\": \"0x1\"}</pre>\n\n### Object notation\n\nInstead of having to nest sections to dig into an object:\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/prop}}\n    {{/obj}}\n\nYou can just dot a path. Like javascript.\n\n    {{obj.prop.val}}\n\n### DRY\n\nDon't repeat yourself; namely, don't use XML-type redundancy. A Mustache template is a directed acyclic graph (DAG), i.e. a tree, meaning that a closing node is never ambiguous. You needn't tell the Amulet parser what you're closing. It already knows.\n\n    {{#obj}}\n        {{#prop}}\n            {{val}}\n        {{/}}\n    {{/}}\n\n### Yields\n\nWhen rendering a template hierarchy, use a `<` in your master layout (the opposite of the partial symbol `>`):\n\n*layout.mu*\n\n    <!DOCTYPE html>\n    {{<}}\n\n*index.mu*\n\n    <p>Just the facts.</p>\n\nOutput of `amulet.render(response, ['layout.mu', 'index.mu'])`:\n\n    <!DOCTYPE html>\n    <p>Just the facts.</p>\n\nTo make it easier to remember what `<` does, you can also write `{{<yield}}` or even `{{<yield/>}}` to make your syntax highlighter happy. As soon as the parser sees the `<` character, it will skip to the end of the mustache tag.\n\n### Arrows\n\nTo keep better track of scope, you can name your sectioned variables with the `->` symbol:\n\n    {{#people -> person}}\n        {{person.first_name}}\n    {{/}}\n\nOtherwise, you can access the local scope nakedly or with a `_`:\n\n    {{#people}}\n        {{_.first_name}}\n        {{last_name}}\n    {{/}}\n\n\n## TODO\n\n* Implement ability to add templates asap-ly, so that the first one\n  can start rendering without its yield being specified yet.\n\n\n## Tests\n\n**Travis CI Build Status**: [![Travis CI Build Status](https://api.travis-ci.org/chbrown/amulet.png)](https://travis-ci.org/chbrown/amulet)\n\nThere are 14 failing tests right now. but it's not a big deal, since those are all edge cases of the formal Mustache spec.\n\n### Testing locally\n\nYou'll need to grab the submodules along with the repository to run tests:\n\n    git clone --recursive https://github.com/chbrown/amulet.git\n\nOr if you've already cloned the repository:\n\n    git submodule update --init --recursive\n\nAnd then just run `tap test` in the root directory (i.e., in the same directory as this `README.md` file).\n\n\n## License\n\nCopyright © 2011–2013 Christopher Brown. [MIT Licensed](LICENSE).\n"}