{"_id":"hamljs","_rev":"3635717","name":"hamljs","description":"Faster / Express compliant Haml implementation","dist-tags":{"latest":"0.6.2"},"maintainers":[{"name":"saschagehlich","email":""},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"time":{"modified":"2024-10-21T06:06:32.000Z","created":"2011-03-04T16:42:46.184Z","0.6.2":"2014-02-17T18:22:18.176Z","0.6.1":"2012-07-26T22:05:42.444Z","0.6.0":"2012-06-26T16:47:46.850Z","0.5.2":"2011-12-08T23:23:00.903Z","0.5.1":"2011-03-30T17:31:51.080Z","0.4.5":"2011-03-04T16:42:46.184Z","0.5.0":"2011-03-04T16:42:46.184Z"},"users":{},"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca","url":"http://tjholowaychuk.com"},"repository":{"type":"git","url":"git://github.com/visionmedia/haml.js.git"},"versions":{"0.6.2":{"name":"hamljs","description":"Faster / Express compliant Haml implementation","version":"0.6.2","repository":{"type":"git","url":"git://github.com/visionmedia/haml.js.git"},"scripts":{"test":"make test"},"contributors":[{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},{"name":"Sascha Gehlich","email":"sascha@gehlich.us"}],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca","url":"http://tjholowaychuk.com"},"main":"lib/haml.js","devDependencies":{"should":"~2.1.1","mocha":"~1.16.2","grunt-urequire":"~0.6.0","grunt":"~0.4.2"},"bugs":{"url":"https://github.com/visionmedia/haml.js/issues"},"homepage":"https://github.com/visionmedia/haml.js","_id":"hamljs@0.6.2","dist":{"shasum":"7b7116cf6dbe7278e42b3f6ef8725a33e177c8e3","size":20256,"noattachment":false,"key":"/hamljs/-/hamljs-0.6.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/hamljs/download/hamljs-0.6.2.tgz"},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"saschagehlich","email":"sascha@gehlich.us"},"maintainers":[{"name":"saschagehlich","email":""},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"directories":{},"publish_time":1392661338176,"_hasShrinkwrap":false,"_cnpm_publish_time":1392661338176,"_cnpmcore_publish_time":"2021-12-16T18:26:13.002Z"},"0.6.1":{"name":"hamljs","description":"Faster / Express compliant Haml implementation","version":"0.6.1","repository":{"type":"git","url":"git://github.com/visionmedia/haml.js.git"},"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca","url":"http://tjholowaychuk.com"},"main":"lib/haml.js","_id":"hamljs@0.6.1","dist":{"shasum":"c1086dd5ff725a36f17574b26d98e3fb54219a35","size":8266,"noattachment":false,"key":"/hamljs/-/hamljs-0.6.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/hamljs/download/hamljs-0.6.1.tgz"},"maintainers":[{"name":"saschagehlich","email":""},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"directories":{},"publish_time":1343340342444,"_hasShrinkwrap":false,"_cnpm_publish_time":1343340342444,"_cnpmcore_publish_time":"2021-12-16T18:26:13.269Z"},"0.6.0":{"name":"hamljs","description":"Faster / Express compliant Haml implementation","version":"0.6.0","repository":{"type":"git","url":"git://github.com/visionmedia/haml.js.git"},"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca","url":"http://tjholowaychuk.com"},"main":"lib/haml.js","_id":"hamljs@0.6.0","dist":{"shasum":"a536123d1d0cb8471bf57352aae65f27b48a824f","size":8234,"noattachment":false,"key":"/hamljs/-/hamljs-0.6.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hamljs/download/hamljs-0.6.0.tgz"},"maintainers":[{"name":"saschagehlich","email":""},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"directories":{},"publish_time":1340729266850,"_hasShrinkwrap":false,"_cnpm_publish_time":1340729266850,"_cnpmcore_publish_time":"2021-12-16T18:26:13.483Z"},"0.5.2":{"name":"hamljs","description":"Faster / Express compliant Haml implementation","version":"0.5.2","repository":{"type":"git","url":"git://github.com/visionmedia/haml.js.git"},"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca","url":"http://tjholowaychuk.com"},"main":"index","engines":{"node":"0.4.x"},"_npmUser":{"name":"tjholowaychuk","email":"tj@vision-media.ca"},"_id":"hamljs@0.5.2","dependencies":{},"devDependencies":{},"_engineSupported":true,"_npmVersion":"1.0.106","_nodeVersion":"v0.4.12","_defaultsLoaded":true,"dist":{"shasum":"5dace9b858cdbe1ab27381d85a965d7b16703afa","size":61440,"noattachment":false,"key":"/hamljs/-/hamljs-0.5.2.tgz","tarball":"http://registry.cnpm.dingdandao.com/hamljs/download/hamljs-0.5.2.tgz"},"maintainers":[{"name":"saschagehlich","email":""},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"directories":{},"publish_time":1323386580903,"_hasShrinkwrap":false,"_cnpm_publish_time":1323386580903,"_cnpmcore_publish_time":"2021-12-16T18:26:13.726Z"},"0.5.1":{"name":"hamljs","description":"Faster / Express compliant Haml implementation","version":"0.5.1","repository":{"type":"git","url":"git://github.com/visionmedia/haml.js.git"},"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca","url":"http://tjholowaychuk.com"},"main":"index","engines":{"node":"0.4.x"},"_id":"hamljs@0.5.1","_engineSupported":true,"_npmVersion":"0.3.15","_nodeVersion":"v0.4.3","directories":{"lib":"./lib"},"files":[""],"_defaultsLoaded":true,"dist":{"shasum":"ce4ac23b23cb2886fa72c898acc96c8ec08a91a3","size":8216,"noattachment":false,"key":"/hamljs/-/hamljs-0.5.1.tgz","tarball":"http://registry.cnpm.dingdandao.com/hamljs/download/hamljs-0.5.1.tgz"},"publish_time":1301506311080,"maintainers":[{"name":"saschagehlich","email":""},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"_hasShrinkwrap":false,"_cnpm_publish_time":1301506311080,"_cnpmcore_publish_time":"2021-12-16T18:26:13.930Z"},"0.4.5":{"name":"hamljs","description":"Faster, harder, better HAML template engine","keywords":["haml","template","engine","view","nodejs"],"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca"},"version":"0.4.5","directories":{"lib":"."},"_id":"hamljs@0.4.5","engines":{"node":"*"},"_nodeSupported":true,"_npmVersion":"0.2.7-2","_nodeVersion":"v0.3.1-pre","dist":{"shasum":"f66515583ec4f822cc4dbe846871ebf4742b3c22","size":45035,"noattachment":false,"key":"/hamljs/-/hamljs-0.4.5.tgz","tarball":"http://registry.cnpm.dingdandao.com/hamljs/download/hamljs-0.4.5.tgz"},"publish_time":1299256966184,"maintainers":[{"name":"saschagehlich","email":""},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"_hasShrinkwrap":false,"_cnpm_publish_time":1299256966184,"_cnpmcore_publish_time":"2021-12-16T18:26:14.513Z"},"0.5.0":{"name":"hamljs","description":"Faster / Express compliant Haml implementation","version":"0.5.0","repository":{"type":"git","url":"git://github.com/visionmedia/haml.js.git"},"author":{"name":"TJ Holowaychuk","email":"tj@vision-media.ca","url":"http://tjholowaychuk.com"},"main":"index","directories":{"lib":"lib"},"engines":{"node":"0.4.x"},"_id":"hamljs@0.5.0","_engineSupported":true,"_npmVersion":"0.3.13","_nodeVersion":"v0.4.2","files":[""],"_defaultsLoaded":true,"dist":{"shasum":"170a0c7ab3dd236ff6ab6fcc0e28ff27fafde583","size":8191,"noattachment":false,"key":"/hamljs/-/hamljs-0.5.0.tgz","tarball":"http://registry.cnpm.dingdandao.com/hamljs/download/hamljs-0.5.0.tgz"},"publish_time":1299256966184,"maintainers":[{"name":"saschagehlich","email":""},{"name":"tjholowaychuk","email":"tj@vision-media.ca"}],"_hasShrinkwrap":false,"_cnpm_publish_time":1299256966184,"_cnpmcore_publish_time":"2021-12-16T18:26:14.134Z"}},"readme":"# Haml.js\n\n  High performance JavaScript [Haml](http://haml-lang.com) implementation for [nodejs](http://nodejs.org)\n\n  For a higher quality implementation you may want to look at my [Jade](http://jade-lang.com) template engine,\n  however the syntax is slightly different. Jade's engine may be back-ported to haml.js in the future.\n  \n  [![Build Status](https://travis-ci.org/visionmedia/haml.js.png?branch=master)](https://travis-ci.org/visionmedia/haml.js)\n\n## Installation\n\n      $ npm install hamljs\n\n      node> require('hamljs')\n\n## Express\n\n To use with [Express](http://expressjs.com) and the .haml extension, simply register the engine:\n\n     app.engine('.haml', require('hamljs').renderFile);\n\n## About\n\n  Benchmarks rendering the same 21 line haml file located at _benchmarks/page.haml_,\n  shows that this library is nearly **65%** or **3 times** faster than haml-js.\n\n      Winner: haml.js\n      Compared with next highest (haml-js), it's:\n      65.39% faster\n      2.89 times as fast\n      0 order(s) of magnitude faster\n\n  Haml.js attempts to comply with the original [Haml](http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html)\n  implementation as well as possible. There are no magic \"plugins\" like\n  found in other JavaScript haml implementations, for example the following\n  will work just fine:\n\n    - if (items)\n      %ul\n        - for (var i = 0; i < items.length; ++i)\n          %li= items[i]\n\n  Iteration is the one exception to these magical plugins,\n  since this is **ugly** in JavaScript, you may also:\n\n    - if (items)\n      %ul\n        - each item in items\n          %li= item\n\n## Tags\n\n    %div text\n\nhtml:\n\n    <div>text</div>\n\n## Classes\n\n    %div.article.first\n      article text here\n      and here\n\nhtml:\n\n    <div class=\"article first\">\n      article text here and here\n    </div>\n\n## Div Class Shortcut\n\n    .comment hey\n\nhtml:\n\n    <div class=\"comment\">hey</div>\n\n## Div Id Shortcut\n\n    #article-1 foo\n\nhtml:\n\n    <div id=\"article-1\">foo</div>\n\n## Combining Ids and Classes\n\nYou may chain id and classes in any order:\n\n    .article#first.summary content\n\nhtml:\n\n    <div id=\"first\" class=\"article summary\">content</div>\n\n## Attributes\n\n    %a{ href: 'http://google.com', title: 'Google It' } Google\n\nhtml:\n\n    <a href=\"http://google.com\" title=\"Google It\">Google</a>\n\nAttribute keys such as \"for\" are automatically quoted\nby haml.js, so instead of:\n\n    %label{ 'for': 'something' }\n\nyou should:\n\n    %label{ for: 'something' }\n\nwhich will render:\n\n    <label for=\"something\"></label>\n\n## Boolean Attributes\n\n    %input{ type: 'checkbox', checked: true }\n\nhtml:\n\n    <input type=\"checkbox\" checked=\"checked\"/>\n\n## Combining Attributes, Ids, and Classes\n\nWemay also contain id and classes before or after:\n\n    %a.button{ href: 'http://google.com', title: 'Google It' }.first Google\n\nhtml:\n\n    <a href=\"http://google.com\" title=\"Google It\" class=\"button first\">Google</a>\n\n## Code\n\nCode starting with a hyphen will be executed but\nnot buffered, where as code using the equals sign\nwill be buffered:\n\n    - a = 1\n    - b = 2\n    = a + b\n\nhtml:\n\n    3\n\nHTML buffered with equals sign will **always** be escaped:\n\n    = \"<br/>\"\n\nhtml:\n\n    &lt;br/&gt;\n\nTo prevent escaping of HTML entities we can use _!=_:\n\n    != \"<br/>\"\n\nhtml:\n\n    <br/>\n\n## Iteration\n\n    %ul\n      - each item in items\n        %li= item\n\nhtml:\n\n    <ul>\n      <li>one</li>\n      <li>two</li>\n      <li>three</li>\n    </ul>\n\nIf you require the key or index of the object\nor array during iteration simple append a comma\nfollowing another id:\n\n    %ul\n      - each item, index in items\n        %li= item + '(' + index + ')'\n\nhtml:\n\n    <ul>\n      <li>one(0)</li>\n      <li>two(1)</li>\n      <li>three(2)</li>\n    </ul>\n\n## Doctypes\n\nDefaults to transitional:\n\n    !!!\n\nhtml:\n\n    <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n\nOptionally pass a supported doctype name:\n\n    !!! strict\n\nhtml:\n\n    <!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">\n\ncurrently supported doctypes, which can be\nextended simply by adding values to to _haml.doctypes_.\n\n    '5': '<!DOCTYPE html>',\n    'xml': '<?xml version=\"1.0\" encoding=\"utf-8\" ?>',\n    'default': '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">',\n    'strict': '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Strict//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd\">',\n    'frameset': '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Frameset//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd\">',\n    '1.1': '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.1//EN\" \"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd\">',\n    'basic': '<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML Basic 1.1//EN\" \"http://www.w3.org/TR/xhtml-basic/xhtml-basic11.dtd\">',\n    'mobile': '<!DOCTYPE html PUBLIC \"-//WAPFORUM//DTD XHTML Mobile 1.2//EN\" \"http://www.openmobilealliance.org/tech/DTD/xhtml-mobile12.dtd\">'\n\n## String interpolation\n\n    %div Hello #{world}\n\nwith locals:\n\n    { world: \"World!\" }\n\nhtml:\n\n    <div>Hello World!</div>\n\n## :cdata\n\n    %script\n      :cdata\n        foo\n\nhtml:\n\n    <script><![CDATA[\n    foo\n    ]]></script>\n\n## :javascript\n\n    %head\n      :javascript\n        if (foo)\n          if (bar)\n            alert('baz')\n\nhtml:\n\n    <head>\n      <script type=\"javascript\">\n      //<![CDATA[\n      if (foo)\n        if (bar)\n          alert('baz')\n      //]]>\n      </script>\n    </head>\n\n## Extending Haml\n\n### Adding Filters\n\n    var haml = require('hamljs')\n    haml.filters.my_filter = function(str) {\n      return doSomethingWith(str)\n    }\n\nby registering the filter function _my_filter_ we can now\nutilize it within our Haml templates as shown below:\n    %p\n      :my_filter\n        some text\n        here yay\n        whoop awesome\n\n### Adding Doctypes\n\n    var haml = require('hamljs')\n    haml.doctypes.foo = '<!DOCTYPE ... >'\n\nWill now allow you to:\n    !!! foo\n\n## License\n\n(The MIT License)\n\nCopyright (c) 2011 TJ Holowaychuk &lt;tj@vision-media.ca&gt;\n\nPermission is hereby granted, free of charge, to any person obtaining\na copy of this software and associated documentation files (the\n'Software'), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be\nincluded in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","_attachments":{},"homepage":"https://github.com/visionmedia/haml.js","bugs":{"url":"https://github.com/visionmedia/haml.js/issues"}}