🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@iro/tiny

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@iro/tiny

# 编译 ```bash wasm-pack build ```

latest
npmnpm
Version
1.0.0
Version published
Weekly downloads
5
66.67%
Maintainers
1
Weekly downloads
 
Created
Source

PNGQUANT

编译

wasm-pack build

测试

# build 后进入 pkg 目录
pnpm link --global

# 进入前端项目
pnpm link --global pngquant

前端项目引入

import * as pngquant from 'pngquant'

const reader = new FileReader()
const file = // 带压缩图片文件
reader.readAsArrayBuffer(file)
reader.onload = () => {
  const f = new Blob([pngquant.deflate(new Uint8Array(reader.result as ArrayBuffer))], {type: 'image/png'})
  console.log(URL.createObjectURL(f))
}

FAQs

Package last updated on 22 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts