Commit 1ab48452 authored by rockyl's avatar rockyl

need not

parent a9eaa71e
# Tiny-image
图片压缩
可以压缩png和jpg格式的图片,对png的压缩效果比较显著,压缩比高达15%。
使用tinypng的压缩服务
可并发压缩,压缩时间瓶颈在于最大的那张图
## Install
yarn add http://gitlab2.dui88.com/laoqifeng/tiny-image.git
yarn add tiny-image
## Usage
```javascript
import {compressBuffer, compressFile} from 'tiny-image';
let tinyBuffer = compressBuffer('your buffer here');
or
let tinyBuffer = compressFile('you png or jpg file path here');
import {compress} from 'tiny-image';
let tinyBuffer = await compress(文件路径字符串或者Buffer);
```
{
"name": "tiny-image",
"version": "1.0.2",
"version": "1.0.4",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"license": "MIT",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment