@tamland/imagemin

0.0.34 • Public • Published

@tamland/imagemin

License npm package npm downloads Dependencies DevDependencies

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.

Package Sidebar

Install

npm i @tamland/imagemin

Weekly Downloads

2

Version

0.0.34

License

MIT

Unpacked Size

6.98 kB

Total Files

11

Last publish

Collaborators

  • sweetlikepete