How to use the template function from grunt
Find comprehensive JavaScript grunt.template code examples handpicked from public code repositorys.
GitHub: phated/grunt-enyo

7 8 9 10 11 12 13 14 15 16
grunt.npmTasks([ 'enyo' ]); var _ = grunt.utils._; var template = grunt.template.process; // Draw the help screen. function displayHelp(withFlags) { var pkg = require(path.normalize(__dirname + '/../package.json'));
43 44 45 46 47 48 49 50 51 52
'', ' LICENSE: <%= license %>', '*/', '' ].join('\n'); return grunt.template.process(template, {data: pkg}); })(); var less = (function(){ var obj = {files : {}};
58 59 60 61 62 63 64 65 66 67 68 69 70 71
function updateLibraryFiles(version) { var versionRegex = /^(\s*\/\*![^\/]+?v)(\d+\.\d+\.\d+)(([^\n]+?)(\d+\/\d+\/\d+))?/ var today = grunt.template.today('yyyy/mm/dd') var files = glob('lib/*.js') files.forEach(updateLibraryFile)
GitHub: jidesakin/react

24 25 26 27 28 29 30 31 32 33
// TODO: move this out to another build step maybe. function bannerify(src) { var version = grunt.config.data.pkg.version; var packageName = this.data.packageName || this.data.standalone; return ( grunt.template.process( LICENSE_TEMPLATE, {data: {package: packageName, version: version}} ) + src
+ 3 other calls in file
grunt.file is the most popular function in grunt (372 examples)