chiiya / shion

📦 Easy image optimization for your custom build process

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Shion

Easy image optimization for your custom build process.

styled with prettier

The goal of this project is to create a simple-to-use, opinionated API around image-min to optimize your image files, that can be called as a node script in your build process. See below for an example.

Features

  • Image optimization with imagemin
  • Create webp versions of images
  • Resize images with sharp

Usage

npm install --dev shion

Then, import and use the library:

const { shion } = require('shion');

const config = {
  webp: true,
}

(async () => {
  await shion.resize('src/assets/images', 'dist/images', { sizes: [210, 420], pattern: '[name]_[size].[extension]' });
  await shion.images('dist/images', 'public/images', config);
})();

About

📦 Easy image optimization for your custom build process

License:MIT License


Languages

Language:TypeScript 95.7%Language:JavaScript 4.3%