JSPM

gulp-tinypng-unlimited

1.0.3
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 47
  • Score
    100M100P100Q70844F
  • License MIT

Use tinypng to compress the gulp plugins of png and jpg.

Package Exports

  • gulp-tinypng-unlimited

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-tinypng-unlimited) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

gulp-tinypng-unlimited

Use tinypng to compress the gulp plugins of png and jpg.

Install

$ npm install --save-dev gulp-tinypng-unlimited

Usage

const gulp = require('gulp');
const tinypng = require('gulp-tinypng-unlimited');

gulp.task('default', () => {
  return gulp.src('./img/**/*.@(png|jpg|jpeg)')
    .pipe(tinypng())
    .pipe(gulp.dest('./dist'));
});

API

const gulp = require('gulp');
const tinypng = require('gulp-tinypng-unlimited');

gulp.task('default', () => {
  return gulp.src('./img/**/*.@(png|jpg|jpeg)')
    .pipe(tinypng({
      cache: true,                        // 开启缓存
      cachePath: path.join(os.tmpdir(), packageConfig.name + '-cache'),                    // 缓存存放的目录
      outputErrorLog: true,               // 打印错误日志
      outputErrorFiles: false,            // 仍然将错误文件输出
    }))
    .pipe(gulp.dest('./dist'));
});

Changelog

2018-5-2 18:22:26

  1. 修改缓存方法
  2. 修改调用参数

2018-4-25 16:25:04

  1. 完成1.0.0版本的功能
  2. 添加简单的测试
  3. 提交npm