@niwaringo/tinify
v0.1.0
Published
Tiny PNG || JPG client
Downloads
2
Maintainers
Readme
tinify
Tiny PNG || JPEG client.
Installation
$ npm i tinify
Usage
var Tinify = require("tinify");
var tinify = Tinify("your api key");
tinify.compress("/path/to/input/image", "/path/to/output/image")
.on("finish", function() {
// Action after save file
assert(tinify.input.size > tinify.output.size);
});
Method
compress
compress("/path/to/input/image", "/path/to/output/image")
Property
api_key
your api key
tiny_image_uri
The image was successfully compressed file uri.
input, output
Response from Tiny PNG.