{"name":"trisquel","version":"1.0.8","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":"6d3b656694cfe72e7513de4848571e8ac77129cc","_id":"trisquel@1.0.8","_shasum":"99cd9c855c0b47c520665428cbccc200668fe642","_from":".","_npmVersion":"3.10.10","_nodeVersion":"6.10.2","_npmUser":{"name":"jgermade","email":"jesus@germade.es"},"dist":{"shasum":"99cd9c855c0b47c520665428cbccc200668fe642","tarball":"http://registry-npm.ywwl.com/trisquel/download/trisquel-1.0.8.tgz","integrity":"sha512-LEyqb4MVKvYZ/p/86Hp+z0eLLGMVu5aeAVSGtDtnLVaKek5J9IECjYtO54yyn5alS5fl56fLKIqz4M1kyhAl+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFPmTbSaMQ5TvEetBF3c/4ygfCwdEM7kzeybyAx61z8KAiAZpvyEP5IHHifY2IWRHd0NLPRYuVrwPxC7+R/ntVx2fw=="}],"size":8854,"noattachment":false,"key":"/trisquel/-/trisquel-1.0.8.tgz"},"maintainers":[{"name":"jgermade","email":"jesus@germade.es"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/trisquel-1.0.8.tgz_1493390026294_0.9368657870218158"},"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":1493390026964,"_cnpm_publish_time":1493390026964,"dist-tags":{"latest":"1.1.5"}}