npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

compress-img-cli

v1.1.0

Published

小而强的图片可控压缩工具 CLI 版,在线体验:ci.clicli.asia

Readme

compress-img-cli

小而强的图片压缩命令行工具。它把 compress-image_py_web 项目的 Python 压缩核心预打包成 Windows / Linux 可执行文件,再通过 npm 分发;安装后无需用户单独安装 Python、Pillow 或 PyInstaller。

在线体验:https://ci.clicli.asia

安装

npm install -g compress-img-cli

安装后终端命令为:

compress-img --help

快速使用

compress-img input.png
compress-img -o output.webp input.png
compress-img --target-kb 50 --aggressive input.png
compress-img --grayscale --format jpg input.png

Windows 剪贴板模式:

compress-img --clipboard
compress-img --clipboard -o outputs/from_clipboard --format png

常用参数

| 参数 | 默认值 | 说明 | |------|--------|------| | input | 无 | 输入图片路径;使用 --clipboard 时可省略 | | -o, --output | 自动生成 | 输出文件路径或目录 | | --target-kb | 80 | 目标体积 KB,尽量压到此值以内 | | --max-side | 1300 | 最长边像素上限,不放大原图 | | --format | jpg | 输出格式:auto / webp / png / jpeg / jpg | | --min-quality | 70 | WebP/JPEG 最低质量 | | --min-long-side | 无 | 手动指定最低最长边 | | --scale-step | 0.92 | 每轮缩小比例,越小尝试越少 | | --grayscale | false | 转为灰度图 | | --sharpness | 1.10 | 轻微锐化强度,设为 1 可关闭 | | --aggressive | false | 更激进地追求小体积 | | --clipboard | false | Windows 专用:读取剪贴板图片或文件列表 |

更完整的帮助见 HELP.md

平台支持

| 平台 | 状态 | 说明 | |------|------|------| | Windows | 支持 | 包含 resources/win/compress-image.exe,支持剪贴板模式 | | Linux | 支持 | 包含 resources/linux/compress-image,剪贴板模式会给出友好提示 | | macOS | 暂不支持 | 当前 npm 包声明只支持 win32linux |

发布包内容

npm 包通过 files 字段只发布必要文件:

bin/
resources/
HELP.md
PUBLISHING.md
CHANGELOG.md
SUPPORT.md
SECURITY.md
README.md
LICENSE
package.json

其中 resources/ 下的二进制文件不纳入 git 管理,但发布前必须先构建出来,否则用户安装后无法运行。

从源码构建发布包

Windows:

cd package
npm run build:win
npm pack --dry-run

Linux:

cd package
npm run build:linux
npm pack --dry-run

完整发布流程见 PUBLISHING.md

支持和安全

许可证

MIT。详见 LICENSE