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

@codernex/nexpress

v1.0.8

Published

Multi-threaded image batch processor CLI

Readme

NexPress - TypeScript Image Batch Processor CLI

A high-performance, multi-threaded command-line tool built with Node.js and TypeScript. It converts and compresses batches of images into efficient WebP format using worker threads for maximum speed.

⚡ Benchmarks

Tested on a standard machine processing a folder of 111 High-Res Images:

| Metric | Result | | :--- | :--- | | Total Time | ~4.5 seconds | | Throughput | ~25 images / sec | | Success Rate | 100% |

vs. standard single-threaded scripts which typically take 4x-5x longer.

🚀 Features

  • Multi-threaded Processing: Uses Node.js worker_threads to process images in parallel, utilizing all available CPU cores.
  • Format Conversion: Automatically converts .jpg, .jpeg, and .png files to optimized .webp.
  • Smart Path Handling: Supports both absolute system paths and paths relative to your home directory.
  • Space Savings: Calculates and displays the amount of disk space saved per image in MB.
  • Custom Quality: User-definable compression quality (1-100).
  • Robust Error Handling: Graceful shutdowns and detailed error logging.

📦 Installation

You can use NexPress in three ways:

1. Global Installation (Recommended)

This installs the @codernex/nexpress command system-wide.

npm install -g @codernex/nexpress

2. Run Once with npx

Use it immediately without installing.

npx @codernex/nexpress --input=Desktop/photos --output=Desktop/compressed

3. Local Development / Building from Source

# Clone the repository
git clone https://github.com/codernex/nexpress
cd nexpress

# Install dependencies
npm install

# Build the project
npm run build

# Link globally for testing
npm link

🛠 Usage

If installed globally or linked, simply run nexpress:

nexpress --input=<path> --output=<path> [options]

📂 Path Flexibility

NexPress is smart about file paths. You can provide:

  1. Relative Paths (from User Home): If you type Desktop/images, the tool looks in ~/Desktop/images (Linux/Mac) or C:\Users\You\Desktop\images (Windows).
nexpress --input=Desktop/raw --output=Desktop/processed
  1. Absolute Paths: You can also provide the full system path.
nexpress --input=/home/user/Downloads/pics --output=/var/www/html/assets

Options

| Option | Required | Description | Default | | ----------- | -------- | -------------------------------------------------- | ------- | | --input | ✅ | Source folder path (Absolute or relative to Home). | N/A | | --output | ✅ | Destination folder path. | N/A | | --quality | ❌ | Compression quality (1-100). | 80 | | --help | ❌ | Displays the help menu. | N/A |

Examples

Standard Compression (Default Quality: 80)

nexpress --input=Photos --output=CompressedPhotos

High Compression (Maximum Space Saving)

nexpress --input=Desktop/Wallpapers --output=Desktop/WebP_Small --quality=50

High Quality (Near Lossless)

nexpress --input=/mnt/data/raw --output=/mnt/data/optimized --quality=95

💻 Development

If you want to contribute or modify the code:

  1. Clone and Install:
git clone https://github.com/codernex/nexpress
npm install
  1. Run in Development Mode: You can run the script directly using ts-node.
# Run directly without building
npx ts-node src/index.ts --input=TestIn --output=TestOut

🏗 Architecture

The tool uses a Main Thread -> Worker Pool architecture:

  1. Main Thread: Scans the input directory and creates a queue of image processing jobs.
  2. Worker Threads: Each CPU core gets a worker. The main thread distributes jobs to workers dynamically.
  3. Sharp: Inside the worker, the sharp library handles the actual image buffer manipulation and WebP conversion.

📝 License

This project is licensed under the MIT License.