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

@mantiqh/image-optimizer

v1.1.1

Published

CLI to optimize images.

Readme

@mantiqh/image-optimizer

A universal, high-performance CLI tool to optimize images.
It works on Zips, Folders, and Single Files, recursively processing nested directories and maintaining exact file structures.

Built for developers to quickly reduce asset sizes before deployment without complex configs.

🚀 Features

  • Universal Input: Works on .zip files, local folders, or single images.
  • Recursive: Process entire directory trees; copies non-image files (CSS, JS) unchanged.
  • Expanded Support: Optimizes JPG, PNG, WebP, AVIF, GIF, TIFF, and SVG.
  • Smart Output: Creates optimized versions next to your source files by default.
  • Safe: If an optimized image is larger than the original, it keeps the original.

📦 Installation & Usage

Method 1: Run with npx (Recommended)

No installation required. Run it anywhere:

npx @mantiqh/image-optimizer --source ./assets.zip

Method 2: Global Install

If you use it frequently:

npm install -g @mantiqh/image-optimizer

Then run:

image-optimizer -s ./public/images

💡 Examples

1. Optimize a Zip File

Reads assets.zip, optimizes images inside, and saves as assets-optimized.zip.

npx @mantiqh/image-optimizer -s ./assets.zip

2. Optimize a Folder (Recursive)

Optimizes all images inside ./public, creates ./public-optimized, and copies all other files (fonts, videos, etc.).

npx @mantiqh/image-optimizer -s ./public

3. Optimize a Single File

Optimizes hero.png and saves it as hero-optimized.png.

npx @mantiqh/image-optimizer -s ./hero.png

4. Custom Output & Quality

Optimizes a folder with 90% quality and saves to a specific location.

npx @mantiqh/image-optimizer -s ./raw-photos -o ./website-ready -q 90

🛠 Command Line Options

| Flag | Alias | Description | Default | | :---------- | :---- | :------------------------------------------- | :------------------- | | --source | -s | (Required) Path to file, folder, or zip. | - | | --output | -o | Custom output path. | [source]-optimized | | --quality | -q | Compression quality (1-100). | 80 | | --width | -w | Max width in pixels (resizes if larger). | 1600 | | --help | -h | Show help and examples. | - |


💻 Development

  1. Clone the repo:

    git clone <your-repo-url>
    cd image-optimizer
  2. Install dependencies:

    pnpm install
  3. Run in dev mode:

    # Test on a folder
    pnpm dev --source ~/Desktop/test-folder
  4. Build:

    pnpm build