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

photo-compressor

v1.0.0

Published

photo-compressor is a command-line tool to optimize and compress images locally or from the cloud. It leverages the power of sharp to convert images to webp format and compress them, ensuring efficient and hassle-free image optimization for web developers

Readme

photo-compressor

photo-compressor

npm version downloads license issues stars contributors last commit Code Coverage

photo-compressor CLI is a command-line tool to optimize and compress images locally or from the cloud. This tool leverages sharp to perform image compression and conversion to .webp format. It's a great utility for web developers to convert their media to .webp and compress them to serve easily to their end users.

Features

  • Optimize images in a local directory

  • Optimize images from a URL or a directory of image URLs

  • Automatically handles file name conflicts

  • Provides detailed logging with statistics on savings and processing time

Installation

Install the CLI globally using npm:

npm install -g photo-compressor

or use yarn

yarn global add photo-compressor

or use npx to run it without installation

npx photo-compressor

Usage

Below are the available commands and options for the Photo Compressor CLI.

Common Options

  • -h, --help: Display help information for a command.

  • -V, --version: Output the current version of the package.

Commands

photo-compressor local

Description: Optimize and compress images in a local directory.

Usage:

photo-compressor local --dir <path_to_directory> --output <path_to_output_directory>

Options:

  • -d, --dir <path>: Directory to scan for images (Required).

  • -o, --output <path>: Output directory for optimized images, default is ./optimized.

photo-compressor cloud

Description: Optimize and compress images from a URL or a directory URL.

Usage:

photo-compressor cloud --url <image_url_OR_array_of_images> --output <path_to_output_directory>

Options:

  • -u, --url <url>: URL of the image or an array of image URLs to compress (Required).

  • -o, --output <path>: Output directory for optimized images, default is ./optimized.

Notes:

  • --url option can take a single image URL or an array of image URLs for batch processing.

Examples

Optimize Local Images

photo-compressor local --dir ./images --output ./optimized

Optimize Cloud Images

photo-compressor cloud --url ['https://example.com/image.jpg','https://example.com/image_2.jpg'] --output ./optimized

Contributing

We welcome contributions to enhance the functionality of Photo Compressor CLI! Here are some guidelines:

  1. Fork the repository.

  2. Create a new branch with a descriptive name (e.g., feature-add-optimization).

  3. Make your changes and commit them with clear and concise messages.

  4. Raise a pull request against the main branch. Include a detailed description of your changes and the problem you're addressing.

  5. Wait for the maintainers to review your pull request. Engage actively in any feedback and make necessary updates.

Thank you for your contributions!

Issues

If you encounter any issues or bugs or have feature requests, please open an issue in the Issues section of the repository. When reporting an issue, please provide as much detail as possible, including:

  • Steps to reproduce the issue

  • Expected and actual behavior

  • Relevant logs or error messages

  • Screenshots (if applicable)

We appreciate your feedback and will strive to address issues promptly!

License

This project is licensed under the MIT License. See the LICENSE file for details.

Hire Me

Hey there! I'm currently open to new opportunities and would love to work on exciting projects. If you're interested in collaborating or hiring me, feel free to reach out via email or connect with me on LinkedIn

Let's create something amazing together! 🚀

Notes

  1. This is yet another wrapper around sharp. Further optimizations will be added down the road, but it is a good utility to convert and optimize a bunch of images hassle-free.

  2. I was watching Silicon Valley and wanted to build something related to compression. (P.S. I'm a noob)

  3. This is a good utility tool for web developers to compress and convert a bunch of images to .webp.