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

leano-cli

v1.2.0

Published

Leano — batch image conversion to WebP/AVIF with quality control and directory structure preservation

Readme

Leano

Batch convert images to WebP/AVIF — fully local, no server, no API calls.

Docs and web app: leano.dev

npx leano-cli ./public --format webp --quality 80 --max-width 1920

Recursively scans a directory, converts every .jpg, .jpeg, .png to WebP and/or AVIF using sharp, preserves the full folder structure, and reports per-file savings.


Install

npm install -g leano-cli
# or run without installing:
npx leano-cli <input> [options]

Usage

leano-cli <input> [options]

Arguments:
  input                   Directory of images to convert

Options:
  -f, --format <format>   Output format: webp | avif | both  (default: webp)
  -q, --quality <number>  Compression quality 1–100          (default: 80)
  --lossless              Lossless compression
  --max-width  <px>       Maximum output width  (no upscaling)
  --max-height <px>       Maximum output height (no upscaling)
  -o, --out <path>        Output directory      (default: <input>-optimized)
  --in-place              Replace source directory safely via temp dir
  -c, --concurrency <n>   Parallel jobs (default scales with CPU; cap webp 16 / both 12 / avif 8)
  --quiet                 No per-file rows (spinner + summary only)
  --dry-run               List planned outputs only
  -h, --help              Show help
  -V, --version           Show version

Examples

# WebP at quality 80 (default)
leano-cli ./images

# Both WebP + AVIF
leano-cli ./images --format both --quality 75

# Resize + convert
leano-cli ./public/photos --format webp --max-width 1920 --quality 85

# Lossless WebP
leano-cli ./assets --format webp --lossless

# Custom output directory
leano-cli ./src/images --format avif --out ./dist/images

# Overwrite source in-place (safe: uses temp dir, rolls back on failure)
leano-cli ./public --format webp --in-place

Output

leano-cli v1.0.2
  Input:   /home/user/project/public/images
  Output:  /home/user/project/public/images-optimized
  Format:  both  Quality: 80
  Files:   42 images found → 84 outputs

File                                        Original    Converted     Savings
─────────────────────────────────────────────────────────────────────────────
  hero.webp                                     1.2 MB       149 KB         88%
  hero.avif                                     1.2 MB       218 KB         82%
  icons/logo.webp                                45 KB        12 KB         73%
  icons/logo.avif                                45 KB         9 KB         80%
  ...
─────────────────────────────────────────────────────────────────────────────

✔ 84 files converted
✔ 56.2 MB → 9.1 MB (84% saved)

Output: /home/user/project/public/images-optimized

Behavior

| Extension | Action | |------------------|-------------------------------| | .jpg / .jpeg | Re-encoded via sharp | | .png | Re-encoded via sharp | | .webp / .avif| Copied as-is (no re-encoding) |

--in-place safety

  1. All files are written to a temporary directory first.
  2. Only if every conversion succeeds, the source directory is replaced atomically.
  3. On any failure the source is left completely untouched and the temp dir is cleaned up.

Exit codes

| Code | Meaning | |------|--------------------------| | 0 | All files processed OK | | 1 | One or more files failed |


Project structure

src/
  index.ts    Entry point & orchestration
  cli.ts      Argument parsing (commander)
  scan.ts     Recursive directory traversal
  convert.ts  worker-thread pool (one sharp pipeline per core slot) + job scheduling
  workers/    encodeWorker.ts + encodePool.ts — parallel Node workers for CPU-bound encode
  writer.ts   Output & in-place replacement logic
  logger.ts   Table, summary, formatting helpers
  types.ts    Shared TypeScript types

Requirements

  • Node.js ≥ 18
  • Runs on Linux, macOS, Windows (sharp ships pre-built binaries)