# imagemin-jpegoptim

> Imagemin plugin for jpegoptim

Latest version **8.0.0** (published 2021-12-17) · MIT license · 0 weekly downloads

## Install

```sh
npm install imagemin-jpegoptim
pnpm add imagemin-jpegoptim
yarn add imagemin-jpegoptim
bun add imagemin-jpegoptim
```

## Health

**Score 20/100 (F)** — status: abandoned.

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 8.0.0 |
| Published | 2021-12-17 |
| First published | 2014-08-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM |
| Node | ^12.20.0 \|\| ^14.13.1 \|\| >=16.0.0 |
| Dependencies | 3 |
| Unpacked size | 5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 38 |
| Author | Kevin Mårtensson |
| Maintainers | nothingismagick, sindresorhus, kevva, shinnn, 1000ch, bradbaris, xhmikosr |
| Keywords | compress, image, imageminplugin, img, jpg, minify, optimize |

## Links

- npm: https://www.npmjs.com/package/imagemin-jpegoptim
- Repository: https://github.com/imagemin/imagemin-jpegoptim
- Homepage: https://github.com/imagemin/imagemin-jpegoptim#readme
- Issues: https://github.com/imagemin/imagemin-jpegoptim/issues
- npm.io page: https://npm.io/package/imagemin-jpegoptim

## Dependencies (3)

- [execa](https://npm.io/package/execa.md) ^6.0.0
- [is-jpg](https://npm.io/package/is-jpg.md) ^3.0.0
- [jpegoptim-bin](https://npm.io/package/jpegoptim-bin.md) ^7.1.0

## Alternatives

- [exif-parser](https://npm.io/package/exif-parser.md) — 3.8M weekly downloads
- [vite-plugin-compression](https://npm.io/package/vite-plugin-compression.md) — 569.5K weekly downloads
- [pica](https://npm.io/package/pica.md) — 442.4K weekly downloads
- [@reportportal/client-javascript](https://npm.io/package/@reportportal/client-javascript.md) — 408.8K weekly downloads
- [@tldraw/state](https://npm.io/package/@tldraw/state.md) — 316.0K weekly downloads

## Recent versions

- 8.0.0 (latest) — 2021-12-17
- 7.0.0 — 2020-05-25
- 6.0.0 — 2018-11-01
- 5.2.0 — 2017-12-27
- 5.1.0 — 2017-05-25
- 5.0.0 — 2016-05-21
- 4.1.0 — 2015-11-15
- 4.0.0 — 2014-10-24
- 3.1.0 — 2014-10-21
- 3.0.0 — 2014-10-20
- 2.0.0 — 2014-09-24
- 1.0.0 — 2014-08-20
- 0.1.0 — 2014-08-20

## 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<Buffer>`.

#### 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.

---
_Source: https://npm.io/package/imagemin-jpegoptim · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
