image-optimalisator
v1.0.0
Published
ImageOptimalisator is een npm package die afbeeldingen optimaliseert voor betere laadtijden en prestaties op uw website. Het ondersteunt nu .jpg, .png, .gif en .svg bestanden.
Downloads
5
Readme
ImageOptimalisator
ImageOptimalisator is een npm package die afbeeldingen optimaliseert voor betere laadtijden en prestaties op uw website. Het ondersteunt nu .jpg, .png, .gif en .svg bestanden.
Installatie
Gebruik de package manager npm om Image Optimizer te installeren.
npm install image-optimizer
Gebruik
const imageOptimalisator = require('image-optimizer');
imageOptimalisator('path/to/image.jpg', 'path/to/output/directory', 'jpg');
Deze functie zal alle .jpg, .png, .gif en .svg afbeeldingen in de opgegeven directory optimaliseren en opslaan in een 'optimized' subdirectory.
Functies
optimizeImages(input):
Deze functie neemt een directory, een array van directories, een enkele afbeelding, een array van afbeeldingen, een enkele afbeelding URL of een array van afbeelding URL's als input en optimaliseert alle .jpg, .png, .gif en .svg afbeeldingen. De geoptimaliseerde afbeeldingen worden opgeslagen in een 'optimized' subdirectory.
Foutafhandeling
Als er een fout optreedt tijdens het lezen van de directory of het optimaliseren van de afbeeldingen, wordt de fout naar de console gelogd.
Bijdragen
Pull requests zijn welkom. Voor belangrijke wijzigingen, open eerst een issue om te bespreken wat u wilt wijzigen.
Licentie
Projectstatus
Dit project is momenteel in ontwikkeling.