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

image-batch

v0.0.4

Published

Batch images resizing. [NO NATIVE DEPENDENCIES]

Downloads

5

Readme

Batch images resizing [NO NATIVE DEPENDENCIES NEEDED]

Build Status

Easy module for resizing of large amount of images

Powered by Jimp which does not require any native dependencies

Just use

image-batch -D path/to/images --resize 50% --postfix m

Motivation

Need to resize huge amount of images.

For example here is directory with big amount of device mockups of different image types:

iphone_6.png
iphone_6_gold.jpg
iphone_mockup.jpg
mockup_htc_8.png
galaxy-note-4-psd-mockup.png

The task: Produce iPhone mockups of 3 types(100% size with -l postfix, 50% size with -m postfix and 25% size with -s postfix) and png format.

Here is how to get things done with image-batch: Let's create 100% size mockups for beginning:

image-batch -D path/to/mockups --name iphone% --resize 100% --save-as png --postfix l

Now our directory look like this:

iphone_6.png
iphone_6_gold.jpg
iphone_mockup.jpg
iphone_6-l.png
iphone_6_gold-l.png
iphone_mockup-l.png
mockup_htc_8.png
galaxy-note-4-psd-mockup.png

Next we need 50% size mockups:

image-batch -D path/to/mockups --name iphone% --no-name iphone%-l --resize 50% --save-as png --postfix m

And 25% size:

image-batch -D path/to/mockups --name iphone% --no-name iphone%-l,iphone%-m --resize 25% --save-as png --postfix s --remove-original

Here is how our directory should look like on finish:

iphone_6-l.png
iphone_6_gold-l.png
iphone_mockup-l.png
iphone_6-m.png
iphone_6_gold-m.png
iphone_mockup-m.png
iphone_6-s.png
iphone_6_gold-s.png
iphone_mockup-s.png
mockup_htc_8.png
galaxy-note-4-psd-mockup.png

Installation

npm install -g image-batch

Usage

image-batch --help
Usage: image-batch [options]

Options:
 -V, --version          Prints version
 -H, --help             Prints this message

 -R, --resize           Set resize query
 -D, --directory                Set base directory where images are
 -N, --name             Filename search pattern. Can be listed with comma
 -NN, --no-name         Filename excluding pattern. Can be listed with comma
 -OF, --only-format             Set exclusive image format to process
 -WOF, --without-format         Set image format that will be not processed
 -P, --postfix          Set name postfix for output files
 -F, --formats          Set exclusive list of formats separated by commas
 -S, --save-as          Set format for output files
 -REMOVE, --remove-original             Set remove original files flag