
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-swig2
Advanced tools
Task for rendering Swig templates
This plugin requires Grunt ~0.4.2
If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:
npm install grunt-swig2 --save-dev
Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:
grunt.loadNpmTasks("grunt-swig2");
Run this task with the grunt swig command.
Task targets, files and options may be specified according to the grunt Configuring tasks guide.
Type: Object, Array, Function
Default: {}
Locals that will be passed to each template when rendering. If this is a function, then it will be called once per target with no args. If this is an array, then the values will be merged into a single object.
Type: Object
Default: {}
Object containing custom Swig filters, where the key is the filter name and the value is the filter function. Example:
options: {
filters: {
// Makes strings more exciting
makeExciting: function( input ) {
return input + "!!!";
}
}
}
Type: Object
Default: {}
Object containing custom Swig tags, where the key is the tag name and the value is a object that must contain parser and compiler functions. ends and blockLevel flags may also be passed, but are optional.
Also, you may pass a ext key as well, which will add a Swig extension with the name of this tag.
Example:
options: {
tags: {
tagName: {
parser: function( str, line, parser, types, options ) {
// ...
},
compiler: function( compiler, args, content, parents, options, blockName ) {
// ...
},
ends: true,
blockLevel: true,
ext: anythingHere
}
}
}
Type: Object
Default: {}
A hash of Swig options.
FAQs
Grunt task for rendering Swig templates.
We found that grunt-swig2 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.