1.0.0 • Published 6 years ago

gulp-tiny v1.0.0

Weekly downloads
1
License
MIT
Repository
github
Last release
6 years ago

gulp-tiny

Image optimization with Gulp and TinyPNG

Install

Install with npm

npm i gulpjs/gulp#4.0
npm i --save-dev gulp-tinypng 

Example

var	gulp = require('gulp'),
    tiny = require('gulp-tiny'),
    paths =  {
		input: 'img/**/*.{png,jpg,jpeg}',
		output: 'TinyImg'
};
 
var Api_Key = [
	    '8FiQFj9oWwEyTBHMMwxjvuYNx05Fphk2',
	    '08gBPsFKxDDljaEDwlUhxxEhn6811pCp'
];
 
gulp.task('tiny', function () {
	    return gulp.src(paths.input, {since: gulp.lastRun('tiny')})
	    .pipe(tiny({
	        apiKey : Api_Key,
	        cache: false,
	        log: false
	    }))
	    .pipe(gulp.dest(paths.output))
});
 
gulp.task('default', gulp.series('tiny'));

Options

api_Keys = [
    'API_KEY_1',
    'API_KEY_2'
]
cache: true
log: false	

TODO

  • add the possibility to Resize Images
    • scale
    • fit
    • cover
  • rename images with the prefix like that
    • tinyimage-320.jpg
    • tinyimage-480.jpg
    • tinyimage-640.jpg

License

MIT © EinfachAleks

Original MIT © Gaurav Jassal