{"name":"nitro-template","version":"0.1.2","description":"powerful javascript template engine","main":"template.js","repository":{"type":"git","url":"git+ssh://git@github.com/nitrojs/nitro-template.git"},"keywords":["javascript","nitro","demo"],"author":{"name":"Jesús Manuel Germade Castiñeiras","email":"jesus@germade.es"},"license":"MIT","bugs":{"url":"https://github.com/nitrojs/nitro-template/issues"},"homepage":"https://github.com/nitrojs/nitro-template","devDependencies":{"assert":"^1.3.0","jasmine":"^2.1.1","jasmine-core":"^2.1.3","karma":"^0.12.28","karma-chrome-launcher":"^0.1.7","karma-firefox-launcher":"^0.1.4","karma-jasmine":"^0.3.2","mocha":"^2.3.3"},"scripts":{"test":"grunt test","posttest":"grunt uglify:min"},"gitHead":"a79cc1b2f3009b1e59aad4e2e2de6f2321afacb0","_id":"nitro-template@0.1.2","_shasum":"7fbfc70fd9b3e968c524be0c748392fcbfeabd57","_from":".","_npmVersion":"2.11.3","_nodeVersion":"0.12.7","_npmUser":{"name":"jgermade","email":"jesus@germade.es"},"dist":{"shasum":"7fbfc70fd9b3e968c524be0c748392fcbfeabd57","tarball":"http://registry-npm.ywwl.com/nitro-template/download/nitro-template-0.1.2.tgz","integrity":"sha512-kWleJW+8n6mID1QOHvwi3wTphREGIkmpVLoEks/8EAcE8aSj2gI97XhOncgCEjmcOoPBUn+qn80AWCq3FBCeGQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDbZl6tvVnD2IxTmcagH4mOfKAD2QJ2LGBiICYpAyXRnQIhAIedY6wTVPQLq5kv2V7pFK7q//zLZHKuIrb5vs5GF76e"}],"size":5722,"noattachment":false,"key":"/nitro-template/-/nitro-template-0.1.2.tgz"},"maintainers":[{"name":"jgermade","email":"jesus@germade.es"}],"readme":"nitro-template [![wercker status](https://app.wercker.com/status/281f306e7157005f0a21b770fbb81086/s \"wercker status\")](https://app.wercker.com/project/bykey/281f306e7157005f0a21b770fbb81086)\n=============================\n[![npm version](https://badge.fury.io/js/nitro-template.svg)](http://badge.fury.io/js/nitro-template)\n[![Build Status](https://travis-ci.org/nitrojs/nitro-template.svg?branch=master)](https://travis-ci.org/nitrojs/nitro-template)\n\nInstallation\n------------\n```.sh\nnpm install nitro-template --save\n```\n\nUsage\n-----\n```.js\nvar data = {\n  foo: 'bar',\n  crash: {\n    test: 'dummy'\n  },\n  list: ['foo', 'bar', 'foobar'],\n  map: {\n    hi: 'all',\n    bye: 'nobody'\n  }\n};\n\ntemplate.put('partial-map', '$each{ item,key in map }[${foo}:${key}:${item}]{/}');\n\ntemplate.put('partial-list', '$each{ item,i in list }[${foo}:${i}:${item}]{/}');\n\nconsole.log( template('$if{ foo !== \\'bar\\' }whoops{:}map: $include{\\'partial-map\\'} {/}', data) );\n// returns 'map: [bar:hi:all][bar:bye:nobody]'\n\nconsole.log( template('$if{ foo !== \\'bar\\' }whoops{:}list: $include{\\'partial-list\\'} {/}', data) );\n// returns 'list: [bar:0:foo][bar:1:bar][bar:2:foobar]'\n\n\nvar i18n = {\n  months: '${n} mes$if{ n > 1 }es{/}'\n};\ntemplate.filter('i18n', function (key, data) {\n  if( data ) {\n    return template(i18n[key.trim()])(data);\n  }\n\treturn i18n[key.trim()];\n});\n\nconsole.log( template('${ \\'months\\' | i18n:{ n: 5 } }')() );\n// returns '5 meses'\nconsole.log( template('${ \\'months\\' | i18n:{ n: 1 } }')() );\n// returns '1 mes'\n```\n","publish_time":1443563085269,"_cnpm_publish_time":1443563085269,"dist-tags":{"latest":"0.2.13"}}