Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
@mole-inc/imagemin-pngquant
Advanced tools
$ npm install @mole-inc/imagemin-pngquant
const imagemin = require('imagemin');
const imageminPngquant = require('@mole-inc/imagemin-pngquant');
(async () => {
await imagemin(['images/*.png'], 'build/images', {
plugins: [
imageminPngquant()
]
});
console.log('Images optimized');
})();
const fs = require('fs');
const {pngquantStream} = require('@mole-inc/imagemin-pngquant');
const src = fs.createReadStream('foo.png');
const dest = fs.createWriteStream('bar.png');
pngquantStream({quality: [0.3, 0.5]})(src).pipe(dest);
Returns Promise<Buffer>
.
Type: object
Type: number
Default: 4
Values: 1
(brute-force) to 11
(fastest)
Speed 10
has 5% lower quality, but is about 8 times faster than the default. Speed 11
disables dithering and lowers compression level.
Type: boolean
Default: false
Remove optional metadata.
Type: Array<min: number, max: number>
Values: Array<0...1, 0...1>
Example: [0.3, 0.5]
Instructs pngquant to use the least amount of colors required to meet or exceed the max quality. If conversion results in quality below the min quality the image won't be saved.
Min and max are numbers in range 0 (worst) to 1 (perfect), similar to JPEG.
Type: number | boolean
Default: 1
(full)
Values: 0...1
Set the dithering level using a fractional number between 0 (none) and 1 (full).
Pass in false
to disable dithering.
Type: number
Truncate number of least significant bits of color (per channel). Use this when image will be output on low-depth displays (e.g. 16-bit RGB). pngquant will make almost-opaque pixels fully opaque and will reduce amount of semi-transparent colors.
Type: boolean
Default: false
Print verbose status messages.
Type: Buffer | Stream
Buffer or stream to optimize.
Returns Readable
.
This is a fork of imagemin/imagemin-pngquant.
see license file.
FAQs
Imagemin plugin for `pngquant`
The npm package @mole-inc/imagemin-pngquant receives a total of 0 weekly downloads. As such, @mole-inc/imagemin-pngquant popularity was classified as not popular.
We found that @mole-inc/imagemin-pngquant 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’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.