
Security News
PodRocket Podcast: Inside the Recent npm Supply Chain Attacks
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
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 discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.
Product
Socket Firewall is a free tool that blocks malicious packages at install time, giving developers proactive protection against rising supply chain attacks.