Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/chiiya/shion

📦 Easy image optimization for your custom build process
https://github.com/chiiya/shion

Last synced: 12 days ago
JSON representation

📦 Easy image optimization for your custom build process

Awesome Lists containing this project

README

        

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

```bash
npm install --dev shion
```

Then, import and use the library:

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

![](https://i.imgur.com/g85Wlf0.png)