gulp plugin to compress png images using tinypng api
Switch branches/tags
Nothing to show
Clone or download
Pull request Compare This branch is 5 commits ahead of creativeaura:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.editorconfig
.gitattributes
.gitignore
README.md
_config.yml
gulpfile.js
index.js
package.json
test.js

README.md

gulp-tinypng

FOSSA Status

Image optimization with Gulp and TinyPNG

Install

Install with npm

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

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'
]

cached: 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

FOSSA Status