{"name":"trisquel","version":"1.0.26","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":"8dca1fdccf74701e88f522f781c70f99a8aa1f2d","_id":"trisquel@1.0.26","_shasum":"20589908a4674d967158b5b263bbc549a5fc0582","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"jgermade","email":"jesus@germade.es"},"dist":{"shasum":"20589908a4674d967158b5b263bbc549a5fc0582","tarball":"http://registry-npm.ywwl.com/trisquel/download/trisquel-1.0.26.tgz","integrity":"sha512-ZfGhwDNt9cqMMsG1QUWBWFd7eDLGL6x3JcXuC/CtsPxyYCKN7lp0FsB7dSmcrHcktG8uiUFjfbNmb0FWKga+9w==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCNi+vA9yXVXHtwkLuOg/D5M/VIhOEBQePNv5N7veFcfgIgNq7Uhzs1kxBeigPBRH9m6JDP3Ko2lg8DiXfOXzozXjs="}],"size":8908,"noattachment":false,"key":"/trisquel/-/trisquel-1.0.26.tgz"},"maintainers":[{"name":"jgermade","email":"jesus@germade.es"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/trisquel-1.0.26.tgz_1493392218003_0.07537444098852575"},"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":1493392219772,"_cnpm_publish_time":1493392219772,"dist-tags":{"latest":"1.1.5"}}