easytiny v1.1.1
easytiny is a simple CLI for compressing jpg/png images by tinypng api.
Installation
Prerequisites: Node.js (>=7.x preferred), npm version 3+ and Git.
$ npm install -g easytinyConfig
Set your tinypng api key. Get your api key by visiting tinypng, 500 images limited every month, but you can register more api keys.
$ easytiny config set key XXXX-XXXX-XXXXXXXXXXXXSet Proxy
$ easytiny config set proxy http://user:pass@192.168.0.1:8080Usage
Run with default mode, no resize and compressed images output into a new easytiny folder with a timestamp
$ easytiny startRun with overwrite mode, the original images will be overwritten by compressed images
$ easytiny start --overwriteshorthand for overwrite mode
$ easytiny start -oRun with resize mode, images will be resized before compressing
$ easytiny start --resizeshorthand for resize mode
$ easytiny start -rThere are three methed for resizing, scale、fit、 cover. You can learn more here.
- scale
Scales the image down proportionally. You must provide either a target width or a target height, but not both. The scaled image will have exactly the provided width or height.
- fit
Scales the image down proportionally so that it fits within the given dimensions. You must provide both a width and a height. The scaled image will not exceed either of these dimensions.
- cover
Scales the image proportionally and crops it if necessary so that the result has exactly the given dimensions. You must provide both a width and a height. Which parts of the image are cropped away is determined automatically. An intelligent algorithm determines the most important areas and leaves these intact.
Overwrite mode and resize mode can be joined together.
$ easytiny start -roHelp
Get the main help.
$ easytiny -hGet the detail help.
$ easytiny start -h
$ easytiny config -h