Nocturnal Parakeet Monitor
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    bsh-iot-gulp-imagepublic

    gulp-image

    Optimize PNG, JPEG, GIF, SVG images with gulp task.

    Build Status NPM version Dependency Status devDependency Status

    Install

    $ npm install --save-dev gulp-image

    Usage

    This is an example of gulpfile.js.

    const gulp = require('gulp');
    const image = require('gulp-image');
     
    gulp.task('image', function () {
      gulp.src('./fixtures/*')
        .pipe(image())
        .pipe(gulp.dest('./dest'));
    });
     
    gulp.task('default', ['image']);

    You can pass an object to image() as argument such as following:

    gulp.task('image', function () {
      gulp.src('./fixtures/*')
        .pipe(image({
          pngquant: true,
          optipng: false,
          zopflipng: true,
          jpegRecompress: false,
          jpegoptim: true,
          mozjpeg: true,
          gifsicle: true,
          svgo: true,
          concurrent: 10
        }))
        .pipe(gulp.dest('./dest'));
    });

    Set false for optimizers which you don't want to apply. And you can set concurrent option to limit the max concurrency in execution.

    Optionally you may pass enable and disable options to svgo:

    gulp.task('image', function () {
      gulp.src('./fixtures/*')
        .pipe(image({
          svgo: { enable: ["removeRasterImages"], disable: ["removeDoctype"] }
        }))
        .pipe(gulp.dest('./dest'));
    });

    License

    MIT: http://1000ch.mit-license.org/

    install

    npm i bsh-iot-gulp-image

    Downloadsweekly downloads

    2

    version

    2.7.2

    license

    MIT

    repository

    githubgithub

    last publish

    collaborators

    • avatar