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

recursive-resize

v0.0.2

Published

Resize a full directory of images and generate thumbnails

Readme

recursive-resize

This simple command-line tool resizes all images in a directory to a specified width, and outputs them in an output directory. It can also generate thumbnails of an even smaller size, all prefixed with "tn-".

This is meant to be used to quickly shrink a large amount of heavy files, to save on loading times and network usage. Images will maintain their aspect ratio.

To install, use npm install -g recursive-resize

To run, you use recursive-resize (or if that's too many letters, you can use recres instead.)

CLI Options

  • -i, --input: Defines the input directory. Every .png, .jpg, and .jpeg file within the directory will be resized. Can
    • If no input directory is defined, the current directory will be used. If you do this, make sure your output directory is NOT inside the working directory! You should always define both input and output.
  • -o, --output: Defines the output directory. The same file structure from the input directory will be created. Any existing files with the same filenames will be overwritten.
    • If no output directory is defined, the current directory will be used. If you do this, make sure you aren't outputting into your input directory! You should always define both input and output.
  • -w, --width: The new width of every image. Because aspect ratio is meant to be maintained there is no height option.
  • -t, --thumbnail: The new width for each thumbnail. If not defined, no thumbnails will be generated. Thumbnail files are prefixed with "tn-" before the image's regular filename.
  • -d, --debug: Print additional output.
  • -h, --help: Shows these options.

If you want to overwrite your input directory with your output, you can use ./ as both the -i and -o arguments. You probably shouldn't do this though. And you also probably shouldn't use an output directory as an input directory.

Examples

recres -i fullsize-images -o public/images -w 2000 -t 256 Resizes all images from the directory fullsize-images and places it into the public/images directory at 2000px wide, along with thumbnails for each image that are 256px wide.

recres -o ../newimages -w 6000 Resizes all images from current working directory newimages, sizes them up to 6000px across, and puts them into an outer folder.

recres -i /home/user/images -w 25 -t 200 -d Resizes all images from absolute directory /home/user/images to be 25px wide, with their thumbnails 200px wide. I dunno why you'd do this... but no judgement here. This also prints progress and extra information.