
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.
squoosh-compress
Advanced tools
squoosh-compress 是一个前端图片压缩库,适用于react、vue、angular等,核心压缩原理来自google的开源图片压缩方案squoosh
npm i squoosh-compress --save
compress(options).then((res) => {})
| name | type | default | description |
|---|---|---|---|
| image | File | none | 图片文件必传 |
| encodeData | object | none | 转化参数必传 |
| sourceFilename | string | none | 图片文件名称必传 |
| name | type | default | description |
|---|---|---|---|
| type | string | none | 转换图片的类型必传(browser-png | browser-jpeg | browser-webp) |
| options | object | none | 转换的额外参数(type为browser-png时非必传) |
| name | type | default | description |
|---|---|---|---|
| quality | number | none | 转换质量 |
import { compress } from 'squoosh-compress';
const data = await compress(
file,
{
type: "browser-png",
},
file.name
);
const data2 = await window.compress.compress(
file,
{
type: "browser-jpeg",
options: {
quality: 0.75
}
},
file.name
);
FAQs
compress image use squoosh
We found that squoosh-compress 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.