Skip to content

to-static-images

to-static-images

Ein CLI-Tool, das Bilder in das gewünschte Format konvertiert, eine Dateistruktur im JSON-Format generiert und bei Bedarf die Größe ändert. Nützlich für statische Websites, Galerien und Automatisierung.

📖 Anwendungsbeispiel

Erstellen Sie einen Ordner img-src

shell
mkdir img-src

Legen Sie Bilder in den Ordner img-src

shell
npx to-static-images@latest

💻 Befehlszeilenoptionen

OptionTypBeschreibungStandard
srcstringName des Quellordnersimg-src
diststringName des Ergebnisordnersimg-dist
formatstringAusgabeformat: webp, jpg, png, avif oder original (original)webp
jsonstring | nullName der JSON-Datei (oder null zum Überspringen)null
widthnumber | nullMaximale Bildbreite in Pixelnnull
heightnumber | nullMaximale Bildhöhe in Pixelnnull
concurrencynumberMaximale Anzahl gleichzeitiger Bildverarbeitungsaufgaben5
includeSizebooleanBildabmessungen (Breite und Höhe) in das JSON aufnehmenfalse

✨ Beispiele

shell
npx to-static-images json=static-images format=original
shell
npx to-static-images src=sources height=2000

Start ohne Argumente (interaktiver Modus)

shell
npx to-static-images