Skip to content

Commit

Permalink
Require Node.js 10
Browse files Browse the repository at this point in the history
  • Loading branch information
sindresorhus committed Jan 16, 2020
1 parent 279a91b commit aacca91
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 12 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Expand Up @@ -2,4 +2,3 @@ language: node_js
node_js:
- '12'
- '10'
- '8'
4 changes: 2 additions & 2 deletions index.js
Expand Up @@ -13,7 +13,7 @@ const defaultPlugins = ['gifsicle', 'mozjpeg', 'optipng', 'svgo'];
const loadPlugin = (plugin, ...args) => {
try {
return require(`imagemin-${plugin}`)(...args);
} catch (error) {
} catch (_) {
log(`${PLUGIN_NAME}: Couldn't load default plugin "${plugin}"`);
}
};
Expand All @@ -34,7 +34,7 @@ const getDefaultPlugins = () =>
module.exports = (plugins, options) => {
if (typeof plugins === 'object' && !Array.isArray(plugins)) {
options = plugins;
plugins = null;
plugins = undefined;
}

options = {
Expand Down
7 changes: 4 additions & 3 deletions package.json
Expand Up @@ -4,13 +4,14 @@
"description": "Minify PNG, JPEG, GIF and SVG images",
"license": "MIT",
"repository": "sindresorhus/gulp-imagemin",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "sindresorhus.com"
},
"engines": {
"node": ">=8"
"node": ">=10"
},
"scripts": {
"test": "xo && ava"
Expand All @@ -35,7 +36,7 @@
"svg"
],
"dependencies": {
"chalk": "^2.4.1",
"chalk": "^3.0.0",
"fancy-log": "^1.3.2",
"imagemin": "^7.0.0",
"plugin-error": "^1.0.1",
Expand All @@ -48,7 +49,7 @@
"get-stream": "^5.1.0",
"imagemin-pngquant": "^8.0.0",
"vinyl": "^2.2.0",
"xo": "^0.24.0"
"xo": "^0.25.3"
},
"optionalDependencies": {
"imagemin-gifsicle": "^6.0.1",
Expand Down
9 changes: 3 additions & 6 deletions readme.md
Expand Up @@ -4,14 +4,12 @@
*Issues with the output should be reported on the [`imagemin` issue tracker](https://github.com/imagemin/imagemin/issues).*


## Install

```
$ npm install --save-dev gulp-imagemin
```


## Usage

### Basic
Expand Down Expand Up @@ -80,7 +78,6 @@ Note that you may come across an older, implicit syntax. In versions < 3, the sa
//
```


## API

Comes bundled with the following **lossless** optimizers:
Expand All @@ -98,7 +95,7 @@ Unsupported files are ignored.

#### plugins

Type: `Array`<br>
Type: `Array`\
Default: `[imagemin.gifsicle(), imagemin.mozjpeg(), imagemin.optipng(), imagemin.svgo()]`

[Plugins](https://www.npmjs.com/browse/keyword/imageminplugin) to use. This will completely overwrite all the default plugins. So, if you want to use custom plugins and you need some of defaults too, then you should pass default plugins as well. Note that the default plugins come with good defaults and should be sufficient in most cases. See the individual plugins for supported options.
Expand All @@ -109,7 +106,7 @@ Type: `object`

##### verbose

Type: `boolean`<br>
Type: `boolean`\
Default: `false`

Enabling this will log info on every image passed to `gulp-imagemin`:
Expand All @@ -121,7 +118,7 @@ gulp-imagemin: ✔ image2.png (saved 91 B - 0.4%)

##### silent

Type: `boolean`<br>
Type: `boolean`\
Default: `false`

Don't log the number of images that have been minified.
Expand Down

0 comments on commit aacca91

Please sign in to comment.