0.1.2 • Published 2 years ago
@tinify_cli/cli v0.1.2
@tinify_cli/cli
A compress image resource cli tool througth by tinify.
Why
- Convert other image type to webp
- Compress any image files in your local
- Watch mode, it can listen the assets dir, and auto execute convert or compress action
Install
$ npm install @tinify_cli/cli -gSet up
First of all, it need get tinify token. Copy it to your env file(like ~/.zshrc in Mac OSX):
# ~/.zshrc
$ export TINIFY_TOKEN=xxxxxxxFinally, execute the command:
$ source ~/.zshrcUsage
Compress
$ tinify compress --name=[YOUR_IMAGE_PATH]Generate to Webp
$ tinify generate --name=[YOUR_IMAGE_PATH]Common options
--all
short: -a
Transform all files in the directory.
--watch
short: -w
Watch mode, the transform action wont\'t act immediately when the command is executed.
--name
short: -n
The name of the file to transform.
Note: With this option, the
--allwill be invalid.
--cwd
short: -c
The working directory of where @tinify_cli/cli command will be executed in, all other paths options are relative to this path.
--dir
short: -d
The directory to transform.
--output
short: -o
The directory to store the transformed files.