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

tinify-client

v5.1.2

Published

A CLI to compress your images not only intelligently but also to the EXTREME!

Downloads

63

Readme

tinify-client

A CLI to compress your images not only intelligently but also to the EXTREME!

Compress using tinify which is used by TinyPNG and TinyJPG. Read more at http://tinify.com.

npx tinify-client IMG_URL_OR_LOCAL_IMG_PATH

tinify-client-demo-en-US

中文版文档

tinypng.com 使用的压缩技术将图片压缩到极致

解决需要手动将一张图片拖放到 tinypng 十几次才能达到极致压缩的难题

用法

# 压缩单张或多张本地图片或来自 CDN 的图片
npx tinify-client IMG_URL_OR_LOCAL_IMG_PATH_1 [IMG_URL_OR_LOCAL_IMG_PATH_2 [IMG_URL_OR_LOCAL_IMG_PATH_3]]

# 压缩指定目录下的图片
npx tinify-client DIRECTORY

# 图片转 base64
npx tinify-client base64 IMG_URL_OR_LOCAL_IMG_PATH

如果没有开始压缩,请设置 Key。

设置 Key

Key 可从 https://tinypng.com/developers 免费获取,获取过程很简单不要有心理负担。一行命令设置:

tinify set-key YOUR_TINIFY_KEY

文档

参数介绍,详细介绍 tinify -h

  • key: tinypng 需要的 key
  • src: 支持 cdn 地址或本地图片
  • output -o: 最终压缩图片的地址
  • max-count -m: 最大压缩次数,默认 15 次
  • version: 显示该工具的版本号
  • verbose: 显示每一次压缩的日志
  • no-base64: 不显示压缩图片的 base64。默认显示

Features

  • Compress not only intelligently but also to the EXTREME!
  • Compress images in a batch.
  • Image to base64.

Usage

For more usage try npx tinify-client -h.

  1. compress and output the compressed image's base64

    npx tinify-client IMG_URL_OR_LOCAL_IMG_PATH_1 [IMG_URL_OR_LOCAL_IMG_PATH_2 [IMG_URL_OR_LOCAL_IMG_PATH_3]]
  2. compress all the pngs and jpgs in a folder

    npx tinify-client DIRECTORY
  3. image to base64 only (No need to configure the key)

    npx tinify-client base64 IMG_URL_OR_LOCAL_IMG_PATH

Configure the key

  1. Get your key at https://tinypng.com/developers.

  2. $ tinify set-key YOUR_TINIFY_KEY

Documentation

More parameters ``tinify -h`:

  • output -o: The compressed img file path.
  • max-count -m: Set the max compressing turns. Default 15.
  • version: Show the version.
  • verbose: Show more information about each compressing turn.
  • no-base64: Not output the base64 of the compressed image. base64 encoded by default.

Development

LANG=zh-CN node src/cli https://tinypng.com/images/panda-happy.png max-count=1

CLI Powered by cli-aid. ❤️

TODO

  • [x] 压缩文件夹下面所有的 png jpg
  • [x] cli 参数支持多张图片
  • [x] 压缩单张图片默认打开输出的目录