
Security News
Scaling Socket from Zero to 10,000+ Organizations
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.
grunt-batman-template
Advanced tools
forked from grunt-template-client package
Compile any and all templates into a ready to use script include.
Install this grunt plugin next to your project's grunt.js gruntfile with: npm install grunt-batman-template
Then add this line to your project's grunt.js gruntfile:
grunt.loadNpmTasks('grunt-batman-template');
given the following config and template
batman: {
dist: {
src: ['templates/**/*.html'],
dest: 'dist/tmpl.js'
}
}
<h1 data-bind="date"></h1>
<h2 data-bind="time"></h2>
<h1 class="title" data-bind="title"></h1>
<h2 class="value" data-bind="current | prettyNumber | prepend prefix"></h2>
<p class="more-info" data-bind="moreinfo"></p>
will output the following script file
(function bundleTemplates() {
Batman.View.store.set("graph", '<h1 class="title" data-bind="title"></h1><h2 class="value" data-bind="current | prettyNumber | prepend prefix"></h2><p class="more-info" data-bind="moreinfo"></p>' );
Batman.View.store.set("clock", '<h1 data-bind="date"></h1><h2 data-bind="time"></h2>' );
}());
ready to use/include/concat etc.
I guess there will be need to tweek the regex that cleans the template.
In lieu of a formal styleguide, take care to maintain the existing coding style. Add unit tests for any new or changed functionality. Lint and test your code using grunt.
Copyright (c) 2012 Florian Traverse Licensed under the MIT license.
FAQs
compiles any and all templates into ready to use includes
We found that grunt-batman-template demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Socket CEO Feross Aboukhadijeh shares lessons from scaling a developer security startup to 10,000+ organizations in this founder interview.

Research
Socket Threat Research maps a rare inside look at OtterCookie’s npm-Vercel-GitHub chain, adding 197 malicious packages and evidence of North Korean operators.

Research
Socket researchers identified a malicious Chrome extension that manipulates Raydium swaps to inject an undisclosed SOL transfer, quietly routing fees to an attacker wallet.