Research
Security News
Kill Switch Hidden in npm Packages Typosquatting Chalk and Chokidar
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
gulp-retina-resizer
Advanced tools
本插件用于在 Gulp 中转换图片大小,可从3倍图转换到2倍或1倍,也可从2倍转到1倍。
本插件依赖 gm,故也须安装本地软件 GraphicsMagick 或 ImageMagick。
##使用方法 ##
'use strict';
let gulp = require('gulp');
let resizer = require('gulp-retina-resizer');
gulp.task('default', function() {
gulp.src('slice/*.png')
.pipe(resizer({
base: 3,
to: [1, 2],
copy: true,
im: true
}))
.pipe(gulp.dest('dest'))
});
如上例子,resizer
接受一个对象作为参数(可选),默认为
{
base: 2,
to: 1,
copy: false,
im: false
}
base
:数字,是原始图的倍数比to
:数字或数组,生成图的倍数比copy
: 布尔值,是否添加按原始图的倍数比生成的图im
:布尔值,为 true 时使用 ImageMagick 处理图片,否则使用 GraphicsMagick生成的图片的尺寸将保证可以被生成图的倍数比整除。例如:大小为60x61的3倍图转2倍图时,得到的2倍图大小为40x42,如果 copy
为 true
,还将得到60x63的3倍图。
可从3倍图转换到2倍或1倍,亦可从2倍转到1倍。即只能由高到低,不能由低到高。
FAQs
resize images
The npm package gulp-retina-resizer receives a total of 10 weekly downloads. As such, gulp-retina-resizer popularity was classified as not popular.
We found that gulp-retina-resizer 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.
Research
Security News
Socket researchers found several malicious npm packages typosquatting Chalk and Chokidar, targeting Node.js developers with kill switches and data theft.
Security News
pnpm 10 blocks lifecycle scripts by default to improve security, addressing supply chain attack risks but sparking debate over compatibility and workflow changes.
Product
Socket now supports uv.lock files to ensure consistent, secure dependency resolution for Python projects and enhance supply chain security.