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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@zd~/tinify

v0.0.47

Published

git tag

Downloads

103

Readme

@zd~/tinify npm

Lightweight image compression command-line tool based on tinypng.com API.


✨ Features

  • 📂 Batch Processing: Supports batch compression with simple glob pattern matching.
  • High-Speed Concurrency: Supports concurrent batch compression with default concurrency of 10, flexibly adjustable via parameters.
  • 🔄 Multiple Modes: Choose between overwriting original images or preserving them.
  • 💾 Save Your Key: Supports caching compressed images to avoid duplicate compression, improving efficiency and maximizing your tinypng key usage.
  • 🗂️ Custom Output: Supports specifying output directory for convenient management of compressed images.

Prerequisites

Make sure you have an API Key from https://tinypng.com/developers. Free users can compress 500 images per month.


Installation

npm i @zd~/tinify -g

After installation, you can directly use the tinify command.


Usage

| Command Example | Description | |-------------------------------------------------------------------|------------------------------------------------| | tinify --help | Display help information | | tinify --version | Display version information | | tinify init <key> | Initialize and set API key | | tinify <glob-pattern> | Compress matched image files | | tinify -n <glob-pattern> | Compress files without overwriting | | tinify --key <key> <glob-pattern> | Use specified key for compression (overrides global key) | | tinify --no-over <glob-pattern> | No-overwrite mode | | tinify --limit 10 <glob-pattern> | Concurrency limit, default 10 (recommended for speed) | | tinify --force | Force compression, ignore all previously compressed images, default false | | tinify --clear-cache | Clear all compression cache | | tinify --show-key | Display API Key |


Parameters

| Parameter | Description | |-----------------------------|--------------------------------------------------| | -h, --help | Display help information | | -v, --version | Display version information | | -k, --key <key> | Set API key | | -n, --no-over | No-overwrite mode, default is overwrite | | -o, --output <dir> | Output directory, default tinify-output (in no-overwrite mode) | | -l, --limit <num> | Concurrency limit, default 10 (recommended for speed) | | -f, --force | Force compression, ignore all previously compressed images | | -c, --clear-cache | Clear all compression cache | | -s, --show-key | Display API Key |


Getting API Key

Visit https://tinypng.com/developers to apply for a free API Key.


Examples

tinify init <your_key>
tinify "images/**/*.png"
tinify --no-over "assets/*.jpg"
tinify --key <your_key> "imgs/*.webp"

Notes

  • Free users can compress 500 images per month. After exceeding the limit, you need to wait for the next month's reset or upgrade to a paid plan.
  • The <glob-pattern> parameter defaults to **/*.(png|jpeg|jpg|gif|webp). You can adjust as needed, refer to fast-glob.
  • By default, original images will be overwritten. If you don't want to overwrite, use the --no-over parameter and optionally use --output to specify output directory (default: tinify-output).
  • It's recommended to set the --limit parameter to improve compression speed. Default concurrency is 10.
  • User configuration file is located at ~/.zd.tinify. You can manually edit this file to modify the API Key.
  • Compression cache files are located at ~/.zd.tinify/.cache. Use --clear-cache parameter to delete all cache (cache uses hash sharding, theoretically won't occupy too much space).

License

MIT