0.1.17 • Published 5 years ago

iqo v0.1.17

Weekly downloads
1
License
MIT
Repository
github
Last release
5 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

5 years ago

0.1.16

5 years ago

0.1.15

5 years ago

0.1.14

5 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.10

6 years ago

0.0.9

6 years ago

0.0.8

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago