JSPM

gulp-tinify-and-convert

1.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • 0
  • Score
    100M100P100Q22237F
  • License MIT

Minify PNG, JPEG, and WEBP images via TinyPNG's API

Package Exports

  • gulp-tinify-and-convert
  • gulp-tinify-and-convert/index.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (gulp-tinify-and-convert) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-tinify

Update of Josh Broton's gulp-tinify package
Minify compatible files using TinyPNG's API

You must have a TinyPNG Developer API Key for this to work.
The API key is meant to be a local variable named TINIFY_KEY

Usage

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

gulp.task('tinify', function() {
    gulp.src('/img/**/*')
        .pipe(tinify())
        .pipe(gulp.dest('/dest/img'));
});

The conversion mode can be passed to it.

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

gulp.task('tinify', function() {
    gulp.src('/img/**/*')
        .pipe(tinify(['image/webp']))
        .pipe(gulp.dest('/dest/img'));
});

This will convert and compress every image into a .webp image.


The conversion mode can also be set to 'direct' to just compress the image, maintaining filetype.

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

gulp.task('tinify', function() {
    gulp.src('/img/**/*')
        .pipe(tinify('direct'))
        .pipe(gulp.dest('/dest/img'));
});