@tamland/imagemin
v0.0.34
Published
Preconfigured imagemin function
Downloads
21
Maintainers
Readme
@tamland/imagemin
This package provides a shared config for imagemin and several of its plugins.
Install
$ npm install imagemin
Usage
import imagemin from "@tamland/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
.