{"name":"trisquel","version":"1.0.11","description":"JS template engine","main":"dist/trisquel.js","repository":{"type":"git","url":"git+ssh://git@github.com/kiltjs/trisquel.git"},"keywords":["javascript","trisquel","template","templates","demo"],"author":{"name":"Jesús Manuel Germade Castiñeiras","email":"jesus@germade.es"},"license":"MIT","bugs":{"url":"https://github.com/kiltjs/trisquel/issues"},"homepage":"https://github.com/kiltjs/trisquel","devDependencies":{"eslint":"^3.19.0","mocha":"^3.2.0","rollup":"^0.37.0","uglify-js":"^2.7.5"},"scripts":{"test":"make test"},"dependencies":{},"gitHead":"265f80966451650050493e4df0442d77e7cefb06","_id":"trisquel@1.0.11","_shasum":"a0e682d952b258613dbba3870247a9af32f7e625","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"jgermade","email":"jesus@germade.es"},"dist":{"shasum":"a0e682d952b258613dbba3870247a9af32f7e625","tarball":"http://registry-npm.ywwl.com/trisquel/download/trisquel-1.0.11.tgz","integrity":"sha512-xWL+1kAuR4JqZmlzM/h+a/S2NotsGaGTe4UG5FxhwYpQLKjsJEojIeZVbop8QbKjDwBAFWhdanwGOUdisA45og==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQClb5cIVXoTKbLLBvlNNkT41FCQ8tSUW1PZ4l5Ki9r14gIgZ6ZTAhtH+l7oQ7BByOlgmu5CyYYQB3v2L0F0l9sjhok="}],"size":8876,"noattachment":false,"key":"/trisquel/-/trisquel-1.0.11.tgz"},"maintainers":[{"name":"jgermade","email":"jesus@germade.es"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/trisquel-1.0.11.tgz_1493390291617_0.0888182136695832"},"directories":{},"readme":"# trisquel\n\nSimple, customizable template engine for JavaScript\n\n[![](https://img.shields.io/npm/v/trisquel.svg)](https://www.npmjs.com/package/trisquel)\n[![Build Status](https://travis-ci.org/kiltjs/trisquel.svg?branch=master)](https://travis-ci.org/kiltjs/trisquel)\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)\n\n### Installation\n\n```.sh\nnpm install trisquel --save\n```\n\n> Example data\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```\n\n#### Caching templates\n\n``` js\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\n// cached templates can be invoked with $include{}\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\n#### Filters\n\n``` js\n\ntemplate.filter('months', function (nMonths) {\n  return nMonths + (nMonths > 1 ? ' meses' : ' mes' );\n});\n\nconsole.log( template('${ nMonths | months }')({ nMonths: 5 }) );\n// returns '5 meses'\nconsole.log( template('${ nMonths | months }')({ nMonths: 1 }) );\n// returns '1 mes'\n```\n\n``` js\n\nvar messages {\n  greeting: template('Hi ${name}!')\n};\n\ntemplate.filter('message', function (key, data) {\n  return messages[key](data);\n});\n\nconsole.log( template('${ person.last_name }: ${ \\'greeting\\' | message: { name: person.first_name } }')({\n  person: {\n    first_name: 'John',\n    last_name: 'Smith'\n  }\n}) );\n// returns 'Smith: Hi John!'\n```\n\n#### Tests\n\n``` sh\nnpm test\n```\n\n[![Build Status](https://travis-ci.org/kiltjs/trisquel.svg?branch=master)](https://travis-ci.org/kiltjs/trisquel) Travis\n\n[![wercker status](https://app.wercker.com/status/281f306e7157005f0a21b770fbb81086/s \"wercker status\")](https://app.wercker.com/project/bykey/281f306e7157005f0a21b770fbb81086) Wercker\n","publish_time":1493390292262,"_cnpm_publish_time":1493390292262,"dist-tags":{"latest":"1.1.5"}}