项目作者: hawtim

项目描述 :
kty is a tool repo for compress image via tinypng
高级语言: JavaScript
项目地址: git://github.com/hawtim/kty.git
创建时间: 2019-05-10T06:39:45Z
项目社区:https://github.com/hawtim/kty

开源协议:

下载


kty

封装 tinypng 完成前端构建时的图片瘦身工作,可结合 npm script 完成工作流的配套

基础

基于 @mora/tinypng 封装而成,减少一些配置项,使用 nodejs 命令行运行,降低上手难度

使用

  1. const path = require('path')
  2. const Ty = require('../lib')
  3. let ty = new Ty({
  4. quiet: false,
  5. exclude: ['exclude'],
  6. tokens: ['RBPAYIpjk9Xa7878gWLqeqnUk1UEsNE3'],
  7. path: path.resolve(__dirname, './images'),
  8. cacheDir: path.resolve(__dirname, './cache'),
  9. recordFile: path.resolve(__dirname, './recordFile'),
  10. })
  11. ty.process()

Lincense

ISC