imagemin-mozjpeg
Advanced tools
Comparing version 9.0.0 to 10.0.0
16
index.js
@@ -1,7 +0,7 @@ | ||
'use strict'; | ||
const execa = require('execa'); | ||
const isJpg = require('is-jpg'); | ||
const mozjpeg = require('mozjpeg'); | ||
import {Buffer} from 'node:buffer'; | ||
import {execa} from 'execa'; | ||
import isJpg from 'is-jpg'; | ||
import mozjpeg from 'mozjpeg'; | ||
module.exports = options => async buffer => { | ||
const imageminMozjpeg = options => async buffer => { | ||
options = { | ||
@@ -11,3 +11,3 @@ trellis: true, | ||
overshoot: true, | ||
...options | ||
...options, | ||
}; | ||
@@ -113,3 +113,3 @@ | ||
input: buffer, | ||
maxBuffer: Infinity | ||
maxBuffer: Number.POSITIVE_INFINITY, | ||
}); | ||
@@ -119,1 +119,3 @@ | ||
}; | ||
export default imageminMozjpeg; |
{ | ||
"name": "imagemin-mozjpeg", | ||
"version": "9.0.0", | ||
"version": "10.0.0", | ||
"description": "Imagemin plugin for mozjpeg", | ||
"license": "MIT", | ||
"repository": "imagemin/imagemin-mozjpeg", | ||
"type": "module", | ||
"exports": "./index.js", | ||
"author": { | ||
@@ -24,3 +26,3 @@ "name": "Kevin Mårtensson", | ||
"engines": { | ||
"node": ">=10" | ||
"node": "^12.20.0 || ^14.13.1 || >=16.0.0" | ||
}, | ||
@@ -45,11 +47,11 @@ "scripts": { | ||
"dependencies": { | ||
"execa": "^4.0.0", | ||
"is-jpg": "^2.0.0", | ||
"mozjpeg": "^7.0.0" | ||
"execa": "^6.0.0", | ||
"is-jpg": "^3.0.0", | ||
"mozjpeg": "^8.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^3.8.0", | ||
"ava": "^3.15.0", | ||
"is-progressive": "^3.0.0", | ||
"xo": "^0.30.0" | ||
"xo": "^0.47.0" | ||
} | ||
} |
@@ -1,6 +0,5 @@ | ||
# imagemin-mozjpeg [![Build Status](https://travis-ci.org/imagemin/imagemin-mozjpeg.svg?branch=master)](https://travis-ci.org/imagemin/imagemin-mozjpeg) | ||
# imagemin-mozjpeg | ||
> [Imagemin](https://github.com/imagemin/imagemin) plugin for [mozjpeg](https://github.com/mozilla/mozjpeg) | ||
## Install | ||
@@ -12,12 +11,12 @@ | ||
## Usage | ||
```js | ||
const imagemin = require('imagemin'); | ||
const imageminMozjpeg = require('imagemin-mozjpeg'); | ||
import imagemin from 'imagemin'; | ||
import imageminMozjpeg from 'imagemin-mozjpeg'; | ||
(async () => { | ||
await imagemin(['images/*.jpg'], 'build/images', { | ||
use: [ | ||
await imagemin(['images/*.jpg'], { | ||
destination: 'build/images', | ||
plugins: [ | ||
imageminMozjpeg() | ||
@@ -31,6 +30,5 @@ ] | ||
## API | ||
### imageminMozjpeg([options])(buffer) | ||
### imageminMozjpeg(options?)(buffer) | ||
@@ -41,2 +39,4 @@ Returns a `Promise<Buffer>`. | ||
Type: `object` | ||
##### quality | ||
@@ -50,3 +50,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `true` | ||
@@ -58,3 +58,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `false` | ||
@@ -66,3 +66,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `false` | ||
@@ -74,3 +74,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `false` | ||
@@ -82,3 +82,3 @@ | ||
Type: `number`<br> | ||
Type: `number`\ | ||
Default: `1` | ||
@@ -94,3 +94,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `true` | ||
@@ -102,3 +102,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `true` | ||
@@ -110,3 +110,3 @@ | ||
Type: `string`<br> | ||
Type: `string`\ | ||
Default: `hvs-psnr` | ||
@@ -118,3 +118,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `true` | ||
@@ -126,3 +126,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `false` | ||
@@ -134,3 +134,3 @@ | ||
Type: `string`<br> | ||
Type: `string`\ | ||
Default: `int` | ||
@@ -146,3 +146,3 @@ | ||
Type: `boolean`<br> | ||
Type: `boolean`\ | ||
Default: `false` | ||
@@ -188,6 +188,1 @@ | ||
Buffer to optimize. | ||
## License | ||
MIT © [Imagemin](https://github.com/imagemin) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
90
Yes
7291
173
+ Addedexeca@6.1.0(transitive)
+ Addedget-stream@6.0.1(transitive)
+ Addedhuman-signals@3.0.1(transitive)
+ Addedis-jpg@3.0.0(transitive)
+ Addedis-stream@3.0.0(transitive)
+ Addedmimic-fn@4.0.0(transitive)
+ Addedmozjpeg@8.0.0(transitive)
+ Addednpm-run-path@5.3.0(transitive)
+ Addedonetime@6.0.0(transitive)
+ Addedpath-key@4.0.0(transitive)
+ Addedstrip-final-newline@3.0.0(transitive)
- Removedexeca@4.1.0(transitive)
- Removedget-stream@5.2.0(transitive)
- Removedhuman-signals@1.1.1(transitive)
- Removedis-jpg@2.0.0(transitive)
- Removedis-stream@2.0.1(transitive)
- Removedmimic-fn@2.1.0(transitive)
- Removedmozjpeg@7.1.1(transitive)
- Removednpm-run-path@4.0.1(transitive)
- Removedonetime@5.1.2(transitive)
- Removedstrip-final-newline@2.0.0(transitive)
Updatedexeca@^6.0.0
Updatedis-jpg@^3.0.0
Updatedmozjpeg@^8.0.0