{"_id":"walrus","_rev":"33-63d88246487f03ab71b36a22d4a7852c","name":"walrus","description":"A bolder kind of mustache.","dist-tags":{"latest":"0.10.1"},"versions":{"0.1.1":{"author":{"name":"Jeremy Ruppel"},"name":"walrus","description":"A bolder kind of mustache.","version":"0.1.1","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":"~v0.4.1"},"main":"./lib/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.10.2","should":"0.5.1","ejs":"0.6.1","coffee-script":"1.2.0","uglify-js":"1.2.5"},"scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.1.1","_engineSupported":false,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"0bdae8f483d402f14fe9e97d796658a19aeae0ea","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.1.1.tgz","integrity":"sha512-hWGE7BmMhVD3lc8RkfBHdrruHVO1ffnKcMf47zRYptVPLIJCaE9ciLtDxAt/uOkD2BdbX9UmFKLdh296ApPk0A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDNk6VC91dVUpmCwpnaXbI6TxNG8XFEnofHA/OmYnYSlwIhAKtavYk3HHl3e5wedWvS1SaHIo6MxrVLzPy1qZCyRNF6"}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}],"directories":{}},"0.4.4":{"author":{"name":"Jeremy Ruppel"},"name":"walrus","description":"A bolder kind of mustache.","version":"0.4.4","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":"~v0.4.1"},"main":"./lib/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.10.2","should":"0.5.1","ejs":"0.6.1","coffee-script":"1.2.0","uglify-js":"1.2.5"},"scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.4.4","_engineSupported":false,"_npmVersion":"1.0.106","_nodeVersion":"v0.6.8","_defaultsLoaded":true,"dist":{"shasum":"9007ce27310237a9b4055033fe5a5eb24c082f08","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.4.4.tgz","integrity":"sha512-OsKb/uriErY0uO6IGHTNa0HZ2CpFPtY8SmGLLS9748txhlDqGte2fh9ESQOFFh5BtVWTKOF7SP6d0asuRRP2UQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDW1WhQb0z0cZJGcmyi3mvrXJkLPRHESQ3Sr4ABGOZ1MAiEAu0STS3OQSU47WUzVy83Q88spaaM/7ZP33/rYNfxNdFU="}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}],"directories":{}},"0.6.0":{"author":{"name":"Jeremy Ruppel"},"name":"walrus","description":"A bolder kind of mustache.","version":"0.6.0","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":"~v0.4.1"},"main":"./lib/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","should":"0.6.0","ejs":"0.6.1","coffee-script":"1.2.0","uglify-js":"1.2.5"},"scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.6.0","optionalDependencies":{},"_engineSupported":false,"_npmVersion":"1.1.10","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"0b954f2cec1649d56d663f9d3c00f947e07860d2","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.6.0.tgz","integrity":"sha512-Oiz9evTy3JW7AIwG2RsCtXEdxuuYzXF5hYUl/vxlc1RpG3D2uR9HuhtJpWqIaxRuaw4XOX+xm02XDMiqOrvahg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGJWktS0cBy4r5oeYBPSmhqjMpDWrU8TsWNA7EuPrMoSAiEAto8AMb2nyq0tXZ/pz7QJXSG919447muG+NZjUr8VI2Q="}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}],"directories":{}},"0.6.1":{"author":{"name":"Jeremy Ruppel"},"name":"walrus","description":"A bolder kind of mustache.","version":"0.6.1","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":"~v0.4.1"},"main":"./lib/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","should":"0.6.0","ejs":"0.6.1","coffee-script":"1.2.0","uglify-js":"1.2.5"},"scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.6.1","optionalDependencies":{},"_engineSupported":false,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"f9ac0d3c22f81f780ed314a5262405bb5715d3c4","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.6.1.tgz","integrity":"sha512-vNSUa9OGPfaidUXTRWwnP3JzCe3KznF5xip3COQXPoXDHCssOVM3RCH6vPW9k+vInihyiRUnEUYOjeWiyz3gKw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIFV/KUazwFjs2479zVS4GMGa6FOVXfDfaspX6fkGAVLiAiEA/z18IHVY//UqAmqIPaQ6seXcTLuwZ7eJBBXxXRn2xW8="}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}],"directories":{}},"0.7.0":{"author":{"name":"Jeremy Ruppel"},"name":"walrus","description":"A bolder kind of mustache.","version":"0.7.0","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":"~v0.4.1"},"main":"./lib/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","should":"0.6.0","ejs":"0.6.1","coffee-script":"1.2.0","uglify-js":"1.2.5"},"scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.7.0","optionalDependencies":{},"_engineSupported":false,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.13","_defaultsLoaded":true,"dist":{"shasum":"8a3bfe7b9d4bd1f6cd44767b8bc36e6764c6a2c3","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.7.0.tgz","integrity":"sha512-Jim0jSPxEGFOYFrt+432RFJrq3TOLTmcrq0S6a3qKd/dCBWPhqxIn5ISDUUNrZjYHrvNkraM+ponK0toyp0L8A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQxdjvPtRYSGHqB8Q2zlX5gwxfeLXWTOLg6RMm20cKXAIhAP/S+4AH1Z4n0x/GM2QmHJ5B8GmoWlgxCglT+maar2Dk"}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}],"directories":{}},"0.7.1":{"name":"walrus","author":{"name":"Jeremy Ruppel"},"contributors":[{"name":"Eddie Leffler"},{"name":"Curtis Steckel"}],"description":"A bolder kind of mustache.","version":"0.7.1","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":">= 0.6"},"keywords":["template","templating","mustache","handlebars","client side","action view"],"main":"./lib/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","should":"0.6.0","frosting":"0.3.7"},"license":"MIT","scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.7.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"1b8edabb97c89f1c7dda2f112456528d7eb52c52","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.7.1.tgz","integrity":"sha512-dxfq8yF/Eg70m5DfDfNgEwe05Wi543nxo96Y6oVV/zghEyFG9NEmSMYRUHVhSf989c3aWXJQe/v4ScJKRAQeIQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCID0EygIT6hi7/YFkjMqRdIyhpiipKEROQYckFG/b7B7XAiEA66nMLzN6LJlAakb2YMudahdhyiacuiDWJD+Z67YTN3I="}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}],"directories":{}},"0.7.2":{"name":"walrus","author":{"name":"Jeremy Ruppel"},"contributors":[{"name":"Eddie Leffler"},{"name":"Curtis Steckel"}],"description":"A bolder kind of mustache.","version":"0.7.2","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":">= 0.6"},"keywords":["template","templating","mustache","handlebars","client side","action view"],"main":"./lib/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","should":"0.6.0","frosting":"0.3.7"},"license":"MIT","scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.7.2","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"92013942a7c9a33841d9546eaae8c5e4411b2930","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.7.2.tgz","integrity":"sha512-QKIbZ42L1Mb1E9NIVUGTSYMM2b2mQta8BuuKcNgnTII3DJe6i5V/IR8f5PMBHG16sw0P6gY5fvHsJyB3cgP0ag==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD7jNRaBOnzDOZ/DVKYrUvDk/TitGxRogHG3NPR/1gbgwIhAPC5HZbDcRzlozDI8jSt9pQOvNsSI3y9UAG5eXRF5k7K"}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}],"directories":{}},"0.8.0":{"name":"walrus","author":{"name":"Jeremy Ruppel"},"contributors":[{"name":"Eddie Leffler"},{"name":"Curtis Steckel"}],"description":"A bolder kind of mustache.","version":"0.8.0","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":">= 0.6"},"keywords":["template","templating","mustache","handlebars","client side","action view"],"main":"./lib/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","should":"0.6.0","frosting":"0.3.7"},"license":"MIT","scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.8.0","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"13e74d03243fc2bbc48fccc66152712e2021b094","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.8.0.tgz","integrity":"sha512-pSi3a69KEnExaQC25NjSbYfvxKuQmoWng1kqDVGhMyJNjJhhJS4JQ6Upe7urfnGGZ3DGyOqiIc13xAo6eCzC3g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCICUr5/JIeSSZrvWVc5aTL9ieRUQBO3sxUugHIk3s9gVYAiBlVWjj0w60aU/Qig1Ur9oGOtQ2gNa6q8BX/Uuxjb/iaw=="}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}],"directories":{}},"0.8.2":{"name":"walrus","author":{"name":"Jeremy Ruppel"},"contributors":[{"name":"Eddie Leffler"},{"name":"Curtis Steckel"}],"description":"A bolder kind of mustache.","version":"0.8.2","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":">= 0.6"},"keywords":["template","templating","mustache","handlebars","client side","action view"],"main":"./bin/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","should":"0.6.0","frosting":"0.3.7"},"license":"MIT","scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.8.2","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"f4cc685fdf9cc990d18be30b175b7d16a644b63c","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.8.2.tgz","integrity":"sha512-82VWJJdB4Th25nVtEQ/0NHNDGY/r7/MnANgu9WvHwYn9WO7TI33WpxQOsNcYUTPihAua9dyQuVN9LezxuMq5QQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDzJeuJzswdxjEFuXhZXgSjQLko9zN2+F4Asi3P/ulSHQIhAMVf3ZA950uIbM0fPSN9FXd8lj/wqVDyyTGj2vq3h1wB"}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}]},"0.8.3":{"name":"walrus","author":{"name":"Jeremy Ruppel"},"contributors":[{"name":"Eddie Leffler"},{"name":"Curtis Steckel"},{"name":"Grant Klinsing"}],"description":"A bolder kind of mustache.","version":"0.8.3","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":">= 0.6"},"keywords":["template","templating","mustache","handlebars","client side","action view"],"main":"./bin/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","should":"0.6.0","frosting":"0.3.7"},"license":"MIT","scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.8.3","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"29af96b02ceaede6ee9e979af3ce88a2d8fe12ee","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.8.3.tgz","integrity":"sha512-x/trmHL93CyAfzV9kiUZVt8/ZWkW9S/YJ+gs1yZDWWWOKeYvIr056k/pyUmgKuLr8/gKZ+JgMzJCiK7E80Ofmg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIE02CNdFfcOvZaJvESkf+C083d27EV7x1Kt9Vw1xRmWEAiBZA+TMU9IE2MaKQgSJ+XEZkSchXyrHNARDSIXJfjOf6g=="}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}]},"0.9.0":{"name":"walrus","author":{"name":"Jeremy Ruppel"},"contributors":[{"name":"Eddie Leffler"},{"name":"Curtis Steckel"},{"name":"Grant Klinsing"}],"description":"A bolder kind of mustache.","version":"0.9.0","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":">= 0.6"},"keywords":["template","templating","mustache","handlebars","client side","action view"],"main":"./bin/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","should":"0.6.0","frosting":"0.3.7"},"license":"MIT","scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.9.0","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.6.15","_defaultsLoaded":true,"dist":{"shasum":"b1cbd8eacd0df8dc48c0d303df1606255955a7e6","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.9.0.tgz","integrity":"sha512-kfWxCzUIRtPqSmgrJ/HpgRC7gdrWGsDuEMTtWKl3YI9TEloxHu+ihZp1QATG/34FHCi6ZkSwDSE1eVzft7hjBA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCRnNnZ/CSbiw+wUTq8qAn0ldEmzqbj9DUm6FXoHpMzkAIgNkfEDXxEDyonQhmDzAkOKRoUjfyFR2hHBvDCaZj9tns="}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}]},"0.9.1":{"name":"walrus","author":{"name":"Jeremy Ruppel"},"contributors":[{"name":"Eddie Leffler"},{"name":"Curtis Steckel"},{"name":"Grant Klinsing"}],"description":"A bolder kind of mustache.","version":"0.9.1","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":">= 0.6"},"keywords":["template","templating","mustache","handlebars","client side","action view"],"main":"./bin/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","chai":"1.1.1","frosting":"0.3.7"},"license":"MIT","scripts":{"test":"mocha"},"_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"_id":"walrus@0.9.1","optionalDependencies":{},"_engineSupported":true,"_npmVersion":"1.1.9","_nodeVersion":"v0.8.2","_defaultsLoaded":true,"dist":{"shasum":"b5dde6e72dd4ba6b6c98add28118b5e54bcf472f","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.9.1.tgz","integrity":"sha512-IREKAIxXjcLgNCN8+NT4HIQ7mbgLrCyDSmI7f5okhQFf5+PC2FwN+G1E7jz7/bNE2NLyr90a7PyUJhFJaJHvew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIA038K+cuxp5YYBcBv8Pi/lvMHzeOFFw/Fxb5RVgsuRJAiBjipqzQp8cCAnsel7oDx991gF3+SnqbIbIGt1VLJEaEA=="}]},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}]},"0.10.1":{"name":"walrus","author":{"name":"Jeremy Ruppel"},"contributors":[{"name":"Eddie Leffler"},{"name":"Curtis Steckel"},{"name":"Grant Klinsing"}],"description":"A bolder kind of mustache.","version":"0.10.1","repository":{"url":"https://github.com/jeremyruppel/walrus"},"engines":{"node":">= 0.6"},"keywords":["template","templating","mustache","handlebars","client side","action view"],"main":"./bin/walrus","dependencies":{},"devDependencies":{"jison":"0.3.2","mocha":"0.14.1","chai":"1.1.1","frosting":"0.3.7"},"license":"MIT","scripts":{"test":"mocha"},"readme":"# Walrus\n\nA bolder kind of mustache.\n\n[![Build Status](https://secure.travis-ci.org/jeremyruppel/walrus.png)](http://travis-ci.org/jeremyruppel/walrus)\n\nView this readme on [documentup](http://documentup.com/jeremyruppel/walrus).\n\n## About\n\n**Walrus** is a templating library inspired by [mustache][mustache], [handlebars][handlebars], [ejs][ejs] and friends,\nbut with a couple of important differences in philosophy and style:\n\n- **View logic is different than business logic (and that's okay!).**\n\tIn modern web apps, there's often a good amount of presentation logic involved. This logic doesn't belong\n\tin your application code, your backbone models, or anywhere else but the presentation layer. The templating\n\tlanguage is a good place to put this.\n\n- **Reusable view helpers are super fun and helpful.**\n\tRails had the right idea by shipping a bunch of view helpers with ActionView. Having commonly used view helpers\n\tcome bundled with the framework keeps developers from spending time writing them (and testing them, or even worse,\n\t_not testing them_) again and again.\n\n- **Keep the core library light.**\n\tWhile **walrus** ships with a bunch of filters and helpers you can use out-of-the-box, only the essentials\n\tare included in the core. This keeps client-side code as small as it can be, letting you opt-in to extras\n\tonly as often as you need them. To extend **walrus** with new filters and helpers, just include the\n\tjavascript you want and you're done, son.\n\n- **Stop hashing and slashing.**\n\tMaybe it's just me, but opening and closing blocks with \"hash-something\" \"slash-something\" feels super redundant.\n\tWalrus uses do/end for its blocks, which should look a lot more familiar to ruby types.\n\nThe **walrus** parser is written in [jison][jison] and the rest in [coffeescript][coffeescript], and everything\nis tested with [mocha][mocha]. **Walrus has no runtime dependencies.**\n\nSince **walrus** is still pretty young, expect changes in the API, especially for filters and helpers.\n\nThe `/test/examples` directory is filled with plenty of self-documenting examples that comprise over half of\nthe test suite, so give those a once-over if you have a question that isn't answered in the readme.\n\n## Core\n\nThe **walrus** core contains the walrus parser/compiler, several common helpers and filters, and a few internal utility methods.\n\n### Usage in JavaScript\n\nLike other [jison][jison]-based parsers, templating with **walrus** is a two-step process.\n\nFirst, grab your template and parse it:\n\n``` js\nvar template = Walrus.Parser.parse( $( '#my-template' ).html( ) );\n```\n\n`template` is a JavaScript object ready to accept a view object and kick out some text.\n\n``` js\nvar htmlGoodness = template.compile( { data : 'foo bar baz' } );\n```\n\n### Paths\n\nLike some of the other templating solutions out there, Walrus will let you reference members using object paths.\n\nIf your view object is:\n\n``` json\n{\n\t\"hello\" :\n\t{\n\t\t\"walrus\" : \"sweeet.\"\n\t}\n}\n```\n\nThen `{{hello.walrus}}` will resolve to `sweeet.`.\n\n### Root References (all day erryday)\n\nWith Walrus, you can always reference the root view object as a path context by using the `@` symbol before your path.\nUse this even if you're dereferenced, iterating, or even within the arguments to a method.\n\nSo if you've got a view object like:\n\n``` json\n{\n\t\"team\" : \"Detroit Red Wings\",\n\t\"players\" :\n\t[\n\t\t{\n\t\t\t\"name\" : \"Pavel Datsyuk\"\n\t\t},\n\t\t{\n\t\t\t\"name\" : \"Nicklas Lidström\"\n\t\t},\n\t\t{\n\t\t\t\"name\" : \"Darren Helm\"\n\t\t}\n\t]\n}\n```\n\nYou can create your badass hockey roster like:\n\n``` html\n<ul>\n\t{{:each players do}}\n\t<li>{{name}} plays for the {{@team}}</li>\n\t{{end}}\n</ul>\n```\n\n### (Un-)Escaping\n\nLike many other mustache-like languages, **walrus** escapes string members by default in an attempt\nto get rid of HTML-unsafe characters.\n\nIf you want these characters included, use an equals sign before your expression, like: `{{=html}}`.\n\n### Methods\n\nOne of the main focuses of Walrus is to treat methods on your view object like first-class citizens. You can\ncall your methods with any number of arguments from the view object or (most) javascript literals.\n\nWith a view object like:\n\n``` js\n{\n\t\"captitalize\" : function( str ){ return str.charAt( 0 ).toUpperCase( ) + str.slice( 1 ); },\n\t\"city\" : \"detroit\"\n}\n```\n\nIt's as easy as `{{capitalize( city )}}`.\n\n> Note that since both of these members are at the root of the view object, you could also reference them like\n> `{{@capitalize( @city )}}`, or any combination of local or root references.\n\n## Core Blocks/Helpers\n\nIn Walrus, blocks don't look like the `#member`/`/member` hash/slash pairs we've seen elsewhere. Walrus looks\na lot more like ruby and uses a simpler `do`/`end` idiom.\n\nEach block has a helper, preceded by `:`, that tells you what the block does. Walrus ships with a basic set of\nthese built in.\n\n### :if and :unless\n\nConditionals can be represented by `:if` and `:unless` blocks. Both of these test the expression for truthiness\nor falsiness respectively.\n\n``` html\n{{:if @loggedIn do}}\n<p>Welcome back, {{@username}}!</p>\n{{end}}\n\n{{:unless @loggedIn do}}\n<p>I don't believe we've met!</p>\n{{end}}\n```\n\n### :each\n\n`:each` can be used to iterate over a collection.\n\n``` html\n{{:each @player do}}\n<li>{{name}}</li>\n{{end}}\n```\n\n> While in an `:each` block, you can use the following special variables:\n>\n> **$index** provides the index of the current item in the collection\n>\n> **$length** provides the length of the collection\n>\n>\t**$parent** provides access to the parent object of the collection\n>\n> Like several other templating solutions, you can implicitly iterate over a collection of values, like strings, and template in the current value with `{{.}}`.\n\n### :with\n\n`:with` can be used to force a change in context if you don't want to use tons of object paths.\n\n``` html\n{{:with @team.captain do}}\n<p>Captain: {{name}}</p>\n{{end}}\n```\n\n> While in a `:with` block, you can use the following special variables:\n>\n> **$parent** provides access to the parent object of the context\n\n## Core Filters\n\nWalrus also supports the concept of filters, which look a lot like filters you might have used in [liquid][liquid] or [ejs][ejs] templates.\n\nFilters also are preceded by `:`, but come after the main expression separated by a pipe, like `{{name | :upcase}}`.\n\nFilters can be chained together, separated by whitespace. Filters can be used with block helpers or in a standalone expression.\n\n### :equals\n\n`:equals` tests the expression for strict equality. This is most useful with the conditional block helpers.\n\n``` html\n{{:if status | :equals( 'pending' ) do}}\n<p>We're still working on it.</p>\n{{end}}\n```\n\n### :if\n\nReturns the expression if _condition_ is truthy, or nothing if _condition_ is falsy.\n\nParameters:\n\n\tcondition - the condition to test against\n\nUsage:\n\n\t{{ 'active' | :if( true ) }} <!-- \"active\" -->\n\n### :unless\n\nReturns the expression if _condition_ is falsy, or nothing if _condition_ is truthy.\n\nParameters:\n\n\tcondition - the condition to test against\n\nUsage:\n\n\t{{ 'active' | :unless( true ) }} <!-- \"\" -->\n\n### :or\n\n`:or` can be used to provide a default or fallback value if a member doesn't exist on your view object.\n\n``` html\n<h2>{{price | :or( 'N/A' )}}</h2>\n```\n\n### :log\n\n`:log` is a helper method for developers that simply passes its argument to the console.\n\n``` html\nYou can log a {{@member | :log}} of the view object,\nwhile {{. | :log}} will log the whole thing,\nand {{\"arbitrary literals\" | :log}} can be logged, too!\n```\n\n### :as\n\nDecorates a view object or collection of view objects with custom domain methods.\n\nParameters:\n\n\tname - The key for the object on `Walrus.Domain` to decorate with\n\nUsage:\n\nFirst, define some custom domain methods:\n\n``` js\nWalrus.Domain.person = { fullName : function( ){ return this.firstName + ' ' + this.lastName; } };\n```\n\nThen, selectively apply those to your view object at template-time:\n\n``` html\n<ul>\n\t{{:each employee | :as( 'person' ) do}}\n\t<li>{{fullName}}</li>\n\t{{do}}\n</ul>\n```\n\n## Walrus.Collections\n\n`walrus.collections` contains helpers and filters that are useful when working with arrays.\n\n### :first\n\nSelects the first _count_ items of the array. Defaults to only the first item.\n\nParameters:\n\n\tcount - Optional: how many items to include\n\nUsage:\n\n``` html\n{{ :each numbers | :first do }}\n\t<!-- 1 -->\n{{ end }}\n\n{{ :each numbers | :first( 5 ) do }}\n\t<!-- 1 2 3 4 5 -->\n{{ end }}\n```\n\n### :last\n\nSelects the last _count_ items of the array. Defaults to only the last item.\n\nParameters:\n\n\tcount - Optional: how many items to include\n\nUsage:\n\n``` html\n{{ :each numbers | :last do }}\n\t<!-- 10 -->\n{{ end }}\n\n{{ :each numbers | :last( 5 ) do }}\n\t<!-- 6 7 8 9 10 -->\n{{ end }}\n```\n\n### :after\n\nSelects all of the items in the array except for the first _count_.\n\nParameters:\n\n\tcount - how many items to omit from the beginning\n\nUsage:\n\n``` html\n{{ :each numbers | :after( 3 ) do }}\n\t<!-- 4 5 6 7 8 9 10 -->\n{{ end }}\n```\n\n### :before\n\nSelects all of the items in the array except for the last _count_.\n\nParameters:\n\n\tcount - how many items to omit from the end\n\nUsage:\n\n``` html\n{{ :each numbers | :before( 3 ) do }}\n\t<!-- 1 2 3 4 5 6 7 -->\n{{ end }}\n```\n\n### :count\n\nReturns the length of the given array.\n\nParameters: none\n\nUsage:\n\n``` html\nvar numbers = [ 1, 2, 3, 4, 5 ];\n\n{{ numbers | :count }} <!-- 5 -->\n```\n\n### :any\n\nReturns true if the array is not empty. Opposite of `:empty`.\n\nParameters: none\n\nUsage:\n\n``` html\nvar numbers = [ 1, 2, 3, 4, 5 ];\n\n{{ numbers | :any }} <!-- true -->\n```\n\n### :empty\n\nReturns true of the array is empty. Opposite of `:any`.\n\nParameters: none\n\nUsage:\n\n``` html\nvar numbers = [ 1, 2, 3, 4, 5 ];\n\n{{ numbers | :empty }} <!-- false -->\n```\n\n### :in_groups_of\n\nSplits the given array into sub-arrays with at most `count` items apiece\n\nParameters:\n\n  count - the number of items to be placed in each group\n\nUsage:\n\n``` html\nvar numbers = [ 1, 2, 3, 4, 5 ];\n\n{{ :each numbers | :in_groups_of( 3 ) }}  <!-- [ [ 1, 2, 3 ], [ 4, 5 ] ] -->\n```\n\n## Walrus.Currencies\n\n`walrus.currencies` contains helpers and filters that are useful when working with dolla bills.\n\n### :currency\n\nReturns a string formatted in the current locale's format.\nDelegates to [accounting.js](http://josscrowcroft.github.com/accounting.js/) if present.\n\nParameters:\n  symbol - (Optional) the currency symbol to use\n\tprecision - (Optional) the decimal place level to show cents\n\tdecimal - (Optional) the character used to delimit decimals\n\tthousand - (Optional) the character used to delimit thousands\n\nUsage:\n\n\t{{ 36000 | :currency }} // => $36,000.00\n\t{{ 36000 | :currency( '$', 0 ) }} // => $36,000\n\n## Walrus.Dates\n\n`walrus.dates` contains helpers and filters that are useful when working with dates or timestamps.\n\n### :strftime\n\nFormats a date into the string given by `format`. Accepts any value that can be passed to `new Date( )`.\n\nParameters:\n\n\tformat - The format string, according to these tokens, taken directly from `man 3 strftime` (with some omissions):\n\n\t%A\t\tis replaced by national representation of the full weekday name.\n\n\t%a\t\tis replaced by national representation of the abbreviated weekday name.\n\n\t%B\t\tis replaced by national representation of the full month name.\n\n\t%b\t\tis replaced by national representation of the abbreviated month name.\n\n\t%D\t\tis equivalent to ``%m/%d/%y''.\n\n\t%d\t\tis replaced by the day of the month as a decimal number (01-31).\n\n\t%e\t\tis replaced by the day of month as a decimal number (1-31); single digits are\n\t\t\t\tpreceded by a blank.\n\n\t%F\t\tis equivalent to ``%Y-%m-%d''.\n\n\t%H\t\tis replaced by the hour (24-hour clock) as a decimal number (00-23).\n\n\t%I\t\tis replaced by the hour (12-hour clock) as a decimal number (01-12).\n\n\t%k\t\tis replaced by the hour (24-hour clock) as a decimal number (0-23); single dig-\n\t\t\t\tits are preceded by a blank.\n\n\t%l\t\tis replaced by the hour (12-hour clock) as a decimal number (1-12); single dig-\n\t\t\t\tits are preceded by a blank.\n\n\t%M\t\tis replaced by the minute as a decimal number (00-59).\n\n\t%m\t\tis replaced by the month as a decimal number (01-12).\n\n\t%n\t\tis replaced by a newline.\n\n\t%p\t\tis replaced by national representation of either \"ante meridiem\" or \"post meri-\n\t\t\t\tdiem\" as appropriate.\n\n\t%R\t\tis equivalent to ``%H:%M''.\n\n\t%r\t\tis equivalent to ``%I:%M:%S %p''.\n\n\t%S\t\tis replaced by the second as a decimal number (00-60).\n\n\t%T\t\tis equivalent to ``%H:%M:%S''.\n\n\t%t\t\tis replaced by a tab.\n\n\t%U\t\tis replaced by the week number of the year (Sunday as the first day of the\n\t\t\t\tweek) as a decimal number (00-53).\n\n\t%u\t\tis replaced by the weekday (Monday as the first day of the week) as a decimal\n\t\t\t\tnumber (1-7).\n\n\t%v\t\tis equivalent to ``%e-%b-%Y''.\n\n\t%w\t\tis replaced by the weekday (Sunday as the first day of the week) as a decimal\n\n\t%X\t\tis replaced by national representation of the time.\n\n\t%x\t\tis replaced by national representation of the date.\n\n\t%Y\t\tis replaced by the year with century as a decimal number.\n\n\t%y\t\tis replaced by the year without century as a decimal number (00-99).\n\n\t%Z\t\tis replaced by the time zone name.\n\nUsage:\n\n\t{{created_at | :strftime( '%F' )}} <!-- 2012-02-10 -->\n\n### :time_ago_in_words\n\nReturns a human-readable relative time phrase from the given date.\nHeavily adapted from the [ActionPack][actionpack] method of the same name.\n\nParameters:\n\n\tincludeSeconds - (Optional) whether or not to include results for less than one minute\n\nUsage:\n\n\t{{ created_at | :time_ago_in_words( true ) }} <!-- less than a minute -->\n\n## Walrus.Inflections\n\n`walrus.inflections` contains helpers and filters to help work with human-friendly text.\n\n### :pluralize\n\nPluralizes the given word, optionally based on a _count_, and also optionally including the count in the result.\nHeavily adapted from the [ActiveSupport][activesupport] method of the same name.\n\nParameters:\n\n\tword - the word to be pluralized\n\tcount - Optional: count to base pluralization on\n\tincludeCount - Optional: whether or not to include the count in the result\n\nUsage:\n\n\t{{ \"book\" | :pluralize }} <!-- books -->\n\n\t{{ \"book\" | :pluralize( 1 ) }} <!-- book -->\n\n\t{{ \"book\" | :pluralize( 5, true ) }} <!-- 5 books -->\n\n### :singularize\n\nSingularizes the given word. You're probably looking for `pluralize`.\nHeavily adapted from the [ActiveSupport][activesupport] method of the same name.\n\nParameters: none\n\nUsage:\n\n\t{{ \"books\" | :singularize }} <!-- book -->\n\n### :ordinalize\n\nTurns a number into an ordinal string, like 1st, 2nd, 3rd, etc...\nHeavily adapted from the [ActiveSupport][activesupport] method of the same name.\n\nParameters: none\n\nUsage:\n\n\t{{ 5 | :ordinalize }} <!-- 5th -->\n\n## Walrus.Math\n\n`walrus.math` contains helpers and filters to help work with numbers.\n\n### :plus\n\nReturns the sum of two numbers.\n\nParameters:\n\n\tnumber - the number to add to the expression\n\nUsage:\n\n\t{{ 15 | :plus( 6 ) }} <!-- 21 -->\n\n### :minus\n\nReturns the difference of two numbers.\n\nParameters:\n\n\tnumber - the number to subtract from the expression\n\nUsage:\n\n\t{{ 15 | :minus( 6 ) }} <!-- 9 -->\n\n### :gt\n\nReturns whether `value` is greater than the given number.\n\nParameters:\n\n\tnumber - the number to compare against\n\nUsage:\n\n\t{{ 15 | :gt( 5 ) }} <!-- true -->\n\n### :gte\n\nReturns whether `value` is greater than or equal to the given number.\n\nParameters:\n\n\tnumber - the number to compare against\n\nUsage:\n\n\t{{ 15 | :gte( 5 ) }} <!-- true -->\n\n### :lt\n\nReturns whether `value` is less than the given number.\n\nParameters:\n\n\tnumber - the number to compare against\n\nUsage:\n\n\t{{ 15 | :lt( 5 ) }} <!-- false -->\n\n### :lte\n\nReturns whether `value` is less than or equal to the given number.\n\nParameters:\n\n\tnumber - the number to compare against\n\nUsage:\n\n\t{{ 15 | :lte( 5 ) }} <!-- false -->\n\n### :floor\n\nReturns the given number rounded down to the nearest integer.\n\nParameters: none\n\nUsage:\n\n\t{{ 5.6 | :floor }} <!-- 5 -->\n\n### :ceil\n\nReturns the given number rounded up to the nearest integer.\n\nParameters: none\n\nUsage:\n\n\t{{ 5.6 | :ceil }} <!-- 6 -->\n\n### :round\n\nReturns the given number rounded to the nearest integer.\n\nParameters: none\n\nUsage:\n\n\t{{ 5.6 | :round }} <!-- 6 -->\n\n## Walrus.Strings\n\n`walrus.strings` contains helpers and filters to help work with strings.\n\n### :reverse\n\nReverses a string.\n\nParameters: none\n\nUsage:\n\n\t{{ \"hello\" | :reverse }} <!-- olleh -->\n\n### :downcase\n\nConverts a string to lowercase characters. Opposite of `:upcase`.\n\nParameters: none\n\nUsage:\n\n\t{{ \"HelLO!\" | :downcase }} <!-- hello! -->\n\n### :upcase\n\nConverts a string to uppercase characters. Opposite of `:downcase`.\n\nParameters: none\n\nUsage:\n\n\t{{ \"HelLO!\" | :upcase }} <!-- HELLO! -->\n\n### :squish\n\nRemoves all leading and trailing whitespace, then condenses any internal whitespace\ngroups to a single space each.\nHeavily adapted from the [ActiveSupport][activesupport] method of the same name.\n\nParameters: none\n\nUsage:\n\n\t{{ \" foo\t\tbar \\n baz\"\t | :squish }} <!-- foo bar baz -->\n\n### :truncate\n\nTruncates a string to the specified `length`, optionally breaking at a separator or\nproviding a custom string to denote an omission.\nHeavily adapted from the [ActiveSupport][activesupport] method of the same name.\n\nParameters:\n\n\tlength (int) - the number of characters to keep, at most\n\tseparator (string) - Optional: a specified string to break on\n\tomission (string) - Optional: a string to denote an omission\n\nUsage:\n\n\t{{ \"Once upon a time in a world far far away\" | :truncate( 27, ' ' ) }} <!-- Once upon a time in a... -->\n\n### :titleize\n\nCapitalizes all words within a string\n\nParameters: none\n\nUsage:\n\n\t{ \"man from the boondocks\" | :titleize }   // => \"Man From The Boondocks\"\n\t{ \"x-men: the last stand\" | :titleize }    // => \"X Men: The Last Stand\"\n\t{ \"TheManWithoutAPast\" | :titleize }       // => \"The Man Without A Past\"\n\t{ \"raiders_of_the_lost_ark\" | :titleize }  // => \"Raiders Of The Lost Ark\"\n\n## Mad Props\n\nIf Walrus isn't quite your style, one of these other fine looks might suit you:\n\n- [mustache][mustache]\n- [handlebars][handlebars]\n- [ejs][ejs]\n- [liquid][liquid]\n\nIn any case, walrus borrows ideas from each of them, so they're all worth checking out!\n\nMany of the filters in walrus are inspired or borrowed from [ActiveSupport][activesupport]. If walrus can\nbe half as helpful to developers as ActiveSupport has been, it'll be a great success.\n\n## Contributors\n\n- [Eddie Leffler](https://github.com/hershmire)\n- [Curtis Steckel](https://github.com/steckel)\n- [Grant Klinsing](https://github.com/kagd)\n\n## License\n\nWalrus is released under the MIT license.\n\n[handlebars]: https://github.com/wycats/handlebars.js\n[mustache]: https://github.com/janl/mustache.js\n[ejs]: https://github.com/visionmedia/ejs\n[liquid]: http://liquidmarkup.org/\n[jison]: http://zaach.github.com/jison/\n[coffeescript]: http://coffeescript.org/\n[mocha]: http://visionmedia.github.com/mocha/\n[activesupport]: http://as.rubyonrails.org/\n[actionpack]: https://github.com/rails/rails/tree/master/actionpack\n","_id":"walrus@0.10.1","dist":{"shasum":"6d1227eb01294c1c7c6595195b4726786cbdcb9b","tarball":"https://registry.npmjs.org/walrus/-/walrus-0.10.1.tgz","integrity":"sha512-qdt+RfWCTWqyi1gYtgkQrbrlU3lqWtr0dhWEdDz25MDewJQpGn4mdSmnkSBBqdnq4vm0LHPpvicstoZ1MGYnaA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIE4wGKx5vhcUzg1Asr9NGmfgdb+fZ7QRkUQ6/Ypo4iU5AiEAqFWasLKZLR2oDrw/v7r+xIHFRY2cjZq5BzBv6DnoZ+w="}]},"_npmVersion":"1.1.59","_npmUser":{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"},"maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}]}},"readme":"Walrus\n======\n\n[![Build Status](https://secure.travis-ci.org/jeremyruppel/walrus.png)](http://travis-ci.org/jeremyruppel/walrus)\n\nGoal\n----\n\n- Write a mustache templating language that fits more with the idea of view-objects as opposed to view-helpers\n- Support method helpers fully. This means:\n\t- (Semi)-Automatic invocation.\n\t- \"Write what you mean\" when it comes to functions.\n\t- Multiple arguments\n\t- Arguments may be primitive types\n\t- Ability to add in custom domain methods at the view object level (how do we do this?)\n\t- Still support helper methods and block helpers, but put the helper methods where they make the most sense\n- Support object paths like handlebars does\n- Make it easy to traverse back up to root, and to read as such\n\n- More to come...\n\nIdeas\n-----\n\n- `@` means `this`, like in coffeescript. This makes it easy to reference the root object context from anywhere.\n- `do`/`end` style blocks make more sense than `#` and `/` to me\n\nFilter Packages\n---------------\n\n- walrus.string: capitalization, casing, hyphenization, etc\n- walrus.inflection: pluralization, etc\n- walrus.date: date formatting\n- walrus.domain: bring raw json objects into the client domain (perhaps theres a better name for this)\n","maintainers":[{"name":"jeremyruppel","email":"jeremy.ruppel@gmail.com"}],"time":{"modified":"2022-06-28T21:38:54.485Z","created":"2012-02-03T07:35:00.049Z","0.1.1":"2012-02-03T07:35:01.639Z","0.4.4":"2012-02-11T17:49:37.772Z","0.6.0":"2012-03-27T17:32:52.269Z","0.6.1":"2012-04-23T17:08:56.771Z","0.7.0":"2012-05-10T06:22:38.842Z","0.7.1":"2012-06-25T17:33:27.262Z","0.7.2":"2012-06-25T18:32:20.756Z","0.8.0":"2012-06-28T18:20:50.382Z","0.8.2":"2012-07-09T15:28:10.174Z","0.8.3":"2012-07-10T03:16:04.535Z","0.9.0":"2012-07-10T04:43:29.210Z","0.9.1":"2012-07-17T18:42:05.544Z","0.10.1":"2012-09-27T19:48:42.878Z"},"author":{"name":"Jeremy Ruppel"},"repository":{"url":"https://github.com/jeremyruppel/walrus"}}