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

pic-shrink

v1.1.7

Published

pic-shrink is an easy-to-use CLI tool for compressing images in JPG, PNG, and WEBP.

Downloads

2

Readme

pic-shrink

pic-shrink is an easy-to-use CLI tool for compressing images in JPG, PNG, and WEBP.

Prerequisites

  • Node.js installed on your machine

Installation

npm install -g pic-shrink

Usage

To compress a single image file, you can use the following command:

pic-shrink <image-file-path>

To compress multiple image files run the following command:

pic-shrink -i <images-path> -o <output-path> -c <compression-level>

Replace <images-path> with the path to the directory containing the images you want to compress.

Replace <output-path> with the optional path to the directory where you want to store the compressed images. If not provided, the compressed images will be stored in the same directory as the original images.

Replace <compression-level> with an optional value between 1 and 10 to specify the compression level for the images. Lower values result in higher compression and lower image quality, while higher values result in lower compression and higher image quality. If not provided, the default compression level of 7 will be used.

Examples

Compress a single image file

pic-shrink image.jpg

Compress a single image file with a custom compression level

pic-shrink image.jpg -c 4

Compress images located in the "images" directory and store the compressed images in the same directory:

pic-shrink -i images

Compress images located in the "images" directory and store the compressed images in the "output" directory. If the "output" directory does not exist it will be created automatically:

pic-shrink -i images -o output

Compress images located in the "images" directory with a custom compression level:

pic-shrink -i images -c 5

Notes

  • Supported image formats: JPEG, PNG, and WebP.
  • The CLI application uses the Node.js sharp package to perform image compression.
  • Compressed images will be suffixed with "_compressed" and stored in the specified or original directory.
  • The compression level is optional, and if not provided, default values will be used.

Please feel free to create issues for any bugs or unexpected behaviour you come across while using this tool.