@ssthouse/img-compress
v1.2.2
Published
### How to use
Downloads
4
Readme
Cli image compress tool powered with Tinyjpg
How to use
- First install this node cli tool with: (note: you need have node installed first, if not, please check: node.js)
npm install -g @ssthouse/img-compress
- To use this cli tool, you wil need a developer-key from tinyjpg.(free with 500 times per month)
please check this page to get your key: https://tinyjpg.com/developers
- After that, fill in your api-key with:
img-compress init -key _your_personal_api_key_
- That's it, you can start compress your images with one simple cmd:
img-compress ./test.png
使用方式
安装该命令行工具
npm install -g @ssthouse/img-compress
设置 API key (注: API key 需要在 tiniyjpg网站 进行申请, 提供用户名和邮箱即可得到一个 500次/ 每月 的key)
img-compress init -key your_api_key
如果你的terminal网络需要使用代理的话, 需要进行设置:
img-compress proxy http://example.com
开始压缩图片
img-process img_file
命令执行成功后会在原图的同一目录看到压缩过的图片文件. 文件名以
__compress.文件后缀
结尾. 如:test.png => test_compress.png