imagemin

WebJar for imagemin

Лицензия

Лицензия

MIT
Группа

Группа

org.webjars.npm
Идентификатор

Идентификатор

imagemin
Последняя версия

Последняя версия

5.2.2
Дата

Дата

Тип

Тип

jar
Описание

Описание

imagemin
WebJar for imagemin
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/imagemin/imagemin

Скачать imagemin

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.npm/imagemin/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>imagemin</artifactId>
    <version>5.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/imagemin/
implementation 'org.webjars.npm:imagemin:5.2.2'
// https://jarcasting.com/artifacts/org.webjars.npm/imagemin/
implementation ("org.webjars.npm:imagemin:5.2.2")
'org.webjars.npm:imagemin:jar:5.2.2'
<dependency org="org.webjars.npm" name="imagemin" rev="5.2.2">
  <artifact name="imagemin" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='imagemin', version='5.2.2')
)
libraryDependencies += "org.webjars.npm" % "imagemin" % "5.2.2"
[org.webjars.npm/imagemin "5.2.2"]

Зависимости

compile (6)

Идентификатор библиотеки Тип Версия
org.webjars.npm » promise.pipe jar [3.0.0,4)
org.webjars.npm : file-type jar [3.8.0,4)
org.webjars.npm : replace-ext jar 0.0.1
org.webjars.npm : pify jar [2.3.0,3)
org.webjars.npm : globby jar [5.0.0,6)
org.webjars.npm : mkdirp jar [0.5.1,0.6)

Модули Проекта

Данный проект не имеет модулей.

imagemin Build Status

Minify images seamlessly





Install

$ npm install imagemin

Usage

const imagemin = require('imagemin');
const imageminJpegtran = require('imagemin-jpegtran');
const imageminPngquant = require('imagemin-pngquant');

(async () => {
	const files = await imagemin(['images/*.{jpg,png}'], {
		destination: 'build/images',
		plugins: [
			imageminJpegtran(),
			imageminPngquant({
				quality: [0.6, 0.8]
			})
		]
	});

	console.log(files);
	//=> [{data: <Buffer 89 50 4e …>, destinationPath: 'build/images/foo.jpg'}, …]
})();

API

imagemin(input, options?)

Returns Promise<object[]> in the format {data: Buffer, sourcePath: string, destinationPath: string}.

input

Type: string[]

File paths or glob patterns.

options

Type: object

destination

Type: string

Set the destination folder to where your files will be written. If no destination is specified, no files will be written.

plugins

Type: Array

Plugins to use.

glob

Type: boolean
Default: true

Enable globbing when matching file paths.

imagemin.buffer(buffer, options?)

Returns Promise<Buffer>.

buffer

Type: Buffer

Buffer to optimize.

options

Type: object

plugins

Type: Array

Plugins to use.

Hosted API

We also provide a hosted API for imagemin which may simplify your use case.

Related

org.webjars.npm

imagemin

Версии библиотеки

Версия
5.2.2