0.1.17 • Published 6 years ago

iqo v0.1.17

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

IQO

图片压缩

Install

# npm 安装
npm install iqo --save-dev 或者 npm i iqo -D
# yarn 安装
yarn add iqo --save-dev

Usage

注意: 如果是使用webpack打包,建议使用dist/iqo.es.js.

webpack配置:

module.exports = {
  ...
  resolve: {
    alias: {
      'iqo$': 'iqo/dist/iqo.es.js'
    }
  }
  ...
}
import IQO from 'iqo'

let standard = 600 // 默认图片小于 standard * standard时,不进行缩放操作
let file = xxx
let quality = 55 // 只对webp和jpg图片有效,这是canvas决定的
let scale = 60
let iqo = new IQO(standard)
iqo.compress(file, quality, scale)
  .then(newfile => {
    console.log(file.size, newfile.size)
  })
0.1.17

6 years ago

0.1.16

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

7 years ago

0.1.12

7 years ago

0.1.11

7 years ago

0.1.10

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.10

7 years ago

0.0.9

7 years ago

0.0.8

7 years ago

0.0.7

7 years ago

0.0.6

7 years ago

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago