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

media-to-web

v0.0.6

Published

🎨 CLI tool to convert images and videos to web-optimized formats (WebP, WebM) - Under Development

Readme

Version Status

🎨 Media to Web CLI

A powerful CLI tool to convert images and videos to web-optimized formats with advanced features and GPU acceleration.

English | ν•œκ΅­μ–΄

⚠️ Development Status

This project is currently in early development (v0.0.1).

Known Limitations:

  • Limited format support (WebP, WebM only)
  • No recursive folder scanning
  • No batch configuration files
  • Limited error handling

Planned Features:

  • Additional formats (AVIF, HEIC, etc.)
  • Recursive folder processing
  • Configuration file support
  • Better error messages
  • Performance optimizations

Contributions and feedback are welcome!

✨ Key Features

  • πŸ–ΌοΈ Image Conversion: JPG/PNG β†’ WebP/AVIF
  • 🎬 Video Conversion: MP4/MOV β†’ WebM with GPU acceleration
  • πŸ“ Interactive folder browser starting from root directory
  • 🎯 Command line arguments (--help, --version, input-path)
  • πŸ“ Smart file selection (select all or individual files)
  • ⚑ Parallel processing with CPU usage control
  • πŸš€ GPU acceleration (NVIDIA/AMD auto-detection)
  • πŸ“Š Real-time progress tracking (per-file progress for videos)
  • βš™οΈ Advanced mode with custom encoding parameters
  • πŸ”„ Back navigation at every step
  • ⏱️ Elapsed time tracking
  • πŸ›‘οΈ Graceful exit handling with file cleanup options
  • 🌐 Bilingual support (English/Korean)

πŸ“¦ Installation

From NPM (Coming Soon)

# Install globally
npm install -g media-to-web

# Use the CLI
npx mtw-cli

# Quick mode (non-interactive)
# Images: provide all options at once
npx media-to-web --quick --type image \
  --input ./images --output ./converted \
  --quality high --concurrency balanced --select all

# Videos: missing values fall back to defaults (webm/high/balanced)
npx media-to-web --quick --type video \
  --input ./videos --output ./converted --select "*.mp4"

From Source

# Clone the repository
git clone https://github.com/yourusername/media-to-web.git
cd media-to-web

# Install dependencies
npm install

# Run the CLI
npm start
# or
node bin/index.js

πŸš€ Usage

Command Line Arguments

# Show help
npx mtw-cli --help

# Show version
npx mtw-cli --version

# Convert files in specific folder
npx mtw-cli /path/to/your/media/files

# Interactive mode (browse folders)
npx mtw-cli

Run with NPX (Recommended)

# Navigate to folder with files to convert
cd /path/to/your/media/files

# Run CLI
npx mtw-cli

Run locally

npm start

### Local development/testing (npm link)

```bash
# 1) Build
npm run build

# 2) Create a global symlink
npm link

# 3) Test from another folder
mtw-cli --help
mtw-cli --version

# 4) Remove global link
npm unlink -g media-to-web

# 5) Optionally unlink in project root
npm unlink

Notes:

  • If you hit permission issues, use sudo npm link / sudo npm unlink -g.
  • If a global link remains, npx may prefer the linked code over the published package.

## πŸ’‘ Usage Example

### Interactive Folder Browser

```bash
$ npx mtw-cli

🎨 Media to Web CLI

? How would you like to select the input folder? πŸ“ Browse folders

πŸ“ Current directory: /
Found 12 folders
? Select an option: πŸ“ Users

πŸ“ Current directory: /Users
Found 2 folders
? Select an option: πŸ“ butfitseoul

πŸ“ Current directory: /Users/butfitseoul
Found 18 folders
? Select an option: πŸ“ Downloads

πŸ“ Current directory: /Users/butfitseoul/Downloads
Found 6 folders
? Select an option: βœ… Select this folder
Selected input folder: /Users/butfitseoul/Downloads

? What would you like to convert? 🎬 Videos (mp4/mov β†’ webm)

? Select configuration mode: πŸ”§ Simple Mode - Use presets

? How would you like to select files? βœ“ Select all files

? Select conversion quality: Medium - Recommended

? CPU usage level: βš–οΈ Balanced - Recommended (cores/2)

? Output folder for converted files: ./converted

Configuration:
  Convert type: Images
  Mode: Simple
  Selected files: 3
  Input folder: /Users/username/Photos
  Output folder: /Users/username/Photos/converted
  CPU usage: balanced (2 concurrent processes)
  Quality: medium

βœ” Converting 3 files...

βœ… Success (3 files):

  photo1.jpg β†’ photo1.webp
    2.5 MB β†’ 850 KB (66.0% reduction)
  photo2.png β†’ photo2.webp
    4.1 MB β†’ 1.2 MB (70.7% reduction)
  vacation.jpeg β†’ vacation.webp
    1.2 MB β†’ 420 KB (65.0% reduction)

Output folder: /Users/username/Photos/converted
Total elapsed time: 2m 34s

🎯 Supported Formats

Images

  • Input: .jpg, .jpeg, .png
  • Output: .webp

Videos

  • Input: .mp4, .mov, .avi, .mkv
  • Output: .webm

βš™οΈ Configuration Modes

Simple Mode (Default)

Quick setup with predefined quality presets:

Images:

  • High: 90% quality, WebP format
  • Medium: 80% quality, WebP format (recommended)
  • Low: 60% quality, WebP format

Videos:

  • High: CRF 23, Slow preset, VP9 codec
  • Medium: CRF 28, Medium preset, VP9 codec (recommended)
  • Low: CRF 35, Fast preset, VP9 codec

Advanced Mode

Custom encoding parameters for power users:

Images:

  • Custom quality (0-100)
  • Format selection (WebP/AVIF)
  • Advanced Sharp options

Videos:

  • Custom CRF value (0-51)
  • Encoding preset selection
  • Codec selection (VP9/H.264/H.265)
  • GPU acceleration options

πŸš€ Performance Features

CPU Usage Control

  • Maximum: Use all available cores (fastest)
  • Balanced: Use half the cores (recommended)
  • Light: Use 1-2 processes (gentle on system)
  • Custom: Specify exact number of concurrent processes

GPU Acceleration

  • NVIDIA GPU: Automatic detection and H.264 NVENC encoding
  • AMD GPU: Automatic detection and H.264 AMF encoding
  • CPU Fallback: VP9 encoding when no GPU detected
  • Quality Preserved: Same CRF values regardless of encoder

Parallel Processing

  • Images: 2-4x faster with parallel processing
  • Videos: 2-3x faster with parallel processing
  • Smart Batching: Optimal batch sizes for different file types

πŸ› οΈ Tech Stack

  • Runtime: Node.js (ES Modules)
  • Image conversion: Sharp
  • Video conversion: FFmpeg (fluent-ffmpeg + ffmpeg-static)
  • CLI interface: Inquirer
  • UI enhancement: Chalk, Ora

πŸ“‚ Project Structure

media-convert/
β”œβ”€β”€ bin/
β”‚   └── index.js          # CLI entry point
β”œβ”€β”€ src/
β”‚   β”œβ”€β”€ prompts.js        # User input handling
β”‚   β”œβ”€β”€ imageConverter.js # Image conversion logic
β”‚   └── videoConverter.js # Video conversion logic
β”œβ”€β”€ package.json
└── README.md

🚧 Future Plans

  • [x] Command line options (--help, --version, --input-path)
  • [x] Real-time progress display
  • [x] Parallel processing support
  • [x] Interactive folder browser
  • [x] Graceful exit handling
  • [ ] Recursive subfolder scanning (--recursive)
  • [ ] Additional format support (HEIC, etc.)
  • [ ] Resizing/cropping features
  • [ ] Metadata preservation options
  • [x] npm publishing setup

πŸ“ License

MIT

🀝 Contributing

Issues and PRs are welcome!

⚠️ Notes

  • Requires Node.js 18 or higher
  • FFmpeg is automatically included (ffmpeg-static)
  • Large file conversion may take time
  • Original files are not modified (saved to new folder)