@newsteam/imagemin
v0.0.33
Published
Preconfigured imagemin function
Downloads
79
Readme
@newsteam/imagemin
This package provides a shared config for imagemin and several of its plugins.
Install
$ npm install imagemin
Usage
import imagemin from "@newsteam/imagemin";
(async () => {
const files = await imagemin(['images/*.{jpg,png}'], 'build/images');
console.log(files);
//=> [{data: <Buffer 89 50 4e ...>, path: 'build/images/foo.jpg'}, ...]
})();
API
imagemin(input, [output], [options])
Returns Promise<Object[]>
in the format {data: Buffer, path: string}
.
input
Type: string[]
Files to be optimized. See supported minimatch
patterns.
output
Type: string
Maintenance
You can run tests with npm test
.