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

png2webp-hybrid-cli

v1.0.4

Published

CLI tool to convert PNG images to WebP with Node primary engine and Python fallback.

Readme

png2webp-hybrid-cli

Convert PNG/JPG/JPEG images to WebP for frontend projects with a hybrid engine:

  • Primary engine: Node.js (sharp)
  • Fallback engine: Python (Pillow)

This is useful when FE builds contain many large image files and you need a quick CLI conversion flow.

Install

npm install -g png2webp-hybrid-cli

or run without install:

npx png2webp-hybrid-cli --dir ./src/assets/images

Usage

png2webp [options]

Options:

  • --dir <path>: images directory (default ./assets/images)
  • --replace: remove original source image after successful convert (and also when .webp is newer)
  • --only: convert only image1.png and image2.png
  • --quality <0-100>: WebP quality (default 85)
  • --engine <node|python|auto>: conversion engine (default auto)
  • -h, --help: show help

Example commands

# Convert all PNG/JPG/JPEG recursively in React/Vite assets directory
png2webp --dir ./src/assets/images

# Convert only image1.png and image2.png
png2webp --dir ./src/assets/images --only

# Convert and delete source originals
png2webp --dir ./src/assets/images --replace

# Force Node engine
png2webp --dir ./src/assets/images --engine node

# Force Python engine
png2webp --dir ./src/assets/images --engine python

Engine behavior

  • --engine node: run Node engine only, fail if conversion has errors.
  • --engine python: run Python engine only, requires python3 and Pillow.
  • --engine auto: try Node first, then fallback to Python if Node fails.

Safe usage flow

To avoid accidental data loss, run in 2 steps:

# 1) Dry run (without replace)
npx png2webp-hybrid-cli@latest --dir ./src/assets/images

# 2) After reviewing results, run replace
npx png2webp-hybrid-cli@latest --dir ./src/assets/images --replace

Python fallback requirements

Python fallback is only used when:

  • You run --engine python, or
  • You run --engine auto and Node engine fails.

Install dependencies:

python3 --version
pip3 install Pillow

Exit codes

  • 0: successful conversion flow
  • 1: invalid args, missing dependencies, or conversion failure

Release notes

1.0.0

  • Initial public release
  • Hybrid conversion engine (Node primary, Python fallback)
  • Support for --dir, --replace, --only, --quality, and --engine