imagemin
[Unmaintained] Minify images seamlessly
README
imagemin
Minify images seamlessly
Sindre Sorhus' open source work is supported by the community
Special thanks to: Strapi is the leading open-source headless CMS.It’s 100% JavaScript, fully customizable, and developer-first.
Install
- ``` shell
- npm install imagemin
- ```
Usage
- ``` js
- import imagemin from 'imagemin';
- import imageminJpegtran from 'imagemin-jpegtran';
- import imageminPngquant from 'imagemin-pngquant';
- const files = await imagemin(['images/*.{jpg,png}'], {
- destination: 'build/images',
- plugins: [
- imageminJpegtran(),
- imageminPngquant({
- quality: [0.6, 0.8]
- })
- ]
- });
- console.log(files);
- //=> [{data:
, destinationPath: 'build/images/foo.jpg'}, …] - ```