beez-optim

0.2.2 • Public • Published

beez-optim

About

特定のディレクトリを指定して、optipng jpegoptim pngquant を実行し画像を圧縮するコマンドです。

拡張子 .png .jpg .jpeg で画像判定します。

deps

Install

$ npm install -g beez-optim

Test

$ npm test

Configuration file

-c --config json data

{
    "optipng": {
        "use": true,
        "level": 3
    },
    "jpegoptim": {
        "use": true,
        "options": "--strip-all"
    },
    pngquant: {
        use: false,
        options: "--ext .png -f -v"
    }
}

Command line help

$ beez-optim -h
 
  Usage: beez-optim [options]
 
  Options:
 
    -h, --help                output usage information
    -p --limit <limit>        process limit default=10
    -s --srcdir <srcdir>      Source directory root path.
    -c --config <config>      configuration file.
    example config data:
        {
          "optipng"{
            "use"true,
            "level": 2
          },
          "jpegoptim"{
            "use"true,
            "options"'--strip-all'
          },
          "pngquant"{
            "use"false,
            "options""--ext .png -f -v"
          }
        }
 
    -l --loglevel <loglevel>  Log level. default) INFO
       DEBUG: 1
       INFO:  2
       WARN:  3
       ERROR: 4
       FATAL: 5
 

Example

default

$ beez-optim -s /tmp/image

option

$ beez-optim -s /tmp/image -c ./config.json -l 1

LICENSE

The MIT License (MIT)

@see : LICENSE

Package Sidebar

Install

npm i beez-optim

Weekly Downloads

1

Version

0.2.2

License

MIT

Last publish

Collaborators

  • fkei