Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/imagemin/imagemin-jpegoptim
Imagemin plugin for jpegoptim
https://github.com/imagemin/imagemin-jpegoptim
imagemin imagemin-plugin jpegoptim minify-images
Last synced: 3 days ago
JSON representation
Imagemin plugin for jpegoptim
- Host: GitHub
- URL: https://github.com/imagemin/imagemin-jpegoptim
- Owner: imagemin
- License: mit
- Created: 2014-04-29T13:34:32.000Z (over 10 years ago)
- Default Branch: main
- Last Pushed: 2021-12-17T06:19:25.000Z (almost 3 years ago)
- Last Synced: 2024-08-20T04:22:38.394Z (3 months ago)
- Topics: imagemin, imagemin-plugin, jpegoptim, minify-images
- Language: JavaScript
- Homepage:
- Size: 86.9 KB
- Stars: 38
- Watchers: 7
- Forks: 9
- Open Issues: 1
-
Metadata Files:
- Readme: readme.md
- License: license
Awesome Lists containing this project
README
# imagemin-jpegoptim
> [Imagemin](https://github.com/imagemin/imagemin) plugin for [jpegoptim](https://github.com/tjko/jpegoptim)
## Install
```
$ npm install imagemin-jpegoptim
```See [`jpegoptim-bin`'s install section](https://github.com/imagemin/jpegoptim-bin#install) for requirements.
## Usage
```js
import imagemin from 'imagemin';
import imageminJpegoptim from 'imagemin-jpegoptim';(async () => {
await imagemin(['images/*.jpg'], {
destination: 'build/images',
plugins: [
imageminJpegoptim()
]
});console.log('Images optimized');
})();
```## API
### imageminJpegoptim(options?)(buffer)
Returns a `Promise`.
#### options
Type: `object`
##### progressive
Type: `boolean`\
Default: `false`Lossless conversion to progressive.
##### max
Type: `number`
Set maximum image quality factor. (`0`-`100`).
##### size
Type: `number | string`
Try to optimize file to given size. Target size is specified either in kilo bytes (`1`-`n`) or as percentage (`1%`-`99%`).
##### stripAll
Type: `boolean`\
Default: `true`Strip all markers from output file.
**Note**: If you want to control what markers are stripped, this *must* be set to `false`.
##### stripCom
Type: `boolean`\
Default: `true`Strip comment markers from output file.
##### stripExif
Type: `boolean`\
Default: `true`Strip EXIF markers from output file.
##### stripIptc
Type: `boolean`\
Default: `true`Strip IPTC/Photoshop (APP13) markers from output file.
##### stripIcc
Type: `boolean`\
Default: `true`Strip ICC profile markers from output file.
##### stripXmp
Type: `boolean`\
Default: `true`Strip XMP markers markers from output file.
#### buffer
Type: `buffer`
Buffer to optimize.