optimo 0.0.16 → 0.0.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/package.json +1 -1
- package/src/compressor/index.js +3 -5
package/README.md
CHANGED
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
## Highlights
|
|
13
13
|
|
|
14
14
|
- Format-specific tuning for stronger size reduction.
|
|
15
|
-
- Backed by proven tools: ImageMagick, SVGO, Gifsicle, and MozJPEG.
|
|
16
15
|
- Safety guard: if optimized output is not smaller, original file is kept.
|
|
16
|
+
- Backed by proven tools: ImageMagick, SVGO, Gifsicle, and MozJPEG.
|
|
17
17
|
- Resizing supports percentage values (`50%`), max file size targets (`100kB`), width (`w960`), & height (`h480`).
|
|
18
18
|
|
|
19
19
|
## Usage
|
package/package.json
CHANGED
package/src/compressor/index.js
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
|
|
3
3
|
const path = require('node:path')
|
|
4
4
|
|
|
5
|
+
const mozjpegtran = require('./mozjpegtran')
|
|
6
|
+
const gifsicle = require('./gifsicle')
|
|
5
7
|
const magick = require('./magick')
|
|
6
8
|
const svgo = require('./svgo')
|
|
7
|
-
const gifsicle = require('./gifsicle')
|
|
8
|
-
const mozjpegtran = require('./mozjpegtran')
|
|
9
9
|
|
|
10
10
|
const PIPELINES = {
|
|
11
11
|
'.png': [magick.png],
|
|
@@ -40,9 +40,7 @@ const getRequiredBinaries = (pipeline, opts = {}) => {
|
|
|
40
40
|
})
|
|
41
41
|
}
|
|
42
42
|
|
|
43
|
-
return Array.from(
|
|
44
|
-
new Map(binaries.map(binary => [binary.name, binary])).values()
|
|
45
|
-
)
|
|
43
|
+
return Array.from(new Map(binaries.map(binary => [binary.name, binary])).values())
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
module.exports = { getPipeline, getRequiredBinaries }
|