
Security News
Feross on Risky Business Weekly Podcast: npm’s Ongoing Supply Chain Attacks
Socket CEO Feross Aboukhadijeh joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
gulp-liquify
Advanced tools
A Liquid template render using TinyLiquid
$ npm install gulp-liquify
var liquify = require('gulp-liquify');
gulp.task("liquify", function() {
var locals = {
name: "Fred"
};
gulp.src('*.liquid')
.pipe(liquify(locals))
.pipe(gulp.dest('./dist/'))
});
You can pass a base for other templates to be included in a template. It defaults to the file base.
gulp.src('*.liquid')
.pipe(liquify(locals, { base: "../templates/" }))
});
You can pass file specific locals by attaching it to the vinyl file object in a previous task.
var liquify = require('gulp-liquify');
var through = require('through2');
gulp.task("liquify", function() {
var locals = {
name: "Fred"
};
gulp.src('*.liquid')
.pipe(through.obj(function(file, enc, cb) {
file.locals = {
number: Math.random(),
path: file.path
};
cb(null, file);
}))
.pipe(liquify(locals))
.pipe(gulp.dest('./dist/'))
});
TinyLiquid does not support the locals variables like this:
a[0]
, a["b"]
, a[0]["b"]
and so on.
Only support to use .
as the separator: a.b
, a.b.c
FAQs
Render Liquid templates in Gulp using TinyLiquid
We found that gulp-liquify 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 joins Risky Business Weekly to unpack recent npm phishing attacks, their limited impact, and the risks if attackers get smarter.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.