A compress image resource cli tool througth by tinify.
- 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
$ npm install @tinify_cli/cli -g
First of all, it need get tinify token. Copy it to your env file(like ~/.zshrc
in Mac OSX):
# ~/.zshrc
$ export TINIFY_TOKEN=xxxxxxx
Finally, execute the command:
$ source ~/.zshrc
$ tinify compress --name=[YOUR_IMAGE_PATH]
$ tinify generate --name=[YOUR_IMAGE_PATH]
short: -a
Transform all files in the directory.
short: -w
Watch mode, the transform action wont't act immediately when the command is executed.
short: -n
The name of the file to transform.
Note: With this option, the
--all
will be invalid.
short: -c
The working directory of where @tinify_cli/cli command will be executed in, all other paths options are relative to this path.
short: -d
The directory to transform.
short: -o
The directory to store the transformed files.