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

tinypng-plus

v1.0.1

Published

tinypng-plus 图片压缩命令行工具。可选择是否递归处理和覆盖原文件;支持压缩指定文件或目录,也可指定输出目录。

Downloads

6

Readme

tinypng-plus 图片压缩命令行工具

可选择是否递归处理和覆盖原文件;支持压缩指定文件或目录,也可指定输出目录。 tinypng-plus 是基于tinypng 开发的,压缩质量同 tinypng。

使用方法

安装:

npm install tinypng-plus -g

然后,在命令行进入到你想要压缩图片的目录,执行:

tinypng-plus

指令说明

用法:

tinypng-plus [选项]

选项:

  • --path <路径> 指定输入的路径(可以是目录,也可以是文件)。默认值为当前目录。
  • --output <路径> 指定输出目录的路径。默认值为输入目录下的 "output" 目录。
  • -r 递归(recursive)地压缩处理所有目录下的图片。(无参数)
  • -f 压缩后的图片强制(force)覆盖原图片。(无参数)

其他选项:

  • --help-h 显示帮助信息并退出。
  • --version-v 显示工具版本信息并退出。

示例用法:

  1. 使用默认参数运行工具(处理当前目录下的所有文件,并将结果保存在当前目录的 output 目录中):
tinypng-plus
  1. 递归压缩当前目录下的所有文件,并将结果保存在当前目录的 output 目录中:
tinypng-plus -r
  1. 压缩当前目录下的所有文件,并使用结果覆盖原文件:
tinypng-plus -f
  1. 递归压缩当前目录下的所有文件,并使用结果覆盖原文件:
tinypng-plus -rf
  1. 指定输入目录或文件,并将结果保存在默认的输出目录:
tinypng-plus --path /path/to/input
  1. 指定输入目录或文件,并将结果保存在默认的输出目录:
tinypng-plus --path /path/to/input
tinypng-plus --path /path/to/input/img.png
  1. 指定输出目录的路径:
tinypng-plus --out /path/to/output
  1. 指定输入目录和输出目录的路径:
tinypng-plus --path /path/to/input --out /path/to/output

注意: --path 参数支持目录和文件 -f 会覆盖原文件,请根据需求使用。-f 优先级高于--output,即使用-f 后--output 无效。

说明

  • tinypng 默认是会对用户上传数量有限制的,使用了 X-Forwarded-For 头绕过该限制
  • 只能压缩小于 5M 的图片,且只支持 png 和 jpg 格式。