JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 998
  • Score
    100M100P100Q114094F
  • License MIT

jpegoptim imagemin plugin

Package Exports

  • imagemin-jpegoptim

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (imagemin-jpegoptim) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

imagemin-jpegoptim Build Status Build status

jpegoptim imagemin plugin

Install

$ npm install --save imagemin-jpegoptim

Usage

var Imagemin = require('imagemin');
var jpegoptim = require('imagemin-jpegoptim');

var imagemin = new Imagemin()
    .src('images/*.jpg')
    .dest('build/images')
    .use(jpegoptim());

imagemin.run(function (err, files) {
    if (err) {
        throw err;
    }

    console.log('Files optimized successfully!');
});

You can also use this plugin with gulp:

var gulp = require('gulp');
var jpegoptim = require('imagemin-jpegoptim');

gulp.task('default', function () {
    return gulp.src('images/*.jpg')
        .pipe(jpegoptim())
        .pipe(gulp.dest('build/images'));
});

Options

progressive

Type: Boolean
Default: false

Lossless conversion to progressive.

max

Type: Number

Set maximum image quality factor. (0 - 100)

size

Type: Number or String

Try to optimize file to given size. Target size is specified either in kilo bytes (1 -) or as percentage (1% - 99%).

License

MIT © imagemin