Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gulp-query-compress

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-query-compress

This plugin provides automatic compress and copy.

  • 1.1.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

gulp-query-compress

Plugin for gulp-query

Compress your images in other directory

Uses imagemin, pngquant for PNG and pngquant for JPEG

This plugin provides automatic compress and copy.

npm install gulp-query gulp-query-compress

Example

Paste the code into your gulpfile.js and configure it

let build = require('gulp-query')
  , compress = require('gulp-query-compress')
;
build((query) => {
    query.plugins([compress])

      // simple
      .compress('src/icons/*.png','images/')

      // multi
      .compress([
        'src/icons/*.png',
        {from:'src/bg/*',to: 'bg/'},
        {from:'src/bg2/*',to: 'bg2/'}
       ], 'images/','admin')
       
      // multi and config
      .compress([
        'src/icons/*.png',
        {from:'src/bg/*',to: 'bg/'},
        {from:'src/bg2/*',to: 'bg2/'}
       ], 'images/',{
         png: {
           quality: '60-70',
           speed: 1
         }
       })

      // object
      .compress({
        name: 'any',
        from: ['src/images/*.jpg'],
        to: 'images/',
        png: {
          quality: '60-70',
          speed: 1
        },
        jpeg: {
          quality: 60,
        }
      })
    ;
});

And feel the freedom

gulp
gulp --production // For production (minification)
gulp watch // Watching change
gulp compress // Only for compress
gulp compress:admin // Only for task with name admin
...

Options

.compress({
    name: "task_name", // For gulp js:task_name 
    from: 'src/images/*.jpg', // ["src/images/*.jpg", "src/images2/*.jpg"]
    to: "images/",
    png: {
      quality: '60-70',
      speed: 1
    },
    jpeg: {
      quality: 60,
    }
})

Keywords

FAQs

Package last updated on 06 Jan 2019

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc