0.3.3 • Published 2 years ago

shion v0.3.3

Weekly downloads
3
License
MIT
Repository
github
Last release
2 years ago

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);
})();

npm.io