
Security News
AGENTS.md Gains Traction as an Open Format for AI Coding Agents
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
gulp-responsive-imgzz
Advanced tools
Add img attribute 'srcset' for variable density/width image loading
gulp-img-retina
repo with some improvements)Add img attribute 'srcset' for variable density/width image loading.
You must have corresponding images in the folder which the original image in.
npm install gulp-responsive-imgzz
var gulp = require('gulp');
var imgRetina = require('gulp-responsive-imgzz');
var retinaOpts = {
// Your options here.
};
gulp.task('views', function() {
return gulp.src('./views/**/*.html')
.pipe(imgRetina(retinaOpts))
.on('error', function(e) {
console.log(e.message);
})
.pipe(gulp.dest('./build'));
});
You put html in:
<figure>
<img src="images/default/example.jpg" alt="example image" />
</figure>
And get html out:
<figure>
<img src="images/default/example.jpg" alt="example image" srcset="images/default/example.jpg 1x, images/default/example@2x.jpg 2x, images/default/example@3x.jpg 3x, images/default/example-mobile.jpg 480w" />
</figure>
Type: Object
Default:
imgRetina({
suffix: {
'1x': '',
'2x': '@2x',
'3x': '@3x'
}
})
The suffix will insert to image's path, the key is resolution, and value is suffix.
You can also use width srcset params eg.
imgRetina({
suffix: {
'1x': '',
'2x': '@2x',
'3x': '@3x',
'480w': '-mobile'
}
})
SVG's are ignored
FAQs
Add img attribute 'srcset' for variable density/width image loading
The npm package gulp-responsive-imgzz receives a total of 2 weekly downloads. As such, gulp-responsive-imgzz popularity was classified as not popular.
We found that gulp-responsive-imgzz 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
AGENTS.md is a fast-growing open format giving AI coding agents a shared, predictable way to understand project setup, style, and workflows.
Security News
/Research
Malicious npm package impersonates Nodemailer and drains wallets by hijacking crypto transactions across multiple blockchains.
Security News
This episode explores the hard problem of reachability analysis, from static analysis limits to handling dynamic languages and massive dependency trees.