0.1.6 • Published 3 months ago

optimage-cli v0.1.6

Weekly downloads
-
License
MIT
Repository
-
Last release
3 months ago

Optimage

Installation

npm install -D optimage-cli

Usage

npx optimage-cli "{path}" "{ignore}" [--config=path/to/config.json]

Argument

ArgumentDescriptionExample
pathA Glob pattern that match all files to optimize."images/**/*.@(png|jpg|jpeg|gif|webp)"
ignoreA Glob pattern that match files to ignore."images/raw/*"

Options

OptionDescriptionExample
--configRelative or absolute path the a JSON config file.optimage.json

Example usage

node optimage "images/**/*.@(png|jpg|jpeg|gif|webp)" "images/raw/**/*" --config=optimage.json

Optimize all png and jpeg image files in ./images exept those in the ./images/raw folder using configuration from optimage.json.

Configuration

EntryDescription
cacheSharp cache configuration
optionsSharp images options (applied to all formats)
jpegSharp jpeg options
pngSharp png options
webpSharp webp options
gifSharp gif options

Example configuration

optimage.json:

{
  "cache": {
    "memory":  500
  },
  "options": {
    "quality": 80
  },
  "png": {
    "compressionLevel": 9
  },
  "webp": {
    "reductionEffort": 6
  },
  "jpeg": {
    "quality": 75
  }
}
0.1.6

3 months ago

0.1.5

2 years ago

0.1.3

3 years ago

0.1.2

3 years ago

0.1.1

3 years ago

0.1.0

3 years ago