Skip to content
leanojsPublic

About

The open-source image processing platform for developers.

Resources

Stars

1 star

Watchers

0 watching

Forks

Repository files navigation

Skive — optimize image folders in one command

npm version npm downloads license node GitHub stars

Skive — cut a thin layer off your images.
Format-preserving by default · directory structure mirrored · originals untouched unless you ask.

npx skive-cli optimize ./public
$ skive optimize ./public

Scanning ./public... 340 images found (png, jpeg, webp)

optimizing [====================>] 340/340

  public/img/hero.png          842 KB → 210 KB   (-75%)
  public/img/icons/logo.svg    skipped (unsupported format)
  public/blog/2024/cover.jpg   1.2 MB → 380 KB   (-68%)
  ...

Done. 338 optimized, 2 skipped.
Total: 84.3 MB → 21.6 MB  (74% smaller)
Output written to ./public-optimized  (originals untouched)

Point it at a real Next.js / Astro / whatever public/ folder. No config file, no account, no setup.

Install

# one-shot
npx skive-cli optimize ./public

# or global (bin is `skive`)
npm install -g skive-cli
skive optimize ./public

Usage

skive optimize <input> [options]

<input> can be a single image or a directory.

Flag Description
-o, --out <dir> Output directory (default: <input>-optimized)
--in-place Overwrite files in <input> directly
-f, --format <fmt> Convert to png, jpeg, or webp (default: preserve)
-q, --quality <n> Quality override (default: 80)
--width <n> Resize to width, aspect ratio preserved
--dry-run Report projected savings, write nothing
--concurrency <n> Parallel file limit (default: 4)

Examples

# Safe default — writes ./public-optimized
skive optimize ./public

# Preview savings without writing
skive optimize ./public --dry-run

# Overwrite the source tree (explicit opt-in)
skive optimize ./public --in-place

# Single file
skive optimize ./hero.png

# Convert a folder to WebP
skive optimize ./public -f webp -o ./public-webp

Behavior

  • Safe by default. Output goes to <input>-optimized. Use --in-place only when you mean it.
  • Format-preserving. optimize never changes format unless you pass --format.
  • Skip, don't fail. SVG, ICO, and other unsupported files are reported and skipped; the rest of the run continues.
  • Supported formats: PNG, JPEG, WebP.

Develop

pnpm install
pnpm build
pnpm test
pnpm skive optimize ./path/to/images

Monorepo packages (current focus: CLI):

Package Role Status
skive-engine Shared optimize engine Published
skive-cli CLI (skive binary) Published
skive Multer-style upload + optimize + storage Later
skive-s3 S3 storage adapter Later
skive-gcs GCS storage adapter Later

License

Apache-2.0

About

The open-source image processing platform for developers.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages