Coder Social home page Coder Social logo

gulp-imageisux's Introduction

#gulp-imageisux

智图的gulp插件

##Introduce It is a gulp plugin for imageisux(智图), it can automatically compress your images, and it can returns original type and webp-type. You just need to set the src(path) which is the path of your images, and then run pipe(imageisux()), evertything will be done, that's so easy.

##Install Of course, you need to install gulp first. And then use the npm:

$ npm install gulp-imageisux

##Usage

var imageisux = require('gulp-imageisux');

gulp.task('imageisux', function() {
	return gulp.src(['img/*'])
			   .pipe(imageisux('/dest/',true));
});

##API Just two params you should notice, the dirpath and enableWebp.

options

These are basically options to the imageisux

  • dirpath: If it is not defined, it will automatically generate two path: '/dest/' for original type, '/webp/' for webp-type.
  • enableWebp : If true, it will only generate the webp-type, and if 'false', it will only generate the original type. Defaults to false.

###imageisux(dirpath,enableWebp);

var dirpath = "/after/";
var enableWebp = true;
gulp.task('imageisux', function() {
	return gulp.src(['img/*'])
			   .pipe(imageisux(dirpath,enableWebp));
});

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.