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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@julytian/tinypng-cli

v2.1.2

Published

An command line tool for tinypng.com

Downloads

14

Readme

Tinypng CLI:高效的图片压缩工具

Tinypng CLI 是一个基于 Tinypng.com 网页版实现的命令行工具,支持多种格式转换和压缩包操作。

特性

  • 支持多种图片格式: png、jpg、jpeg、webp
  • 便捷的压缩方式: 单张图片、整个文件夹或压缩包
  • 灵活的图片格式转换: png、jpg、jpeg、webp 之间的互转
  • 压缩包解压缩: 支持 tar、zip、tgz 格式
  • 压缩后的图片打包: 生成 tar、zip、tgz 等格式的压缩包

安装

# npm
npm i @julytian/tinypng-cli -g

# yarn
yarn i @julytian/tinypng-cli -g

# pnpm
pnpm i @julytian/tinypng-cli -g

快速上手

$ tinypng <file> [options]
# 帮助信息
$ tinypng --help
# 版本信息
$ tinypng --version
# 多语言设置输出 (zh, en)
$ tinypng -l zh
# 压缩单张图片
$ tinypng a.png
# 压缩单张图片并将 png 格式图片转换为 jpeg 格式
$ tinypng a.png -c jpeg
# 压缩单张图片并生成 zip 格式包
$ tinypng a.png -z
# 压缩单张图片并生成 tar 格式包
$ tinypng a.png -z tar
# 压缩 a 目录下的图片
$ tinypng a
# 递归遍历 a 目录,压缩 a 目录下的所有的图片
$ tinypng a -r
# 压缩目录下的图片并生成 zip 格式包
$ tinypng a -z
# 压缩目录下的所有图片并生成 zip 格式包
$ tinypng a -r -z
# 压缩目录下的所有图片并生成 tgz 格式包
$ tinypng a -r -z tgz
# 解压 zip 格式包并压缩里面的图片
$ tinypng a.zip
# 解压 zip 格式包并压缩里面的图片,并重新生成 zip 格式包
$ tinypng a.zip -z
# 解压 zip 格式包并压缩里面的图片,并重新生成 tar 格式包
$ tinypng a.zip -z tar

选项

  • -h, --help: 显示帮助信息。
  • -v, --version: 显示版本号。
  • -z, --zip <格式>: 生成指定格式的压缩包 (zip, tar, tgz)。
  • -c, --convert <格式>: 将图片转换为指定格式 (png, jpg, jpeg, webp)。
  • -r, --recursive: 递归遍历文件夹。
  • -l, --language <语言>: 设置输出语言 (zh, en)。

案例

# 压缩名为 "a.png" 的图片
$ tinypng a.png

# 压缩名为 "a.png" 的图片并转换为 jpeg 格式
$ tinypng a.png -c jpeg

# 压缩名为 "a.png" 的图片并生成 zip 包
$ tinypng a.png -z

# 压缩名为 "images" 的文件夹下的所有图片
$ tinypng images -r

# 解压名为 "images.zip" 的 zip 包并压缩里面的所有图片
$ tinypng images.zip

许可证

本项目采用 MIT 许可证