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.
apng-optimizer
Advanced tools
基于 WebAssembly 的 APNG 图片压缩工具。
底层基于 libimagequant 与 APNG Optimizer
npm run demo
在开始使用前,我们需要配置我们的打包工具(如 webpack)来支持加载 WebAssembly:
module.exports = {
module: {
rules: [{
test: /\.wasm$/,
use: [{
loader: 'file-loader'
}]
}]
}
}
import { APNGOptimizer } from 'apng-optimizer';
import assemblyPath from 'apng-optimizer/dist/apng-optimizer.wasm';
APNGOptimizer.createOptimizer(assemblyPath)
.then(optimizer => {
// ... load your apng image as buffer
const uint8Array = new Uint8Array(buffer);
const optAPNGArray = optimizer.optAPNG(uint8Array, {
minQuality: 0,
maxQuality: 100,
processCallback: function(progerss) {
console.log(progress); // 0.1231111
}
});
const blob = new Blob([optAPNGArray.buffer], { type: 'image/png' });
const url = URL.createObjectURL(blob);
img.src = url;
});
通过加载 modulePath
路径上的 WebAssembly 来创建一个新的压缩器实例
压缩 apng 图片
1
15
imagequant
进行色板取色的最小质量,默认为 0
imagequant
进行色斑取色的最大质量,默认为 100
imagequant
,禁用后 minQuality
与 maxQuality
将会无效progress
为当前压缩进度( 0 ~ 1)FAQs
Optimizes APNG animations for js
The npm package apng-optimizer receives a total of 1 weekly downloads. As such, apng-optimizer popularity was classified as not popular.
We found that apng-optimizer demonstrated a healthy version release cadence and project activity because the last version was released less than 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.