{"id":21989015,"url":"https://github.com/imweb/grunt-imweb-tpl-complie","last_synced_at":"2026-05-07T06:34:49.726Z","repository":{"id":13107431,"uuid":"15789017","full_name":"imweb/grunt-imweb-tpl-complie","owner":"imweb","description":"Just a Template Complier","archived":false,"fork":false,"pushed_at":"2014-09-04T09:44:46.000Z","size":396,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":11,"default_branch":"master","last_synced_at":"2025-03-22T06:04:17.422Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/imweb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-01-10T05:17:18.000Z","updated_at":"2014-11-01T16:03:03.000Z","dependencies_parsed_at":"2022-09-19T08:40:24.332Z","dependency_job_id":null,"html_url":"https://github.com/imweb/grunt-imweb-tpl-complie","commit_stats":null,"previous_names":["qqedu/grunt-imweb-tpl-complie"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imweb%2Fgrunt-imweb-tpl-complie","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imweb%2Fgrunt-imweb-tpl-complie/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imweb%2Fgrunt-imweb-tpl-complie/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/imweb%2Fgrunt-imweb-tpl-complie/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/imweb","download_url":"https://codeload.github.com/imweb/grunt-imweb-tpl-complie/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244913331,"owners_count":20530817,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-29T19:27:23.734Z","updated_at":"2026-05-07T06:34:44.707Z","avatar_url":"https://github.com/imweb.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Build Status](https://travis-ci.org/QQEDU/grunt-imweb-tpl-complie.svg?branch=master)](https://travis-ci.org/QQEDU/grunt-imweb-tpl-complie)\n#grunt-imweb-tpl-complie\n\n\u003e Just a Template Compiler\n\n## Getting Started\nThis plugin requires Grunt `~0.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```shell\nnpm install grunt-imweb-tpl-complie --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-imweb-tpl-complie');\n```\n\n## The \"tplComplie\" task\n\n### Overview\nIn your project's Gruntfile, add a section named `tplComplie` to the data object passed into `grunt.initConfig()`.\n\n```js\ngrunt.initConfig({\n  tplComplie: {\n    options: {\n      // Task-specific options go here.\n    },\n    your_target: {\n      // Target-specific file lists and/or options go here.\n    },\n  },\n})\n```\n\n### Options\n\n#### options.namespace\nType: `String`\nDefault value: `'JST'`\n\nThe namespace in which the precompiled templates will be assigned.\n\n#### options.processName\nType: `Function`\nDefault value: `null`\n\nThis option accepts a function which takes one argument (the template filepath) and returns a string which will be used as the key for the precompiled template object.\n\n#### options.processContent\nType: `Function`\nDefault value: `null`\n\nThis option accepts a function which takes one argument (the file content) and returns a string which will be used as template string.\n\n\n### Usage Examples\n\n#### Default Options\n\n```js\ngrunt.initConfig({\n  tplComplie: {\n    options: {},\n    files: {\n      'dest/template.js': ['src/testing.html', 'src/123.html'],\n    },\n  },\n})\n```\n\n#### Custom Options\n\n```js\ngrunt.initConfig({\n  tplComplie: {\n    options: {\n      namespace: 'custom',\n      processName: function (filename) {\n        return filename.split(/src\\//)[1];\n      },\n      processContent: function (source) {\n        return 'test - ' + source;\n      }\n    },\n    files: {\n      'dest/template.js': ['src/testing.html', 'src/123.html'],\n    },\n  },\n})\n```\n\n## License\n(The MIT License)\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimweb%2Fgrunt-imweb-tpl-complie","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fimweb%2Fgrunt-imweb-tpl-complie","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fimweb%2Fgrunt-imweb-tpl-complie/lists"}