Skip to content

cli-tool for image compressing powered with Tinify / 基于 Tinify 的图片压缩命令行工具

Notifications You must be signed in to change notification settings

ssthouse/img-compress

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

25 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Cli image compress tool powered with Tinyjpg

How to use

  1. 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
  1. 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

  1. After that, fill in your api-key with:
img-compress init -key _your_personal_api_key_
  1. That's it, you can start compress your images with one simple cmd:
img-compress ./test.png

使用方式

  1. 安装该命令行工具

    npm install -g @ssthouse/img-compress
    
  2. 设置 API key (注: API key 需要在 tiniyjpg网站 进行申请, 提供用户名和邮箱即可得到一个 500次/ 每月 的key)

    img-compress init -key your_api_key
  3. 如果你的terminal网络需要使用代理的话, 需要进行设置:

    img-compress proxy http://example.com
  4. 开始压缩图片

    img-process img_file

    命令执行成功后会在原图的同一目录看到压缩过的图片文件. 文件名以 __compress.文件后缀 结尾. 如: test.png => test_compress.png

About

cli-tool for image compressing powered with Tinify / 基于 Tinify 的图片压缩命令行工具

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published