{"_id":"grunt-template","_rev":"18-5f995f970eb668be38aa016e6ad2a33a","name":"grunt-template","description":"Grunt plugin that interpolates template files with any data you provide and saves the result to another file.","dist-tags":{"latest":"1.0.0"},"versions":{"0.1.0":{"name":"grunt-template","version":"0.1.0","description":"Grunt plugin that interpolates template files with any data you provide and saves the result to another file.","author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"homepage":"http://git.io/grunt-template","licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"repository":{"type":"git","url":"git://github.com/mathiasbynens/grunt-template.git"},"bugs":{"url":"https://github.com/mathiasbynens/grunt-template/issues"},"directories":{"test":"tests"},"scripts":{"test":"grunt test"},"dependencies":{},"devDependencies":{"grunt-contrib-clean":"~0.4.1","grunt-contrib-nodeunit":"~0.2.0","grunt":"~0.4.1"},"peerDependencies":{"grunt":"~0.4.1"},"keywords":["gruntplugin","template"],"_id":"grunt-template@0.1.0","dist":{"shasum":"38905d27d9c5b95f829f00129f41c23247cd10ca","tarball":"https://registry.npmjs.org/grunt-template/-/grunt-template-0.1.0.tgz","integrity":"sha512-+K87fbnc2CWkrI9KfejzNNxarHP5EGg90P5HW7tSoJQw4akvyZc3yivC2Mcsxgbl2zOybuyvSnvEYwKsH01K+Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIHQArLfYXPCokVu36xIwIB6M+e725FY2JnK4GcezYdtcAiEAptK5JJSJvgR/bugP0/84tuQ8FoU3Pv9Nlvsu263JA3A="}]},"_from":".","_npmVersion":"1.2.19","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}]},"0.2.0":{"name":"grunt-template","version":"0.2.0","description":"Grunt plugin that interpolates template files with any data you provide and saves the result to another file.","author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"homepage":"http://git.io/grunt-template","licenses":[{"type":"MIT","url":"http://mths.be/mit"},{"type":"GPL","url":"http://mths.be/gpl"}],"repository":{"type":"git","url":"git://github.com/mathiasbynens/grunt-template.git"},"bugs":{"url":"https://github.com/mathiasbynens/grunt-template/issues"},"directories":{"test":"tests"},"scripts":{"test":"grunt test"},"dependencies":{},"devDependencies":{"grunt-contrib-clean":"~0.4.1","grunt-contrib-nodeunit":"~0.2.0","grunt":"~0.4.1"},"peerDependencies":{"grunt":"~0.4.1"},"keywords":["gruntplugin","template"],"_id":"grunt-template@0.2.0","dist":{"shasum":"a87bd30a39da21ca40df865a66ac081c805808c9","tarball":"https://registry.npmjs.org/grunt-template/-/grunt-template-0.2.0.tgz","integrity":"sha512-tIKmqmYesqp4c90LkNvxcWxbboeGUzg7Npdm/4vHUmXSo2UGio7XwdvmX7OEeYNqpW7Hr/7bu0eBoC2UQ+073Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBJ6Lc3UVkuEhtiqq+Wxx6dX3gHFzy7CSoTkSldkxfRPAiEAnHT5kT2kKTfmChFmmo98MS6viE3+cvIQmh+T1IDAAXY="}]},"_from":".","_npmVersion":"1.2.30","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}]},"0.2.1":{"name":"grunt-template","version":"0.2.1","description":"Grunt plugin that interpolates template files with any data you provide and saves the result to another file.","author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"homepage":"http://git.io/grunt-template","licenses":[{"type":"MIT","url":"http://mths.be/mit"}],"repository":{"type":"git","url":"git://github.com/mathiasbynens/grunt-template.git"},"bugs":{"url":"https://github.com/mathiasbynens/grunt-template/issues"},"files":["LICENSE-MIT.txt","tasks/"],"directories":{"test":"tests"},"scripts":{"test":"grunt test"},"dependencies":{},"devDependencies":{"grunt-contrib-clean":"~0.5.0","grunt-contrib-nodeunit":"~0.2.1","grunt":"~0.4.1"},"peerDependencies":{"grunt":"~0.4.1"},"keywords":["gruntplugin","template"],"_id":"grunt-template@0.2.1","dist":{"shasum":"3e4bf607678545f087bb6b34d27aa03f7393dcd3","tarball":"https://registry.npmjs.org/grunt-template/-/grunt-template-0.2.1.tgz","integrity":"sha512-CJ0iT/RrnaDa2ym1xW4M5Y0zzlYdsETW8wpvQ6Yu5pXrq4kH9fXS6I7AcqIAtNjI8ECvGgPc1dtTwHlRHs6+/A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDyrCETTNIgriduCbMZzTPSPUF+XIbh391kcwKz6w5wGwIhAJFkLaQhOxwTp7b8yOiEcsMuMJSjtE9NlaLR9hopQjCx"}]},"_from":".","_npmVersion":"1.3.8","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}]},"0.2.2":{"name":"grunt-template","version":"0.2.2","description":"Grunt plugin that interpolates template files with any data you provide and saves the result to another file.","author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"homepage":"http://git.io/grunt-template","licenses":[{"type":"MIT","url":"http://mths.be/mit"}],"repository":{"type":"git","url":"git://github.com/mathiasbynens/grunt-template.git"},"bugs":{"url":"https://github.com/mathiasbynens/grunt-template/issues"},"files":["LICENSE-MIT.txt","tasks/"],"directories":{"test":"tests"},"scripts":{"test":"grunt test"},"dependencies":{},"devDependencies":{"grunt-contrib-clean":"~0.5.0","grunt-contrib-nodeunit":"~0.2.2","grunt":"~0.4.2"},"peerDependencies":{"grunt":"~0.4.0"},"keywords":["gruntplugin","template"],"_id":"grunt-template@0.2.2","dist":{"shasum":"0d0c3aaef1a12a13b392724395f3fc5fe51363af","tarball":"https://registry.npmjs.org/grunt-template/-/grunt-template-0.2.2.tgz","integrity":"sha512-/fkrj/6NdapBaRH0sJKcpmdW2Lsb6qWE3U6oIbXGbFu/GQ9LtqccOlno0Fq/0YFKGbyG82vwqmSFPwyMMlV7Ig==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIBAJR0+e53Adv7PPPDMNo+U84EBcv9saXtQkE33rVimcAiEA5QsRt93pxlaTlyTqkus5n/Tk9yN8VStiOMpCsAEz/B4="}]},"_from":".","_npmVersion":"1.3.14","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}]},"0.2.3":{"name":"grunt-template","version":"0.2.3","description":"Grunt plugin that interpolates template files with any data you provide and saves the result to another file.","author":{"name":"Mathias Bynens","url":"http://mathiasbynens.be/"},"homepage":"http://git.io/grunt-template","licenses":[{"type":"MIT","url":"http://mths.be/mit"}],"repository":{"type":"git","url":"git://github.com/mathiasbynens/grunt-template.git"},"bugs":{"url":"https://github.com/mathiasbynens/grunt-template/issues"},"files":["LICENSE-MIT.txt","tasks/"],"directories":{"test":"tests"},"scripts":{"test":"grunt test"},"dependencies":{},"devDependencies":{"grunt-contrib-clean":"~0.5.0","grunt-contrib-nodeunit":"~0.2.2","grunt":"~0.4.2"},"peerDependencies":{"grunt":"~0.4.0"},"keywords":["gruntplugin","template"],"_id":"grunt-template@0.2.3","dist":{"shasum":"24155afea78984be6730c1c773bb92de8747a370","tarball":"https://registry.npmjs.org/grunt-template/-/grunt-template-0.2.3.tgz","integrity":"sha512-0bWgA05ZOSgPOsbeUkXtKdMupJ5Ze6sVkRy9QtWmZGgOMy5ybaH+W5k32jdOpSEWoj7qKbEquclZg4OKnix3BQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDfzuBmlb5R9Lc1MrGkTynkxkeLVjz3G1Pmuf60U/G2JQIgLsMtHoRDTIfRxDxe5P/ntQjFbitCfAlsQ/M1kPK2zbY="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}]},"1.0.0":{"name":"grunt-template","version":"1.0.0","description":"Grunt plugin that interpolates template files with any data you provide and saves the result to another file.","author":{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"},"homepage":"http://git.io/grunt-template","license":"MIT","repository":{"type":"git","url":"git://github.com/mathiasbynens/grunt-template.git"},"bugs":{"url":"https://github.com/mathiasbynens/grunt-template/issues"},"files":["LICENSE-MIT.txt","tasks/"],"scripts":{"test":"grunt test"},"dependencies":{},"devDependencies":{"grunt-contrib-clean":"~0.5.0","grunt-contrib-nodeunit":"~0.2.2","grunt":"^1.0.0"},"peerDependencies":{"grunt":">=0.4.0"},"keywords":["gruntplugin","template"],"gitHead":"78b2dff0e3fe61c9c93ea83bde447c2235033d6b","_id":"grunt-template@1.0.0","_shasum":"5608f9b05a06a786fa048ca66447e4b48d3d1c21","_from":".","_npmVersion":"3.9.3","_nodeVersion":"6.2.1","_npmUser":{"name":"mathias","email":"mathias@qiwi.be"},"maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"dist":{"shasum":"5608f9b05a06a786fa048ca66447e4b48d3d1c21","tarball":"https://registry.npmjs.org/grunt-template/-/grunt-template-1.0.0.tgz","integrity":"sha512-1boA7QTNwnc8B3Wp4NEU0v99wrkLVXcgR0TC+M1fdstZs0Do8zRWuB5nY1Z9vH85vew9faUR2S0MhnWoymY25A==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCytWPXfag4Mvlj7qWCK/m+HwbpugqEj2GbjoSKQ9M7AQIgOZixHxm5RDh/ZmNRT9polhMWNbkn1kGvScq/+tzlh7U="}]},"_npmOperationalInternal":{"host":"packages-16-east.internal.npmjs.com","tmp":"tmp/grunt-template-1.0.0.tgz_1467805416190_0.05535671208053827"}}},"readme":"# grunt-template [![Build status](https://travis-ci.org/mathiasbynens/grunt-template.svg?branch=master)](https://travis-ci.org/mathiasbynens/grunt-template) [![Dependency status](https://gemnasium.com/mathiasbynens/grunt-template.svg)](https://gemnasium.com/mathiasbynens/grunt-template)\n\nThis Grunt plugin interpolates template files with any data you provide and saves the result to another file.\n\nSince [`grunt.template.process`](http://gruntjs.com/api/grunt.template#grunt.template.process) is used for the templating, this Grunt plugin is very lightweight and doesn’t have any dependencies (other than Grunt itself).\n\n## Getting started\n\nThis plugin requires Grunt v0.4.0+.\n\nIf you haven’t used [Grunt](http://gruntjs.com/) before, be sure to check out the [Getting Started](http://gruntjs.com/getting-started) guide, as it explains how to create a [Gruntfile](http://gruntjs.com/sample-gruntfile) as well as install and use Grunt plugins. Once you’re familiar with that process, you may install this plugin with this command:\n\n```bash\nnpm install grunt-template --save-dev\n```\n\nOnce the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:\n\n```js\ngrunt.loadNpmTasks('grunt-template');\n```\n\n## The `template` task\n\n### Overview\n\nIn your project’s Gruntfile, add a section named `template` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n\t'template': {\n\t\t'options': {\n\t\t\t// Task-specific options go here\n\t\t},\n\t\t'your-target': {\n\t\t\t'options': {\n\t\t\t\t// Target-specific options go here\n\t\t\t},\n\t\t\t'files': {\n\t\t\t\t// Target-specific file lists go here\n\t\t\t}\n\t\t}\n\t}\n});\n```\n\n### Options\n\nThe `options` property accepts the following options:\n\n#### `data`\nType: `Object` or `Function`\nDefault: `{}`\n\nThis object contains the data that will be used while interpolating the template files. If you pass a function instead, it will be called when grunt-template needs the template data (lazy evaluation). This is useful if you want to load data from a file that is generated by another Grunt task, for example.\n\n#### `delimiters`\nType: `String` or `Function`\nDefault: `config`\n\nThis is the delimiters' name that will be used to interpolate and evaluate code. A function that returns this name can be used too.\nThis property is useful when you want to generate JSP/ERB like code and you need the default interpolation delimiters to be `<%` and `%>`. See below for an example.\n\n### Template syntax\n\nUnder the hood, grunt-template uses [`grunt.template.process`](http://gruntjs.com/api/grunt.template#grunt.template.process), which in turn relies on [Lo-Dash’s `_.template()` method](http://lodash.com/docs#template). Here’s a quick reminder of the default delimiters:\n\n* Use `<%= value %>` to interpolate any values directly, i.e. inject them into the template without any modifications.\n* Use `<%- value %>` to interpolate an HTML-escaped version of a given value. Use this if you’re generating an HTML file and you’re using unknown input data.\n\nFor more details and examples, see the [Lo-Dash’s API documentation for the `_.template()` method](http://lodash.com/docs#template).\n\n### Usage example\n\nHere’s a practical example of grunt-template. Here, the file `src/post.html.tpl` is loaded, then parsed as a template using the provided `data` object (with `title`, `author` and `content` properties), and finally the result is saved as `dist/post.html`.\n\n#### `src/post.html.tpl`\n\n```html\n<!DOCTYPE html>\n<title><%- title %></title>\n<h1><%- title %>, by <%- author %></h1>\n<p><%- content %></p>\n```\n\n#### `Gruntfile.js`\n\n```js\nmodule.exports = function(grunt) {\n\tgrunt.initConfig({\n\t\t'template': {\n\t\t\t'process-html-template': {\n\t\t\t\t'options': {\n\t\t\t\t\t'data': {\n\t\t\t\t\t\t'title': 'My blog post',\n\t\t\t\t\t\t'author': 'Mathias Bynens',\n\t\t\t\t\t\t'content': 'Lorem ipsum dolor sit amet.'\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t'files': {\n\t\t\t\t\t'dist/post.html': ['src/post.html.tpl']\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\tgrunt.loadNpmTasks('grunt-template');\n\tgrunt.registerTask('default', [\n\t\t'template'\n\t]);\n};\n```\n\n#### `dist/post.html` (the end result)\n\n```html\n<!DOCTYPE html>\n<title>My blog post</title>\n<h1>My blog post, by Mathias Bynens</h1>\n<p>Lorem ipsum dolor sit amet.</p>\n```\n\n#### `Gruntfile.js` (using a custom delimiter)\n\n```js\nmodule.exports = function(grunt) {\n\tgrunt.template.addDelimiters('handlebars-like-delimiters', '{{', '}}')\n\tgrunt.initConfig({\n\t\t'template': {\n\t\t\t'process-html-template': {\n\t\t\t\t'options': {\n\t\t\t\t\t'data': {\n\t\t\t\t\t\t'title': 'My blog post',\n\t\t\t\t\t\t'author': 'Mathias Bynens',\n\t\t\t\t\t\t'content': 'Lorem ipsum dolor sit amet.'\n\t\t\t\t\t},\n\t\t\t\t\t'delimiters': 'handlebars-like-delimiters'\n\t\t\t\t},\n\t\t\t\t'files': {\n\t\t\t\t\t'dist/post.html': ['src/post.html.tpl']\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t});\n\tgrunt.loadNpmTasks('grunt-template');\n\tgrunt.registerTask('default', [\n\t\t'template'\n\t]);\n};\n```\n\n#### `src/post.html.tpl` (using a custom delimiter)\n\n```html\n<!DOCTYPE html>\n<title>{{- title }}</title>\n<h1>{{- title }}, by {{- author }}</h1>\n<p>{{- content }}</p>\n```\n\n\n## Notes\n\nIf you use [gulp](https://github.com/wearefractal/gulp) instead of Grunt, but want to perform a similar task, use [gulp-template](https://github.com/sindresorhus/gulp-template).\n\n## Author\n\n| [![twitter/mathias](https://gravatar.com/avatar/24e08a9ea84deb17ae121074d0f17125?s=70)](https://twitter.com/mathias \"Follow @mathias on Twitter\") |\n|---|\n| [Mathias Bynens](https://mathiasbynens.be/) |\n\n## License\n\ngrunt-template is available under the [MIT](https://mths.be/mit) license.\n","maintainers":[{"name":"mathias","email":"mathias@qiwi.be"}],"time":{"modified":"2022-06-18T16:07:13.375Z","created":"2013-05-26T20:17:36.848Z","0.1.0":"2013-05-26T20:17:39.889Z","0.2.0":"2013-06-28T19:19:00.004Z","0.2.1":"2013-10-15T12:28:23.959Z","0.2.2":"2013-12-17T10:08:31.202Z","0.2.3":"2014-02-03T18:43:45.811Z","1.0.0":"2016-07-06T11:43:37.232Z"},"author":{"name":"Mathias Bynens","url":"https://mathiasbynens.be/"},"repository":{"type":"git","url":"git://github.com/mathiasbynens/grunt-template.git"},"readmeFilename":"README.md","users":{"piotrlewandowski":true,"mle626":true,"enjoypb":true,"cueedee":true},"homepage":"http://git.io/grunt-template","keywords":["gruntplugin","template"],"bugs":{"url":"https://github.com/mathiasbynens/grunt-template/issues"},"license":"MIT"}