Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/chiiya/shion
- Owner: chiiya
- License: mit
- Created: 2019-03-06T20:13:02.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-03-01T01:59:00.000Z (over 1 year ago)
- Last Synced: 2024-10-23T07:54:41.750Z (15 days ago)
- Language: TypeScript
- Homepage:
- Size: 1.67 MB
- Stars: 2
- Watchers: 2
- Forks: 1
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Easy image optimization for your custom build process.
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)