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

image-tool-cli

v0.1.0

Published

CLI for photo resize with CSS object-fit: cover, physical units, and RAW preview fallback

Downloads

175

Readme

image-tool

CLI for photo resize with CSS object-fit: cover, physical units, and RAW preview fallback. Every job is a subcommand with full --help.

Install

Requires Node.js 20+.

npm install -g image-tool-cli
image-tool --help

Or run without installing:

npx image-tool-cli --help
npx image-tool-cli resize --help
npx image-tool-cli resize ./photo.jpg -w 800 -H 600

The published package name is image-tool-cli because image-tool is already taken on npm. The command stays image-tool.

Tools

resize — photo resize with object-cover

Scales the photo so it fills the requested box, then crops overflow. This matches CSS object-fit: cover: the output is always exactly --width by --height, with no letterboxing and no stretching.

image-tool resize <input> --width <size> --height <size> [options]

Sizes accept px, cm, and mm. Bare numbers use --unit (default px). Physical units are converted with --dpi (default 96; use 300 for print).

| Option | Description | | --- | --- | | -w, --width <size> | Target width, e.g. 800, 800px, 10cm, 50mm (required) | | -H, --height <size> | Target height. -h is reserved for help. | | -u, --unit <px\|cm\|mm> | Unit for width/height when they have no suffix. Default: px | | -d, --dpi <number> | Converts cm/mm to pixels and is stored on the output. Default: 96 | | -o, --output <path> | Output path. Default: <name>-<W>x<H>-cover.<ext> | | -p, --position <anchor> | Crop anchor, like CSS object-position. Default: center | | -f, --format <format> | jpeg, jpg, png, webp, avif, tiff | | -q, --quality <1-100> | Quality for jpeg/webp/avif/tiff. Default: 80 | | --overwrite | Replace an existing output file | | -v, --verbose | Print source, crop, and output details |

image-tool resize ./photo.jpg -w 1080px -H 1080px
image-tool resize ./photo.jpg -w 10cm -H 15cm --dpi 300
image-tool resize ./photo.jpg -w 50 -H 70 --unit mm --dpi 300
image-tool resize ./photo.jpg -w 800 -H 600 -o ./out.webp -f webp
image-tool resize ./wide.png -w 1920 -H 1080 --position top --verbose
image-tool resize ./IMG_1190.CR2 -w 16cm -H 21cm -f jpeg --verbose

Camera RAW files such as Canon .CR2 are decoded by Sharp when possible. If Sharp cannot read the RAW compression (common with old-style JPEG CR2), the tool uses the largest embedded JPEG preview.

Help

image-tool --help
image-tool resize --help
image-tool help resize

Development

npm install
npm run build
npm test

After a local build:

npm run cli -- --help
npm run cli -- resize ./photo.jpg -w 800 -H 600

Link the binary locally:

npm link
image-tool --help