mmyhs-utils
TypeScript icon, indicating that this package has built-in type declarations

1.0.2 • Public • Published

工具包

compressPicture

压缩图片

参数 说明 默认值
compressMaxNum 最大压缩次数 3
quality 压缩质量 0.8
maxWidth 压缩后的图片最大宽度,0代表保持原图大小 800
maxSize 单位kb, 压缩后图片的最大大小,如果填写的是 -1 那么就只看 compressMaxNum 的次数 1024
compressPicture(file,{
	compressMaxNum:3,
    quality:0.8,
    maxWidth:800,
    maxSize:1024
}).then(res=>{
    console.log(res)
})

random

随机生成一定范围的数字

random(min,max)

Package Sidebar

Install

npm i mmyhs-utils

Weekly Downloads

17

Version

1.0.2

License

MIT

Unpacked Size

18.4 kB

Total Files

6

Last publish

Collaborators

  • mmyhs