
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
tiny-imagemin
Advanced tools
支持 tiny 和 imagemin 压缩图片
npm install -D tiny-imagemin
const zegoImagemin = require('tiny-imagemin')
const path = require('path')
let srcUrl = path.resolve(__dirname, '../src/assets/common')
let distUrl = path.resolve(__dirname, '../src/assets/n')
// 使用 tiny 进行 jpg 和 png 图片压缩
zegoImagemin(srcUrl, distUrl, {
// onlyDir: 'dist/img',
// key: '',
imageminConfig: true,
cache: false
})
调用
zegoImagemin(srcUrl, distUrl, options)
params
srcUrl: 需要压缩的原地址--- 是绝对路径
distUrl: 压缩完成后的目标地址 --- 是绝对路径
options:
onlyDir: String 如果设置了,则图片都解析到该目录,否则默认原先是什么目录,解析完的目录一样
key: String tiny 提供的 apikey,用来调用tiny 的压缩 api 进行压缩,需要去官网申请,每月免费 500 次调用 ,超过收费
cache: Boolean 是否启用缓存,压缩过的不再压缩,从缓存中取
imageminConfig Boolean || Object gulp-imagemin 的配置项,设置了即启动 imagemin 压缩,不设置默认启动 tiny 压缩
// 清除之前设置的图片缓存
zegoImagemin.clearCache()
FAQs
支持 tiny 和 imagemin 压缩图片
We found that tiny-imagemin 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
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.