{"_id":"hogan.js","_rev":"142562","name":"hogan.js","description":"A mustache compiler.","dist-tags":{"latest":"3.0.2"},"maintainers":[{"name":"fat","email":"jacobthornton@gmail.com"},{"name":"sayrer","email":"sayrer@gmail.com"}],"time":{"modified":"2021-06-03T11:27:52.000Z","created":"2011-12-23T01:41:17.296Z","3.0.2":"2014-06-17T03:02:35.207Z","3.0.1":"2014-06-09T04:40:42.282Z","2.0.0":"2012-03-13T15:35:50.407Z","1.0.5-dev":"2012-01-23T19:58:39.439Z","1.0.4-dev":"2012-01-02T23:36:04.282Z","1.0.2":"2011-12-25T06:12:58.156Z","1.0.0":"2011-12-23T01:41:17.296Z"},"users":{"sjonnet19":true,"sjonnet":true,"lexa":true,"mattstyles":true,"fgribreau":true,"jxson":true,"cedx":true,"macmac":true,"subchen":true,"mchlbrnd":true,"invelo":true,"neefrankie":true,"markrogers":true,"timdp":true,"aquafadas":true,"imaginegenesis":true},"author":{"name":"Twitter Inc."},"repository":{"type":"git","url":"https://github.com/twitter/hogan.js.git"},"versions":{"3.0.2":{"name":"hogan.js","description":"A mustache compiler.","version":"3.0.2","keywords":["mustache","template"],"main":"./lib/hogan.js","homepage":"http://twitter.github.com/hogan.js/","author":{"name":"Twitter Inc."},"repository":{"type":"git","url":"https://github.com/twitter/hogan.js.git"},"licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"dependencies":{"nopt":"1.0.10","mkdirp":"0.3.0"},"devDependencies":{"uglify-js":"2.x","jsdom":"0.3.4","step":"0.0.5","rimraf":"2.0.1"},"bin":{"hulk":"./bin/hulk"},"gitHead":"c52d142643e764e3f82e8ad3f2d44a46b82d1640","bugs":{"url":"https://github.com/twitter/hogan.js/issues"},"_id":"hogan.js@3.0.2","scripts":{},"_shasum":"4cd9e1abd4294146e7679e41d7898732b02c7bfd","_from":".","_npmVersion":"1.4.15","_npmUser":{"name":"sayrer","email":"sayrer@gmail.com"},"maintainers":[{"name":"fat","email":"jacobthornton@gmail.com"},{"name":"sayrer","email":"sayrer@gmail.com"}],"dist":{"shasum":"4cd9e1abd4294146e7679e41d7898732b02c7bfd","size":163519,"noattachment":false,"key":"/hogan.js/-/hogan.js-3.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/hogan.js/download/hogan.js-3.0.2.tgz"},"directories":{},"publish_time":1402974155207,"_cnpm_publish_time":1402974155207,"_hasShrinkwrap":false},"3.0.1":{"name":"hogan.js","description":"A mustache compiler.","version":"3.0.1","keywords":["mustache","template"],"main":"./lib/hogan.js","homepage":"http://twitter.github.com/hogan.js/","author":{"name":"Twitter Inc."},"repository":{"type":"git","url":"https://github.com/twitter/hogan.js.git"},"licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"dependencies":{"nopt":"1.0.10","mkdirp":"0.3.0"},"devDependencies":{"uglify-js":"2.x","jsdom":"0.3.4","step":"0.0.5","rimraf":"2.0.1"},"bin":{"hulk":"./bin/hulk"},"bugs":{"url":"https://github.com/twitter/hogan.js/issues"},"_id":"hogan.js@3.0.1","dist":{"shasum":"09312f1de2d318f3fab71770e784036a0d3310bc","size":13296,"noattachment":false,"key":"/hogan.js/-/hogan.js-3.0.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/hogan.js/download/hogan.js-3.0.1.tgz"},"_from":".","_npmVersion":"1.4.3","_npmUser":{"name":"fat","email":"jacobthornton@gmail.com"},"maintainers":[{"name":"fat","email":"jacobthornton@gmail.com"},{"name":"sayrer","email":"sayrer@gmail.com"}],"directories":{},"publish_time":1402288842282,"_cnpm_publish_time":1402288842282,"_hasShrinkwrap":false},"2.0.0":{"name":"hogan.js","description":"A mustache compiler.","version":"2.0.0","keywords":["mustache","template"],"main":"./lib/hogan.js","homepage":"http://twitter.github.com/hogan.js/","author":{"name":"Twitter Inc."},"repository":{"type":"git","url":"git://github.com/twitter/hogan.js.git"},"licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"devDependencies":{"uglify-js":"*","jsdom":"0.2.10","step":"0.0.5"},"bin":{"hulk":"./bin/hulk"},"_npmUser":{"name":"sayrer","email":"sayrer@gmail.com"},"_id":"hogan.js@2.0.0","dependencies":{},"optionalDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.1.0-3","_nodeVersion":"v0.6.10","_defaultsLoaded":true,"dist":{"shasum":"3a5b04186d51737fd2035792d419a9f5a82f9d0e","size":180194,"noattachment":false,"key":"/hogan.js/-/hogan.js-2.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hogan.js/download/hogan.js-2.0.0.tgz"},"maintainers":[{"name":"fat","email":"jacobthornton@gmail.com"},{"name":"sayrer","email":"sayrer@gmail.com"}],"directories":{},"publish_time":1331652950407,"_hasShrinkwrap":false,"_cnpm_publish_time":1331652950407},"1.0.5-dev":{"name":"hogan.js","description":"A mustache compiler.","version":"1.0.5-dev","keywords":["mustache","template"],"main":"./lib/hogan.js","homepage":"http://twitter.github.com/hogan.js/","author":{"name":"Twitter Inc."},"repository":{"type":"git","url":"git://github.com/twitter/hogan.js.git"},"licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"devDependencies":{"uglify-js":"*"},"bin":{"hulk":"./bin/hulk"},"_npmUser":{"name":"fat","email":"jacobthornton@gmail.com"},"_id":"hogan.js@1.0.5-dev","dependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"5951af8f638a9f463c302da8dc7116a09cf4660a","size":81920,"noattachment":false,"key":"/hogan.js/-/hogan.js-1.0.5-dev.tgz","tarball":"http://registry.cnpm.dingdandao.com/hogan.js/download/hogan.js-1.0.5-dev.tgz"},"maintainers":[{"name":"fat","email":"jacobthornton@gmail.com"},{"name":"sayrer","email":"sayrer@gmail.com"}],"directories":{},"publish_time":1327348719439,"_hasShrinkwrap":false,"_cnpm_publish_time":1327348719439},"1.0.4-dev":{"name":"hogan.js","description":"A mustache compiler.","version":"1.0.4-dev","keywords":["mustache","template"],"main":"./lib/hogan.js","homepage":"http://twitter.github.com/hogan.js/","author":{"name":"Twitter Inc."},"repository":{"type":"git","url":"git://github.com/twitter/hogan.js.git"},"licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_npmUser":{"name":"fat","email":"jacobthornton@gmail.com"},"_id":"hogan.js@1.0.4-dev","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"a5c9b47d06941fecf1584e966716e95e932c67a2","size":71680,"noattachment":false,"key":"/hogan.js/-/hogan.js-1.0.4-dev.tgz","tarball":"http://registry.cnpm.dingdandao.com/hogan.js/download/hogan.js-1.0.4-dev.tgz"},"maintainers":[{"name":"fat","email":"jacobthornton@gmail.com"},{"name":"sayrer","email":"sayrer@gmail.com"}],"directories":{},"publish_time":1325547364282,"_hasShrinkwrap":false,"_cnpm_publish_time":1325547364282},"1.0.2":{"name":"hogan.js","description":"A mustache compiler.","version":"1.0.2","keywords":["mustache","template"],"main":"./lib/hogan.js","homepage":"http://twitter.github.com/hogan.js/","author":{"name":"Twitter Inc."},"repository":{"type":"git","url":"git://github.com/twitter/hogan.js.git"},"licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_npmUser":{"name":"fat","email":"jacobthornton@gmail.com"},"_id":"hogan.js@1.0.2","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"017e38e9203ff62a2d395530039cfb14205c8573","size":20480,"noattachment":false,"key":"/hogan.js/-/hogan.js-1.0.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/hogan.js/download/hogan.js-1.0.2.tgz"},"maintainers":[{"name":"fat","email":"jacobthornton@gmail.com"},{"name":"sayrer","email":"sayrer@gmail.com"}],"directories":{},"publish_time":1324793578156,"_hasShrinkwrap":false,"_cnpm_publish_time":1324793578156},"1.0.0":{"name":"hogan.js","description":"A mustache compiler.","version":"1.0.0","keywords":["mustache","template"],"main":"./lib/hogan.js","homepage":"http://twitter.github.com/hogan.js/","author":{"name":"Twitter Inc."},"repository":{"type":"git","url":"git://github.com/twitter/hogan.js.git"},"licenses":[{"type":"Apache-2.0","url":"http://www.apache.org/licenses/LICENSE-2.0"}],"_npmUser":{"name":"fat","email":"jacobthornton@gmail.com"},"_id":"hogan.js@1.0.0","dependencies":{},"devDependencies":{},"engines":{"node":"*"},"_engineSupported":true,"_npmVersion":"1.0.104","_nodeVersion":"v0.6.0","_defaultsLoaded":true,"dist":{"shasum":"ec30e5491b16575f48f783164ce7c1e60ff7a20b","size":20480,"noattachment":false,"key":"/hogan.js/-/hogan.js-1.0.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hogan.js/download/hogan.js-1.0.0.tgz"},"maintainers":[{"name":"fat","email":"jacobthornton@gmail.com"},{"name":"sayrer","email":"sayrer@gmail.com"}],"directories":{},"publish_time":1324604477296,"_hasShrinkwrap":false,"_cnpm_publish_time":1324604477296}},"readme":"## Hogan.js - A mustache compiler. [![Build Status](https://secure.travis-ci.org/twitter/hogan.js.png)](http://travis-ci.org/twitter/hogan.js)\n\n[Hogan.js](http://twitter.github.io/hogan.js/) is a compiler for the\n[Mustache](http://mustache.github.io/) templating language. For information\non Mustache, see the [manpage](http://mustache.github.com/mustache.5.html) and\nthe [spec](https://github.com/mustache/spec).\n\n## Basics\n\nHogan compiles templates to HoganTemplate objects, which have a render method.\n\n```js\nvar data = {\n  screenName: \"dhg\",\n};\n\nvar template = Hogan.compile(\"Follow @{{screenName}}.\");\nvar output = template.render(data);\n\n// prints \"Follow @dhg.\"\nconsole.log(output);\n```\n\n## Features\n\nHogan is fast--try it on your workload.\n\nHogan has separate scanning, parsing and code generation phases. This way it's\npossible to add new features without touching the scanner at all, and many\ndifferent code generation techniques can be tried without changing the parser.\n\nHogan exposes scan and parse methods. These can be useful for\npre-processing templates on the server.\n\n```js\nvar text = \"{{^check}}{{#i18n}}No{{/i18n}}{{/check}}\";\ntext +=  \"{{#check}}{{#i18n}}Yes{{/i18n}}{{/check}}\";\nvar tree = Hogan.parse(Hogan.scan(text));\n\n// outputs \"# check\"\nconsole.log(tree[0].tag + \" \" + tree[0].name);\n\n// outputs \"Yes\"\nconsole.log(tree[1].nodes[0].nodes[0]);\n```\n\nIt's also possible to use HoganTemplate objects without the Hogan compiler\npresent. That means you can pre-compile your templates on the server, and\navoid shipping the compiler. However, the optional lambda features from the\nMustache spec require the compiler and the original template source to be present.\n\nHogan also supports [template inheritance](https://github.com/mustache/spec/pull/75),\nand maintains compatibility with other implementations like [mustache.java](https://github.com/spullara/mustache.java),\n[mustache.php](https://github.com/bobthecow/mustache.php), and [GRMustache](https://github.com/groue/GRMustache)\n\n## Why Hogan.js?\n\nWhy another templating library?\n\nHogan.js was written to meet three templating library requirements: good\nperformance, standalone template objects, and a parser API.\n\n## Install\n\n# Node.js\n\n```\nnpm install hogan.js\n```\n\n# component\n\n```\ncomponent install twitter/hogan.js\n```\n\n## Compilation options\n\nThe second argument to Hogan.compile is an options hash.\n\n```js\nvar text = \"my <%example%> template.\"\nHogan.compile(text, {delimiters: '<% %>'});\n```\n\nThere are currently four valid options.\n\nasString: return the compiled template as a string. This feature is used\nby hulk to produce strings containing pre-compiled templates.\n\nsectionTags: allow custom tags that require opening and closing tags, and\ntreat them as though they were section tags.\n\n```js\nvar text = \"my {{_foo}}example{{/foo}} template.\"\nHogan.compile(text, { sectionTags: [{o: '_foo', c: 'foo'}]});\n```\n\nThe value is an array of object with o and c fields that indicate names\nfor custom section tags. The example above allows parsing of {{_foo}}{{/foo}}.\n\ndelimiters: A string that overrides the default delimiters. Example: \"<% %>\".\n\ndisableLambda: disables the higher-order sections / lambda-replace features of Mustache.\n\n## Issues\n\nHave a bug? Please create an issue here on GitHub!\n\nhttps://github.com/twitter/hogan.js/issues\n\n## Versioning\n\nFor transparency and insight into our release cycle, releases will be numbered with the follow format:\n\n`<major>.<minor>.<patch>`\n\nAnd constructed with the following guidelines:\n\n* Breaking backwards compatibility bumps the major\n* New additions without breaking backwards compatibility bumps the minor\n* Bug fixes and misc changes bump the patch\n\nFor more information on semantic versioning, please visit http://semver.org/.\n\n## Testing\n\nTo run the tests you first need to update all git submodules.\n\n    $ git submodule init\n    $ git submodule update\n\nUnit tests are written using [QUnit](http://qunitjs.com/). To run them, open `test/index.html`\nin a browser.\n\nUse [node](http://nodejs.org/) to run all tests from the\n[mustache spec](https://github.com/mustache/spec).\n\n    $ node test/spec.js\n\n## Authors\n\n**Robert Sayre**\n\n+ http://github.com/sayrer\n\n**Jacob Thornton**\n\n+ http://github.com/fat\n\n## License\n\nCopyright 2011 Twitter, Inc.\n\nLicensed under the Apache License, Version 2.0: http://www.apache.org/licenses/LICENSE-2.0\n","_attachments":{},"homepage":"http://twitter.github.com/hogan.js/","bugs":{"url":"https://github.com/twitter/hogan.js/issues"}}