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

@harurow/icon-resize

v1.0.4

Published

A CLI tool for resizing icon images with customizable dimensions and automatic file watching for changes. Ideal for managing and updating icon assets efficiently.

Downloads

218

Readme

@harurow/icon-resize

This project is a CLI tool for resizing images. It is designed to be simple and efficient, allowing you to resize images to various sizes. It also supports automatic processing when files are updated by monitoring changes.

Features

  • Resizes images to the specified size.
  • Monitors file changes and automatically resizes on update.
  • Supports overwriting existing files with the --force option.
  • Allows specifying multiple sizes.
  • Custom output directory configuration.

Installation

To use this tool, you need to have Node.js installed. Once Node.js is set up, you can install the tool globally using the following command:

npm install -g icon-resize

Alternatively, you can run the tool using npx without installing it globally:

npx @harurow/icon-resize <file-path> [options]

Usage

Basic Command

npx icon-resize <file-path> [options]

Options

  • --output-dir=<dir>: Required. Specifies the output directory where the resized images will be saved.
  • --size=<size>: Specifies the size for resizing (can be used multiple times). Example: --size=32. Default sizes are 16, 32, 64, 128.
  • --force, -f: Overwrites existing files in the output directory. Example: --force.
  • --watch, -w: Watches for file changes and automatically resizes when the file changes. Example: --watch.
  • --help, -h: Shows this help message.

Examples

  1. Resize an image to 32x32 pixels and save it to a directory:
npx icon-resize ./path/to/image.png --size=32 --output-dir=output-dir
  1. Monitor an image file for changes and automatically resize on change:
npx icon-resize ./path/to/image.png --size=64 --output-dir=output-dir --watch
  1. Resize an image to multiple sizes and overwrite existing files:
npx icon-resize ./path/to/image.png -s 16 -s 128 -o output-dir -f

Development

Prerequisites

  • Node.js
  • npm

Setup

Clone the repository:

git clone https://github.com/yourusername/icon-resize.git
cd icon-resize
npm install

Running Tests

You can run tests with the following command:

npm test

The tests are located in the tests directory. During testing, images are automatically copied to a temporary directory, and the output directory is cleared for each test.

License

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