schnee effeckt und fehler Korektur
This commit is contained in:
191
node_modules/imagemin/readme.md
generated
vendored
191
node_modules/imagemin/readme.md
generated
vendored
@@ -1,141 +1,140 @@
|
||||
# imagemin [](https://travis-ci.org/imagemin/imagemin) [](https://ci.appveyor.com/project/ShinnosukeWatanabe/imagemin)
|
||||
# imagemin
|
||||
|
||||
> Minify images seamlessly
|
||||
|
||||
<br>
|
||||
|
||||
---
|
||||
|
||||
<div align="center">
|
||||
<p>
|
||||
<p>
|
||||
<sup>
|
||||
<a href="https://github.com/sponsors/sindresorhus">Sindre Sorhus' open source work is supported by the community</a>
|
||||
</sup>
|
||||
</p>
|
||||
<sup>Special thanks to:</sup>
|
||||
<br>
|
||||
<br>
|
||||
<a href="https://standardresume.co/tech">
|
||||
<img src="https://sindresorhus.com/assets/thanks/standard-resume-logo.svg" width="180">
|
||||
</a>
|
||||
<br>
|
||||
<br>
|
||||
<br>
|
||||
<a href="https://doppler.com/?utm_campaign=github_repo&utm_medium=referral&utm_content=imagemin&utm_source=github">
|
||||
<div>
|
||||
<img src="https://dashboard.doppler.com/imgs/logo-long.svg" width="240" alt="Doppler">
|
||||
</div>
|
||||
<b>All your environment variables, in one place</b>
|
||||
<div>
|
||||
<span>Stop struggling with scattered API keys, hacking together home-brewed tools,</span>
|
||||
<br>
|
||||
<span>and avoiding access controls. Keep your team and servers in sync with Doppler.</span>
|
||||
</div>
|
||||
</a>
|
||||
<br>
|
||||
<a href="https://strapi.io/?ref=sindresorhus">
|
||||
<div>
|
||||
<img src="https://sindresorhus.com/assets/thanks/strapi-logo-white-bg.png" width="200" alt="Strapi">
|
||||
</div>
|
||||
<b>Strapi is the leading open-source headless CMS.</b>
|
||||
<div>
|
||||
<sup>It’s 100% JavaScript, fully customizable, and developer-first.</sup>
|
||||
</div>
|
||||
</a>
|
||||
</p>
|
||||
</div>
|
||||
|
||||
---
|
||||
|
||||
<br>
|
||||
|
||||
## Install
|
||||
|
||||
```
|
||||
$ npm install --save imagemin
|
||||
$ npm install imagemin
|
||||
```
|
||||
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var Imagemin = require('imagemin');
|
||||
import imagemin from 'imagemin';
|
||||
import imageminJpegtran from 'imagemin-jpegtran';
|
||||
import imageminPngquant from 'imagemin-pngquant';
|
||||
|
||||
new Imagemin()
|
||||
.src('images/*.{gif,jpg,png,svg}')
|
||||
.dest('build/images')
|
||||
.use(Imagemin.jpegtran({progressive: true}))
|
||||
.run(function (err, files) {
|
||||
console.log(files[0]);
|
||||
// => {path: 'build/images/foo.jpg', contents: <Buffer 89 50 4e ...>}
|
||||
});
|
||||
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'}, …]
|
||||
```
|
||||
|
||||
You can use [gulp-rename](https://github.com/hparra/gulp-rename) to rename your files:
|
||||
|
||||
```js
|
||||
var Imagemin = require('imagemin');
|
||||
var rename = require('gulp-rename');
|
||||
|
||||
new Imagemin()
|
||||
.src('images/foo.png')
|
||||
.use(rename('bar.png'));
|
||||
```
|
||||
|
||||
|
||||
## API
|
||||
|
||||
### new Imagemin()
|
||||
### imagemin(input, options?)
|
||||
|
||||
Creates a new `Imagemin` instance.
|
||||
Returns `Promise<object[]>` in the format `{data: Buffer, sourcePath: string, destinationPath: string}`.
|
||||
|
||||
### .src(file)
|
||||
#### input
|
||||
|
||||
Type: `array`, `buffer` or `string`
|
||||
Type: `string[]`
|
||||
|
||||
Set the files to be optimized. Takes a buffer, glob string or an array of glob strings
|
||||
as argument.
|
||||
File paths or [glob patterns](https://github.com/sindresorhus/globby#globbing-patterns).
|
||||
|
||||
### .dest(folder)
|
||||
#### options
|
||||
|
||||
Type: `object`
|
||||
|
||||
##### destination
|
||||
|
||||
Type: `string`
|
||||
|
||||
Set the destination folder to where your files will be written. If you don't set
|
||||
any destination no files will be written.
|
||||
Set the destination folder to where your files will be written. If no destination is specified, no files will be written.
|
||||
|
||||
### .use(plugin)
|
||||
##### plugins
|
||||
|
||||
Type: `function`
|
||||
Type: `Array`
|
||||
|
||||
Add a `plugin` to the middleware stack.
|
||||
[Plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use.
|
||||
|
||||
### .run(callback)
|
||||
##### glob
|
||||
|
||||
Type: `function`
|
||||
Type: `boolean`\
|
||||
Default: `true`
|
||||
|
||||
Optimize your files with the given settings.
|
||||
Enable globbing when matching file paths.
|
||||
|
||||
#### callback(err, files)
|
||||
### imagemin.buffer(buffer, options?)
|
||||
|
||||
The callback will return an array of vinyl files in `files`.
|
||||
Returns `Promise<Buffer>`.
|
||||
|
||||
#### buffer
|
||||
|
||||
## Plugins
|
||||
Type: `Buffer`
|
||||
|
||||
The following [plugins](https://www.npmjs.org/browse/keyword/imageminplugin) are bundled with imagemin:
|
||||
Buffer to optimize.
|
||||
|
||||
* [gifsicle](#gifsicleoptions) — Compress GIF images.
|
||||
* [jpegtran](#jpegtranoptions) — Compress JPG images.
|
||||
* [optipng](#optipngoptions) — Compress PNG images losslessly.
|
||||
* [svgo](#svgooptions) — Compress SVG images.
|
||||
#### options
|
||||
|
||||
### .gifsicle(options)
|
||||
Type: `object`
|
||||
|
||||
Compress GIF images.
|
||||
##### plugins
|
||||
|
||||
```js
|
||||
var Imagemin = require('imagemin');
|
||||
|
||||
new Imagemin()
|
||||
.use(Imagemin.gifsicle({interlaced: true}));
|
||||
```
|
||||
|
||||
### .jpegtran(options)
|
||||
|
||||
Compress JPG images.
|
||||
|
||||
```js
|
||||
var Imagemin = require('imagemin');
|
||||
|
||||
new Imagemin()
|
||||
.use(Imagemin.jpegtran({progressive: true}));
|
||||
```
|
||||
|
||||
### .optipng(options)
|
||||
|
||||
Lossless compression of PNG images.
|
||||
|
||||
```js
|
||||
var Imagemin = require('imagemin');
|
||||
|
||||
new Imagemin()
|
||||
.use(Imagemin.optipng({optimizationLevel: 3}));
|
||||
```
|
||||
|
||||
### .svgo(options)
|
||||
|
||||
Compress SVG images.
|
||||
|
||||
```js
|
||||
var Imagemin = require('imagemin');
|
||||
|
||||
new Imagemin()
|
||||
.use(Imagemin.svgo());
|
||||
```
|
||||
Type: `Array`
|
||||
|
||||
[Plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use.
|
||||
|
||||
## Related
|
||||
|
||||
- [imagemin-cli](https://github.com/imagemin/imagemin-cli) - CLI for this module
|
||||
- [imagemin-app](https://github.com/imagemin/imagemin-app) - GUI app for this module.
|
||||
- [gulp-imagemin](https://github.com/sindresorhus/gulp-imagemin) - Gulp plugin.
|
||||
- [grunt-contrib-imagemin](https://github.com/gruntjs/grunt-contrib-imagemin) - Grunt plugin.
|
||||
|
||||
|
||||
## License
|
||||
|
||||
MIT © [imagemin](https://github.com/imagemin)
|
||||
- [imagemin-app](https://github.com/imagemin/imagemin-app) - GUI app for this module
|
||||
- [gulp-imagemin](https://github.com/sindresorhus/gulp-imagemin) - Gulp plugin
|
||||
- [grunt-contrib-imagemin](https://github.com/gruntjs/grunt-contrib-imagemin) - Grunt plugin
|
||||
|
||||
Reference in New Issue
Block a user